import{cY as zt,cZ as no,r as m,j as C,a5 as Vs,R as ws,c as K,t as Ae,f as Mt,a as Rt,e as Ms,S as so,o as Rs,d as io,c_ as oo}from"./index-bcc89564.js";function Es(t=zt){const e=t===zt?no:()=>m.useContext(t);return function(){const{store:s}=e();return s}}const ro=Es();function ao(t=zt){const e=t===zt?ro:Es(t);return function(){return e().dispatch}}const co=ao();function lo(t,e){return`${t} returned \`undefined\`. Seems you forgot to wrap component within ${e}`}function Et(t={}){const{name:e,strict:n=!0,hookName:s="useContext",providerName:i="Provider",errorMessage:r}=t,o=m.createContext(void 0);o.displayName=e;function a(){var c;const l=m.useContext(o);if(!l&&n){const u=new Error(r??lo(s,i));throw u.name="ContextError",(c=Error.captureStackTrace)==null||c.call(Error,u,a),u}return l}return[o.Provider,a,o]}var[uo,fo]=Et({strict:!1,name:"PortalManagerContext"});function ho(t){const{children:e,zIndex:n}=t;return C.jsx(uo,{value:{zIndex:n},children:e})}ho.displayName="PortalManager";var Ve=Boolean(globalThis==null?void 0:globalThis.document)?m.useLayoutEffect:m.useEffect,[Ls,po]=Et({strict:!1,name:"PortalContext"}),He="chakra-portal",mo=".chakra-portal",go=t=>C.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:t.zIndex,top:0,left:0,right:0},children:t.children}),yo=t=>{const{appendToParentPortal:e,children:n}=t,[s,i]=m.useState(null),r=m.useRef(null),[,o]=m.useState({});m.useEffect(()=>o({}),[]);const a=po(),c=fo();Ve(()=>{if(!s)return;const u=s.ownerDocument,f=e?a??u.body:u.body;if(!f)return;r.current=u.createElement("div"),r.current.className=He,f.appendChild(r.current),o({});const h=r.current;return()=>{f.contains(h)&&f.removeChild(h)}},[s]);const l=c!=null&&c.zIndex?C.jsx(go,{zIndex:c==null?void 0:c.zIndex,children:n}):n;return r.current?Vs.createPortal(C.jsx(Ls,{value:r.current,children:l}),r.current):C.jsx("span",{ref:u=>{u&&i(u)}})},vo=t=>{const{children:e,containerRef:n,appendToParentPortal:s}=t,i=n.current,r=i??(typeof window<"u"?document.body:void 0),o=m.useMemo(()=>{const c=i==null?void 0:i.ownerDocument.createElement("div");return c&&(c.className=He),c},[i]),[,a]=m.useState({});return Ve(()=>a({}),[]),Ve(()=>{if(!(!o||!r))return r.appendChild(o),()=>{r.removeChild(o)}},[o,r]),r&&o?Vs.createPortal(C.jsx(Ls,{value:s?o:null,children:e}),o):null};function te(t){const e={appendToParentPortal:!0,...t},{containerRef:n,...s}=e;return n?C.jsx(vo,{containerRef:n,...s}):C.jsx(yo,{...s})}te.className=He;te.selector=mo;te.displayName="Portal";var xo=(t,e)=>t.find(n=>n.id===e);function vn(t,e){const n=Ds(t,e),s=n?t[n].findIndex(i=>i.id===e):-1;return{position:n,index:s}}function Ds(t,e){for(const[n,s]of Object.entries(t))if(xo(s,e))return n}function bo(t){const e=t.includes("right"),n=t.includes("left");let s="center";return e&&(s="flex-end"),n&&(s="flex-start"),{display:"flex",flexDirection:"column",alignItems:s}}function Po(t){const n=t==="top"||t==="bottom"?"0 auto":void 0,s=t.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=t.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,r=t.includes("left")?void 0:"env(safe-area-inset-right, 0px)",o=t.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:s,bottom:i,right:r,left:o}}function To(t,e=[]){const n=m.useRef(t);return m.useEffect(()=>{n.current=t}),m.useCallback((...s)=>{var i;return(i=n.current)==null?void 0:i.call(n,...s)},e)}function Co(t,e){const n=To(t);m.useEffect(()=>{if(e==null)return;let s=null;return s=window.setTimeout(()=>{n()},e),()=>{s&&window.clearTimeout(s)}},[e,n])}function xn(t,e){const n=m.useRef(!1),s=m.useRef(!1);m.useEffect(()=>{if(n.current&&s.current)return t();s.current=!0},e),m.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const ks=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),ee=m.createContext({});function So(){return m.useContext(ee).visualElement}const Lt=m.createContext(null),ne=typeof document<"u",Ht=ne?m.useLayoutEffect:m.useEffect,Bs=m.createContext({strict:!1});function Ao(t,e,n,s){const i=So(),r=m.useContext(Bs),o=m.useContext(Lt),a=m.useContext(ks).reducedMotion,c=m.useRef();s=s||r.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:i,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;return m.useInsertionEffect(()=>{l&&l.update(n,o)}),Ht(()=>{l&&l.render()}),m.useEffect(()=>{l&&l.updateFeatures()}),(window.HandoffAppearAnimations?Ht:m.useEffect)(()=>{l&&l.animationState&&l.animationState.animateChanges()}),l}function lt(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Vo(t,e,n){return m.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):lt(n)&&(n.current=s))},[e])}function St(t){return typeof t=="string"||Array.isArray(t)}function se(t){return typeof t=="object"&&typeof t.start=="function"}const wo=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function ie(t){return se(t.animate)||wo.some(e=>St(t[e]))}function Fs(t){return Boolean(ie(t)||t.variants)}function Mo(t,e){if(ie(t)){const{initial:n,animate:s}=t;return{initial:n===!1||St(n)?n:void 0,animate:St(s)?s:void 0}}return t.inherit!==!1?e:{}}function Ro(t){const{initial:e,animate:n}=Mo(t,m.useContext(ee));return m.useMemo(()=>({initial:e,animate:n}),[bn(e),bn(n)])}function bn(t){return Array.isArray(t)?t.join(" "):t}const Pn={animation:["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},At={};for(const t in Pn)At[t]={isEnabled:e=>Pn[t].some(n=>!!e[n])};function Eo(t){for(const e in t)At[e]={...At[e],...t[e]}}function We(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const vt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Lo=1;function Do(){return We(()=>{if(vt.hasEverUpdated)return Lo++})}const Ge=m.createContext({}),Is=m.createContext({}),ko=Symbol.for("motionComponentSymbol");function Bo({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&Eo(t);function r(a,c){let l;const u={...m.useContext(ks),...a,layoutId:Fo(a)},{isStatic:f}=u,h=Ro(a),d=f?void 0:Do(),p=s(a,f);if(!f&&ne){h.visualElement=Ao(i,p,u,e);const g=m.useContext(Is),T=m.useContext(Bs).strict;h.visualElement&&(l=h.visualElement.loadFeatures(u,T,t,d,g))}return m.createElement(ee.Provider,{value:h},l&&h.visualElement?m.createElement(l,{visualElement:h.visualElement,...u}):null,n(i,a,d,Vo(p,h.visualElement,c),p,f,h.visualElement))}const o=m.forwardRef(r);return o[ko]=i,o}function Fo({layoutId:t}){const e=m.useContext(Ge).id;return e&&t!==void 0?e+"-"+t:t}function Io(t){function e(s,i={}){return Bo(t(s,i))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(s,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const jo=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ke(t){return typeof t!="string"||t.includes("-")?!1:!!(jo.indexOf(t)>-1||/[A-Z]/.test(t))}const Wt={};function Oo(t){Object.assign(Wt,t)}const oe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],pt=new Set(oe);function js(t,{layout:e,layoutId:n}){return pt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Wt[t]||t==="opacity")}const B=t=>Boolean(t&&t.getVelocity),No={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Uo=oe.length;function _o(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,i){let r="";for(let o=0;oe&&typeof t=="number"?e.transform(t):t,ht=(t,e,n)=>Math.min(Math.max(n,t),e),rt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},xt={...rt,transform:t=>ht(0,1,t)},jt={...rt,default:1},bt=t=>Math.round(t*1e5)/1e5,Vt=/(-)?([\d]*\.?[\d])+/g,we=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,zo=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Dt(t){return typeof t=="string"}const kt=t=>({test:e=>Dt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),X=kt("deg"),$=kt("%"),P=kt("px"),Ho=kt("vh"),Wo=kt("vw"),Tn={...$,parse:t=>$.parse(t)/100,transform:t=>$.transform(t*100)},Cn={...rt,transform:Math.round},Ns={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,radius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,size:P,top:P,right:P,bottom:P,left:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,rotate:X,rotateX:X,rotateY:X,rotateZ:X,scale:jt,scaleX:jt,scaleY:jt,scaleZ:jt,skew:X,skewX:X,skewY:X,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:xt,originX:Tn,originY:Tn,originZ:P,zIndex:Cn,fillOpacity:xt,strokeOpacity:xt,numOctaves:Cn};function Ze(t,e,n,s){const{style:i,vars:r,transform:o,transformOrigin:a}=t;let c=!1,l=!1,u=!0;for(const f in e){const h=e[f];if(Os(f)){r[f]=h;continue}const d=Ns[f],p=$o(h,d);if(pt.has(f)){if(c=!0,o[f]=p,!u)continue;h!==(d.default||0)&&(u=!1)}else f.startsWith("origin")?(l=!0,a[f]=p):i[f]=p}if(e.transform||(c||s?i.transform=_o(t.transform,n,u,s):i.transform&&(i.transform="none")),l){const{originX:f="50%",originY:h="50%",originZ:d=0}=a;i.transformOrigin=`${f} ${h} ${d}`}}const Ye=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Us(t,e,n){for(const s in e)!B(e[s])&&!js(s,n)&&(t[s]=e[s])}function Go({transformTemplate:t},e,n){return m.useMemo(()=>{const s=Ye();return Ze(s,e,{enableHardwareAcceleration:!n},t),Object.assign({},s.vars,s.style)},[e])}function Ko(t,e,n){const s=t.style||{},i={};return Us(i,s,t),Object.assign(i,Go(t,e,n)),t.transformValues?t.transformValues(i):i}function Zo(t,e,n){const s={},i=Ko(t,e,n);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=i,s}const Yo=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Gt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||Yo.has(t)}let _s=t=>!Gt(t);function Xo(t){t&&(_s=e=>e.startsWith("on")?!Gt(e):t(e))}try{Xo(require("@emotion/is-prop-valid").default)}catch{}function qo(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(_s(i)||n===!0&&Gt(i)||!e&&!Gt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function Sn(t,e,n){return typeof t=="string"?t:P.transform(e+n*t)}function Jo(t,e,n){const s=Sn(e,t.x,t.width),i=Sn(n,t.y,t.height);return`${s} ${i}`}const Qo={offset:"stroke-dashoffset",array:"stroke-dasharray"},tr={offset:"strokeDashoffset",array:"strokeDasharray"};function er(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Qo:tr;t[r.offset]=P.transform(-s);const o=P.transform(e),a=P.transform(n);t[r.array]=`${o} ${a}`}function Xe(t,{attrX:e,attrY:n,originX:s,originY:i,pathLength:r,pathSpacing:o=1,pathOffset:a=0,...c},l,u,f){if(Ze(t,c,l,f),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:d,dimensions:p}=t;h.transform&&(p&&(d.transform=h.transform),delete h.transform),p&&(s!==void 0||i!==void 0||d.transform)&&(d.transformOrigin=Jo(p,s!==void 0?s:.5,i!==void 0?i:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&er(h,r,o,a,!1)}const $s=()=>({...Ye(),attrs:{}}),qe=t=>typeof t=="string"&&t.toLowerCase()==="svg";function nr(t,e,n,s){const i=m.useMemo(()=>{const r=$s();return Xe(r,e,{enableHardwareAcceleration:!1},qe(s),t.transformTemplate),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Us(r,t.style,t),i.style={...r,...i.style}}return i}function sr(t=!1){return(n,s,i,r,{latestValues:o},a)=>{const l=(Ke(n)?nr:Zo)(s,o,a,n),f={...qo(s,typeof n=="string",t),...l,ref:r},{children:h}=s,d=m.useMemo(()=>B(h)?h.get():h,[h]);return i&&(f["data-projection-id"]=i),m.createElement(n,{...f,children:d})}}const Je=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function zs(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const r in n)t.style.setProperty(r,n[r])}const Hs=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ws(t,e,n,s){zs(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Hs.has(i)?i:Je(i),e.attrs[i])}function Qe(t,e){const{style:n}=t,s={};for(const i in n)(B(n[i])||e.style&&B(e.style[i])||js(i,t))&&(s[i]=n[i]);return s}function Gs(t,e){const n=Qe(t,e);for(const s in t)if(B(t[s])||B(e[s])){const i=s==="x"||s==="y"?"attr"+s.toUpperCase():s;n[i]=t[s]}return n}function tn(t,e,n,s={},i={}){return typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,i)),e}const Kt=t=>Array.isArray(t),ir=t=>Boolean(t&&typeof t=="object"&&t.mix&&t.toValue),or=t=>Kt(t)?t[t.length-1]||0:t;function _t(t){const e=B(t)?t.get():t;return ir(e)?e.toValue():e}function rr({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,i,r){const o={latestValues:ar(s,i,r,t),renderState:e()};return n&&(o.mount=a=>n(s,a,o)),o}const Ks=t=>(e,n)=>{const s=m.useContext(ee),i=m.useContext(Lt),r=()=>rr(t,e,s,i);return n?r():We(r)};function ar(t,e,n,s){const i={},r=s(t,{});for(const h in r)i[h]=_t(r[h]);let{initial:o,animate:a}=t;const c=ie(t),l=Fs(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;return f&&typeof f!="boolean"&&!se(f)&&(Array.isArray(f)?f:[f]).forEach(d=>{const p=tn(t,d);if(!p)return;const{transitionEnd:g,transition:T,...b}=p;for(const x in b){let v=b[x];if(Array.isArray(v)){const y=u?v.length-1:0;v=v[y]}v!==null&&(i[x]=v)}for(const x in g)i[x]=g[x]}),i}const cr={useVisualState:Ks({scrapeMotionValuesFromProps:Gs,createRenderState:$s,onMount:(t,e,{renderState:n,latestValues:s})=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}Xe(n,s,{enableHardwareAcceleration:!1},qe(e.tagName),t.transformTemplate),Ws(e,n)}})},lr={useVisualState:Ks({scrapeMotionValuesFromProps:Qe,createRenderState:Ye})};function ur(t,{forwardMotionProps:e=!1},n,s){return{...Ke(t)?cr:lr,preloadedFeatures:n,useRender:sr(e),createVisualElement:s,Component:t}}function H(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Zs=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function re(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const fr=t=>e=>Zs(e)&&t(e,re(e));function W(t,e,n,s){return H(t,e,fr(n),s)}var A;(function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"})(A||(A={}));const hr=(t,e)=>n=>e(t(n)),J=(...t)=>t.reduce(hr);function Ys(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const An=Ys("dragHorizontal"),Vn=Ys("dragVertical");function Xs(t){let e=!1;if(t==="y")e=Vn();else if(t==="x")e=An();else{const n=An(),s=Vn();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function qs(){const t=Xs(!0);return t?(t(),!1):!0}class et{constructor(e){this.isMounted=!1,this.node=e}update(){}}function wn(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End"),i=(r,o)=>{if(r.type==="touch"||qs())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive(A.Hover,e),a[s]&&a[s](r,o)};return W(t.current,n,i,{passive:!t.getProps()[s]})}class dr extends et{mount(){this.unmount=J(wn(this.node,!0),wn(this.node,!1))}unmount(){}}class pr extends et{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(A.Focus,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(A.Focus,!1),this.isActive=!1)}mount(){this.unmount=J(H(this.node.current,"focus",()=>this.onFocus()),H(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Js=(t,e)=>e?t===e?!0:Js(t,e.parentElement):!1,z=t=>t;function fe(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,re(n))}class mr extends et{constructor(){super(...arguments),this.removeStartListeners=z,this.removeEndListeners=z,this.removeAccessibleListeners=z,this.startPointerPress=(e,n)=>{if(this.removeEndListeners(),this.isPressing)return;const s=this.node.getProps(),r=W(window,"pointerup",(a,c)=>{if(!this.checkPressEnd())return;const{onTap:l,onTapCancel:u}=this.node.getProps();Js(this.node.current,a.target)?l&&l(a,c):u&&u(a,c)},{passive:!(s.onTap||s.onPointerUp)}),o=W(window,"pointercancel",(a,c)=>this.cancelPress(a,c),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=J(r,o),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||fe("up",this.node.getProps().onTap)};this.removeEndListeners(),this.removeEndListeners=H(this.node.current,"keyup",o),fe("down",(a,c)=>{this.startPress(a,c)})},n=H(this.node.current,"keydown",e),s=()=>{this.isPressing&&fe("cancel",(r,o)=>this.cancelPress(r,o))},i=H(this.node.current,"blur",s);this.removeAccessibleListeners=J(n,i)}}startPress(e,n){this.isPressing=!0;const{onTapStart:s,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive(A.Tap,!0),s&&s(e,n)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive(A.Tap,!1),!qs()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&s(e,n)}mount(){const e=this.node.getProps(),n=W(this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),s=H(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=J(n,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Me=new WeakMap,he=new WeakMap,gr=t=>{const e=Me.get(t.target);e&&e(t)},yr=t=>{t.forEach(gr)};function vr({root:t,...e}){const n=t||document;he.has(n)||he.set(n,{});const s=he.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(yr,{root:t,...e})),s[i]}function xr(t,e,n){const s=vr(e);return Me.set(t,n),s.observe(t),()=>{Me.delete(t),s.unobserve(t)}}const br={some:0,all:1};class Pr extends et{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:e}=this.node.getProps();e&&e(null),this.node.animationState&&this.node.animationState.setActive(A.InView,!0)})}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r,fallback:o=!0}=e;if(typeof IntersectionObserver>"u"){o&&this.viewportFallback();return}const a={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:br[i]},c=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(A.InView,u);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),d=u?f:h;d&&d(l)};return xr(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Tr(e,n))&&this.startObserver()}unmount(){}}function Tr({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Cr={inView:{Feature:Pr},tap:{Feature:mr},focus:{Feature:pr},hover:{Feature:dr}};function Qs(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s/^\-?\d*\.?\d+$/.test(t),Ar=t=>/^0[^.\s]+$/.test(t),G={delta:0,timestamp:0},ti=1/60*1e3,Vr=typeof performance<"u"?()=>performance.now():()=>Date.now(),ei=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Vr()),ti);function wr(t){let e=[],n=[],s=0,i=!1,r=!1;const o=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const f=u&&i,h=f?e:n;return l&&o.add(c),h.indexOf(c)===-1&&(h.push(c),f&&i&&(s=e.length)),c},cancel:c=>{const l=n.indexOf(c);l!==-1&&n.splice(l,1),o.delete(c)},process:c=>{if(i){r=!0;return}if(i=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let l=0;l(t[e]=wr(()=>wt=!0),t),{}),L=Bt.reduce((t,e)=>{const n=ae[e];return t[e]=(s,i=!1,r=!1)=>(wt||Er(),n.schedule(s,i,r)),t},{}),Q=Bt.reduce((t,e)=>(t[e]=ae[e].cancel,t),{}),de=Bt.reduce((t,e)=>(t[e]=()=>ae[e].process(G),t),{}),Rr=t=>ae[t].process(G),ni=t=>{wt=!1,G.delta=Re?ti:Math.max(Math.min(t-G.timestamp,Mr),1),G.timestamp=t,Ee=!0,Bt.forEach(Rr),Ee=!1,wt&&(Re=!1,ei(ni))},Er=()=>{wt=!0,Re=!0,Ee||ei(ni)};function en(t,e){t.indexOf(e)===-1&&t.push(e)}function nn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class sn{constructor(){this.subscriptions=[]}add(e){return en(this.subscriptions,e),()=>nn(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r!isNaN(parseFloat(t));class Dr{constructor(e,n={}){this.version="9.0.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,i=!0)=>{this.prev=this.current,this.current=s;const{delta:r,timestamp:o}=G;this.lastUpdated!==o&&(this.timeDelta=r,this.lastUpdated=o,L.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>L.postRender(this.velocityCheck),this.velocityCheck=({timestamp:s})=>{s!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=Lr(this.current),this.owner=n.owner}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new sn);const s=this.events[e].add(n);return e==="change"?()=>{s(),L.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=e,this.timeDelta=s}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?on(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function dt(t,e){return new Dr(t,e)}const rn=(t,e)=>n=>Boolean(Dt(n)&&zo.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),si=(t,e,n)=>s=>{if(!Dt(s))return s;const[i,r,o,a]=s.match(Vt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},kr=t=>ht(0,255,t),pe={...rt,transform:t=>Math.round(kr(t))},ot={test:rn("rgb","red"),parse:si("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+pe.transform(t)+", "+pe.transform(e)+", "+pe.transform(n)+", "+bt(xt.transform(s))+")"};function Br(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Le={test:rn("#"),parse:Br,transform:ot.transform},ut={test:rn("hsl","hue"),parse:si("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+$.transform(bt(e))+", "+$.transform(bt(n))+", "+bt(xt.transform(s))+")"},D={test:t=>ot.test(t)||Le.test(t)||ut.test(t),parse:t=>ot.test(t)?ot.parse(t):ut.test(t)?ut.parse(t):Le.parse(t),transform:t=>Dt(t)?t:t.hasOwnProperty("red")?ot.transform(t):ut.transform(t)},ii="${c}",oi="${n}";function Fr(t){var e,n;return isNaN(t)&&Dt(t)&&(((e=t.match(Vt))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(we))===null||n===void 0?void 0:n.length)||0)>0}function Zt(t){typeof t=="number"&&(t=`${t}`);const e=[];let n=0,s=0;const i=t.match(we);i&&(n=i.length,t=t.replace(we,ii),e.push(...i.map(D.parse)));const r=t.match(Vt);return r&&(s=r.length,t=t.replace(Vt,oi),e.push(...r.map(rt.parse))),{values:e,numColors:n,numNumbers:s,tokenised:t}}function ri(t){return Zt(t).values}function ai(t){const{values:e,numColors:n,tokenised:s}=Zt(t),i=e.length;return r=>{let o=s;for(let a=0;atypeof t=="number"?0:t;function jr(t){const e=ri(t);return ai(t)(e.map(Ir))}const tt={test:Fr,parse:ri,createTransformer:ai,getAnimatableNone:jr},Or=new Set(["brightness","contrast","saturate","opacity"]);function Nr(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Vt)||[];if(!s)return t;const i=n.replace(s,"");let r=Or.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Ur=/([a-z-]*)\(.*?\)/g,De={...tt,getAnimatableNone:t=>{const e=t.match(Ur);return e?e.map(Nr).join(" "):t}},_r={...Ns,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:De,WebkitFilter:De},an=t=>_r[t];function cn(t,e){let n=an(t);return n!==De&&(n=tt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ci=t=>e=>e.test(t),$r={test:t=>t==="auto",parse:t=>t},li=[rt,P,$,X,Wo,Ho,$r],mt=t=>li.find(ci(t)),zr=[...li,D,tt],Hr=t=>zr.find(ci(t));function Wr(t){const e={};return t.values.forEach((n,s)=>e[s]=n.get()),e}function Gr(t){const e={};return t.values.forEach((n,s)=>e[s]=n.getVelocity()),e}function ce(t,e,n){const s=t.getProps();return tn(s,e,n!==void 0?n:s.custom,Wr(t),Gr(t))}function Kr(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,dt(n))}function Zr(t,e){const n=ce(t,e);let{transitionEnd:s={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...s};for(const o in r){const a=or(r[o]);Kr(t,o,a)}}function Yr(t,e,n){var s,i;const r=Object.keys(e).filter(a=>!t.hasValue(a)),o=r.length;if(o)for(let a=0;at*1e3,ea={current:!1},ln=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,un=t=>e=>1-t(1-e),fn=t=>t*t,na=un(fn),hn=ln(fn),V=(t,e,n)=>-n*t+n*e+t;function me(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function sa({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=me(c,a,t+1/3),r=me(c,a,t),o=me(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}const ge=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},ia=[Le,ot,ut],oa=t=>ia.find(e=>e.test(t));function Mn(t){const e=oa(t);let n=e.parse(t);return e===ut&&(n=sa(n)),n}const ui=(t,e)=>{const n=Mn(t),s=Mn(e),i={...n};return r=>(i.red=ge(n.red,s.red,r),i.green=ge(n.green,s.green,r),i.blue=ge(n.blue,s.blue,r),i.alpha=V(n.alpha,s.alpha,r),ot.transform(i))};function fi(t,e){return typeof t=="number"?n=>V(t,e,n):D.test(t)?ui(t,e):di(t,e)}const hi=(t,e)=>{const n=[...t],s=n.length,i=t.map((r,o)=>fi(r,e[o]));return r=>{for(let o=0;o{const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=fi(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}},di=(t,e)=>{const n=tt.createTransformer(e),s=Zt(t),i=Zt(e);return s.numColors===i.numColors&&s.numNumbers>=i.numNumbers?J(hi(s.values,i.values),n):o=>`${o>0?e:t}`},qt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},Rn=(t,e)=>n=>V(t,e,n);function aa(t){return typeof t=="number"?Rn:typeof t=="string"?D.test(t)?ui:di:Array.isArray(t)?hi:typeof t=="object"?ra:Rn}function ca(t,e,n){const s=[],i=n||aa(t[0]),r=t.length-1;for(let o=0;ot[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=ca(e,s,i),a=o.length,c=l=>{let u=0;if(a>1)for(;uc(ht(t[0],t[r-1],l)):c}const mi=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,la=1e-7,ua=12;function fa(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=mi(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>la&&++afa(r,0,1,t,n);return r=>r===0||r===1?r:mi(i(r),e,s)}const yi=t=>1-Math.sin(Math.acos(t)),dn=un(yi),ha=ln(dn),vi=gi(.33,1.53,.69,.99),pn=un(vi),da=ln(pn),pa=t=>(t*=2)<1?.5*pn(t):.5*(2-Math.pow(2,-10*(t-1))),ma={linear:z,easeIn:fn,easeInOut:hn,easeOut:na,circIn:yi,circInOut:ha,circOut:dn,backIn:pn,backInOut:da,backOut:vi,anticipate:pa},En=t=>{if(Array.isArray(t)){Xt(t.length===4);const[e,n,s,i]=t;return gi(e,n,s,i)}else if(typeof t=="string")return ma[t];return t},ga=t=>Array.isArray(t)&&typeof t[0]!="number";function ya(t,e){return t.map(()=>e||hn).splice(0,t.length-1)}function va(t){const e=t.length;return t.map((n,s)=>s!==0?s/(e-1):0)}function xa(t,e){return t.map(n=>n*e)}function ke({keyframes:t,ease:e=hn,times:n,duration:s=300}){t=[...t];const i=ga(e)?e.map(En):En(e),r={done:!1,value:t[0]},o=xa(n&&n.length===t.length?n:va(t),s);function a(){return pi(o,t,{ease:Array.isArray(i)?i:ya(t,i)})}let c=a();return{next:l=>(r.value=c(l),r.done=l>=s,r),flipTarget:()=>{t.reverse(),c=a()}}}const ye=.001,ba=.01,Ln=10,Pa=.05,Ta=1;function Ca({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let i,r;ta(t<=Ln*1e3);let o=1-e;o=ht(Pa,Ta,o),t=ht(ba,Ln,t/1e3),o<1?(i=l=>{const u=l*o,f=u*t,h=u-n,d=Be(l,o),p=Math.exp(-f);return ye-h/d*p},r=l=>{const f=l*o*t,h=f*n+n,d=Math.pow(o,2)*Math.pow(l,2)*t,p=Math.exp(-f),g=Be(Math.pow(l,2),o);return(-i(l)+ye>0?-1:1)*((h-d)*p)/g}):(i=l=>{const u=Math.exp(-l*t),f=(l-n)*t+1;return-ye+u*f},r=l=>{const u=Math.exp(-l*t),f=(n-l)*(t*t);return u*f});const a=5/t,c=Aa(i,r,a);if(t=t*1e3,isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:t}}}const Sa=12;function Aa(t,e,n){let s=n;for(let i=1;it[n]!==void 0)}function Ma(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Dn(t,wa)&&Dn(t,Va)){const n=Ca(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}const Ra=5;function xi({keyframes:t,restDelta:e,restSpeed:n,...s}){let i=t[0],r=t[t.length-1];const o={done:!1,value:i},{stiffness:a,damping:c,mass:l,velocity:u,duration:f,isResolvedFromDuration:h}=Ma(s);let d=Ea,p=u?-(u/1e3):0;const g=c/(2*Math.sqrt(a*l));function T(){const b=r-i,x=Math.sqrt(a/l)/1e3,v=Math.abs(b)<5;if(n||(n=v?.01:2),e||(e=v?.005:.5),g<1){const y=Be(x,g);d=S=>{const M=Math.exp(-g*x*S);return r-M*((p+g*x*b)/y*Math.sin(y*S)+b*Math.cos(y*S))}}else if(g===1)d=y=>r-Math.exp(-x*y)*(b+(p+x*b)*y);else{const y=x*Math.sqrt(g*g-1);d=S=>{const M=Math.exp(-g*x*S),E=Math.min(y*S,300);return r-M*((p+g*x*b)*Math.sinh(E)+y*b*Math.cosh(E))/y}}}return T(),{next:b=>{const x=d(b);if(h)o.done=b>=f;else{let v=p;if(b!==0)if(g<1){const M=Math.max(0,b-Ra);v=on(x-d(M),b-M)}else v=0;const y=Math.abs(v)<=n,S=Math.abs(r-x)<=e;o.done=y&&S}return o.value=o.done?r:x,o},flipTarget:()=>{p=-p,[i,r]=[r,i],T()}}}xi.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const Ea=t=>0;function La({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:s=350,restDelta:i=.5,modifyTarget:r}){const o=t[0],a={done:!1,value:o};let c=n*e;const l=o+c,u=r===void 0?l:r(l);return u!==l&&(c=u-o),{next:f=>{const h=-c*Math.exp(-f/s);return a.done=!(h>i||h<-i),a.value=a.done?u:u+h,a},flipTarget:()=>{}}}const Da={decay:La,keyframes:ke,tween:ke,spring:xi};function bi(t,e,n=0){return t-e-n}function ka(t,e=0,n=0,s=!0){return s?bi(e+-t,e,n):e-(t-e)+n}function Ba(t,e,n,s){return s?t>=e+n:t<=-n}const Fa=t=>{const e=({delta:n})=>t(n);return{start:()=>L.update(e,!0),stop:()=>Q.update(e)}};function Jt({duration:t,driver:e=Fa,elapsed:n=0,repeat:s=0,repeatType:i="loop",repeatDelay:r=0,keyframes:o,autoplay:a=!0,onPlay:c,onStop:l,onComplete:u,onRepeat:f,onUpdate:h,type:d="keyframes",...p}){const g=n;let T,b=0,x=t,v=!1,y=!0,S;const M=Da[o.length>2?"keyframes":d]||ke,E=o[0],N=o[o.length-1];let I={done:!1,value:E};const{needsInterpolation:j}=M;j&&j(E,N)&&(S=pi([0,100],[E,N],{clamp:!1}),o=[0,100]);const Z=M({...p,duration:t,keyframes:o});function It(){b++,i==="reverse"?(y=b%2===0,n=ka(n,x,r,y)):(n=bi(n,x,r),i==="mirror"&&Z.flipTarget()),v=!1,f&&f()}function le(){T&&T.stop(),u&&u()}function Y(k){y||(k=-k),n+=k,v||(I=Z.next(Math.max(0,n)),S&&(I.value=S(I.value)),v=y?I.done:n<=0),h&&h(I.value),v&&(b===0&&(x=x!==void 0?x:n),b{l&&l(),T&&T.stop()},set currentTime(k){n=g,Y(k)},sample:k=>{n=g;const at=t&&typeof t=="number"?Math.max(t*.5,50):50;let ue=0;for(Y(0);ue<=k;){const eo=k-ue;Y(Math.min(eo,at)),ue+=at}return I}}}function Ia(t){return!t||Array.isArray(t)||typeof t=="string"&&Pi[t]}const yt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Pi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yt([0,.65,.55,1]),circOut:yt([.55,0,1,.45]),backIn:yt([.31,.01,.66,-.59]),backOut:yt([.33,1.53,.69,.99])};function ja(t){if(t)return Array.isArray(t)?yt(t):Pi[t]}function Oa(t,e,n,{delay:s=0,duration:i,repeat:r=0,repeatType:o="loop",ease:a,times:c}={}){return t.animate({[e]:n,offset:c},{delay:s,duration:i,easing:ja(a),fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}const kn={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},ve={},Ti={};for(const t in kn)Ti[t]=()=>(ve[t]===void 0&&(ve[t]=kn[t]()),ve[t]);function Na(t,{repeat:e,repeatType:n="loop"}){const s=e&&n!=="loop"&&e%2===1?0:t.length-1;return t[s]}const Ua=new Set(["opacity"]),Ot=10;function _a(t,e,{onUpdate:n,onComplete:s,...i}){if(!(Ti.waapi()&&Ua.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0))return!1;let{keyframes:o,duration:a=300,elapsed:c=0,ease:l}=i;if(i.type==="spring"||!Ia(i.ease)){if(i.repeat===1/0)return;const f=Jt({...i,elapsed:0});let h={done:!1,value:o[0]};const d=[];let p=0;for(;!h.done&&p<2e4;)h=f.sample(p),d.push(h.value),p+=Ot;o=d,a=p-Ot,l="linear"}const u=Oa(t.owner.current,e,o,{...i,delay:-c,duration:a,ease:l});return u.onfinish=()=>{t.set(Na(o,i)),L.update(()=>u.cancel()),s&&s()},{get currentTime(){return u.currentTime||0},set currentTime(f){u.currentTime=f},stop:()=>{const{currentTime:f}=u;if(f){const h=Jt({...i,autoplay:!1});t.setWithVelocity(h.sample(f-Ot).value,h.sample(f).value,Ot)}L.update(()=>u.cancel())}}}function Ci(t,e){const n=performance.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Q.read(s),t(r-e))};return L.read(s,!0),()=>Q.read(s)}function $a({keyframes:t,elapsed:e,onUpdate:n,onComplete:s}){const i=()=>{n&&n(t[t.length-1]),s&&s()};return e?{stop:Ci(i,-e)}:i()}function za({keyframes:t,velocity:e=0,min:n,max:s,power:i=.8,timeConstant:r=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:f,onComplete:h,onStop:d}){const p=t[0];let g;function T(y){return n!==void 0&&ys}function b(y){return n===void 0?s:s===void 0||Math.abs(n-y){f&&f(S),y.onUpdate&&y.onUpdate(S)},onComplete:h,onStop:d})}function v(y){x({type:"spring",stiffness:o,damping:a,restDelta:c,...y})}if(T(p))v({velocity:e,keyframes:[p,b(p)]});else{let y=i*e+p;typeof l<"u"&&(y=l(y));const S=b(y),M=S===n?-1:1;let E,N;const I=j=>{E=N,N=j,e=on(j-E,G.delta),(M===1&&j>S||M===-1&&jg&&g.stop()}}const nt=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Nt=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),xe=()=>({type:"keyframes",ease:"linear",duration:.3}),Ha={type:"keyframes",duration:.8},Bn={x:nt,y:nt,z:nt,rotate:nt,rotateX:nt,rotateY:nt,rotateZ:nt,scaleX:Nt,scaleY:Nt,scale:Nt,opacity:xe,backgroundColor:xe,color:xe,default:Nt},Wa=(t,{keyframes:e})=>e.length>2?Ha:(Bn[t]||Bn.default)(e[1]),Fe=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&tt.test(e)&&!e.startsWith("url("));function Ga({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}function Fn(t){return t===0||typeof t=="string"&&parseFloat(t)===0&&t.indexOf(" ")===-1}function In(t){return typeof t=="number"?0:cn("",t)}function Si(t,e){return t[e]||t.default||t}function Ka(t,e,n,s){const i=Fe(e,n);let r=s.from!==void 0?s.from:t.get();return r==="none"&&i&&typeof n=="string"?r=cn(e,n):Fn(r)&&typeof n=="string"?r=In(n):!Array.isArray(n)&&Fn(n)&&typeof r=="string"&&(n=In(r)),Array.isArray(n)?(n[0]===null&&(n[0]=r),n):[r,n]}const mn=(t,e,n,s={})=>i=>{const r=Si(s,t)||{},o=r.delay||s.delay||0;let{elapsed:a=0}=s;a=a-$t(o);const c=Ka(e,t,n,r),l=c[0],u=c[c.length-1],f=Fe(t,l),h=Fe(t,u);let d={keyframes:c,velocity:e.getVelocity(),...r,elapsed:a,onUpdate:p=>{e.set(p),r.onUpdate&&r.onUpdate(p)},onComplete:()=>{i(),r.onComplete&&r.onComplete()}};if(!f||!h||ea.current||r.type===!1)return $a(d);if(r.type==="inertia")return za(d);if(Ga(r)||(d={...d,...Wa(t,d)}),d.duration&&(d.duration=$t(d.duration)),d.repeatDelay&&(d.repeatDelay=$t(d.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const p=_a(e,t,d);if(p)return p}return Jt(d)};function Za(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ie(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ie(t,e,n);else{const i=typeof e=="function"?ce(t,e,n.custom):e;s=Ai(t,i,n)}return s.then(()=>t.notify("AnimationComplete",e))}function Ie(t,e,n={}){const s=ce(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Ai(t,s,n):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:f}=i;return Ya(t,e,l+c,u,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,l]=a==="beforeChildren"?[r,o]:[o,r];return c().then(l)}else return Promise.all([r(),o(n.delay)])}function Ai(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=t.makeTargetAnimatable(e);const c=t.getValue("willChange");s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const h=t.getValue(f),d=a[f];if(!h||d===void 0||u&&qa(u,f))continue;const p={delay:n,elapsed:0,...r};if(window.HandoffAppearAnimations&&!h.hasAnimated){const T=t.getProps()[Qr];T&&(p.elapsed=window.HandoffAppearAnimations(T,f,h,L))}let g=h.start(mn(f,h,d,t.shouldReduceMotion&&pt.has(f)?{type:!1}:p));Yt(c)&&(c.add(f),g=g.then(()=>c.remove(f))),l.push(g)}return Promise.all(l).then(()=>{o&&Zr(t,o)})}function Ya(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,c=i===1?(l=0)=>l*s:(l=0)=>a-l*s;return Array.from(t.variantChildren).sort(Xa).forEach((l,u)=>{l.notify("AnimationStart",e),o.push(Ie(l,e,{...r,delay:n+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function Xa(t,e){return t.sortNodePosition(e)}function qa({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}const gn=[A.Animate,A.InView,A.Focus,A.Hover,A.Tap,A.Drag,A.Exit],Ja=[...gn].reverse(),Qa=gn.length;function tc(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Za(t,n,s)))}function ec(t){let e=tc(t);const n=sc();let s=!0;const i=(c,l)=>{const u=ce(t,l);if(u){const{transition:f,transitionEnd:h,...d}=u;c={...c,...d,...h}}return c};function r(c){e=c(t)}function o(c,l){const u=t.getProps(),f=t.getVariantContext(!0)||{},h=[],d=new Set;let p={},g=1/0;for(let b=0;bg&&S;const j=Array.isArray(y)?y:[y];let Z=j.reduce(i,{});M===!1&&(Z={});const{prevResolvedValues:It={}}=v,le={...It,...Z},Y=R=>{I=!0,d.delete(R),v.needsAnimating[R]=!0};for(const R in le){const k=Z[R],at=It[R];p.hasOwnProperty(R)||(k!==at?Kt(k)&&Kt(at)?!Qs(k,at)||N?Y(R):v.protectedKeys[R]=!0:k!==void 0?Y(R):d.add(R):k!==void 0&&d.has(R)?Y(R):v.protectedKeys[R]=!0)}v.prevProp=y,v.prevResolvedValues=Z,v.isActive&&(p={...p,...Z}),s&&t.blockInitialAnimation&&(I=!1),I&&!E&&h.push(...j.map(R=>({animation:R,options:{type:x,...c}})))}if(d.size){const b={};d.forEach(x=>{const v=t.getBaseTarget(x);v!==void 0&&(b[x]=v)}),h.push({animation:b})}let T=Boolean(h.length);return s&&u.initial===!1&&!t.manuallyAnimateOnMount&&(T=!1),s=!1,T?e(h):Promise.resolve()}function a(c,l,u){if(n[c].isActive===l)return Promise.resolve();t.variantChildren&&t.variantChildren.forEach(h=>{h.animationState&&h.animationState.setActive(c,l)}),n[c].isActive=l;const f=o(u,c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n}}function nc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Qs(e,t):!1}function st(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sc(){return{[A.Animate]:st(!0),[A.InView]:st(),[A.Hover]:st(),[A.Tap]:st(),[A.Drag]:st(),[A.Focus]:st(),[A.Exit]:st()}}class ic extends et{constructor(e){super(e),e.animationState||(e.animationState=ec(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),se(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let oc=0;class rc extends et{constructor(){super(...arguments),this.id=oc++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n,custom:s}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive(A.Exit,!e,{custom:s??this.node.getProps().custom});n&&!e&&r.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const ac={animation:{Feature:ic},exit:{Feature:rc}},jn=(t,e)=>Math.abs(t-e);function cc(t,e){const n=jn(t.x,e.x),s=jn(t.y,e.y);return Math.sqrt(n**2+s**2)}class Vi{constructor(e,n,{transformPagePoint:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=Pe(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,f=cc(l.offset,{x:0,y:0})>=3;if(!u&&!f)return;const{point:h}=l,{timestamp:d}=G;this.history.push({...h,timestamp:d});const{onStart:p,onMove:g}=this.handlers;u||(p&&p(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{this.lastMoveEvent=l,this.lastMoveEventInfo=be(u,this.transformPagePoint),L.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:h}=this.handlers,d=Pe(l.type==="pointercancel"?this.lastMoveEventInfo:be(u,this.transformPagePoint),this.history);this.startEvent&&f&&f(l,d),h&&h(l,d)},!Zs(e))return;this.handlers=n,this.transformPagePoint=s;const i=re(e),r=be(i,this.transformPagePoint),{point:o}=r,{timestamp:a}=G;this.history=[{...o,timestamp:a}];const{onSessionStart:c}=n;c&&c(e,Pe(r,this.history)),this.removeListeners=J(W(window,"pointermove",this.handlePointerMove),W(window,"pointerup",this.handlePointerUp),W(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Q.update(this.updatePoint)}}function be(t,e){return e?{point:e(t.point)}:t}function On(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Pe({point:t},e){return{point:t,delta:On(t,wi(e)),offset:On(t,lc(e)),velocity:uc(e,.1)}}function lc(t){return t[0]}function wi(t){return t[t.length-1]}function uc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=wi(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>$t(e)));)n--;if(!s)return{x:0,y:0};const r=(i.timestamp-s.timestamp)/1e3;if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function F(t){return t.max-t.min}function je(t,e=0,n=.01){return Math.abs(t-e)<=n}function Nn(t,e,n,s=.5){t.origin=s,t.originPoint=V(e.min,e.max,t.origin),t.scale=F(n)/F(e),(je(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=V(n.min,n.max,t.origin)-t.originPoint,(je(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Pt(t,e,n,s){Nn(t.x,e.x,n.x,s?s.originX:void 0),Nn(t.y,e.y,n.y,s?s.originY:void 0)}function Un(t,e,n){t.min=n.min+e.min,t.max=t.min+F(e)}function fc(t,e,n){Un(t.x,e.x,n.x),Un(t.y,e.y,n.y)}function _n(t,e,n){t.min=e.min-n.min,t.max=t.min+F(e)}function Tt(t,e,n){_n(t.x,e.x,n.x),_n(t.y,e.y,n.y)}function hc(t,{min:e,max:n},s){return e!==void 0&&tn&&(t=s?V(n,t,s.max):Math.min(t,n)),t}function $n(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function dc(t,{top:e,left:n,bottom:s,right:i}){return{x:$n(t.x,n,i),y:$n(t.y,e,s)}}function zn(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.mins?n=qt(e.min,e.max-s,t.min):s>i&&(n=qt(t.min,t.max-i,e.min)),ht(0,1,n)}function gc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Oe=.35;function yc(t=Oe){return t===!1?t=0:t===!0&&(t=Oe),{x:Hn(t,"left","right"),y:Hn(t,"top","bottom")}}function Hn(t,e,n){return{min:Wn(t,e),max:Wn(t,n)}}function Wn(t,e){return typeof t=="number"?t:t[e]||0}const Gn=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ct=()=>({x:Gn(),y:Gn()}),Kn=()=>({min:0,max:0}),w=()=>({x:Kn(),y:Kn()});function U(t){return[t("x"),t("y")]}function Mi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function vc({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function xc(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Te(t){return t===void 0||t===1}function Ne({scale:t,scaleX:e,scaleY:n}){return!Te(t)||!Te(e)||!Te(n)}function it(t){return Ne(t)||Ri(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Ri(t){return Zn(t.x)||Zn(t.y)}function Zn(t){return t&&t!=="0%"}function Qt(t,e,n){const s=t-n,i=e*s;return n+i}function Yn(t,e,n,s,i){return i!==void 0&&(t=Qt(t,i,s)),Qt(t,n,s)+e}function Ue(t,e=0,n=1,s,i){t.min=Yn(t.min,e,n,s,i),t.max=Yn(t.max,e,n,s,i)}function Ei(t,{x:e,y:n}){Ue(t.x,e.translate,e.scale,e.originPoint),Ue(t.y,n.translate,n.scale,n.originPoint)}function bc(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a1.0000000000001||t<.999999999999?t:1}function q(t,e){t.min=t.min+e,t.max=t.max+e}function qn(t,e,[n,s,i]){const r=e[i]!==void 0?e[i]:.5,o=V(t.min,t.max,r);Ue(t,e[n],e[s],o,e.scale)}const Pc=["x","scaleX","originX"],Tc=["y","scaleY","originY"];function ft(t,e){qn(t.x,e,Pc),qn(t.y,e,Tc)}function Li(t,e){return Mi(xc(t.getBoundingClientRect(),e))}function Cc(t,e,n){const s=Li(t,n),{scroll:i}=e;return i&&(q(s.x,i.offset.x),q(s.y,i.offset.y)),s}const Sc=new WeakMap;class Ac{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=w(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{this.stopAnimation(),n&&this.snapToCursor(re(c,"page").point)},r=(c,l)=>{const{drag:u,dragPropagation:f,onDragStart:h}=this.getProps();if(u&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Xs(u),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),U(p=>{let g=this.getAxisMotionValue(p).get()||0;if($.test(g)){const{projection:T}=this.visualElement;if(T&&T.layout){const b=T.layout.layoutBox[p];b&&(g=F(b)*(parseFloat(g)/100))}}this.originPoint[p]=g}),h&&h(c,l);const{animationState:d}=this.visualElement;d&&d.setActive(A.Drag,!0)},o=(c,l)=>{const{dragPropagation:u,dragDirectionLock:f,onDirectionLock:h,onDrag:d}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:p}=l;if(f&&this.currentDirection===null){this.currentDirection=Vc(p),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",l.point,p),this.updateAxis("y",l.point,p),this.visualElement.render(),d&&d(c,l)},a=(c,l)=>this.stop(c,l);this.panSession=new Vi(e,{onSessionStart:i,onStart:r,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&r(e,n)}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive(A.Drag,!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Ut(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=hc(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),{layout:s}=this.visualElement.projection||{},i=this.constraints;e&<(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=dc(s.layoutBox,e):this.constraints=!1,this.elastic=yc(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&U(r=>{this.getAxisMotionValue(r)&&(this.constraints[r]=gc(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!lt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=Cc(s,i.root,this.visualElement.getTransformPagePoint());let o=pc(i.layout.layoutBox,r);if(n){const a=n(vc(o));this.hasMutatedConstraints=!!a,a&&(o=Mi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=U(u=>{if(!Ut(u,n,this.currentDirection))return;let f=c&&c[u]||{};o&&(f={min:0,max:0});const h=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[u]:0,bounceStiffness:h,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...f};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return s.start(mn(e,s,0,n))}stopAnimation(){U(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n="_drag"+e.toUpperCase(),s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){U(n=>{const{drag:s}=this.getProps();if(!Ut(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];r.set(e[n]-V(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!lt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};U(o=>{const a=this.getAxisMotionValue(o);if(a){const c=a.get();i[o]=mc({min:c,max:c},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),U(o=>{if(!Ut(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(V(c,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;Sc.set(this.visualElement,this);const e=this.visualElement.current,n=W(e,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();lt(c)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),s();const o=H(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(U(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=c[u].translate,f.set(f.get()+c[u].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Oe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ut(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Vc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class wc extends et{constructor(e){super(e),this.removeGroupControls=z,this.removeListeners=z,this.controls=new Ac(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||z}unmount(){this.removeGroupControls(),this.removeListeners()}}class Mc extends et{constructor(){super(...arguments),this.removePointerDownListener=z}onPointerDown(e){this.session=new Vi(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:e,onStart:n,onMove:s,onEnd:(r,o)=>{delete this.session,i&&i(r,o)}}}mount(){this.removePointerDownListener=W(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Rc(){const t=m.useContext(Lt);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=m.useId();return m.useEffect(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}function Ec(){return Lc(m.useContext(Lt))}function Lc(t){return t===null?!0:t.isPresent}function Jn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const gt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=Jn(t,e.target.x),s=Jn(t,e.target.y);return`${n}% ${s}%`}};function _e(t){return typeof t=="string"&&t.startsWith("var(--")}const Di=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Dc(t){const e=Di.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}function $e(t,e,n=1){const[s,i]=Dc(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);return r?r.trim():_e(i)?$e(i,e,n+1):i}function kc(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(i=>{const r=i.get();if(!_e(r))return;const o=$e(r,s);o&&i.set(o)});for(const i in e){const r=e[i];if(!_e(r))continue;const o=$e(r,s);o&&(e[i]=o,n&&n[i]===void 0&&(n[i]=r))}return{target:e,transitionEnd:n}}const Qn="_$css",Bc={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=t.includes("var("),r=[];i&&(t=t.replace(Di,d=>(r.push(d),Qn)));const o=tt.parse(t);if(o.length>5)return s;const a=tt.createTransformer(t),c=typeof o[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;o[0+c]/=l,o[1+c]/=u;const f=V(l,u,.5);typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f);let h=a(o);if(i){let d=0;h=h.replace(Qn,()=>{const p=r[d];return d++,p})}return h}};class Fc extends ws.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;Oo(Ic),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),vt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,o=s.projection;return o&&(o.isPresent=r,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||L.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ki(t){const[e,n]=Rc(),s=m.useContext(Ge);return ws.createElement(Fc,{...t,layoutGroup:s,switchLayoutGroup:m.useContext(Is),isPresent:e,safeToRemove:n})}const Ic={borderRadius:{...gt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gt,borderTopRightRadius:gt,borderBottomLeftRadius:gt,borderBottomRightRadius:gt,boxShadow:Bc};function jc(t,e,n={}){const s=B(t)?t:dt(t);return s.start(mn("",s,e,n)),{stop:()=>s.stop(),isAnimating:()=>s.isAnimating()}}const Bi=["TopLeft","TopRight","BottomLeft","BottomRight"],Oc=Bi.length,ts=t=>typeof t=="string"?parseFloat(t):t,es=t=>typeof t=="number"||P.test(t);function Nc(t,e,n,s,i,r){i?(t.opacity=V(0,n.opacity!==void 0?n.opacity:1,Uc(s)),t.opacityExit=V(e.opacity!==void 0?e.opacity:1,0,_c(s))):r&&(t.opacity=V(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let o=0;ose?1:n(qt(t,e,s))}function ss(t,e){t.min=e.min,t.max=e.max}function O(t,e){ss(t.x,e.x),ss(t.y,e.y)}function is(t,e,n,s,i){return t-=e,t=Qt(t,1/n,s),i!==void 0&&(t=Qt(t,1/i,s)),t}function $c(t,e=0,n=1,s=.5,i,r=t,o=t){if($.test(e)&&(e=parseFloat(e),e=V(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=V(r.min,r.max,s);t===r&&(a-=e),t.min=is(t.min,e,n,a,i),t.max=is(t.max,e,n,a,i)}function os(t,e,[n,s,i],r,o){$c(t,e[n],e[s],e[i],e.scale,r,o)}const zc=["x","scaleX","originX"],Hc=["y","scaleY","originY"];function rs(t,e,n,s){os(t.x,e,zc,n?n.x:void 0,s?s.x:void 0),os(t.y,e,Hc,n?n.y:void 0,s?s.y:void 0)}function as(t){return t.translate===0&&t.scale===1}function Ii(t){return as(t.x)&&as(t.y)}function ji(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function cs(t){return F(t.x)/F(t.y)}class Wc{constructor(){this.members=[]}add(e){en(this.members,e),e.scheduleRender()}remove(e){if(nn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ls(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y;if((i||r)&&(s=`translate3d(${i}px, ${r}px, 0) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:c,rotateX:l,rotateY:u}=n;c&&(s+=`rotate(${c}deg) `),l&&(s+=`rotateX(${l}deg) `),u&&(s+=`rotateY(${u}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(s+=`scale(${o}, ${a})`),s||"none"}const Gc=(t,e)=>t.depth-e.depth;class Kc{constructor(){this.children=[],this.isDirty=!1}add(e){en(this.children,e),this.isDirty=!0}remove(e){nn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Gc),this.isDirty=!1,this.children.forEach(e)}}const us=["","X","Y","Z"],fs=1e3;let Zc=0;function Oi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o,a={},c=e==null?void 0:e()){this.id=Zc++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(qc),this.nodes.forEach(tl),this.nodes.forEach(el)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Ci(h,250),vt.hasAnimatedSinceResize&&(vt.hasAnimatedSinceResize=!1,this.nodes.forEach(ds))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||l)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||rl,{onLayoutAnimationStart:T,onLayoutAnimationComplete:b}=u.getProps(),x=!this.targetLayout||!ji(this.targetLayout,p)||d,v=!h&&d;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||v||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,v);const y={...Si(g,"layout"),onPlay:T,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y)}else!h&&this.animationProgress===0&&ds(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Q.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nl),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const y=v/1e3;ps(f.x,o.x,y),ps(f.y,o.y,y),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),il(this.relativeTarget,this.relativeTargetOrigin,h,y)),g&&(this.animationValues=u,Nc(u,l,this.latestValues,y,x,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=y},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Q.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=L.update(()=>{vt.hasAnimatedSinceResize=!0,this.currentAnimation=jc(0,fs,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&Ni(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||w();const f=F(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const h=F(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+h}O(a,c),ft(a,u),Pt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Wc),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.rotate||c.rotateX||c.rotateY||c.rotateZ)&&(a=!0),!a)return;const l={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(hs),this.root.sharedNodes.clear()}}}function Yc(t){t.updateLayout()}function Xc(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=n.source!==t.layout.source;r==="size"?U(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],d=F(h);h.min=s[f].min,h.max=h.min+d}):Ni(r,n.layoutBox,s)&&U(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],d=F(s[f]);h.max=h.min+d});const a=Ct();Pt(a,s,n.layoutBox);const c=Ct();o?Pt(c,t.applyTransform(i,!0),n.measuredBox):Pt(c,s,n.layoutBox);const l=!Ii(a);let u=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:d}=f;if(h&&d){const p=w();Tt(p,n.layoutBox,h.layoutBox);const g=w();Tt(g,s,d.layoutBox),ji(p,g)||(u=!0),f.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function qc(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function Jc(t){t.clearSnapshot()}function hs(t){t.clearMeasurements()}function Qc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ds(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function tl(t){t.resolveTargetDelta()}function el(t){t.calcProjection()}function nl(t){t.resetRotation()}function sl(t){t.removeLeadSnapshot()}function ps(t,e,n){t.translate=V(e.translate,0,n),t.scale=V(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ms(t,e,n,s){t.min=V(e.min,n.min,s),t.max=V(e.max,n.max,s)}function il(t,e,n,s){ms(t.x,e.x,n.x,s),ms(t.y,e.y,n.y,s)}function ol(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const rl={duration:.45,ease:[.4,0,.1,1]};function al(t,e){let n=t.root;for(let r=t.path.length-1;r>=0;r--)if(Boolean(t.path[r].instance)){n=t.path[r];break}const i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function gs(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function cl(t){gs(t.x),gs(t.y)}function Ni(t,e,n){return t==="position"||t==="preserve-aspect"&&!je(cs(e),cs(n),.2)}const ll=Oi({attachResizeListener:(t,e)=>H(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ce={current:void 0},Ui=Oi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ce.current){const t=new ll(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Ce.current=t}return Ce.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>Boolean(window.getComputedStyle(t).position==="fixed")}),ul={pan:{Feature:Mc},drag:{Feature:wc,ProjectionNode:Ui,MeasureLayout:ki}},fl=new Set(["width","height","top","left","right","bottom","x","y"]),_i=t=>fl.has(t),hl=t=>Object.keys(t).some(_i),ys=t=>t===rt||t===P;var vs;(function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"})(vs||(vs={}));const xs=(t,e)=>parseFloat(t.split(", ")[e]),bs=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/);if(i)return xs(i[1],e);{const r=s.match(/^matrix\((.+)\)$/);return r?xs(r[1],t):0}},dl=new Set(["x","y","z"]),pl=oe.filter(t=>!dl.has(t));function ml(t){const e=[];return pl.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}const Ps={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:bs(4,13),y:bs(5,14)},gl=(t,e,n)=>{const s=e.measureViewportBox(),i=e.current,r=getComputedStyle(i),{display:o}=r,a={};o==="none"&&e.setStaticValue("display",t.display||"block"),n.forEach(l=>{a[l]=Ps[l](s,r)}),e.render();const c=e.measureViewportBox();return n.forEach(l=>{const u=e.getValue(l);u&&u.jump(a[l]),t[l]=Ps[l](c,r)}),t},yl=(t,e,n={},s={})=>{e={...e},s={...s};const i=Object.keys(e).filter(_i);let r=[],o=!1;const a=[];if(i.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=n[c],f=mt(u);const h=e[c];let d;if(Kt(h)){const p=h.length,g=h[0]===null?1:0;u=h[g],f=mt(u);for(let T=g;T=0?window.pageYOffset:null,l=gl(e,t,a);return r.length&&r.forEach(([u,f])=>{t.getValue(u).set(f)}),t.render(),ne&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:s}}else return{target:e,transitionEnd:s}};function vl(t,e,n,s){return hl(e)?yl(t,e,n,s):{target:e,transitionEnd:s}}const xl=(t,e,n,s)=>{const i=kc(t,e,s);return e=i.target,s=i.transitionEnd,vl(t,e,n,s)},ze={current:null},$i={current:!1};function bl(){if($i.current=!0,!!ne)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ze.current=t.matches;t.addListener(e),e()}else ze.current=!1}function Pl(t,e,n){const{willChange:s}=e;for(const i in e){const r=e[i],o=n[i];if(B(r))t.addValue(i,r),Yt(s)&&s.add(i);else if(B(o))t.addValue(i,dt(r,{owner:t})),Yt(s)&&s.remove(i);else if(o!==r)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(r)}else{const a=t.getStaticValue(i);t.addValue(i,dt(a!==void 0?a:r,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const zi=Object.keys(At),Tl=zi.length,Ts=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Cl{constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>L.render(this.render,!1,!0);const{latestValues:a,renderState:c}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.isControllingVariants=ie(n),this.isVariantNode=Fs(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n,{});for(const f in u){const h=u[f];a[f]!==void 0&&B(h)&&(h.set(a[f],!1),Yt(l)&&l.add(f))}}scrapeMotionValuesFromProps(e,n){return{}}mount(e){this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),$i.current||bl(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ze.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Q.update(this.notifyUpdate),Q.render(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,n){const s=pt.has(e),i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&L.update(this.notifyUpdate,!1,!0),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),r()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...n},s,i,r,o){let a,c;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:d,layoutRoot:p})}return c}updateFeatures(){for(const e in this.features){const n=this.features[e];n.isMounted?n.update(this.props,this.prevProps):(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):w()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}makeTargetAnimatable(e,n=!0){return this.makeTargetAnimatableFromInstance(e,this.props,n)}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;sn.variantChildren.delete(e)}addValue(e,n){n!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,n)),this.values.set(e,n),this.latestValues[e]=n.get()}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=dt(n,{owner:this}),this.addValue(e,s)),s}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props,i=typeof s=="string"||typeof s=="object"?(n=tn(this.props,s))===null||n===void 0?void 0:n[e]:void 0;if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!B(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new sn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}const Hi=["initial",...gn],Sl=Hi.length;class Wi extends Cl{sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:n,...s},{transformValues:i},r){let o=qr(s,e||{},this);if(i&&(n&&(n=i(n)),s&&(s=i(s)),o&&(o=i(o))),r){Yr(this,s,o);const a=xl(this,s,o,n);n=a.transitionEnd,s=a.target}return{transition:e,transitionEnd:n,...s}}}function Al(t){return window.getComputedStyle(t)}class Vl extends Wi{readValueFromInstance(e,n){if(pt.has(n)){const s=an(n);return s&&s.default||0}else{const s=Al(e),i=(Os(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Li(e,n)}build(e,n,s,i){Ze(e,n,s,i.transformTemplate)}scrapeMotionValuesFromProps(e,n){return Qe(e,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,s,i){zs(e,n,s,i)}}class wl extends Wi{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(pt.has(n)){const s=an(n);return s&&s.default||0}return n=Hs.has(n)?n:Je(n),e.getAttribute(n)}measureInstanceViewportBox(){return w()}scrapeMotionValuesFromProps(e,n){return Gs(e,n)}build(e,n,s,i){Xe(e,n,s,this.isSVGTag,i.transformTemplate)}renderInstance(e,n,s,i){Ws(e,n,s,i)}mount(e){this.isSVGTag=qe(e.tagName),super.mount(e)}}const Ml=(t,e)=>Ke(t)?new wl(e,{enableHardwareAcceleration:!1}):new Vl(e,{enableHardwareAcceleration:!0}),Rl={layout:{ProjectionNode:Ui,MeasureLayout:ki}},El={...ac,...Cr,...ul,...Rl},Ll=Io((t,e)=>ur(t,e,El,Ml));function Gi(){const t=m.useRef(!1);return Ht(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Dl(){const t=Gi(),[e,n]=m.useState(0),s=m.useCallback(()=>{t.current&&n(e+1)},[e]);return[m.useCallback(()=>L.postRender(s),[s]),e]}class kl extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Bl({children:t,isPresent:e}){const n=m.useId(),s=m.useRef(null),i=m.useRef({width:0,height:0,top:0,left:0});return m.useInsertionEffect(()=>{const{width:r,height:o,top:a,left:c}=i.current;if(e||!s.current||!r||!o)return;s.current.dataset.motionPopId=n;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${r}px !important; height: ${o}px !important; top: ${a}px !important; left: ${c}px !important; } `),()=>{document.head.removeChild(l)}},[e]),m.createElement(kl,{isPresent:e,childRef:s,sizeRef:i},m.cloneElement(t,{ref:s}))}const Se=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o})=>{const a=We(Fl),c=m.useId(),l=m.useMemo(()=>({id:c,initial:e,isPresent:n,custom:i,onExitComplete:u=>{a.set(u,!0);for(const f of a.values())if(!f)return;s&&s()},register:u=>(a.set(u,!1),()=>a.delete(u))}),r?void 0:[n]);return m.useMemo(()=>{a.forEach((u,f)=>a.set(f,!1))},[n]),m.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),o==="popLayout"&&(t=m.createElement(Bl,{isPresent:n},t)),m.createElement(Lt.Provider,{value:l},t)};function Fl(){return new Map}function Il(t){return m.useEffect(()=>()=>t(),[])}const ct=t=>t.key||"";function jl(t,e){t.forEach(n=>{const s=ct(n);e.set(s,n)})}function Ol(t){const e=[];return m.Children.forEach(t,n=>{m.isValidElement(n)&&e.push(n)}),e}const Nl=({children:t,custom:e,initial:n=!0,onExitComplete:s,exitBeforeEnter:i,presenceAffectsLayout:r=!0,mode:o="sync"})=>{i&&(o="wait");let[a]=Dl();const c=m.useContext(Ge).forceRender;c&&(a=c);const l=Gi(),u=Ol(t);let f=u;const h=new Set,d=m.useRef(f),p=m.useRef(new Map).current,g=m.useRef(!0);if(Ht(()=>{g.current=!1,jl(u,p),d.current=f}),Il(()=>{g.current=!0,p.clear(),h.clear()}),g.current)return m.createElement(m.Fragment,null,f.map(v=>m.createElement(Se,{key:ct(v),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:r,mode:o},v)));f=[...f];const T=d.current.map(ct),b=u.map(ct),x=T.length;for(let v=0;v{if(b.indexOf(v)!==-1)return;const y=p.get(v);if(!y)return;const S=T.indexOf(v),M=()=>{p.delete(v),h.delete(v);const E=d.current.findIndex(N=>N.key===v);if(d.current.splice(E,1),!h.size){if(d.current=u,l.current===!1)return;a(),s&&s()}};f.splice(S,0,m.createElement(Se,{key:ct(y),isPresent:!1,onExitComplete:M,custom:e,presenceAffectsLayout:r,mode:o},y))}),f=f.map(v=>{const y=v.key;return h.has(y)?v:m.createElement(Se,{key:ct(v),isPresent:!0,presenceAffectsLayout:r,mode:o},v)}),m.createElement(m.Fragment,null,h.size?f:f.map(v=>m.cloneElement(v)))};var Ul={initial:t=>{const{position:e}=t,n=["top","bottom"].includes(e)?"y":"x";let s=["top-right","bottom-right"].includes(e)?1:-1;return e==="bottom"&&(s=1),{opacity:0,[n]:s*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},Ki=m.memo(t=>{const{id:e,message:n,onCloseComplete:s,onRequestRemove:i,requestClose:r=!1,position:o="bottom",duration:a=5e3,containerStyle:c,motionVariants:l=Ul,toastSpacing:u="0.5rem"}=t,[f,h]=m.useState(a),d=Ec();xn(()=>{d||s==null||s()},[d]),xn(()=>{h(a)},[a]);const p=()=>h(null),g=()=>h(a),T=()=>{d&&i()};m.useEffect(()=>{d&&r&&i()},[d,r,i]),Co(T,f);const b=m.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:u,...c}),[c,u]),x=m.useMemo(()=>bo(o),[o]);return C.jsx(Ll.li,{layout:!0,className:"chakra-toast",variants:l,initial:"initial",animate:"animate",exit:"exit",onHoverStart:p,onHoverEnd:g,custom:{position:o},style:x,children:C.jsx(K.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:Ae(n,{id:e,onClose:T})})})});Ki.displayName="ToastComponent";function _l(t,e){var n;const s=t??"bottom",r={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[s];return(n=r==null?void 0:r[e])!=null?n:s}var Cs={path:C.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[C.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),C.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),C.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Ft=Mt((t,e)=>{const{as:n,viewBox:s,color:i="currentColor",focusable:r=!1,children:o,className:a,__css:c,...l}=t,u=Rt("chakra-icon",a),f=Ms("Icon",t),h={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...c,...f},d={ref:e,focusable:r,className:u,__css:h},p=s??Cs.viewBox;if(n&&typeof n!="string")return C.jsx(K.svg,{as:n,...d,...l});const g=o??Cs.path;return C.jsx(K.svg,{verticalAlign:"middle",viewBox:p,...d,...l,children:g})});Ft.displayName="Icon";function $l(t){return C.jsx(Ft,{viewBox:"0 0 24 24",...t,children:C.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function zl(t){return C.jsx(Ft,{viewBox:"0 0 24 24",...t,children:C.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function Ss(t){return C.jsx(Ft,{viewBox:"0 0 24 24",...t,children:C.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var[Hl,Wl]=Et({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Gl,yn]=Et({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),Zi={info:{icon:zl,colorScheme:"blue"},warning:{icon:Ss,colorScheme:"orange"},success:{icon:$l,colorScheme:"green"},error:{icon:Ss,colorScheme:"red"},loading:{icon:so,colorScheme:"blue"}};function Kl(t){return Zi[t].colorScheme}function Zl(t){return Zi[t].icon}var Yi=Mt(function(e,n){const i={display:"inline",...yn().description};return C.jsx(K.div,{ref:n,...e,className:Rt("chakra-alert__desc",e.className),__css:i})});Yi.displayName="AlertDescription";function Xi(t){const{status:e}=Wl(),n=Zl(e),s=yn(),i=e==="loading"?s.spinner:s.icon;return C.jsx(K.span,{display:"inherit",...t,className:Rt("chakra-alert__icon",t.className),__css:i,children:t.children||C.jsx(n,{h:"100%",w:"100%"})})}Xi.displayName="AlertIcon";var qi=Mt(function(e,n){const s=yn();return C.jsx(K.div,{ref:n,...e,className:Rt("chakra-alert__title",e.className),__css:s.title})});qi.displayName="AlertTitle";var Ji=Mt(function(e,n){var s;const{status:i="info",addRole:r=!0,...o}=Rs(e),a=(s=e.colorScheme)!=null?s:Kl(i),c=io("Alert",{...e,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...c.container};return C.jsx(Hl,{value:{status:i},children:C.jsx(Gl,{value:c,children:C.jsx(K.div,{role:r?"alert":void 0,ref:n,...o,className:Rt("chakra-alert",e.className),__css:l})})})});Ji.displayName="Alert";function Yl(t){return C.jsx(Ft,{focusable:"false","aria-hidden":!0,...t,children:C.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var Qi=Mt(function(e,n){const s=Ms("CloseButton",e),{children:i,isDisabled:r,__css:o,...a}=Rs(e),c={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return C.jsx(K.button,{type:"button","aria-label":"Close",ref:n,disabled:r,__css:{...c,...s,...o},...a,children:i||C.jsx(Yl,{width:"1em",height:"1em"})})});Qi.displayName="CloseButton";var Xl={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},_=ql(Xl);function ql(t){let e=t;const n=new Set,s=i=>{e=i(e),n.forEach(r=>r())};return{getState:()=>e,subscribe:i=>(n.add(i),()=>{s(()=>t),n.delete(i)}),removeToast:(i,r)=>{s(o=>({...o,[r]:o[r].filter(a=>a.id!=i)}))},notify:(i,r)=>{const o=Jl(i,r),{position:a,id:c}=o;return s(l=>{var u,f;const d=a.includes("top")?[o,...(u=l[a])!=null?u:[]]:[...(f=l[a])!=null?f:[],o];return{...l,[a]:d}}),c},update:(i,r)=>{i&&s(o=>{const a={...o},{position:c,index:l}=vn(a,i);return c&&l!==-1&&(a[c][l]={...a[c][l],...r,message:to(r)}),a})},closeAll:({positions:i}={})=>{s(r=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((c,l)=>(c[l]=r[l].map(u=>({...u,requestClose:!0})),c),{...r}))},close:i=>{s(r=>{const o=Ds(r,i);return o?{...r,[o]:r[o].map(a=>a.id==i?{...a,requestClose:!0}:a)}:r})},isActive:i=>Boolean(vn(_.getState(),i).position)}}var As=0;function Jl(t,e={}){var n,s;As+=1;const i=(n=e.id)!=null?n:As,r=(s=e.position)!=null?s:"bottom";return{id:i,message:t,position:r,duration:e.duration,onCloseComplete:e.onCloseComplete,onRequestRemove:()=>_.removeToast(String(i),r),status:e.status,requestClose:!1,containerStyle:e.containerStyle}}var Ql=t=>{const{status:e,variant:n="solid",id:s,title:i,isClosable:r,onClose:o,description:a,icon:c}=t,l=s?{root:`toast-${s}`,title:`toast-${s}-title`,description:`toast-${s}-description`}:void 0;return C.jsxs(Ji,{addRole:!1,status:e,variant:n,id:l==null?void 0:l.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",children:[C.jsx(Xi,{children:c}),C.jsxs(K.div,{flex:"1",maxWidth:"100%",children:[i&&C.jsx(qi,{id:l==null?void 0:l.title,children:i}),a&&C.jsx(Yi,{id:l==null?void 0:l.description,display:"block",children:a})]}),r&&C.jsx(Qi,{size:"sm",onClick:o,position:"absolute",insetEnd:1,top:1})]})};function to(t={}){const{render:e,toastComponent:n=Ql}=t;return i=>typeof e=="function"?e({...i,...t}):C.jsx(n,{...i,...t})}function nu(t,e){const n=i=>{var r;return{...e,...i,position:_l((r=i==null?void 0:i.position)!=null?r:e==null?void 0:e.position,t)}},s=i=>{const r=n(i),o=to(r);return _.notify(o,r)};return s.update=(i,r)=>{_.update(i,n(r))},s.promise=(i,r)=>{const o=s({...r.loading,status:"loading",duration:null});i.then(a=>s.update(o,{status:"success",duration:5e3,...Ae(r.success,a)})).catch(a=>s.update(o,{status:"error",duration:5e3,...Ae(r.error,a)}))},s.closeAll=_.closeAll,s.close=_.close,s.isActive=_.isActive,s}var[su,iu]=Et({name:"ToastOptionsContext",strict:!1}),ou=t=>{const e=m.useSyncExternalStore(_.subscribe,_.getState,_.getState),{motionVariants:n,component:s=Ki,portalProps:i}=t,o=Object.keys(e).map(a=>{const c=e[a];return C.jsx("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${a}`,style:Po(a),children:C.jsx(Nl,{initial:!1,children:c.map(l=>C.jsx(s,{motionVariants:n,...l},l.id))})},a)});return C.jsx(te,{...i,children:o})};const ru=co,au=oo,cu={"::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},lu={scrollbarColor:"accent.600 transparent",scrollbarWidth:"thick","::-webkit-scrollbar":{width:"6px",height:"6px"},"::-webkit-scrollbar-track":{background:"transparent"},"::-webkit-scrollbar-thumb":{background:"accent.600",borderRadius:"8px",borderWidth:"4px",borderColor:"accent.600"},"::-webkit-scrollbar-thumb:hover":{background:"accent.500",borderColor:"accent.500"},"::-webkit-scrollbar-button":{background:"transaprent"}};export{Nl as A,Qi as C,Ft as I,te as P,su as T,Et as a,To as b,nu as c,Ve as d,xn as e,Rc as f,au as g,ru as h,ho as i,ou as j,Ll as m,cu as n,lu as s,iu as u};