@workokay/atom 0.2.34 → 0.2.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atom.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +39 -11
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/types/components/switch/Switch.d.ts.map +1 -1
- package/dist/types/components/switch/switchVariants.d.ts +5 -5
- package/dist/types/components/switch/switchVariants.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -65,5 +65,5 @@ hover:text-[color-mix(in_oklab,var(--atom-theme-surface-secondary)_85%,black)] f
|
|
|
65
65
|
${p}px !important;
|
|
66
66
|
top: ${f}px !important;
|
|
67
67
|
}
|
|
68
|
-
`),()=>{v.contains(b)&&v.removeChild(b)}},[t]),h.jsx(GS,{isPresent:t,childRef:s,sizeRef:a,children:g.cloneElement(e,{ref:l})})}const qS=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:a,anchorX:i,root:c})=>{const l=Ys(KS),u=w.useId();let d=!0,f=w.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:m=>{l.set(m,!0);for(const y of l.values())if(!y)return;r&&r()},register:m=>(l.set(m,!1),()=>l.delete(m))}),[n,l,r]);return s&&d&&(f={...f}),w.useMemo(()=>{l.forEach((m,y)=>l.set(y,!1))},[n]),g.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),a==="popLayout"&&(e=h.jsx(US,{isPresent:n,anchorX:i,root:c,children:e})),h.jsx(zr.Provider,{value:f,children:e})};function KS(){return new Map}function Qf(e=!0){const t=w.useContext(zr);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=w.useId();w.useEffect(()=>{if(e)return o(s)},[e]);const a=w.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const lr=e=>e.key||"";function Gi(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const ma=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:a=!1,anchorX:i="left",root:c})=>{const[l,u]=Qf(a),d=w.useMemo(()=>Gi(e),[e]),f=a&&!l?[]:d.map(lr),m=w.useRef(!0),y=w.useRef(d),p=Ys(()=>new Map),b=w.useRef(new Set),[v,C]=w.useState(d),[x,k]=w.useState(d);of(()=>{m.current=!1,y.current=d;for(let E=0;E<x.length;E++){const D=lr(x[E]);f.includes(D)?(p.delete(D),b.current.delete(D)):p.get(D)!==!0&&p.set(D,!1)}},[x,f.length,f.join("-")]);const S=[];if(d!==v){let E=[...d];for(let D=0;D<x.length;D++){const N=x[D],M=lr(N);f.includes(M)||(E.splice(D,0,N),S.push(N))}return s==="wait"&&S.length&&(E=S),k(Gi(E)),C(d),null}process.env.NODE_ENV!=="production"&&s==="wait"&&x.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:T}=w.useContext(zs);return h.jsx(h.Fragment,{children:x.map(E=>{const D=lr(E),N=a&&!l?!1:d===x||f.includes(D),M=()=>{if(b.current.has(D))return;if(b.current.add(D),p.has(D))p.set(D,!0);else return;let j=!0;p.forEach(_=>{_||(j=!1)}),j&&(T?.(),k(y.current),a&&u?.(),r&&r())};return h.jsx(qS,{isPresent:N,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:c,onExitComplete:N?void 0:M,anchorX:i,children:E},D)})})},Jf=w.createContext({strict:!1}),Ui={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],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"]},tn={};for(const e in Ui)tn[e]={isEnabled:t=>Ui[e].some(n=>!!t[n])};function XS(e){for(const t in e)tn[t]={...tn[t],...e[t]}}const ZS=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Pr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ZS.has(e)}let em=e=>!Pr(e);function QS(e){typeof e=="function"&&(em=t=>t.startsWith("on")?!Pr(t):e(t))}try{QS(require("@emotion/is-prop-valid").default)}catch{}function JS(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(em(o)||n===!0&&Pr(o)||!t&&!Pr(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Yr=w.createContext({});function Hr(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function In(e){return typeof e=="string"||Array.isArray(e)}const ha=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pa=["initial",...ha];function Gr(e){return Hr(e.animate)||pa.some(t=>In(e[t]))}function tm(e){return!!(Gr(e)||e.variants)}function e1(e,t){if(Gr(e)){const{initial:n,animate:r}=e;return{initial:n===!1||In(n)?n:void 0,animate:In(r)?r:void 0}}return e.inherit!==!1?t:{}}function t1(e){const{initial:t,animate:n}=e1(e,w.useContext(Yr));return w.useMemo(()=>({initial:t,animate:n}),[qi(t),qi(n)])}function qi(e){return Array.isArray(e)?e.join(" "):e}function Ki(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(I.test(e))e=parseFloat(e);else return e;const n=Ki(e,t.target.x),r=Ki(e,t.target.y);return`${n}% ${r}%`}},n1={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=xt.parse(e);if(o.length>5)return r;const s=xt.createTransformer(e),a=typeof o[0]!="number"?1:0,i=n.x.scale*t.x,c=n.y.scale*t.y;o[0+a]/=i,o[1+a]/=c;const l=me(i,c,.5);return typeof o[2+a]=="number"&&(o[2+a]/=l),typeof o[3+a]=="number"&&(o[3+a]/=l),s(o)}},os={borderRadius:{...vn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vn,borderTopRightRadius:vn,borderBottomLeftRadius:vn,borderBottomRightRadius:vn,boxShadow:n1};function nm(e,{layout:t,layoutId:n}){return fn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!os[e]||e==="opacity")}const r1={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},o1=dn.length;function s1(e,t,n){let r="",o=!0;for(let s=0;s<o1;s++){const a=dn[s],i=e[a];if(i===void 0)continue;let c=!0;if(typeof i=="number"?c=i===(a.startsWith("scale")?1:0):c=parseFloat(i)===0,!c||n){const l=Hf(i,la[a]);if(!c){o=!1;const u=r1[a]||a;r+=`${u}(${l}) `}n&&(t[a]=l)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function ga(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let a=!1,i=!1;for(const c in t){const l=t[c];if(fn.has(c)){a=!0;continue}else if(Cf(c)){o[c]=l;continue}else{const u=Hf(l,la[c]);c.startsWith("origin")?(i=!0,s[c]=u):r[c]=u}}if(t.transform||(a||n?r.transform=s1(t,e.transform,n):r.transform&&(r.transform="none")),i){const{originX:c="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${l} ${u}`}}const ba=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rm(e,t,n){for(const r in t)!De(t[r])&&!nm(r,n)&&(e[r]=t[r])}function a1({transformTemplate:e},t){return w.useMemo(()=>{const n=ba();return ga(n,t,e),Object.assign({},n.vars,n.style)},[t])}function i1(e,t){const n=e.style||{},r={};return rm(r,n,e),Object.assign(r,a1(e,t)),r}function c1(e,t){const n={},r=i1(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const l1={offset:"stroke-dashoffset",array:"stroke-dasharray"},u1={offset:"strokeDashoffset",array:"strokeDasharray"};function d1(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?l1:u1;e[s.offset]=I.transform(-r);const a=I.transform(t),i=I.transform(n);e[s.array]=`${a} ${i}`}const f1=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function om(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:a=0,...i},c,l,u){if(ga(e,i,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete d.transformBox);for(const m of f1)d[m]!==void 0&&(f[m]=d[m],delete d[m]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&d1(d,o,s,a,!1)}const sm=()=>({...ba(),attrs:{}}),am=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m1(e,t,n,r){const o=w.useMemo(()=>{const s=sm();return om(s,t,am(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};rm(s,e.style,e),o.style={...s,...o.style}}return o}const h1=["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 ya(e){return typeof e!="string"||e.includes("-")?!1:!!(h1.indexOf(e)>-1||/[A-Z]/u.test(e))}function p1(e,t,n,{latestValues:r},o,s=!1,a){const c=(a??ya(e)?m1:c1)(t,r,o,e),l=JS(t,typeof e=="string",s),u=e!==w.Fragment?{...l,...c,ref:n}:{},{children:d}=t,f=w.useMemo(()=>De(d)?d.get():d,[d]);return w.createElement(e,{...u,children:f})}function Xi(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function va(e,t,n,r){if(typeof t=="function"){const[o,s]=Xi(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=Xi(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function gr(e){return De(e)?e.get():e}function g1({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:b1(n,r,o,e),renderState:t()}}function b1(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=gr(s[f]);let{initial:a,animate:i}=e;const c=Gr(e),l=tm(e);t&&l&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),i===void 0&&(i=t.animate));let u=n?n.initial===!1:!1;u=u||a===!1;const d=u?i:a;if(d&&typeof d!="boolean"&&!Hr(d)){const f=Array.isArray(d)?d:[d];for(let m=0;m<f.length;m++){const y=va(e,f[m]);if(y){const{transitionEnd:p,transition:b,...v}=y;for(const C in v){let x=v[C];if(Array.isArray(x)){const k=u?x.length-1:0;x=x[k]}x!==null&&(o[C]=x)}for(const C in p)o[C]=p[C]}}}return o}const im=e=>(t,n)=>{const r=w.useContext(Yr),o=w.useContext(zr),s=()=>g1(e,t,r,o);return n?s():Ys(s)};function xa(e,t,n){const{style:r}=e,o={};for(const s in r)(De(r[s])||t.style&&De(t.style[s])||nm(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(o[s]=r[s]);return o}const y1=im({scrapeMotionValuesFromProps:xa,createRenderState:ba});function cm(e,t,n){const r=xa(e,t,n);for(const o in e)if(De(e[o])||De(t[o])){const s=dn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const v1=im({scrapeMotionValuesFromProps:cm,createRenderState:sm}),x1=Symbol.for("motionComponentSymbol");function w1(e,t,n){const r=w.useRef(n);w.useInsertionEffect(()=>{r.current=n});const o=w.useRef(null);return w.useCallback(s=>{s&&e.onMount?.(s),t&&(s?t.mount(s):t.unmount());const a=r.current;if(typeof a=="function")if(s){const i=a(s);typeof i=="function"&&(o.current=i)}else o.current?(o.current(),o.current=null):a(s);else a&&(a.current=s)},[t])}const wa=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),C1="framerAppearId",lm="data-"+wa(C1),um=w.createContext({});function kn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function k1(e,t,n,r,o,s){const{visualElement:a}=w.useContext(Yr),i=w.useContext(Jf),c=w.useContext(zr),l=w.useContext(fa).reducedMotion,u=w.useRef(null);r=r||i.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,isSVG:s}));const d=u.current,f=w.useContext(um);d&&!d.projection&&o&&(d.type==="html"||d.type==="svg")&&S1(u.current,n,o,f);const m=w.useRef(!1);w.useInsertionEffect(()=>{d&&m.current&&d.update(n,c)});const y=n[lm],p=w.useRef(!!y&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return of(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),p.current&&d.animationState&&d.animationState.animateChanges())}),w.useEffect(()=>{d&&(!p.current&&d.animationState&&d.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),p.current=!1),d.enteringChildren=void 0)}),d}function S1(e,t,n,r){const{layoutId:o,layout:s,drag:a,dragConstraints:i,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:dm(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!a||i&&kn(i),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function dm(e){if(e)return e.options.allowProjection!==!1?e.projection:dm(e.parent)}function Do(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&XS(r);const s=n?n==="svg":ya(e),a=s?v1:y1;function i(l,u){let d;const f={...w.useContext(fa),...l,layoutId:D1(l)},{isStatic:m}=f,y=t1(l),p=a(l,m);if(!m&&Hs){T1(f,r);const b=E1(f);d=b.MeasureLayout,y.visualElement=k1(e,p,f,o,b.ProjectionNode,s)}return h.jsxs(Yr.Provider,{value:y,children:[d&&y.visualElement?h.jsx(d,{visualElement:y.visualElement,...f}):null,p1(e,l,w1(p,y.visualElement,u),p,m,t,s)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=w.forwardRef(i);return c[x1]=e,c}function D1({layoutId:e}){const t=w.useContext(zs).id;return t&&e!==void 0?t+"-"+e:e}function T1(e,t){const n=w.useContext(Jf).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?ln(!1,r,"lazy-strict-mode"):ct(!1,r,"lazy-strict-mode")}}function E1(e){const{drag:t,layout:n}=tn;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function P1(e,t){if(typeof Proxy>"u")return Do;const n=new Map,r=(s,a)=>Do(s,a,e,t),o=(s,a)=>(process.env.NODE_ENV!=="production"&&Xs(!1,"motion() is deprecated. Use motion.create() instead."),r(s,a));return new Proxy(o,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,Do(a,void 0,e,t)),n.get(a))})}function fm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function M1({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function R1(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function To(e){return e===void 0||e===1}function ss({scale:e,scaleX:t,scaleY:n}){return!To(e)||!To(t)||!To(n)}function Et(e){return ss(e)||mm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function mm(e){return Zi(e.x)||Zi(e.y)}function Zi(e){return e&&e!=="0%"}function Mr(e,t,n){const r=e-n,o=t*r;return n+o}function Qi(e,t,n,r,o){return o!==void 0&&(e=Mr(e,o,r)),Mr(e,n,r)+t}function as(e,t=0,n=1,r,o){e.min=Qi(e.min,t,n,r,o),e.max=Qi(e.max,t,n,r,o)}function hm(e,{x:t,y:n}){as(e.x,t.translate,t.scale,t.originPoint),as(e.y,n.translate,n.scale,n.originPoint)}const Ji=.999999999999,ec=1.0000000000001;function N1(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,a;for(let i=0;i<o;i++){s=n[i],a=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Gt(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,hm(e,a)),r&&Et(s.latestValues)&&Gt(e,s.latestValues))}t.x<ec&&t.x>Ji&&(t.x=1),t.y<ec&&t.y>Ji&&(t.y=1)}function Ht(e,t){e.min=e.min+t,e.max=e.max+t}function tc(e,t,n,r,o=.5){const s=me(e.min,e.max,o);as(e,t,n,s,r)}function Gt(e,t){tc(e.x,t.x,t.scaleX,t.scale,t.originX),tc(e.y,t.y,t.scaleY,t.scale,t.originY)}function pm(e,t){return fm(R1(e.getBoundingClientRect(),t))}function A1(e,t,n){const r=pm(e,n),{scroll:o}=t;return o&&(Ht(r.x,o.offset.x),Ht(r.y,o.offset.y)),r}const nc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ut=()=>({x:nc(),y:nc()}),rc=()=>({min:0,max:0}),ve=()=>({x:rc(),y:rc()}),is={current:null},gm={current:!1};function O1(){if(gm.current=!0,!!Hs)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>is.current=e.matches;e.addEventListener("change",t),t()}else is.current=!1}const j1=new WeakMap;function _1(e,t,n){for(const r in t){const o=t[r],s=n[r];if(De(o))e.addValue(r,o);else if(De(s))e.addValue(r,en(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=e.getStaticValue(r);e.addValue(r,en(a!==void 0?a:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const oc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class I1{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ia,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.renderScheduledAt=0,this.scheduleRender=()=>{const f=Te.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,le.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!s,this.isControllingVariants=Gr(n),this.isVariantNode=tm(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const m=d[f];c[f]!==void 0&&De(m)&&m.set(c[f])}}mount(t){this.current=t,j1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(gm.current||O1(),this.shouldReduceMotion=is.current),process.env.NODE_ENV!=="production"&&Xs(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),vt(this.notifyUpdate),vt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=fn.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&le.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in tn){const n=tn[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ve()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<oc.length;r++){const o=oc[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,a=t[s];a&&(this.propEventSubscriptions[o]=this.on(o,a))}this.prevMotionValues=_1(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=en(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(sf(r)||cf(r))?r=parseFloat(r):!zS(r)&&xt.test(n)&&(r=Yf(t,n)),this.setBaseTarget(t,De(r)?r.get():r)),De(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=va(this.props,n,this.presenceContext?.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!De(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ks),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ua.render(this.render)}}class bm extends I1{constructor(){super(...arguments),this.KeyframeResolver=AS}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;De(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ym(e,{style:t,vars:n},r,o){const s=e.style;let a;for(a in t)s[a]=t[a];o?.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function V1(e){return window.getComputedStyle(e)}class F1 extends bm{constructor(){super(...arguments),this.type="html",this.renderInstance=ym}readValueFromInstance(t,n){if(fn.has(n))return this.projection?.isProjecting?Zo(n):Xk(t,n);{const r=V1(t),o=(Cf(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return pm(t,n)}build(t,n,r){ga(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return xa(t,n,r)}}const vm=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 L1(e,t,n,r){ym(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(vm.has(o)?o:wa(o),t.attrs[o])}class W1 extends bm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ve}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(fn.has(n)){const r=zf(n);return r&&r.default||0}return n=vm.has(n)?n:wa(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return cm(t,n,r)}build(t,n,r){om(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){L1(t,n,r,o)}mount(t){this.isSVGTag=am(t.tagName),super.mount(t)}}const B1=(e,t)=>t.isSVG??ya(e)?new W1(t):new F1(t,{allowProjection:e!==w.Fragment});function Xt(e,t,n){const r=e.getProps();return va(r,t,n!==void 0?n:r.custom,e)}const cs=e=>Array.isArray(e);function $1(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,en(n))}function z1(e){return cs(e)?e[e.length-1]||0:e}function Y1(e,t){const n=Xt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const a in s){const i=z1(s[a]);$1(e,a,i)}}function H1(e){return!!(De(e)&&e.add)}function ls(e,t){const n=e.getValue("willChange");if(H1(n))return n.add(t);if(!n&<.WillChange){const r=new lt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function xm(e){return e.props[lm]}const G1=e=>e!==null;function U1(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(G1),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const q1={type:"spring",stiffness:500,damping:25,restSpeed:10},K1=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),X1={type:"keyframes",duration:.8},Z1={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Q1=(e,{keyframes:t})=>t.length>2?X1:fn.has(e)?e.startsWith("scale")?K1(t[1]):q1:Z1;function J1({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:a,repeatDelay:i,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Ca=(e,t,n,r={},o,s)=>a=>{const i=ca(r,e)||{},c=i.delay||r.delay||0;let{elapsed:l=0}=r;l=l-Ze(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-l,onUpdate:f=>{t.set(f),i.onUpdate&&i.onUpdate(f)},onComplete:()=>{a(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:s?void 0:o};J1(i)||Object.assign(u,Q1(e,u)),u.duration&&(u.duration=Ze(u.duration)),u.repeatDelay&&(u.repeatDelay=Ze(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ns(u),u.delay===0&&(d=!0)),(lt.instantAnimations||lt.skipAnimations)&&(d=!0,ns(u),u.delay=0),u.allowFlatten=!i.type&&!i.ease,d&&!s&&t.get()!==void 0){const f=U1(u.keyframes,i);if(f!==void 0){le.update(()=>{u.onUpdate(f),u.onComplete()});return}}return i.isSync?new aa(u):new vS(u)};function eD({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function wm(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:a,...i}=t;r&&(s=r);const c=[],l=o&&e.animationState&&e.animationState.getState()[o];for(const u in i){const d=e.getValue(u,e.latestValues[u]??null),f=i[u];if(f===void 0||l&&eD(l,u))continue;const m={delay:n,...ca(s||{},u)},y=d.get();if(y!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===y&&!m.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=xm(e);if(v){const C=window.MotionHandoffAnimation(v,u,le);C!==null&&(m.startTime=C,p=!0)}}ls(e,u),d.start(Ca(u,d,f,e.shouldReduceMotion&&Wf.has(u)?{type:!1}:m,e,p));const b=d.animation;b&&c.push(b)}return a&&Promise.all(c).then(()=>{le.update(()=>{a&&Y1(e,a)})}),c}function Cm(e,t,n,r=0,o=1){const s=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),a=e.size,i=(a-1)*r;return typeof n=="function"?n(s,a):o===1?s*r:i-s*r}function us(e,t,n={}){const r=Xt(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(wm(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:d}=o;return tD(e,t,c,l,u,d,n)}:()=>Promise.resolve(),{when:i}=o;if(i){const[c,l]=i==="beforeChildren"?[s,a]:[a,s];return c().then(()=>l())}else return Promise.all([s(),a(n.delay)])}function tD(e,t,n=0,r=0,o=0,s=1,a){const i=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),i.push(us(c,t,{...a,delay:n+(typeof r=="function"?0:r)+Cm(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(i)}function nD(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>us(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=us(e,t,n);else{const o=typeof t=="function"?Xt(e,t,n.custom):t;r=Promise.all(wm(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function km(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const rD=pa.length;function Sm(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Sm(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<rD;n++){const r=pa[n],o=e.props[r];(In(o)||o===!1)&&(t[r]=o)}return t}const oD=[...ha].reverse(),sD=ha.length;function aD(e){return t=>Promise.all(t.map(({animation:n,options:r})=>nD(e,n,r)))}function iD(e){let t=aD(e),n=sc(),r=!0;const o=c=>(l,u)=>{const d=Xt(e,u,c==="exit"?e.presenceContext?.custom:void 0);if(d){const{transition:f,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function s(c){t=c(e)}function a(c){const{props:l}=e,u=Sm(e.parent)||{},d=[],f=new Set;let m={},y=1/0;for(let b=0;b<sD;b++){const v=oD[b],C=n[v],x=l[v]!==void 0?l[v]:u[v],k=In(x),S=v===c?C.isActive:null;S===!1&&(y=b);let T=x===u[v]&&x!==l[v]&&k;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),C.protectedKeys={...m},!C.isActive&&S===null||!x&&!C.prevProp||Hr(x)||typeof x=="boolean")continue;const E=cD(C.prevProp,x);let D=E||v===c&&C.isActive&&!T&&k||b>y&&k,N=!1;const M=Array.isArray(x)?x:[x];let j=M.reduce(o(v),{});S===!1&&(j={});const{prevResolvedValues:_={}}=C,B={..._,...j},z=W=>{D=!0,f.has(W)&&(N=!0,f.delete(W)),C.needsAnimating[W]=!0;const O=e.getValue(W);O&&(O.liveStyle=!1)};for(const W in B){const O=j[W],H=_[W];if(m.hasOwnProperty(W))continue;let ee=!1;cs(O)&&cs(H)?ee=!km(O,H):ee=O!==H,ee?O!=null?z(W):f.add(W):O!==void 0&&f.has(W)?z(W):C.protectedKeys[W]=!0}C.prevProp=x,C.prevResolvedValues=j,C.isActive&&(m={...m,...j}),r&&e.blockInitialAnimation&&(D=!1);const K=T&&E;D&&(!K||N)&&d.push(...M.map(W=>{const O={type:v};if(typeof W=="string"&&r&&!K&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,ee=Xt(H,W);if(H.enteringChildren&&ee){const{delayChildren:P}=ee.transition||{};O.delay=Cm(H.enteringChildren,e,P)}}return{animation:W,options:O}}))}if(f.size){const b={};if(typeof l.initial!="boolean"){const v=Xt(e,Array.isArray(l.initial)?l.initial[0]:l.initial);v&&v.transition&&(b.transition=v.transition)}f.forEach(v=>{const C=e.getBaseTarget(v),x=e.getValue(v);x&&(x.liveStyle=!0),b[v]=C??null}),d.push({animation:b})}let p=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(d):Promise.resolve()}function i(c,l){if(n[c].isActive===l)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(c,l)),n[c].isActive=l;const u=a(c);for(const d in n)n[d].protectedKeys={};return u}return{animateChanges:a,setActive:i,setAnimateFunction:s,getState:()=>n,reset:()=>{n=sc()}}}function cD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!km(t,e):!1}function Dt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sc(){return{animate:Dt(!0),whileInView:Dt(),whileHover:Dt(),whileTap:Dt(),whileDrag:Dt(),whileFocus:Dt(),exit:Dt()}}class Ct{constructor(t){this.isMounted=!1,this.node=t}update(){}}class lD extends Ct{constructor(t){super(t),t.animationState||(t.animationState=iD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Hr(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let uD=0;class dD extends Ct{constructor(){super(...arguments),this.id=uD++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const fD={animation:{Feature:lD},exit:{Feature:dD}};function Vn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Xn(e){return{point:{x:e.pageX,y:e.pageY}}}const mD=e=>t=>da(t)&&e(t,Xn(t));function Tn(e,t,n,r){return Vn(e,t,mD(n),r)}const Dm=1e-4,hD=1-Dm,pD=1+Dm,Tm=.01,gD=0-Tm,bD=0+Tm;function Ee(e){return e.max-e.min}function yD(e,t,n){return Math.abs(e-t)<=n}function ac(e,t,n,r=.5){e.origin=r,e.originPoint=me(t.min,t.max,e.origin),e.scale=Ee(n)/Ee(t),e.translate=me(n.min,n.max,e.origin)-e.originPoint,(e.scale>=hD&&e.scale<=pD||isNaN(e.scale))&&(e.scale=1),(e.translate>=gD&&e.translate<=bD||isNaN(e.translate))&&(e.translate=0)}function En(e,t,n,r){ac(e.x,t.x,n.x,r?r.originX:void 0),ac(e.y,t.y,n.y,r?r.originY:void 0)}function ic(e,t,n){e.min=n.min+t.min,e.max=e.min+Ee(t)}function vD(e,t,n){ic(e.x,t.x,n.x),ic(e.y,t.y,n.y)}function cc(e,t,n){e.min=t.min-n.min,e.max=e.min+Ee(t)}function Rr(e,t,n){cc(e.x,t.x,n.x),cc(e.y,t.y,n.y)}function _e(e){return[e("x"),e("y")]}const Em=({current:e})=>e?e.ownerDocument.defaultView:null,lc=(e,t)=>Math.abs(e-t);function xD(e,t){const n=lc(e.x,t.x),r=lc(e.y,t.y);return Math.sqrt(n**2+r**2)}const uc=new Set(["auto","scroll"]);class Pm{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=Po(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,p=xD(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!p)return;const{point:b}=m,{timestamp:v}=ke;this.history.push({...b,timestamp:v});const{onStart:C,onMove:x}=this.handlers;y||(C&&C(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,m)},this.handlePointerMove=(m,y)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=Eo(y,this.transformPagePoint),le.update(this.updatePoint,!0)},this.handlePointerUp=(m,y)=>{this.end();const{onEnd:p,onSessionEnd:b,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Po(m.type==="pointercancel"?this.lastMoveEventInfo:Eo(y,this.transformPagePoint),this.history);this.startEvent&&p&&p(m,C),b&&b(m,C)},!da(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=o||window;const c=Xn(t),l=Eo(c,this.transformPagePoint),{point:u}=l,{timestamp:d}=ke;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,Po(l,this.history)),this.removeListeners=Un(Tn(this.contextWindow,"pointermove",this.handlePointerMove),Tn(this.contextWindow,"pointerup",this.handlePointerUp),Tn(this.contextWindow,"pointercancel",this.handlePointerUp)),i&&this.startScrollTracking(i)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(uc.has(r.overflowX)||uc.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),le.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),vt(this.updatePoint)}}function Eo(e,t){return t?{point:t(e.point)}:e}function dc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Po({point:e},t){return{point:e,delta:dc(e,Mm(t)),offset:dc(e,wD(t)),velocity:CD(t,.1)}}function wD(e){return e[0]}function Mm(e){return e[e.length-1]}function CD(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Mm(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ze(t)));)n--;if(!r)return{x:0,y:0};const s=Ve(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function kD(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?me(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?me(n,e,r.max):Math.min(e,n)),e}function fc(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function SD(e,{top:t,left:n,bottom:r,right:o}){return{x:fc(e.x,n,o),y:fc(e.y,t,r)}}function mc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function DD(e,t){return{x:mc(e.x,t.x),y:mc(e.y,t.y)}}function TD(e,t){let n=.5;const r=Ee(e),o=Ee(t);return o>r?n=On(t.min,t.max-r,e.min):r>o&&(n=On(e.min,e.max-o,t.min)),et(0,1,n)}function ED(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ds=.35;function PD(e=ds){return e===!1?e=0:e===!0&&(e=ds),{x:hc(e,"left","right"),y:hc(e,"top","bottom")}}function hc(e,t,n){return{min:pc(e,t),max:pc(e,n)}}function pc(e,t){return typeof e=="number"?e:e[t]||0}const MD=new WeakMap;class RD{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ve(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=d=>{n?(this.stopAnimation(),this.snapToCursor(Xn(d).point)):this.pauseAnimation()},a=(d,f)=>{this.stopAnimation();const{drag:m,dragPropagation:y,onDragStart:p}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=IS(m),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),_e(v=>{let C=this.getAxisMotionValue(v).get()||0;if(Qe.test(C)){const{projection:x}=this.visualElement;if(x&&x.layout){const k=x.layout.layoutBox[v];k&&(C=Ee(k)*(parseFloat(C)/100))}}this.originPoint[v]=C}),p&&le.postRender(()=>p(d,f)),ls(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},i=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:p,onDrag:b}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:v}=f;if(y&&this.currentDirection===null){this.currentDirection=ND(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},c=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>_e(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Pm(t,{onSessionStart:s,onStart:a,onMove:i,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Em(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:a}=o;this.startAnimation(a);const{onDragEnd:i}=this.getProps();i&&le.postRender(()=>i(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!ur(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=kD(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&kn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=SD(r.layoutBox,t):this.constraints=!1,this.elastic=PD(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&_e(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ED(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!kn(t))return!1;const r=t.current;ct(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=A1(r,o.root,this.visualElement.getTransformPagePoint());let a=DD(o.layout.layoutBox,s);if(n){const i=n(M1(a));this.hasMutatedConstraints=!!i,i&&(a=fm(i))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),c=this.constraints||{},l=_e(u=>{if(!ur(u,n,this.currentDirection))return;let d=c&&c[u]||{};a&&(d={min:0,max:0});const f=o?200:1e6,m=o?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,y)});return Promise.all(l).then(i)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ls(this.visualElement,t),r.start(Ca(t,r,0,n,this.visualElement,!1))}stopAnimation(){_e(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){_e(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){_e(n=>{const{drag:r}=this.getProps();if(!ur(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:i}=o.layout.layoutBox[n],c=s.get()||0;s.set(t[n]-me(a,i,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!kn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};_e(a=>{const i=this.getAxisMotionValue(a);if(i&&this.constraints!==!1){const c=i.get();o[a]=TD({min:c,max:c},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),_e(a=>{if(!ur(a,t,null))return;const i=this.getAxisMotionValue(a),{min:c,max:l}=this.constraints[a];i.set(me(c,l,o[a]))})}addListeners(){if(!this.visualElement.current)return;MD.set(this.visualElement,this);const t=this.visualElement.current,n=Tn(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&!Xf(c.target)&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();kn(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),le.read(r);const a=Vn(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(_e(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())}));return()=>{a(),n(),s(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:a=ds,dragMomentum:i=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:a,dragMomentum:i}}}function ur(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ND(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class AD extends Ct{constructor(t){super(t),this.removeGroupControls=Fe,this.removeListeners=Fe,this.controls=new RD(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fe}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const gc=e=>(t,n)=>{e&&le.postRender(()=>e(t,n))};class OD extends Ct{constructor(){super(...arguments),this.removePointerDownListener=Fe}onPointerDown(t){this.session=new Pm(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Em(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:gc(t),onStart:gc(n),onMove:r,onEnd:(s,a)=>{delete this.session,o&&le.postRender(()=>o(s,a))}}}mount(){this.removePointerDownListener=Tn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const br={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Mo=!1;class jD extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),Mo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),br.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,Mo=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||le.postRender(()=>{const i=a.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ua.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Mo=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Rm(e){const[t,n]=Qf(),r=w.useContext(zs);return h.jsx(jD,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(um),isPresent:t,safeToRemove:n})}function _D(e,t,n){const r=De(e)?e:en(e);return r.start(Ca("",r,t,n)),r.animation}const ID=(e,t)=>e.depth-t.depth;class VD{constructor(){this.children=[],this.isDirty=!1}add(t){Gs(this.children,t),this.isDirty=!0}remove(t){Us(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ID),this.isDirty=!1,this.children.forEach(t)}}function FD(e,t){const n=Te.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(vt(r),e(s-t))};return le.setup(r,!0),()=>vt(r)}const Nm=["TopLeft","TopRight","BottomLeft","BottomRight"],LD=Nm.length,bc=e=>typeof e=="string"?parseFloat(e):e,yc=e=>typeof e=="number"||I.test(e);function WD(e,t,n,r,o,s){o?(e.opacity=me(0,n.opacity??1,BD(r)),e.opacityExit=me(t.opacity??1,0,$D(r))):s&&(e.opacity=me(t.opacity??1,n.opacity??1,r));for(let a=0;a<LD;a++){const i=`border${Nm[a]}Radius`;let c=vc(t,i),l=vc(n,i);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||yc(c)===yc(l)?(e[i]=Math.max(me(bc(c),bc(l),r),0),(Qe.test(l)||Qe.test(c))&&(e[i]+="%")):e[i]=l}(t.rotate||n.rotate)&&(e.rotate=me(t.rotate||0,n.rotate||0,r))}function vc(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const BD=Am(0,.5,gf),$D=Am(.5,.95,Fe);function Am(e,t,n){return r=>r<e?0:r>t?1:n(On(e,t,r))}function xc(e,t){e.min=t.min,e.max=t.max}function We(e,t){xc(e.x,t.x),xc(e.y,t.y)}function wc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Cc(e,t,n,r,o){return e-=t,e=Mr(e,1/n,r),o!==void 0&&(e=Mr(e,1/o,r)),e}function zD(e,t=0,n=1,r=.5,o,s=e,a=e){if(Qe.test(t)&&(t=parseFloat(t),t=me(a.min,a.max,t/100)-a.min),typeof t!="number")return;let i=me(s.min,s.max,r);e===s&&(i-=t),e.min=Cc(e.min,t,n,i,o),e.max=Cc(e.max,t,n,i,o)}function kc(e,t,[n,r,o],s,a){zD(e,t[n],t[r],t[o],t.scale,s,a)}const YD=["x","scaleX","originX"],HD=["y","scaleY","originY"];function Sc(e,t,n,r){kc(e.x,t,YD,n?n.x:void 0,r?r.x:void 0),kc(e.y,t,HD,n?n.y:void 0,r?r.y:void 0)}function Dc(e){return e.translate===0&&e.scale===1}function Om(e){return Dc(e.x)&&Dc(e.y)}function Tc(e,t){return e.min===t.min&&e.max===t.max}function GD(e,t){return Tc(e.x,t.x)&&Tc(e.y,t.y)}function Ec(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function jm(e,t){return Ec(e.x,t.x)&&Ec(e.y,t.y)}function Pc(e){return Ee(e.x)/Ee(e.y)}function Mc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class UD{constructor(){this.members=[]}add(t){Gs(this.members,t),t.scheduleRender()}remove(t){if(Us(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function qD(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,a=n?.z||0;if((o||s||a)&&(r=`translate3d(${o}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:d,rotateY:f,skewX:m,skewY:y}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const i=e.x.scale*t.x,c=e.y.scale*t.y;return(i!==1||c!==1)&&(r+=`scale(${i}, ${c})`),r||"none"}const Ro=["","X","Y","Z"],KD=1e3;let XD=0;function No(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function _m(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=xm(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",le,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&_m(r)}function Im({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},i=t?.()){this.id=XD++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(JD),this.nodes.forEach(rT),this.nodes.forEach(oT),this.nodes.forEach(eT)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new VD)}addEventListener(a,i){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Ks),this.eventHandlers.get(a).add(i)}notifyListeners(a,...i){const c=this.eventHandlers.get(a);c&&c.notify(...i)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Zf(a)&&!BS(a),this.instance=a;const{layoutId:i,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||i)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;le.read(()=>{d=window.innerWidth}),e(a,()=>{const m=window.innerWidth;m!==d&&(d=m,this.root.updateBlockedByResize=!0,u&&u(),u=FD(f,250),br.hasAnimatedSinceResize&&(br.hasAnimatedSinceResize=!1,this.nodes.forEach(Ac)))})}i&&this.root.registerSharedNode(i,this),this.options.animate!==!1&&l&&(i||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||l.getDefaultTransition()||lT,{onLayoutAnimationStart:p,onLayoutAnimationComplete:b}=l.getProps(),v=!this.targetLayout||!jm(this.targetLayout,m),C=!d&&f;if(this.options.layoutRoot||this.resumeFrom||C||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...ca(y,"layout"),onPlay:p,onComplete:b};(l.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,C)}else d||Ac(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),vt(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(sT),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&_m(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:i,layout:c}=this.options;if(i===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Rc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Nc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nT),this.nodes.forEach(ZD),this.nodes.forEach(QD)):this.nodes.forEach(Nc),this.clearAllSnapshots();const i=Te.now();ke.delta=et(0,1e3/60,i-ke.timestamp),ke.timestamp=i,ke.isProcessing=!0,yo.update.process(ke),yo.preRender.process(ke),yo.render.process(ke),ke.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ua.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(tT),this.sharedNodes.forEach(aT)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,le.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){le.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ee(this.snapshot.measuredBox.x)&&!Ee(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}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<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ve(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(i=!1),i&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!Om(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;a&&this.instance&&(i||Et(this.latestValues)||u)&&(o(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const i=this.measurePageBox();let c=this.removeElementScroll(i);return a&&(c=this.removeTransform(c)),uT(c),{animationId:this.root.animationId,measuredBox:i,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return ve();const i=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(dT))){const{scroll:l}=this.root;l&&(Ht(i.x,l.offset.x),Ht(i.y,l.offset.y))}return i}removeElementScroll(a){const i=ve();if(We(i,a),this.scroll?.wasRoot)return i;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:d}=l;l!==this.root&&u&&d.layoutScroll&&(u.wasRoot&&We(i,a),Ht(i.x,u.offset.x),Ht(i.y,u.offset.y))}return i}applyTransform(a,i=!1){const c=ve();We(c,a);for(let l=0;l<this.path.length;l++){const u=this.path[l];!i&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Gt(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Et(u.latestValues)&&Gt(c,u.latestValues)}return Et(this.latestValues)&&Gt(c,this.latestValues),c}removeTransform(a){const i=ve();We(i,a);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!Et(l.latestValues))continue;ss(l.latestValues)&&l.updateSnapshot();const u=ve(),d=l.measurePageBox();We(u,d),Sc(i,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return Et(this.latestValues)&&Sc(i,this.latestValues),i}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ke.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const i=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=i.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=i.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=i.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==i;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!this.layout||!(u||d))return;this.resolvedRelativeTargetAt=ke.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ve(),this.targetWithTransforms=ve()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vD(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):We(this.target,this.layout.layoutBox),hm(this.target,this.targetDelta)):We(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ss(this.parent.latestValues)||mm(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,i,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ve(),this.relativeTargetOrigin=ve(),Rr(this.relativeTargetOrigin,i,c),We(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const a=this.getLead(),i=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===ke.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;We(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;N1(this.layoutCorrected,this.treeScale,this.path,i),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ve());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(wc(this.prevProjectionDelta.x,this.projectionDelta.x),wc(this.prevProjectionDelta.y,this.projectionDelta.y)),En(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Mc(this.projectionDelta.x,this.prevProjectionDelta.x)||!Mc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const i=this.getStack();i&&i.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ut(),this.projectionDelta=Ut(),this.projectionDeltaWithTransform=Ut()}setAnimationOrigin(a,i=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=Ut();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;const f=ve(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,p=m!==y,b=this.getStack(),v=!b||b.members.length<=1,C=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(cT));this.animationProgress=0;let x;this.mixTargetDelta=k=>{const S=k/1e3;Oc(d.x,a.x,S),Oc(d.y,a.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rr(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),iT(this.relativeTarget,this.relativeTargetOrigin,f,S),x&&GD(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ve()),We(x,this.relativeTarget)),p&&(this.animationValues=u,WD(u,l,this.latestValues,S,C,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(vt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=le.update(()=>{br.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=en(0)),this.currentAnimation=_D(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:i=>{this.mixTargetDelta(i),a.onUpdate&&a.onUpdate(i)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(KD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:i,target:c,layout:l,latestValues:u}=a;if(!(!i||!c||!l)){if(this!==a&&this.layout&&l&&Vm(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||ve();const d=Ee(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+d;const f=Ee(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+f}We(i,c),Gt(i,u),En(this.projectionDeltaWithTransform,this.layoutCorrected,i,u)}}registerSharedNode(a,i){this.sharedNodes.has(a)||this.sharedNodes.set(a,new UD),this.sharedNodes.get(a).add(i);const l=i.options.initialPromotionConfig;i.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(i):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:i,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let i=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(i=!0),!i)return;const l={};c.z&&No("z",a,l,this.animationValues);for(let u=0;u<Ro.length;u++)No(`rotate${Ro[u]}`,a,l,this.animationValues),No(`skew${Ro[u]}`,a,l,this.animationValues);a.render();for(const u in l)a.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);a.scheduleRender()}applyProjectionStyles(a,i){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=gr(i?.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=gr(i?.pointerEvents)||""),this.hasProjected&&!Et(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let d=qD(this.projectionDeltaWithTransform,this.treeScale,u);c&&(d=c(u,d)),a.transform=d;const{x:f,y:m}=this.projectionDelta;a.transformOrigin=`${f.origin*100}% ${m.origin*100}% 0`,l.animationValues?a.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const y in os){if(u[y]===void 0)continue;const{correct:p,applyTo:b,isCSSVariable:v}=os[y],C=d==="none"?u[y]:p(u[y],l);if(b){const x=b.length;for(let k=0;k<x;k++)a[b[k]]=C}else v?this.options.visualElement.renderState.vars[y]=C:a[y]=C}this.options.layoutId&&(a.pointerEvents=l===this?gr(i?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(Rc),this.root.sharedNodes.clear()}}}function ZD(e){e.updateLayout()}function QD(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,s=t.source!==e.layout.source;o==="size"?_e(u=>{const d=s?t.measuredBox[u]:t.layoutBox[u],f=Ee(d);d.min=n[u].min,d.max=d.min+f}):Vm(o,t.layoutBox,n)&&_e(u=>{const d=s?t.measuredBox[u]:t.layoutBox[u],f=Ee(n[u]);d.max=d.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+f)});const a=Ut();En(a,n,t.layoutBox);const i=Ut();s?En(i,e.applyTransform(r,!0),t.measuredBox):En(i,n,t.layoutBox);const c=!Om(a);let l=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:d,layout:f}=u;if(d&&f){const m=ve();Rr(m,t.layoutBox,d.layoutBox);const y=ve();Rr(y,n,f.layoutBox),jm(m,y)||(l=!0),u.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:i,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function JD(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function eT(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function tT(e){e.clearSnapshot()}function Rc(e){e.clearMeasurements()}function Nc(e){e.isLayoutDirty=!1}function nT(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ac(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rT(e){e.resolveTargetDelta()}function oT(e){e.calcProjection()}function sT(e){e.resetSkewAndRotation()}function aT(e){e.removeLeadSnapshot()}function Oc(e,t,n){e.translate=me(t.translate,0,n),e.scale=me(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jc(e,t,n,r){e.min=me(t.min,n.min,r),e.max=me(t.max,n.max,r)}function iT(e,t,n,r){jc(e.x,t.x,n.x,r),jc(e.y,t.y,n.y,r)}function cT(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lT={duration:.45,ease:[.4,0,.1,1]},_c=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ic=_c("applewebkit/")&&!_c("chrome/")?Math.round:Fe;function Vc(e){e.min=Ic(e.min),e.max=Ic(e.max)}function uT(e){Vc(e.x),Vc(e.y)}function Vm(e,t,n){return e==="position"||e==="preserve-aspect"&&!yD(Pc(t),Pc(n),.2)}function dT(e){return e!==e.root&&e.scroll?.wasRoot}const fT=Im({attachResizeListener:(e,t)=>Vn(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ao={current:void 0},Fm=Im({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ao.current){const e=new fT({});e.mount(window),e.setOptions({layoutScroll:!0}),Ao.current=e}return Ao.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),mT={pan:{Feature:OD},drag:{Feature:AD,ProjectionNode:Fm,MeasureLayout:Rm}};function Fc(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&le.postRender(()=>s(t,Xn(t)))}class hT extends Ct{mount(){const{current:t}=this.node;t&&(this.unmount=VS(t,(n,r)=>(Fc(this.node,r,"Start"),o=>Fc(this.node,o,"End"))))}unmount(){}}class pT extends Ct{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Un(Vn(this.node.current,"focus",()=>this.onFocus()),Vn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Lc(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&le.postRender(()=>s(t,Xn(t)))}class gT extends Ct{mount(){const{current:t}=this.node;t&&(this.unmount=WS(t,(n,r)=>(Lc(this.node,r,"Start"),(o,{success:s})=>Lc(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const fs=new WeakMap,Oo=new WeakMap,bT=e=>{const t=fs.get(e.target);t&&t(e)},yT=e=>{e.forEach(bT)};function vT({root:e,...t}){const n=e||document;Oo.has(n)||Oo.set(n,{});const r=Oo.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(yT,{root:e,...t})),r[o]}function xT(e,t,n){const r=vT(t);return fs.set(e,n),r.observe(e),()=>{fs.delete(e),r.unobserve(e)}}const wT={some:0,all:1};class CT extends Ct{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:wT[o]},i=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return xT(this.node.current,a,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(kT(t,n))&&this.startObserver()}unmount(){}}function kT({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ST={inView:{Feature:CT},tap:{Feature:gT},focus:{Feature:pT},hover:{Feature:hT}},DT={layout:{ProjectionNode:Fm,MeasureLayout:Rm}},TT={...fD,...ST,...mT,...DT},pt=P1(TT,B1);class ET extends w.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Dropdown Error:",t,n),this.props.onError?.(t,n)}render(){return this.state.hasError?this.props.fallback||null:this.props.children}}const Lm=w.createContext(void 0);function ka(){const e=w.useContext(Lm);if(!e)throw new Error("Dropdown components must be used within Dropdown");return e}const PT=te(["absolute z-[1000] min-w-[8rem] overflow-hidden","rounded-md border shadow-lg","bg-[var(--atom-theme-surface-primary)] border-[var(--atom-theme-border-primary)] px-1.5 py-2"].join(" "),{variants:{side:{top:"",bottom:"",left:"",right:""},align:{start:"",center:"",end:""}},defaultVariants:{side:"bottom",align:"start"}}),MT=te(["relative flex cursor-pointer select-none items-center","rounded-sm px-3 py-2 text-sm outline-none","transition-colors duration-150","focus:bg-[color-mix(in_oklab,var(--atom-theme-surface-secondary)_15%,transparent)] focus:text-[var(--atom-text)]","hover:bg-[color-mix(in_oklab,var(--atom-theme-surface-secondary)_15%,transparent)] hover:text-[var(--atom-text)]","focus:hover:bg-[color-mix(in_oklab,var(--atom-theme-surface-secondary)_20%,transparent)]","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","data-[selected]:text-[var(--atom-primary)] data-[selected]:font-medium"].join(" ")),RT=te(["inline-flex items-center justify-center gap-2","px-4 py-2 rounded-md text-sm font-medium","transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--atom-primary)] focus-visible:ring-offset-2","cursor-pointer","disabled:pointer-events-none disabled:opacity-50"].join(" "),{variants:{variant:{default:["bg-[var(--atom-theme-surface-primary)]","border border-[var(--atom-theme-border-primary)]","text-[var(--atom-theme-text-primary)]"].join(" "),ghost:["bg-transparent","hover:bg-[color-mix(in_oklab,var(--atom-theme-surface-secondary)_15%,transparent)]","text-[var(--atom-text)]"].join(" ")}},defaultVariants:{variant:"ghost"}}),NT=e=>{const n={top:{y:8,x:0},bottom:{y:-8,x:0},left:{y:0,x:8},right:{y:0,x:-8}};return{initial:{opacity:0,scale:.95,...n[e]},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.95,...n[e]}}};function AT(e,t,n,r=!0){w.useEffect(()=>{if(!r||typeof document>"u")return;const o=s=>{const a=s.target;!e.current||e.current.contains(a)||t.current&&t.current.contains(a)||n()};return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[e,t,n,r])}function OT(e,t,n,r,o,s,a){const[i,c]=w.useState({top:0,left:0}),l=w.useCallback(()=>{if(typeof window>"u"||!n||!e.current||!t.current)return;const u=e.current.getBoundingClientRect(),d=t.current.getBoundingClientRect(),f={width:window.innerWidth,height:window.innerHeight},m=window.scrollY,y=window.scrollX;let p=0,b=0;switch(r){case"top":p=u.top+m-d.height-s;break;case"bottom":p=u.bottom+m+s;break;case"left":case"right":switch(o){case"start":p=u.top+m+a;break;case"center":p=u.top+m+u.height/2-d.height/2;break;case"end":p=u.bottom+m-d.height-a;break}break}switch(r){case"left":b=u.left+y-d.width-s;break;case"right":b=u.right+y+s;break;case"top":case"bottom":switch(o){case"start":b=u.left+y+a;break;case"center":b=u.left+y+u.width/2-d.width/2;break;case"end":b=u.right+y-d.width-a;break}break}const v=8;b<v&&(b=v),b+d.width>f.width-v&&(b=f.width-d.width-v),p<m+v&&(p=m+v),p+d.height>m+f.height-v&&(p=m+f.height-d.height-v),c({top:p,left:b})},[n,r,o,s,a,t,e]);return w.useEffect(()=>{if(typeof window>"u"||!n||!e.current||!t.current)return;l();let u=null;return typeof ResizeObserver<"u"&&t.current&&(u=new ResizeObserver(l),u.observe(t.current)),window.addEventListener("scroll",l,{passive:!0,capture:!0}),window.addEventListener("resize",l,{passive:!0}),()=>{u?.disconnect(),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[l,n,t,e]),i}const Wm=({open:e,onOpenChange:t,defaultOpen:n=!1,value:r,onValueChange:o,disabled:s=!1,animateItems:a=!1,errorFallback:i,onError:c,children:l})=>{const[u,d]=w.useState(n),[f,m]=w.useState(r||""),[y,p]=w.useState(""),[b,v]=w.useState(!1),C=w.useId(),x=`dropdown-trigger-${C}`,k=`dropdown-content-${C}`,S=e!==void 0,T=s?!1:S?e:u,E=w.useCallback((M,j=!1)=>{s||(v(j),S||d(M),t?.(M))},[S,t,s]),D=w.useCallback(M=>{m(M),o?.(M)},[o]);w.useEffect(()=>{r!==void 0&&m(r)},[r]);const N=w.useMemo(()=>({open:T,setOpen:E,triggerId:x,contentId:k,selectedValue:r||f,setSelectedValue:D,activeDescendant:y,setActiveDescendant:p,animateItems:a,openedViaKeyboard:b}),[T,E,x,k,r,f,D,y,a,b]);return h.jsx(ET,{fallback:i,onError:c,children:h.jsx(Lm.Provider,{value:N,children:h.jsxs("div",{className:"relative inline-block",children:[l,h.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:f&&`Selected: ${f}`})]})})})};Wm.displayName="Dropdown";const Bm=w.forwardRef(({className:e,children:t,onClick:n,onMouseDown:r,onKeyDown:o,variant:s,asChild:a=!1,disabled:i,...c},l)=>{const{open:u,setOpen:d,triggerId:f,contentId:m}=ka(),y=w.useRef(null);w.useEffect(()=>{l&&(typeof l=="function"?l(y.current):l.current=y.current)},[l]);const p=x=>{x.preventDefault(),r?.(x)},b=x=>{i||(x.stopPropagation(),d(!u,!1),n?.(x))},v=x=>{if(!i){switch(x.key){case"ArrowDown":x.preventDefault(),u||d(!0,!0);break;case"ArrowUp":x.preventDefault(),u||d(!0,!0);break;case"Enter":case" ":x.preventDefault(),d(!u,!0);break}o?.(x)}},C=a?Me:"button";return h.jsx(C,{ref:y,id:f,type:a?void 0:"button","aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?m:void 0,disabled:i,"data-testid":"dropdown-trigger",className:a?e:R(RT({variant:s}),e),onMouseDown:p,onClick:b,onKeyDown:v,...c,children:t})});Bm.displayName="DropdownTrigger";const $m=w.forwardRef(({className:e,children:t,side:n="bottom",align:r="start",sideOffset:o=4,alignOffset:s=0,container:a,preventClose:i=!1,...c},l)=>{const{open:u,setOpen:d,triggerId:f,contentId:m,activeDescendant:y,openedViaKeyboard:p}=ka(),b=w.useRef(null),v=w.useRef(null),C=_r();w.useEffect(()=>{l&&(typeof l=="function"?l(b.current):l.current=b.current)},[l]);const x=n??"bottom",k=r??"start",S=OT(v,b,u,x,k,o,s);w.useEffect(()=>{if(typeof document>"u")return;const N=document.getElementById(f);N&&(v.current=N)},[f]),AT(b,v,()=>{u&&!i&&d(!1)},u),w.useEffect(()=>{if(typeof document>"u"||!u||!b.current)return;if(p){const M=b.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');M.length>0&&M[0].focus()}const N=M=>{M.key==="Escape"&&(M.preventDefault(),M.stopPropagation(),d(!1),v.current?.focus())};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[u,d,p]);const T=w.useMemo(()=>NT(x),[x]),E=a||C||(typeof document<"u"?document.body:null);if(!E)return null;const D=h.jsx(ma,{mode:"wait",children:u&&h.jsx(pt.div,{ref:b,id:m,role:"menu","aria-labelledby":f,"aria-orientation":"vertical","aria-activedescendant":y||void 0,"data-testid":"dropdown-content",initial:"initial",animate:"animate",exit:"exit",variants:T,transition:{duration:.2,ease:[.16,1,.3,1]},className:R(PT({side:x,align:k}),e),style:{position:"fixed",top:`${S.top}px`,left:`${S.left}px`,pointerEvents:"auto"},...c,children:t})});return Fn.createPortal(h.jsx(w.Suspense,{fallback:null,children:D}),E)});$m.displayName="DropdownContent";const zm=w.forwardRef(({className:e,children:t,disabled:n,preventClose:r=!1,value:o,onClick:s,onKeyDown:a,...i},c)=>{const{setOpen:l,selectedValue:u,setSelectedValue:d,setActiveDescendant:f,animateItems:m}=ka(),y=o!==void 0&&o===u,p=w.useRef(null),v=`dropdown-item-${w.useId()}`,[C,x]=w.useState(!1);w.useEffect(()=>{c&&(typeof c=="function"?c(p.current):c.current=p.current)},[c]);const k=w.useCallback(()=>{n||C||(x(!0),o!==void 0&&d(o),r||l(!1),setTimeout(()=>x(!1),300))},[n,C,o,d,r,l]),S=D=>{n||C||(D.stopPropagation(),s?.(D),k())},T=D=>{if(n)return;const N=p.current;if(!N)return;const M=Array.from(N.closest('[role="menu"]')?.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')||[]),j=M.indexOf(N);switch(D.key){case"Enter":case" ":D.preventDefault(),D.stopPropagation(),a?.(D),k();break;case"ArrowDown":if(D.preventDefault(),D.stopPropagation(),M.length>0){const _=(j+1)%M.length,B=M[_];B?.focus(),f(B.id)}break;case"ArrowUp":if(D.preventDefault(),D.stopPropagation(),M.length>0){const _=j===0?M.length-1:j-1,B=M[_];B?.focus(),f(B.id)}break;case"Home":if(D.preventDefault(),D.stopPropagation(),M.length>0){const _=M[0];_?.focus(),f(_.id)}break;case"End":if(D.preventDefault(),D.stopPropagation(),M.length>0){const _=M[M.length-1];_?.focus(),f(_.id)}break;case"Tab":if(M.length>0)if(D.shiftKey)if(j===0)l(!1);else{D.preventDefault();const _=M[j-1];_?.focus(),f(_.id)}else if(j===M.length-1)l(!1);else{D.preventDefault();const _=M[j+1];_?.focus(),f(_.id)}break;default:a?.(D)}},E=()=>{f(v)};return h.jsx(pt.div,{ref:p,id:v,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-selected":y?"":void 0,"data-testid":`dropdown-item-${o||v}`,className:R(MT(),e),onClick:S,onKeyDown:T,onFocus:E,whileHover:n||!m?void 0:{scale:1.01},whileTap:n||!m?void 0:{scale:.98},...i,children:t})});zm.displayName="DropdownItem";const Ym=w.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"separator","aria-orientation":"horizontal","data-testid":"dropdown-separator",className:R("my-1 h-px bg-(--atom-theme-border-primary)",e),...t}));Ym.displayName="DropdownSeparator";const Hm=w.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"presentation","data-testid":"dropdown-label",className:R("px-3 py-1.5 text-xs font-semibold text-(--atom-text-secondary)",e),...t}));Hm.displayName="DropdownLabel";const Gm=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("div",{ref:r,role:"group","data-testid":"dropdown-group",className:R("py-1",e),...n,children:t}));Gm.displayName="DropdownGroup";class jT extends w.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){console.error("Popover Error:",t,n),this.props.onError?.(t,n)}render(){return this.state.hasError?this.props.fallback||null:this.props.children}}const Um=w.createContext(void 0);function Sa(){const e=w.useContext(Um);if(!e)throw new Error("Popover components must be used within Popover");return e}const _T=te(["absolute z-[1000] rounded-lg border shadow-lg","bg-[var(--atom-theme-surface-primary)] border-[var(--atom-theme-border-primary)]","outline-none overflow-hidden"].join(" "),{variants:{side:{top:"",bottom:"",left:"",right:""},align:{start:"",center:"",end:""},size:{sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[32rem]",full:"w-screen max-w-md"}},defaultVariants:{side:"bottom",align:"center",size:"md"}}),IT=te(["inline-flex items-center justify-center","transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--atom-primary)] focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","cursor-pointer"].join(" ")),VT=e=>{const n={top:{y:8,x:0},bottom:{y:-8,x:0},left:{y:0,x:8},right:{y:0,x:-8}};return{initial:{opacity:0,scale:.96,...n[e]},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.95,...n[e]}}};function FT(e,t,n,r=!0){w.useEffect(()=>{if(!r||typeof document>"u")return;const o=s=>{const a=s.target;!e.current||e.current.contains(a)||t.current&&t.current.contains(a)||n()};return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[e,t,n,r])}function LT(e,t,n,r,o,s,a){const[i,c]=w.useState({top:0,left:0}),l=w.useCallback(()=>{if(typeof window>"u"||!n||!e.current||!t.current)return;const u=e.current.getBoundingClientRect(),d=t.current.getBoundingClientRect(),f={width:window.innerWidth,height:window.innerHeight},m=window.scrollY,y=window.scrollX;let p=0,b=0;switch(r){case"top":p=u.top+m-d.height-s;break;case"bottom":p=u.bottom+m+s;break;case"left":case"right":switch(o){case"start":p=u.top+m+a;break;case"center":p=u.top+m+u.height/2-d.height/2;break;case"end":p=u.bottom+m-d.height-a;break}break}switch(r){case"left":b=u.left+y-d.width-s;break;case"right":b=u.right+y+s;break;case"top":case"bottom":switch(o){case"start":b=u.left+y+a;break;case"center":b=u.left+y+u.width/2-d.width/2;break;case"end":b=u.right+y-d.width-a;break}break}const v=8;b<v&&(b=v),b+d.width>f.width-v&&(b=f.width-d.width-v),p<m+v&&(p=m+v),p+d.height>m+f.height-v&&(p=m+f.height-d.height-v),c({top:p,left:b})},[n,r,o,s,a,t,e]);return w.useEffect(()=>{if(typeof window>"u"||!n||!e.current||!t.current)return;l();let u=null;return typeof ResizeObserver<"u"&&t.current&&(u=new ResizeObserver(l),u.observe(t.current)),window.addEventListener("scroll",l,{passive:!0,capture:!0}),window.addEventListener("resize",l,{passive:!0}),()=>{u?.disconnect(),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[l,n,t,e]),i}const qm=({open:e,onOpenChange:t,defaultOpen:n=!1,modal:r=!1,errorFallback:o,onError:s,children:a})=>{const[i,c]=w.useState(n),l=w.useId(),u=`popover-trigger-${l}`,d=`popover-content-${l}`,f=e!==void 0,m=f?e:i,y=w.useCallback(b=>{f||c(b),t?.(b)},[f,t]),p=w.useMemo(()=>({open:m,setOpen:y,triggerId:u,contentId:d,modal:r}),[m,y,u,d,r]);return h.jsx(jT,{fallback:o,onError:s,children:h.jsx(Um.Provider,{value:p,children:h.jsx("div",{className:"relative inline-block",children:a})})})};qm.displayName="Popover";const Km=w.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,asChild:o=!1,disabled:s,...a},i)=>{const{open:c,setOpen:l,triggerId:u,contentId:d}=Sa(),f=w.useRef(null);w.useEffect(()=>{i&&(typeof i=="function"?i(f.current):i.current=f.current)},[i]);const m=b=>{s||(b.stopPropagation(),l(!c),n?.(b))},y=b=>{s||((b.key==="Enter"||b.key===" ")&&(b.preventDefault(),l(!c)),r?.(b))},p=o?Me:"button";return h.jsx(p,{ref:f,id:u,type:o?void 0:"button","aria-haspopup":"dialog","aria-expanded":c,"aria-controls":c?d:void 0,disabled:s,"data-state":c?"open":"closed","data-testid":"popover-trigger",className:o?e:R(IT(),e),onClick:m,onKeyDown:y,...a,children:t})});Km.displayName="PopoverTrigger";const Xm=w.forwardRef(({className:e,children:t,side:n="bottom",align:r="center",size:o="md",sideOffset:s=8,alignOffset:a=0,container:i,preventClose:c=!1,preventOutsideClick:l=!1,showArrow:u=!1,...d},f)=>{const{open:m,setOpen:y,triggerId:p,contentId:b,modal:v}=Sa(),C=w.useRef(null),x=w.useRef(null),k=_r();w.useEffect(()=>{f&&(typeof f=="function"?f(C.current):f.current=C.current)},[f]);const S=LT(x,C,m,n??"bottom",r??"center",s,a);w.useEffect(()=>{if(typeof document>"u")return;const j=document.getElementById(p);j&&(x.current=j)},[p]),FT(C,x,()=>{m&&!c&&!l&&y(!1)},m),w.useEffect(()=>{if(typeof document>"u"||!m)return;const j=_=>{_.key==="Escape"&&(_.preventDefault(),_.stopPropagation(),y(!1),x.current?.focus())};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[m,y]),w.useEffect(()=>{if(typeof document>"u"||!m||!v)return;const j=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=j}},[m,v]),w.useEffect(()=>{if(typeof document>"u"||!m||!v||!C.current)return;const j=C.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),_=j[0],B=j[j.length-1],z=K=>{K.key==="Tab"&&(K.shiftKey?document.activeElement===_&&(K.preventDefault(),B?.focus()):document.activeElement===B&&(K.preventDefault(),_?.focus()))};return _?.focus(),document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[m,v]);const T=w.useMemo(()=>VT(n??"bottom"),[n]),E=i||k||(typeof document<"u"?document.body:null);if(!E)return null;const D=()=>R("absolute h-2 w-2 rotate-45 bg-[var(--atom-theme-surface-primary)] border-[var(--atom-theme-border-primary)]",{top:"bottom-[-5px] border-r border-b",bottom:"top-[-5px] border-l border-t",left:"right-[-5px] border-t border-r",right:"left-[-5px] border-b border-l"}[n??"bottom"]),N=()=>r==="center"?{left:"calc(50% - 4px)"}:r==="start"?{left:"16px"}:r==="end"?{right:"16px"}:{},M=h.jsx(ma,{mode:"wait",children:m&&h.jsxs(h.Fragment,{children:[v&&h.jsx(pt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-999 bg-black/50 backdrop-blur-sm","data-testid":"popover-backdrop",onClick:()=>!c&&!l&&y(!1),"aria-hidden":"true"}),h.jsxs(pt.div,{ref:C,id:b,role:"dialog","aria-labelledby":p,"aria-modal":v,"data-state":m?"open":"closed","data-testid":"popover-content",initial:"initial",animate:"animate",exit:"exit",variants:T,transition:{duration:.2,ease:[.16,1,.3,1]},className:R(_T({side:n,align:r,size:o}),e),style:{position:"fixed",top:`${S.top}px`,left:`${S.left}px`,pointerEvents:"auto"},...d,children:[u&&h.jsx("div",{className:D(),style:N(),"aria-hidden":"true"}),t]})]})});return Fn.createPortal(h.jsx(w.Suspense,{fallback:null,children:M}),E)});Xm.displayName="PopoverContent";const Zm=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("div",{ref:r,"data-testid":"popover-header",className:R("flex items-center justify-between px-4 py-3 border-b border-(--atom-theme-border-primary)",e),...n,children:t}));Zm.displayName="PopoverHeader";const Qm=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("div",{ref:r,"data-testid":"popover-body",className:R("px-4 py-3",e),...n,children:t}));Qm.displayName="PopoverBody";const Jm=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("div",{ref:r,"data-testid":"popover-footer",className:R("flex items-center justify-end gap-2 px-4 py-3 border-t border-(--atom-theme-border-primary)",e),...n,children:t}));Jm.displayName="PopoverFooter";const eh=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("h3",{ref:r,"data-testid":"popover-title",className:R("text-lg font-semibold text-(--atom-text)",e),...n,children:t}));eh.displayName="PopoverTitle";const th=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("p",{ref:r,"data-testid":"popover-description",className:R("text-sm text-(--atom-text)",e),...n,children:t}));th.displayName="PopoverDescription";const nh=w.forwardRef(({className:e,children:t,onClick:n,asChild:r=!1,...o},s)=>{const{setOpen:a}=Sa(),i=l=>{a(!1),n?.(l)},c=r?Me:"button";return h.jsx(c,{ref:s,type:r?void 0:"button","data-testid":"popover-close",className:r?e:R("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--atom-primary)","disabled:pointer-events-none disabled:opacity-50","h-8 w-8",e),onClick:i,"aria-label":"Close popover",...o,children:t||h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})});nh.displayName="PopoverClose";const WT=te(["block w-full rounded-md outline-none leading-none","bg-[var(--atom-input-bg)] text-[var(--atom-input-fg)]","border border-[var(--atom-theme-border-primary)]","transition-[background-color,border-color,box-shadow,color] duration-150 ease-in-out","placeholder:text-[color-mix(in_srgb,var(--atom-input-fg)_55%,transparent)]","caret-[var(--atom-primary)]","selection:bg-[color-mix(in_srgb,var(--atom-primary)_30%,transparent)]","hover:bg-[color-mix(in_srgb,var(--atom-primary)_1%,transparent)]","hover:border-[color-mix(in_srgb,var(--atom-input-border)_70%,var(--atom-primary)_30%)]","focus-visible:border-[var(--atom-input-focus,var(--atom-primary))]","focus-visible:ring-1 focus-visible:ring-[color-mix(in_srgb,var(--atom-primary)_35%,transparent)]","focus-visible:ring-offset-0","disabled:opacity-60 disabled:cursor-not-allowed","disabled:hover:bg-[var(--atom-input-bg)] disabled:hover:border-[var(--atom-input-border)]","read-only:bg-[color-mix(in_srgb,var(--atom-input-bg)_90%,var(--atom-border)_10%)] read-only:cursor-default","read-only:hover:bg-[color-mix(in_srgb,var(--atom-input-bg)_90%,var(--atom-border)_10%)]","placeholder:text-muted-foreground [&:not(:placeholder-shown)]:border-[color-mix(in_srgb,var(--atom-theme-border-primary)_70%,var(--atom-primary))]focus-visible:border-[var(--atom-primary)]"].join(" "),{variants:{size:{sm:"h-9 px-3 text-sm",md:"h-10 px-3.5 text-sm",lg:"h-11 px-4 text-base"},tone:{default:"",invalid:"border-[var(--atom-error)] focus-visible:border-[var(--atom-error)]",success:"border-[var(--atom-success)]"},hasLeft:{true:"pl-9"},hasRight:{true:"pr-9"}},defaultVariants:{size:"md",tone:"default"}}),rh=g.forwardRef(({className:e,size:t,tone:n="default",leftIcon:r,rightIcon:o,hint:s,errorText:a,loading:i=!1,id:c,placeholder:l,label:u,required:d=!1,requiredText:f="This field is required",value:m,onBlur:y,...p},b)=>{const v=g.useId(),C=c??`inp_${v}`,[x,k]=g.useState(!1),S=!!r,T=!!o||i,D=a??(d&&x&&!a&&(m===""||m===void 0)?f:void 0),N=s?`${C}__hint`:void 0,M=D?`${C}__err`:void 0,j=[N,M].filter(Boolean).join(" ")||void 0,_=n==="invalid"||!!D;return h.jsxs("div",{className:"w-full",children:[u&&h.jsxs("label",{htmlFor:C,className:"mb-1 block text-sm font-medium text-[var(--atom-text)]",children:[u,d&&h.jsx("span",{className:"ml-0.5 text-[var(--atom-error)]",children:"*"})]}),h.jsxs("div",{className:"relative",children:[S&&h.jsx("span",{className:"pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 flex w-9 items-center justify-center",children:r}),T&&h.jsx("span",{className:"absolute right-0 top-1/2 -translate-y-1/2 flex w-9 items-center justify-center",children:i?h.jsxs("svg",{viewBox:"0 0 24 24",className:"animate-spin h-4 w-4",fill:"none",stroke:"currentColor",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9",strokeOpacity:".2",strokeWidth:"3"}),h.jsx("path",{d:"M21 12a9 9 0 0 1-9 9",strokeWidth:"3",strokeLinecap:"round"})]}):o}),h.jsx("input",{ref:b,id:C,className:R(WT({size:t,tone:n,hasLeft:S,hasRight:T}),_&&"border-[var(--atom-error)]",e),value:m,placeholder:l??" ","aria-required":d||void 0,"aria-invalid":_||void 0,"aria-errormessage":M,"aria-describedby":j,onBlur:B=>{k(!0),y?.(B)},...p})]}),(s||D)&&h.jsxs("div",{className:"mt-1 text-xs leading-snug",children:[D&&h.jsx("p",{id:M,className:"text-[var(--atom-error)]",children:D}),s&&!D&&h.jsx("p",{id:N,className:"text-[var(--atom-text-muted)]",children:s})]})]})});rh.displayName="Input";var Ur="Switch",[BT]=wt(Ur),[$T,zT]=BT(Ur),oh=g.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:a,disabled:i,value:c="on",onCheckedChange:l,form:u,...d}=e,[f,m]=g.useState(null),y=xe(t,x=>m(x)),p=g.useRef(!1),b=f?u||!!f.closest("form"):!0,[v,C]=zn({prop:o,defaultProp:s??!1,onChange:l,caller:Ur});return h.jsxs($T,{scope:n,checked:v,disabled:i,children:[h.jsx(he.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":ch(v),"data-disabled":i?"":void 0,disabled:i,value:c,...d,ref:y,onClick:ue(e.onClick,x=>{C(k=>!k),b&&(p.current=x.isPropagationStopped(),p.current||x.stopPropagation())})}),b&&h.jsx(ih,{control:f,bubbles:!p.current,name:r,value:c,checked:v,required:a,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});oh.displayName=Ur;var sh="SwitchThumb",ah=g.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=zT(sh,n);return h.jsx(he.span,{"data-state":ch(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});ah.displayName=sh;var YT="SwitchBubbleInput",ih=g.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=g.useRef(null),i=xe(a,s),c=Xu(n),l=Rs(t);return g.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&m){const y=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(y)}},[c,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ih.displayName=YT;function ch(e){return e?"checked":"unchecked"}var HT=oh,GT=ah;const lh=te(["relative inline-flex shrink-0 cursor-pointer items-center","rounded-full transition-colors","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--atom-ring-color)]","disabled:cursor-not-allowed disabled:opacity-50"].join(" "),{variants:{variant:{default:"bg-[color-mix(in_srgb,var(--atom-border)_40%,transparent)] data-[state=checked]:bg-[var(--atom-primary)]",theme:"bg-[color-mix(in_srgb,var(--atom-border)_35%,transparent)] data-[state=checked]:bg-[var(--atom-primary)]"},size:{sm:"h-5 w-9",md:"h-6 w-11",lg:"h-7 w-14"},fullWidth:{true:"w-full",false:""}},defaultVariants:{variant:"default",size:"md",fullWidth:!1}}),uh={sm:{size:"h-4 w-4",translateX:16},md:{size:"h-5 w-5",translateX:20},lg:{size:"h-6 w-6",translateX:28}},UT=pt(GT),qT=({size:e=12})=>h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[h.jsx("circle",{cx:"12",cy:"12",r:"4",fill:"white"}),h.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),KT=({size:e=12})=>h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:h.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"})}),XT=({size:e=8})=>h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:h.jsx("path",{d:"M12 2l3 6.3 7 1-5 4.9 1.2 6.9L12 17.8l-6.2 3.3L7 14.1 2 9.3l7-1z"})}),dh=g.forwardRef(({className:e,variant:t,size:n,fullWidth:r,checked:o,onCheckedChange:s,...a},i)=>{const[c,l]=g.useState(o??!1),[u,d]=g.useState(!1),f=n??"md",m=uh[f],y=f==="sm"?10:f==="md"?12:14;g.useEffect(()=>{o!==void 0&&l(o)},[o]);const p=b=>{d(!0),setTimeout(()=>d(!1),250),l(b),s?.(b)};return h.jsxs(HT,{ref:i,"data-slot":"switch",className:R(lh({variant:t,size:f,fullWidth:r}),e),checked:c,onCheckedChange:p,...a,children:[t==="theme"&&h.jsx(ma,{mode:"wait",children:c?h.jsxs(h.Fragment,{children:[h.jsx(pt.div,{className:"absolute left-1 top-1/2 -translate-y-1/2 text-white/80",initial:{opacity:0,scale:.4},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},children:h.jsx(KT,{size:y})},"moon"),h.jsx(pt.div,{className:"absolute right-3 top-1 text-white/60",initial:{opacity:0},animate:{opacity:1},children:h.jsx(XT,{})},"star")]}):h.jsx(pt.div,{className:"absolute right-1 top-1/2 -translate-y-1/2 text-amber-500",initial:{opacity:0,scale:.4,rotate:-180},animate:{opacity:1,scale:1,rotate:0},exit:{opacity:0,scale:0,rotate:180},children:h.jsx(qT,{size:y})},"sun")}),h.jsx(UT,{"data-slot":"switch-thumb",className:R(m.size,"block rounded-full bg-[var(--atom-bg)] shadow-md"),animate:{x:c?m.translateX:0,scaleX:u?[1,1.25,1]:1,scaleY:u?[1,.9,1]:1},transition:{type:"spring",stiffness:500,damping:30}})]})});dh.displayName="Switch";exports.Avatar=sl;exports.Badge=Ap;exports.Button=hs;exports.Calendar=zy;exports.Card=Ll;exports.CardBody=zl;exports.CardFooter=Yl;exports.CardHeader=Wl;exports.CardMedia=Hl;exports.CardSubtitle=$l;exports.CardTitle=Bl;exports.Checkbox=Gl;exports.ContentCard=Ul;exports.DataTable=Yw;exports.Dialog=Fx;exports.DialogBody=Mu;exports.DialogContent=Eu;exports.DialogDescription=Au;exports.DialogFooter=Ru;exports.DialogHeader=Pu;exports.DialogOverlay=Ms;exports.DialogPortal=Ps;exports.DialogTitle=Nu;exports.DialogTrigger=Lx;exports.Drawer=Ou;exports.DrawerBody=Vu;exports.DrawerClose=Lu;exports.DrawerDescription=Iu;exports.DrawerFooter=Fu;exports.DrawerHeader=ju;exports.DrawerTitle=_u;exports.Dropdown=Wm;exports.DropdownContent=$m;exports.DropdownGroup=Gm;exports.DropdownItem=zm;exports.DropdownLabel=Hm;exports.DropdownSeparator=Ym;exports.DropdownTrigger=Bm;exports.Heading=Wu;exports.Input=rh;exports.NumberInput=rf;exports.Paper=Bu;exports.Popover=qm;exports.PopoverBody=Qm;exports.PopoverClose=nh;exports.PopoverContent=Xm;exports.PopoverDescription=th;exports.PopoverFooter=Jm;exports.PopoverHeader=Zm;exports.PopoverTitle=eh;exports.PopoverTrigger=Km;exports.ProgressBar=$u;exports.Radio=ld;exports.RadioDescription=fd;exports.RadioGroup=md;exports.RadioLabel=ud;exports.RadioOption=dd;exports.StatCardA=hd;exports.StatCardB=pd;exports.StatCardC=gd;exports.Switch=dh;exports.TabContent=wd;exports.TabTrigger=xd;exports.Tabs=yd;exports.TabsList=vd;exports.Text=Cd;exports.TextArea=kd;exports.Tooltip=nf;exports.avatarVariants=ol;exports.badgeVariants=rl;exports.switchVariants=lh;exports.thumbConfig=uh;
|
|
68
|
+
`),()=>{v.contains(b)&&v.removeChild(b)}},[t]),h.jsx(GS,{isPresent:t,childRef:s,sizeRef:a,children:g.cloneElement(e,{ref:l})})}const qS=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:a,anchorX:i,root:c})=>{const l=Ys(KS),u=w.useId();let d=!0,f=w.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:m=>{l.set(m,!0);for(const y of l.values())if(!y)return;r&&r()},register:m=>(l.set(m,!1),()=>l.delete(m))}),[n,l,r]);return s&&d&&(f={...f}),w.useMemo(()=>{l.forEach((m,y)=>l.set(y,!1))},[n]),g.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),a==="popLayout"&&(e=h.jsx(US,{isPresent:n,anchorX:i,root:c,children:e})),h.jsx(zr.Provider,{value:f,children:e})};function KS(){return new Map}function Qf(e=!0){const t=w.useContext(zr);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=w.useId();w.useEffect(()=>{if(e)return o(s)},[e]);const a=w.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const lr=e=>e.key||"";function Gi(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const ma=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:a=!1,anchorX:i="left",root:c})=>{const[l,u]=Qf(a),d=w.useMemo(()=>Gi(e),[e]),f=a&&!l?[]:d.map(lr),m=w.useRef(!0),y=w.useRef(d),p=Ys(()=>new Map),b=w.useRef(new Set),[v,C]=w.useState(d),[x,k]=w.useState(d);of(()=>{m.current=!1,y.current=d;for(let E=0;E<x.length;E++){const D=lr(x[E]);f.includes(D)?(p.delete(D),b.current.delete(D)):p.get(D)!==!0&&p.set(D,!1)}},[x,f.length,f.join("-")]);const S=[];if(d!==v){let E=[...d];for(let D=0;D<x.length;D++){const N=x[D],M=lr(N);f.includes(M)||(E.splice(D,0,N),S.push(N))}return s==="wait"&&S.length&&(E=S),k(Gi(E)),C(d),null}process.env.NODE_ENV!=="production"&&s==="wait"&&x.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:T}=w.useContext(zs);return h.jsx(h.Fragment,{children:x.map(E=>{const D=lr(E),N=a&&!l?!1:d===x||f.includes(D),M=()=>{if(b.current.has(D))return;if(b.current.add(D),p.has(D))p.set(D,!0);else return;let j=!0;p.forEach(_=>{_||(j=!1)}),j&&(T?.(),k(y.current),a&&u?.(),r&&r())};return h.jsx(qS,{isPresent:N,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:c,onExitComplete:N?void 0:M,anchorX:i,children:E},D)})})},Jf=w.createContext({strict:!1}),Ui={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],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"]},tn={};for(const e in Ui)tn[e]={isEnabled:t=>Ui[e].some(n=>!!t[n])};function XS(e){for(const t in e)tn[t]={...tn[t],...e[t]}}const ZS=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Pr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ZS.has(e)}let em=e=>!Pr(e);function QS(e){typeof e=="function"&&(em=t=>t.startsWith("on")?!Pr(t):e(t))}try{QS(require("@emotion/is-prop-valid").default)}catch{}function JS(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(em(o)||n===!0&&Pr(o)||!t&&!Pr(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Yr=w.createContext({});function Hr(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function In(e){return typeof e=="string"||Array.isArray(e)}const ha=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pa=["initial",...ha];function Gr(e){return Hr(e.animate)||pa.some(t=>In(e[t]))}function tm(e){return!!(Gr(e)||e.variants)}function e1(e,t){if(Gr(e)){const{initial:n,animate:r}=e;return{initial:n===!1||In(n)?n:void 0,animate:In(r)?r:void 0}}return e.inherit!==!1?t:{}}function t1(e){const{initial:t,animate:n}=e1(e,w.useContext(Yr));return w.useMemo(()=>({initial:t,animate:n}),[qi(t),qi(n)])}function qi(e){return Array.isArray(e)?e.join(" "):e}function Ki(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const vn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(I.test(e))e=parseFloat(e);else return e;const n=Ki(e,t.target.x),r=Ki(e,t.target.y);return`${n}% ${r}%`}},n1={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=xt.parse(e);if(o.length>5)return r;const s=xt.createTransformer(e),a=typeof o[0]!="number"?1:0,i=n.x.scale*t.x,c=n.y.scale*t.y;o[0+a]/=i,o[1+a]/=c;const l=me(i,c,.5);return typeof o[2+a]=="number"&&(o[2+a]/=l),typeof o[3+a]=="number"&&(o[3+a]/=l),s(o)}},os={borderRadius:{...vn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:vn,borderTopRightRadius:vn,borderBottomLeftRadius:vn,borderBottomRightRadius:vn,boxShadow:n1};function nm(e,{layout:t,layoutId:n}){return fn.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!os[e]||e==="opacity")}const r1={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},o1=dn.length;function s1(e,t,n){let r="",o=!0;for(let s=0;s<o1;s++){const a=dn[s],i=e[a];if(i===void 0)continue;let c=!0;if(typeof i=="number"?c=i===(a.startsWith("scale")?1:0):c=parseFloat(i)===0,!c||n){const l=Hf(i,la[a]);if(!c){o=!1;const u=r1[a]||a;r+=`${u}(${l}) `}n&&(t[a]=l)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function ga(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let a=!1,i=!1;for(const c in t){const l=t[c];if(fn.has(c)){a=!0;continue}else if(Cf(c)){o[c]=l;continue}else{const u=Hf(l,la[c]);c.startsWith("origin")?(i=!0,s[c]=u):r[c]=u}}if(t.transform||(a||n?r.transform=s1(t,e.transform,n):r.transform&&(r.transform="none")),i){const{originX:c="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${l} ${u}`}}const ba=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rm(e,t,n){for(const r in t)!De(t[r])&&!nm(r,n)&&(e[r]=t[r])}function a1({transformTemplate:e},t){return w.useMemo(()=>{const n=ba();return ga(n,t,e),Object.assign({},n.vars,n.style)},[t])}function i1(e,t){const n=e.style||{},r={};return rm(r,n,e),Object.assign(r,a1(e,t)),r}function c1(e,t){const n={},r=i1(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const l1={offset:"stroke-dashoffset",array:"stroke-dasharray"},u1={offset:"strokeDashoffset",array:"strokeDasharray"};function d1(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?l1:u1;e[s.offset]=I.transform(-r);const a=I.transform(t),i=I.transform(n);e[s.array]=`${a} ${i}`}const f1=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function om(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:s=1,pathOffset:a=0,...i},c,l,u){if(ga(e,i,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete d.transformBox);for(const m of f1)d[m]!==void 0&&(f[m]=d[m],delete d[m]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),o!==void 0&&d1(d,o,s,a,!1)}const sm=()=>({...ba(),attrs:{}}),am=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m1(e,t,n,r){const o=w.useMemo(()=>{const s=sm();return om(s,t,am(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};rm(s,e.style,e),o.style={...s,...o.style}}return o}const h1=["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 ya(e){return typeof e!="string"||e.includes("-")?!1:!!(h1.indexOf(e)>-1||/[A-Z]/u.test(e))}function p1(e,t,n,{latestValues:r},o,s=!1,a){const c=(a??ya(e)?m1:c1)(t,r,o,e),l=JS(t,typeof e=="string",s),u=e!==w.Fragment?{...l,...c,ref:n}:{},{children:d}=t,f=w.useMemo(()=>De(d)?d.get():d,[d]);return w.createElement(e,{...u,children:f})}function Xi(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function va(e,t,n,r){if(typeof t=="function"){const[o,s]=Xi(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=Xi(r);t=t(n!==void 0?n:e.custom,o,s)}return t}function gr(e){return De(e)?e.get():e}function g1({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:b1(n,r,o,e),renderState:t()}}function b1(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=gr(s[f]);let{initial:a,animate:i}=e;const c=Gr(e),l=tm(e);t&&l&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),i===void 0&&(i=t.animate));let u=n?n.initial===!1:!1;u=u||a===!1;const d=u?i:a;if(d&&typeof d!="boolean"&&!Hr(d)){const f=Array.isArray(d)?d:[d];for(let m=0;m<f.length;m++){const y=va(e,f[m]);if(y){const{transitionEnd:p,transition:b,...v}=y;for(const C in v){let x=v[C];if(Array.isArray(x)){const k=u?x.length-1:0;x=x[k]}x!==null&&(o[C]=x)}for(const C in p)o[C]=p[C]}}}return o}const im=e=>(t,n)=>{const r=w.useContext(Yr),o=w.useContext(zr),s=()=>g1(e,t,r,o);return n?s():Ys(s)};function xa(e,t,n){const{style:r}=e,o={};for(const s in r)(De(r[s])||t.style&&De(t.style[s])||nm(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(o[s]=r[s]);return o}const y1=im({scrapeMotionValuesFromProps:xa,createRenderState:ba});function cm(e,t,n){const r=xa(e,t,n);for(const o in e)if(De(e[o])||De(t[o])){const s=dn.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const v1=im({scrapeMotionValuesFromProps:cm,createRenderState:sm}),x1=Symbol.for("motionComponentSymbol");function w1(e,t,n){const r=w.useRef(n);w.useInsertionEffect(()=>{r.current=n});const o=w.useRef(null);return w.useCallback(s=>{s&&e.onMount?.(s),t&&(s?t.mount(s):t.unmount());const a=r.current;if(typeof a=="function")if(s){const i=a(s);typeof i=="function"&&(o.current=i)}else o.current?(o.current(),o.current=null):a(s);else a&&(a.current=s)},[t])}const wa=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),C1="framerAppearId",lm="data-"+wa(C1),um=w.createContext({});function kn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function k1(e,t,n,r,o,s){const{visualElement:a}=w.useContext(Yr),i=w.useContext(Jf),c=w.useContext(zr),l=w.useContext(fa).reducedMotion,u=w.useRef(null);r=r||i.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,isSVG:s}));const d=u.current,f=w.useContext(um);d&&!d.projection&&o&&(d.type==="html"||d.type==="svg")&&S1(u.current,n,o,f);const m=w.useRef(!1);w.useInsertionEffect(()=>{d&&m.current&&d.update(n,c)});const y=n[lm],p=w.useRef(!!y&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return of(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),p.current&&d.animationState&&d.animationState.animateChanges())}),w.useEffect(()=>{d&&(!p.current&&d.animationState&&d.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),p.current=!1),d.enteringChildren=void 0)}),d}function S1(e,t,n,r){const{layoutId:o,layout:s,drag:a,dragConstraints:i,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:dm(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!a||i&&kn(i),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function dm(e){if(e)return e.options.allowProjection!==!1?e.projection:dm(e.parent)}function Do(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&XS(r);const s=n?n==="svg":ya(e),a=s?v1:y1;function i(l,u){let d;const f={...w.useContext(fa),...l,layoutId:D1(l)},{isStatic:m}=f,y=t1(l),p=a(l,m);if(!m&&Hs){T1(f,r);const b=E1(f);d=b.MeasureLayout,y.visualElement=k1(e,p,f,o,b.ProjectionNode,s)}return h.jsxs(Yr.Provider,{value:y,children:[d&&y.visualElement?h.jsx(d,{visualElement:y.visualElement,...f}):null,p1(e,l,w1(p,y.visualElement,u),p,m,t,s)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=w.forwardRef(i);return c[x1]=e,c}function D1({layoutId:e}){const t=w.useContext(zs).id;return t&&e!==void 0?t+"-"+e:e}function T1(e,t){const n=w.useContext(Jf).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?ln(!1,r,"lazy-strict-mode"):ct(!1,r,"lazy-strict-mode")}}function E1(e){const{drag:t,layout:n}=tn;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function P1(e,t){if(typeof Proxy>"u")return Do;const n=new Map,r=(s,a)=>Do(s,a,e,t),o=(s,a)=>(process.env.NODE_ENV!=="production"&&Xs(!1,"motion() is deprecated. Use motion.create() instead."),r(s,a));return new Proxy(o,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,Do(a,void 0,e,t)),n.get(a))})}function fm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function M1({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function R1(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function To(e){return e===void 0||e===1}function ss({scale:e,scaleX:t,scaleY:n}){return!To(e)||!To(t)||!To(n)}function Et(e){return ss(e)||mm(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function mm(e){return Zi(e.x)||Zi(e.y)}function Zi(e){return e&&e!=="0%"}function Mr(e,t,n){const r=e-n,o=t*r;return n+o}function Qi(e,t,n,r,o){return o!==void 0&&(e=Mr(e,o,r)),Mr(e,n,r)+t}function as(e,t=0,n=1,r,o){e.min=Qi(e.min,t,n,r,o),e.max=Qi(e.max,t,n,r,o)}function hm(e,{x:t,y:n}){as(e.x,t.translate,t.scale,t.originPoint),as(e.y,n.translate,n.scale,n.originPoint)}const Ji=.999999999999,ec=1.0000000000001;function N1(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,a;for(let i=0;i<o;i++){s=n[i],a=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Gt(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,hm(e,a)),r&&Et(s.latestValues)&&Gt(e,s.latestValues))}t.x<ec&&t.x>Ji&&(t.x=1),t.y<ec&&t.y>Ji&&(t.y=1)}function Ht(e,t){e.min=e.min+t,e.max=e.max+t}function tc(e,t,n,r,o=.5){const s=me(e.min,e.max,o);as(e,t,n,s,r)}function Gt(e,t){tc(e.x,t.x,t.scaleX,t.scale,t.originX),tc(e.y,t.y,t.scaleY,t.scale,t.originY)}function pm(e,t){return fm(R1(e.getBoundingClientRect(),t))}function A1(e,t,n){const r=pm(e,n),{scroll:o}=t;return o&&(Ht(r.x,o.offset.x),Ht(r.y,o.offset.y)),r}const nc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ut=()=>({x:nc(),y:nc()}),rc=()=>({min:0,max:0}),ve=()=>({x:rc(),y:rc()}),is={current:null},gm={current:!1};function O1(){if(gm.current=!0,!!Hs)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>is.current=e.matches;e.addEventListener("change",t),t()}else is.current=!1}const j1=new WeakMap;function _1(e,t,n){for(const r in t){const o=t[r],s=n[r];if(De(o))e.addValue(r,o);else if(De(s))e.addValue(r,en(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=e.getStaticValue(r);e.addValue(r,en(a!==void 0?a:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const oc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class I1{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ia,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.renderScheduledAt=0,this.scheduleRender=()=>{const f=Te.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,le.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!s,this.isControllingVariants=Gr(n),this.isVariantNode=tm(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const m=d[f];c[f]!==void 0&&De(m)&&m.set(c[f])}}mount(t){this.current=t,j1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(gm.current||O1(),this.shouldReduceMotion=is.current),process.env.NODE_ENV!=="production"&&Xs(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),vt(this.notifyUpdate),vt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=fn.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&le.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in tn){const n=tn[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ve()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<oc.length;r++){const o=oc[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,a=t[s];a&&(this.propEventSubscriptions[o]=this.on(o,a))}this.prevMotionValues=_1(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=en(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(sf(r)||cf(r))?r=parseFloat(r):!zS(r)&&xt.test(n)&&(r=Yf(t,n)),this.setBaseTarget(t,De(r)?r.get():r)),De(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=va(this.props,n,this.presenceContext?.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!De(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ks),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ua.render(this.render)}}class bm extends I1{constructor(){super(...arguments),this.KeyframeResolver=AS}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;De(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ym(e,{style:t,vars:n},r,o){const s=e.style;let a;for(a in t)s[a]=t[a];o?.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function V1(e){return window.getComputedStyle(e)}class F1 extends bm{constructor(){super(...arguments),this.type="html",this.renderInstance=ym}readValueFromInstance(t,n){if(fn.has(n))return this.projection?.isProjecting?Zo(n):Xk(t,n);{const r=V1(t),o=(Cf(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return pm(t,n)}build(t,n,r){ga(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return xa(t,n,r)}}const vm=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 L1(e,t,n,r){ym(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(vm.has(o)?o:wa(o),t.attrs[o])}class W1 extends bm{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ve}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(fn.has(n)){const r=zf(n);return r&&r.default||0}return n=vm.has(n)?n:wa(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return cm(t,n,r)}build(t,n,r){om(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){L1(t,n,r,o)}mount(t){this.isSVGTag=am(t.tagName),super.mount(t)}}const B1=(e,t)=>t.isSVG??ya(e)?new W1(t):new F1(t,{allowProjection:e!==w.Fragment});function Xt(e,t,n){const r=e.getProps();return va(r,t,n!==void 0?n:r.custom,e)}const cs=e=>Array.isArray(e);function $1(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,en(n))}function z1(e){return cs(e)?e[e.length-1]||0:e}function Y1(e,t){const n=Xt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const a in s){const i=z1(s[a]);$1(e,a,i)}}function H1(e){return!!(De(e)&&e.add)}function ls(e,t){const n=e.getValue("willChange");if(H1(n))return n.add(t);if(!n&<.WillChange){const r=new lt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function xm(e){return e.props[lm]}const G1=e=>e!==null;function U1(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(G1),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[s]}const q1={type:"spring",stiffness:500,damping:25,restSpeed:10},K1=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),X1={type:"keyframes",duration:.8},Z1={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Q1=(e,{keyframes:t})=>t.length>2?X1:fn.has(e)?e.startsWith("scale")?K1(t[1]):q1:Z1;function J1({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:a,repeatDelay:i,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Ca=(e,t,n,r={},o,s)=>a=>{const i=ca(r,e)||{},c=i.delay||r.delay||0;let{elapsed:l=0}=r;l=l-Ze(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-l,onUpdate:f=>{t.set(f),i.onUpdate&&i.onUpdate(f)},onComplete:()=>{a(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:s?void 0:o};J1(i)||Object.assign(u,Q1(e,u)),u.duration&&(u.duration=Ze(u.duration)),u.repeatDelay&&(u.repeatDelay=Ze(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ns(u),u.delay===0&&(d=!0)),(lt.instantAnimations||lt.skipAnimations)&&(d=!0,ns(u),u.delay=0),u.allowFlatten=!i.type&&!i.ease,d&&!s&&t.get()!==void 0){const f=U1(u.keyframes,i);if(f!==void 0){le.update(()=>{u.onUpdate(f),u.onComplete()});return}}return i.isSync?new aa(u):new vS(u)};function eD({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function wm(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:a,...i}=t;r&&(s=r);const c=[],l=o&&e.animationState&&e.animationState.getState()[o];for(const u in i){const d=e.getValue(u,e.latestValues[u]??null),f=i[u];if(f===void 0||l&&eD(l,u))continue;const m={delay:n,...ca(s||{},u)},y=d.get();if(y!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===y&&!m.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=xm(e);if(v){const C=window.MotionHandoffAnimation(v,u,le);C!==null&&(m.startTime=C,p=!0)}}ls(e,u),d.start(Ca(u,d,f,e.shouldReduceMotion&&Wf.has(u)?{type:!1}:m,e,p));const b=d.animation;b&&c.push(b)}return a&&Promise.all(c).then(()=>{le.update(()=>{a&&Y1(e,a)})}),c}function Cm(e,t,n,r=0,o=1){const s=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),a=e.size,i=(a-1)*r;return typeof n=="function"?n(s,a):o===1?s*r:i-s*r}function us(e,t,n={}){const r=Xt(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const s=r?()=>Promise.all(wm(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:d}=o;return tD(e,t,c,l,u,d,n)}:()=>Promise.resolve(),{when:i}=o;if(i){const[c,l]=i==="beforeChildren"?[s,a]:[a,s];return c().then(()=>l())}else return Promise.all([s(),a(n.delay)])}function tD(e,t,n=0,r=0,o=0,s=1,a){const i=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),i.push(us(c,t,{...a,delay:n+(typeof r=="function"?0:r)+Cm(e.variantChildren,c,r,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(i)}function nD(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>us(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=us(e,t,n);else{const o=typeof t=="function"?Xt(e,t,n.custom):t;r=Promise.all(wm(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function km(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const rD=pa.length;function Sm(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Sm(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<rD;n++){const r=pa[n],o=e.props[r];(In(o)||o===!1)&&(t[r]=o)}return t}const oD=[...ha].reverse(),sD=ha.length;function aD(e){return t=>Promise.all(t.map(({animation:n,options:r})=>nD(e,n,r)))}function iD(e){let t=aD(e),n=sc(),r=!0;const o=c=>(l,u)=>{const d=Xt(e,u,c==="exit"?e.presenceContext?.custom:void 0);if(d){const{transition:f,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function s(c){t=c(e)}function a(c){const{props:l}=e,u=Sm(e.parent)||{},d=[],f=new Set;let m={},y=1/0;for(let b=0;b<sD;b++){const v=oD[b],C=n[v],x=l[v]!==void 0?l[v]:u[v],k=In(x),S=v===c?C.isActive:null;S===!1&&(y=b);let T=x===u[v]&&x!==l[v]&&k;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),C.protectedKeys={...m},!C.isActive&&S===null||!x&&!C.prevProp||Hr(x)||typeof x=="boolean")continue;const E=cD(C.prevProp,x);let D=E||v===c&&C.isActive&&!T&&k||b>y&&k,N=!1;const M=Array.isArray(x)?x:[x];let j=M.reduce(o(v),{});S===!1&&(j={});const{prevResolvedValues:_={}}=C,B={..._,...j},z=W=>{D=!0,f.has(W)&&(N=!0,f.delete(W)),C.needsAnimating[W]=!0;const O=e.getValue(W);O&&(O.liveStyle=!1)};for(const W in B){const O=j[W],H=_[W];if(m.hasOwnProperty(W))continue;let ee=!1;cs(O)&&cs(H)?ee=!km(O,H):ee=O!==H,ee?O!=null?z(W):f.add(W):O!==void 0&&f.has(W)?z(W):C.protectedKeys[W]=!0}C.prevProp=x,C.prevResolvedValues=j,C.isActive&&(m={...m,...j}),r&&e.blockInitialAnimation&&(D=!1);const K=T&&E;D&&(!K||N)&&d.push(...M.map(W=>{const O={type:v};if(typeof W=="string"&&r&&!K&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,ee=Xt(H,W);if(H.enteringChildren&&ee){const{delayChildren:P}=ee.transition||{};O.delay=Cm(H.enteringChildren,e,P)}}return{animation:W,options:O}}))}if(f.size){const b={};if(typeof l.initial!="boolean"){const v=Xt(e,Array.isArray(l.initial)?l.initial[0]:l.initial);v&&v.transition&&(b.transition=v.transition)}f.forEach(v=>{const C=e.getBaseTarget(v),x=e.getValue(v);x&&(x.liveStyle=!0),b[v]=C??null}),d.push({animation:b})}let p=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(d):Promise.resolve()}function i(c,l){if(n[c].isActive===l)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(c,l)),n[c].isActive=l;const u=a(c);for(const d in n)n[d].protectedKeys={};return u}return{animateChanges:a,setActive:i,setAnimateFunction:s,getState:()=>n,reset:()=>{n=sc()}}}function cD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!km(t,e):!1}function Dt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sc(){return{animate:Dt(!0),whileInView:Dt(),whileHover:Dt(),whileTap:Dt(),whileDrag:Dt(),whileFocus:Dt(),exit:Dt()}}class Ct{constructor(t){this.isMounted=!1,this.node=t}update(){}}class lD extends Ct{constructor(t){super(t),t.animationState||(t.animationState=iD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Hr(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let uD=0;class dD extends Ct{constructor(){super(...arguments),this.id=uD++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const fD={animation:{Feature:lD},exit:{Feature:dD}};function Vn(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Xn(e){return{point:{x:e.pageX,y:e.pageY}}}const mD=e=>t=>da(t)&&e(t,Xn(t));function Tn(e,t,n,r){return Vn(e,t,mD(n),r)}const Dm=1e-4,hD=1-Dm,pD=1+Dm,Tm=.01,gD=0-Tm,bD=0+Tm;function Ee(e){return e.max-e.min}function yD(e,t,n){return Math.abs(e-t)<=n}function ac(e,t,n,r=.5){e.origin=r,e.originPoint=me(t.min,t.max,e.origin),e.scale=Ee(n)/Ee(t),e.translate=me(n.min,n.max,e.origin)-e.originPoint,(e.scale>=hD&&e.scale<=pD||isNaN(e.scale))&&(e.scale=1),(e.translate>=gD&&e.translate<=bD||isNaN(e.translate))&&(e.translate=0)}function En(e,t,n,r){ac(e.x,t.x,n.x,r?r.originX:void 0),ac(e.y,t.y,n.y,r?r.originY:void 0)}function ic(e,t,n){e.min=n.min+t.min,e.max=e.min+Ee(t)}function vD(e,t,n){ic(e.x,t.x,n.x),ic(e.y,t.y,n.y)}function cc(e,t,n){e.min=t.min-n.min,e.max=e.min+Ee(t)}function Rr(e,t,n){cc(e.x,t.x,n.x),cc(e.y,t.y,n.y)}function _e(e){return[e("x"),e("y")]}const Em=({current:e})=>e?e.ownerDocument.defaultView:null,lc=(e,t)=>Math.abs(e-t);function xD(e,t){const n=lc(e.x,t.x),r=lc(e.y,t.y);return Math.sqrt(n**2+r**2)}const uc=new Set(["auto","scroll"]);class Pm{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:i}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=Po(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,p=xD(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!p)return;const{point:b}=m,{timestamp:v}=ke;this.history.push({...b,timestamp:v});const{onStart:C,onMove:x}=this.handlers;y||(C&&C(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,m)},this.handlePointerMove=(m,y)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=Eo(y,this.transformPagePoint),le.update(this.updatePoint,!0)},this.handlePointerUp=(m,y)=>{this.end();const{onEnd:p,onSessionEnd:b,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=Po(m.type==="pointercancel"?this.lastMoveEventInfo:Eo(y,this.transformPagePoint),this.history);this.startEvent&&p&&p(m,C),b&&b(m,C)},!da(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=o||window;const c=Xn(t),l=Eo(c,this.transformPagePoint),{point:u}=l,{timestamp:d}=ke;this.history=[{...u,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,Po(l,this.history)),this.removeListeners=Un(Tn(this.contextWindow,"pointermove",this.handlePointerMove),Tn(this.contextWindow,"pointerup",this.handlePointerUp),Tn(this.contextWindow,"pointercancel",this.handlePointerUp)),i&&this.startScrollTracking(i)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(uc.has(r.overflowX)||uc.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),le.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),vt(this.updatePoint)}}function Eo(e,t){return t?{point:t(e.point)}:e}function dc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Po({point:e},t){return{point:e,delta:dc(e,Mm(t)),offset:dc(e,wD(t)),velocity:CD(t,.1)}}function wD(e){return e[0]}function Mm(e){return e[e.length-1]}function CD(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Mm(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ze(t)));)n--;if(!r)return{x:0,y:0};const s=Ve(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function kD(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?me(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?me(n,e,r.max):Math.min(e,n)),e}function fc(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function SD(e,{top:t,left:n,bottom:r,right:o}){return{x:fc(e.x,n,o),y:fc(e.y,t,r)}}function mc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function DD(e,t){return{x:mc(e.x,t.x),y:mc(e.y,t.y)}}function TD(e,t){let n=.5;const r=Ee(e),o=Ee(t);return o>r?n=On(t.min,t.max-r,e.min):r>o&&(n=On(e.min,e.max-o,t.min)),et(0,1,n)}function ED(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ds=.35;function PD(e=ds){return e===!1?e=0:e===!0&&(e=ds),{x:hc(e,"left","right"),y:hc(e,"top","bottom")}}function hc(e,t,n){return{min:pc(e,t),max:pc(e,n)}}function pc(e,t){return typeof e=="number"?e:e[t]||0}const MD=new WeakMap;class RD{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ve(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=d=>{n?(this.stopAnimation(),this.snapToCursor(Xn(d).point)):this.pauseAnimation()},a=(d,f)=>{this.stopAnimation();const{drag:m,dragPropagation:y,onDragStart:p}=this.getProps();if(m&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=IS(m),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),_e(v=>{let C=this.getAxisMotionValue(v).get()||0;if(Qe.test(C)){const{projection:x}=this.visualElement;if(x&&x.layout){const k=x.layout.layoutBox[v];k&&(C=Ee(k)*(parseFloat(C)/100))}}this.originPoint[v]=C}),p&&le.postRender(()=>p(d,f)),ls(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},i=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:m,dragDirectionLock:y,onDirectionLock:p,onDrag:b}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:v}=f;if(y&&this.currentDirection===null){this.currentDirection=ND(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},c=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>_e(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Pm(t,{onSessionStart:s,onStart:a,onMove:i,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:Em(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:a}=o;this.startAnimation(a);const{onDragEnd:i}=this.getProps();i&&le.postRender(()=>i(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!ur(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=kD(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&kn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=SD(r.layoutBox,t):this.constraints=!1,this.elastic=PD(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&_e(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ED(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!kn(t))return!1;const r=t.current;ct(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=A1(r,o.root,this.visualElement.getTransformPagePoint());let a=DD(o.layout.layoutBox,s);if(n){const i=n(M1(a));this.hasMutatedConstraints=!!i,i&&(a=fm(i))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),c=this.constraints||{},l=_e(u=>{if(!ur(u,n,this.currentDirection))return;let d=c&&c[u]||{};a&&(d={min:0,max:0});const f=o?200:1e6,m=o?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,y)});return Promise.all(l).then(i)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ls(this.visualElement,t),r.start(Ca(t,r,0,n,this.visualElement,!1))}stopAnimation(){_e(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){_e(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){_e(n=>{const{drag:r}=this.getProps();if(!ur(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:i}=o.layout.layoutBox[n],c=s.get()||0;s.set(t[n]-me(a,i,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!kn(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};_e(a=>{const i=this.getAxisMotionValue(a);if(i&&this.constraints!==!1){const c=i.get();o[a]=TD({min:c,max:c},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),_e(a=>{if(!ur(a,t,null))return;const i=this.getAxisMotionValue(a),{min:c,max:l}=this.constraints[a];i.set(me(c,l,o[a]))})}addListeners(){if(!this.visualElement.current)return;MD.set(this.visualElement,this);const t=this.visualElement.current,n=Tn(t,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&!Xf(c.target)&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();kn(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),le.read(r);const a=Vn(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(_e(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())}));return()=>{a(),n(),s(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:a=ds,dragMomentum:i=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:a,dragMomentum:i}}}function ur(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ND(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class AD extends Ct{constructor(t){super(t),this.removeGroupControls=Fe,this.removeListeners=Fe,this.controls=new RD(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fe}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const gc=e=>(t,n)=>{e&&le.postRender(()=>e(t,n))};class OD extends Ct{constructor(){super(...arguments),this.removePointerDownListener=Fe}onPointerDown(t){this.session=new Pm(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Em(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:gc(t),onStart:gc(n),onMove:r,onEnd:(s,a)=>{delete this.session,o&&le.postRender(()=>o(s,a))}}}mount(){this.removePointerDownListener=Tn(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const br={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Mo=!1;class jD extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),Mo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),br.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,Mo=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||le.postRender(()=>{const i=a.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ua.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Mo=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Rm(e){const[t,n]=Qf(),r=w.useContext(zs);return h.jsx(jD,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(um),isPresent:t,safeToRemove:n})}function _D(e,t,n){const r=De(e)?e:en(e);return r.start(Ca("",r,t,n)),r.animation}const ID=(e,t)=>e.depth-t.depth;class VD{constructor(){this.children=[],this.isDirty=!1}add(t){Gs(this.children,t),this.isDirty=!0}remove(t){Us(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ID),this.isDirty=!1,this.children.forEach(t)}}function FD(e,t){const n=Te.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(vt(r),e(s-t))};return le.setup(r,!0),()=>vt(r)}const Nm=["TopLeft","TopRight","BottomLeft","BottomRight"],LD=Nm.length,bc=e=>typeof e=="string"?parseFloat(e):e,yc=e=>typeof e=="number"||I.test(e);function WD(e,t,n,r,o,s){o?(e.opacity=me(0,n.opacity??1,BD(r)),e.opacityExit=me(t.opacity??1,0,$D(r))):s&&(e.opacity=me(t.opacity??1,n.opacity??1,r));for(let a=0;a<LD;a++){const i=`border${Nm[a]}Radius`;let c=vc(t,i),l=vc(n,i);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||yc(c)===yc(l)?(e[i]=Math.max(me(bc(c),bc(l),r),0),(Qe.test(l)||Qe.test(c))&&(e[i]+="%")):e[i]=l}(t.rotate||n.rotate)&&(e.rotate=me(t.rotate||0,n.rotate||0,r))}function vc(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const BD=Am(0,.5,gf),$D=Am(.5,.95,Fe);function Am(e,t,n){return r=>r<e?0:r>t?1:n(On(e,t,r))}function xc(e,t){e.min=t.min,e.max=t.max}function We(e,t){xc(e.x,t.x),xc(e.y,t.y)}function wc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Cc(e,t,n,r,o){return e-=t,e=Mr(e,1/n,r),o!==void 0&&(e=Mr(e,1/o,r)),e}function zD(e,t=0,n=1,r=.5,o,s=e,a=e){if(Qe.test(t)&&(t=parseFloat(t),t=me(a.min,a.max,t/100)-a.min),typeof t!="number")return;let i=me(s.min,s.max,r);e===s&&(i-=t),e.min=Cc(e.min,t,n,i,o),e.max=Cc(e.max,t,n,i,o)}function kc(e,t,[n,r,o],s,a){zD(e,t[n],t[r],t[o],t.scale,s,a)}const YD=["x","scaleX","originX"],HD=["y","scaleY","originY"];function Sc(e,t,n,r){kc(e.x,t,YD,n?n.x:void 0,r?r.x:void 0),kc(e.y,t,HD,n?n.y:void 0,r?r.y:void 0)}function Dc(e){return e.translate===0&&e.scale===1}function Om(e){return Dc(e.x)&&Dc(e.y)}function Tc(e,t){return e.min===t.min&&e.max===t.max}function GD(e,t){return Tc(e.x,t.x)&&Tc(e.y,t.y)}function Ec(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function jm(e,t){return Ec(e.x,t.x)&&Ec(e.y,t.y)}function Pc(e){return Ee(e.x)/Ee(e.y)}function Mc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class UD{constructor(){this.members=[]}add(t){Gs(this.members,t),t.scheduleRender()}remove(t){if(Us(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function qD(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,a=n?.z||0;if((o||s||a)&&(r=`translate3d(${o}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:d,rotateY:f,skewX:m,skewY:y}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const i=e.x.scale*t.x,c=e.y.scale*t.y;return(i!==1||c!==1)&&(r+=`scale(${i}, ${c})`),r||"none"}const Ro=["","X","Y","Z"],KD=1e3;let XD=0;function No(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function _m(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=xm(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",le,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&_m(r)}function Im({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},i=t?.()){this.id=XD++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(JD),this.nodes.forEach(rT),this.nodes.forEach(oT),this.nodes.forEach(eT)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new VD)}addEventListener(a,i){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Ks),this.eventHandlers.get(a).add(i)}notifyListeners(a,...i){const c=this.eventHandlers.get(a);c&&c.notify(...i)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=Zf(a)&&!BS(a),this.instance=a;const{layoutId:i,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||i)&&(this.isLayoutDirty=!0),e){let u,d=0;const f=()=>this.root.updateBlockedByResize=!1;le.read(()=>{d=window.innerWidth}),e(a,()=>{const m=window.innerWidth;m!==d&&(d=m,this.root.updateBlockedByResize=!0,u&&u(),u=FD(f,250),br.hasAnimatedSinceResize&&(br.hasAnimatedSinceResize=!1,this.nodes.forEach(Ac)))})}i&&this.root.registerSharedNode(i,this),this.options.animate!==!1&&l&&(i||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||l.getDefaultTransition()||lT,{onLayoutAnimationStart:p,onLayoutAnimationComplete:b}=l.getProps(),v=!this.targetLayout||!jm(this.targetLayout,m),C=!d&&f;if(this.options.layoutRoot||this.resumeFrom||C||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...ca(y,"layout"),onPlay:p,onComplete:b};(l.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,C)}else d||Ac(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),vt(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(sT),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&_m(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:i,layout:c}=this.options;if(i===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Rc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Nc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(nT),this.nodes.forEach(ZD),this.nodes.forEach(QD)):this.nodes.forEach(Nc),this.clearAllSnapshots();const i=Te.now();ke.delta=et(0,1e3/60,i-ke.timestamp),ke.timestamp=i,ke.isProcessing=!0,yo.update.process(ke),yo.preRender.process(ke),yo.render.process(ke),ke.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ua.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(tT),this.sharedNodes.forEach(aT)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,le.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){le.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Ee(this.snapshot.measuredBox.x)&&!Ee(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}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<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ve(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(i=!1),i&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!Om(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;a&&this.instance&&(i||Et(this.latestValues)||u)&&(o(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const i=this.measurePageBox();let c=this.removeElementScroll(i);return a&&(c=this.removeTransform(c)),uT(c),{animationId:this.root.animationId,measuredBox:i,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return ve();const i=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(dT))){const{scroll:l}=this.root;l&&(Ht(i.x,l.offset.x),Ht(i.y,l.offset.y))}return i}removeElementScroll(a){const i=ve();if(We(i,a),this.scroll?.wasRoot)return i;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:d}=l;l!==this.root&&u&&d.layoutScroll&&(u.wasRoot&&We(i,a),Ht(i.x,u.offset.x),Ht(i.y,u.offset.y))}return i}applyTransform(a,i=!1){const c=ve();We(c,a);for(let l=0;l<this.path.length;l++){const u=this.path[l];!i&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Gt(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Et(u.latestValues)&&Gt(c,u.latestValues)}return Et(this.latestValues)&&Gt(c,this.latestValues),c}removeTransform(a){const i=ve();We(i,a);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!Et(l.latestValues))continue;ss(l.latestValues)&&l.updateSnapshot();const u=ve(),d=l.measurePageBox();We(u,d),Sc(i,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return Et(this.latestValues)&&Sc(i,this.latestValues),i}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ke.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const i=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=i.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=i.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=i.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==i;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:d}=this.options;if(!this.layout||!(u||d))return;this.resolvedRelativeTargetAt=ke.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ve(),this.targetWithTransforms=ve()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vD(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):We(this.target,this.layout.layoutBox),hm(this.target,this.targetDelta)):We(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ss(this.parent.latestValues)||mm(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,i,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ve(),this.relativeTargetOrigin=ve(),Rr(this.relativeTargetOrigin,i,c),We(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const a=this.getLead(),i=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===ke.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;We(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;N1(this.layoutCorrected,this.treeScale,this.path,i),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ve());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(wc(this.prevProjectionDelta.x,this.projectionDelta.x),wc(this.prevProjectionDelta.y,this.projectionDelta.y)),En(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!Mc(this.projectionDelta.x,this.prevProjectionDelta.x)||!Mc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const i=this.getStack();i&&i.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ut(),this.projectionDelta=Ut(),this.projectionDeltaWithTransform=Ut()}setAnimationOrigin(a,i=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=Ut();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;const f=ve(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,p=m!==y,b=this.getStack(),v=!b||b.members.length<=1,C=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(cT));this.animationProgress=0;let x;this.mixTargetDelta=k=>{const S=k/1e3;Oc(d.x,a.x,S),Oc(d.y,a.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rr(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),iT(this.relativeTarget,this.relativeTargetOrigin,f,S),x&&GD(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ve()),We(x,this.relativeTarget)),p&&(this.animationValues=u,WD(u,l,this.latestValues,S,C,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(vt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=le.update(()=>{br.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=en(0)),this.currentAnimation=_D(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:i=>{this.mixTargetDelta(i),a.onUpdate&&a.onUpdate(i)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(KD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:i,target:c,layout:l,latestValues:u}=a;if(!(!i||!c||!l)){if(this!==a&&this.layout&&l&&Vm(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||ve();const d=Ee(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+d;const f=Ee(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+f}We(i,c),Gt(i,u),En(this.projectionDeltaWithTransform,this.layoutCorrected,i,u)}}registerSharedNode(a,i){this.sharedNodes.has(a)||this.sharedNodes.set(a,new UD),this.sharedNodes.get(a).add(i);const l=i.options.initialPromotionConfig;i.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(i):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:i,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let i=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(i=!0),!i)return;const l={};c.z&&No("z",a,l,this.animationValues);for(let u=0;u<Ro.length;u++)No(`rotate${Ro[u]}`,a,l,this.animationValues),No(`skew${Ro[u]}`,a,l,this.animationValues);a.render();for(const u in l)a.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);a.scheduleRender()}applyProjectionStyles(a,i){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=gr(i?.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=gr(i?.pointerEvents)||""),this.hasProjected&&!Et(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let d=qD(this.projectionDeltaWithTransform,this.treeScale,u);c&&(d=c(u,d)),a.transform=d;const{x:f,y:m}=this.projectionDelta;a.transformOrigin=`${f.origin*100}% ${m.origin*100}% 0`,l.animationValues?a.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:a.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const y in os){if(u[y]===void 0)continue;const{correct:p,applyTo:b,isCSSVariable:v}=os[y],C=d==="none"?u[y]:p(u[y],l);if(b){const x=b.length;for(let k=0;k<x;k++)a[b[k]]=C}else v?this.options.visualElement.renderState.vars[y]=C:a[y]=C}this.options.layoutId&&(a.pointerEvents=l===this?gr(i?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(Rc),this.root.sharedNodes.clear()}}}function ZD(e){e.updateLayout()}function QD(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,s=t.source!==e.layout.source;o==="size"?_e(u=>{const d=s?t.measuredBox[u]:t.layoutBox[u],f=Ee(d);d.min=n[u].min,d.max=d.min+f}):Vm(o,t.layoutBox,n)&&_e(u=>{const d=s?t.measuredBox[u]:t.layoutBox[u],f=Ee(n[u]);d.max=d.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+f)});const a=Ut();En(a,n,t.layoutBox);const i=Ut();s?En(i,e.applyTransform(r,!0),t.measuredBox):En(i,n,t.layoutBox);const c=!Om(a);let l=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:d,layout:f}=u;if(d&&f){const m=ve();Rr(m,t.layoutBox,d.layoutBox);const y=ve();Rr(y,n,f.layoutBox),jm(m,y)||(l=!0),u.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:i,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function JD(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function eT(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function tT(e){e.clearSnapshot()}function Rc(e){e.clearMeasurements()}function Nc(e){e.isLayoutDirty=!1}function nT(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ac(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rT(e){e.resolveTargetDelta()}function oT(e){e.calcProjection()}function sT(e){e.resetSkewAndRotation()}function aT(e){e.removeLeadSnapshot()}function Oc(e,t,n){e.translate=me(t.translate,0,n),e.scale=me(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jc(e,t,n,r){e.min=me(t.min,n.min,r),e.max=me(t.max,n.max,r)}function iT(e,t,n,r){jc(e.x,t.x,n.x,r),jc(e.y,t.y,n.y,r)}function cT(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lT={duration:.45,ease:[.4,0,.1,1]},_c=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ic=_c("applewebkit/")&&!_c("chrome/")?Math.round:Fe;function Vc(e){e.min=Ic(e.min),e.max=Ic(e.max)}function uT(e){Vc(e.x),Vc(e.y)}function Vm(e,t,n){return e==="position"||e==="preserve-aspect"&&!yD(Pc(t),Pc(n),.2)}function dT(e){return e!==e.root&&e.scroll?.wasRoot}const fT=Im({attachResizeListener:(e,t)=>Vn(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ao={current:void 0},Fm=Im({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ao.current){const e=new fT({});e.mount(window),e.setOptions({layoutScroll:!0}),Ao.current=e}return Ao.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),mT={pan:{Feature:OD},drag:{Feature:AD,ProjectionNode:Fm,MeasureLayout:Rm}};function Fc(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&le.postRender(()=>s(t,Xn(t)))}class hT extends Ct{mount(){const{current:t}=this.node;t&&(this.unmount=VS(t,(n,r)=>(Fc(this.node,r,"Start"),o=>Fc(this.node,o,"End"))))}unmount(){}}class pT extends Ct{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Un(Vn(this.node.current,"focus",()=>this.onFocus()),Vn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Lc(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&le.postRender(()=>s(t,Xn(t)))}class gT extends Ct{mount(){const{current:t}=this.node;t&&(this.unmount=WS(t,(n,r)=>(Lc(this.node,r,"Start"),(o,{success:s})=>Lc(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const fs=new WeakMap,Oo=new WeakMap,bT=e=>{const t=fs.get(e.target);t&&t(e)},yT=e=>{e.forEach(bT)};function vT({root:e,...t}){const n=e||document;Oo.has(n)||Oo.set(n,{});const r=Oo.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(yT,{root:e,...t})),r[o]}function xT(e,t,n){const r=vT(t);return fs.set(e,n),r.observe(e),()=>{fs.delete(e),r.unobserve(e)}}const wT={some:0,all:1};class CT extends Ct{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:wT[o]},i=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return xT(this.node.current,a,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(kT(t,n))&&this.startObserver()}unmount(){}}function kT({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const ST={inView:{Feature:CT},tap:{Feature:gT},focus:{Feature:pT},hover:{Feature:hT}},DT={layout:{ProjectionNode:Fm,MeasureLayout:Rm}},TT={...fD,...ST,...mT,...DT},pt=P1(TT,B1);class ET extends w.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Dropdown Error:",t,n),this.props.onError?.(t,n)}render(){return this.state.hasError?this.props.fallback||null:this.props.children}}const Lm=w.createContext(void 0);function ka(){const e=w.useContext(Lm);if(!e)throw new Error("Dropdown components must be used within Dropdown");return e}const PT=te(["absolute z-[1000] min-w-[8rem] overflow-hidden","rounded-md border shadow-lg","bg-[var(--atom-theme-surface-primary)] border-[var(--atom-theme-border-primary)] px-1.5 py-2"].join(" "),{variants:{side:{top:"",bottom:"",left:"",right:""},align:{start:"",center:"",end:""}},defaultVariants:{side:"bottom",align:"start"}}),MT=te(["relative flex cursor-pointer select-none items-center","rounded-sm px-3 py-2 text-sm outline-none","transition-colors duration-150","focus:bg-[color-mix(in_oklab,var(--atom-theme-surface-secondary)_15%,transparent)] focus:text-[var(--atom-text)]","hover:bg-[color-mix(in_oklab,var(--atom-theme-surface-secondary)_15%,transparent)] hover:text-[var(--atom-text)]","focus:hover:bg-[color-mix(in_oklab,var(--atom-theme-surface-secondary)_20%,transparent)]","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","data-[selected]:text-[var(--atom-primary)] data-[selected]:font-medium"].join(" ")),RT=te(["inline-flex items-center justify-center gap-2","px-4 py-2 rounded-md text-sm font-medium","transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--atom-primary)] focus-visible:ring-offset-2","cursor-pointer","disabled:pointer-events-none disabled:opacity-50"].join(" "),{variants:{variant:{default:["bg-[var(--atom-theme-surface-primary)]","border border-[var(--atom-theme-border-primary)]","text-[var(--atom-theme-text-primary)]"].join(" "),ghost:["bg-transparent","hover:bg-[color-mix(in_oklab,var(--atom-theme-surface-secondary)_15%,transparent)]","text-[var(--atom-text)]"].join(" ")}},defaultVariants:{variant:"ghost"}}),NT=e=>{const n={top:{y:8,x:0},bottom:{y:-8,x:0},left:{y:0,x:8},right:{y:0,x:-8}};return{initial:{opacity:0,scale:.95,...n[e]},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.95,...n[e]}}};function AT(e,t,n,r=!0){w.useEffect(()=>{if(!r||typeof document>"u")return;const o=s=>{const a=s.target;!e.current||e.current.contains(a)||t.current&&t.current.contains(a)||n()};return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[e,t,n,r])}function OT(e,t,n,r,o,s,a){const[i,c]=w.useState({top:0,left:0}),l=w.useCallback(()=>{if(typeof window>"u"||!n||!e.current||!t.current)return;const u=e.current.getBoundingClientRect(),d=t.current.getBoundingClientRect(),f={width:window.innerWidth,height:window.innerHeight},m=window.scrollY,y=window.scrollX;let p=0,b=0;switch(r){case"top":p=u.top+m-d.height-s;break;case"bottom":p=u.bottom+m+s;break;case"left":case"right":switch(o){case"start":p=u.top+m+a;break;case"center":p=u.top+m+u.height/2-d.height/2;break;case"end":p=u.bottom+m-d.height-a;break}break}switch(r){case"left":b=u.left+y-d.width-s;break;case"right":b=u.right+y+s;break;case"top":case"bottom":switch(o){case"start":b=u.left+y+a;break;case"center":b=u.left+y+u.width/2-d.width/2;break;case"end":b=u.right+y-d.width-a;break}break}const v=8;b<v&&(b=v),b+d.width>f.width-v&&(b=f.width-d.width-v),p<m+v&&(p=m+v),p+d.height>m+f.height-v&&(p=m+f.height-d.height-v),c({top:p,left:b})},[n,r,o,s,a,t,e]);return w.useEffect(()=>{if(typeof window>"u"||!n||!e.current||!t.current)return;l();let u=null;return typeof ResizeObserver<"u"&&t.current&&(u=new ResizeObserver(l),u.observe(t.current)),window.addEventListener("scroll",l,{passive:!0,capture:!0}),window.addEventListener("resize",l,{passive:!0}),()=>{u?.disconnect(),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[l,n,t,e]),i}const Wm=({open:e,onOpenChange:t,defaultOpen:n=!1,value:r,onValueChange:o,disabled:s=!1,animateItems:a=!1,errorFallback:i,onError:c,children:l})=>{const[u,d]=w.useState(n),[f,m]=w.useState(r||""),[y,p]=w.useState(""),[b,v]=w.useState(!1),C=w.useId(),x=`dropdown-trigger-${C}`,k=`dropdown-content-${C}`,S=e!==void 0,T=s?!1:S?e:u,E=w.useCallback((M,j=!1)=>{s||(v(j),S||d(M),t?.(M))},[S,t,s]),D=w.useCallback(M=>{m(M),o?.(M)},[o]);w.useEffect(()=>{r!==void 0&&m(r)},[r]);const N=w.useMemo(()=>({open:T,setOpen:E,triggerId:x,contentId:k,selectedValue:r||f,setSelectedValue:D,activeDescendant:y,setActiveDescendant:p,animateItems:a,openedViaKeyboard:b}),[T,E,x,k,r,f,D,y,a,b]);return h.jsx(ET,{fallback:i,onError:c,children:h.jsx(Lm.Provider,{value:N,children:h.jsxs("div",{className:"relative inline-block",children:[l,h.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:f&&`Selected: ${f}`})]})})})};Wm.displayName="Dropdown";const Bm=w.forwardRef(({className:e,children:t,onClick:n,onMouseDown:r,onKeyDown:o,variant:s,asChild:a=!1,disabled:i,...c},l)=>{const{open:u,setOpen:d,triggerId:f,contentId:m}=ka(),y=w.useRef(null);w.useEffect(()=>{l&&(typeof l=="function"?l(y.current):l.current=y.current)},[l]);const p=x=>{x.preventDefault(),r?.(x)},b=x=>{i||(x.stopPropagation(),d(!u,!1),n?.(x))},v=x=>{if(!i){switch(x.key){case"ArrowDown":x.preventDefault(),u||d(!0,!0);break;case"ArrowUp":x.preventDefault(),u||d(!0,!0);break;case"Enter":case" ":x.preventDefault(),d(!u,!0);break}o?.(x)}},C=a?Me:"button";return h.jsx(C,{ref:y,id:f,type:a?void 0:"button","aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?m:void 0,disabled:i,"data-testid":"dropdown-trigger",className:a?e:R(RT({variant:s}),e),onMouseDown:p,onClick:b,onKeyDown:v,...c,children:t})});Bm.displayName="DropdownTrigger";const $m=w.forwardRef(({className:e,children:t,side:n="bottom",align:r="start",sideOffset:o=4,alignOffset:s=0,container:a,preventClose:i=!1,...c},l)=>{const{open:u,setOpen:d,triggerId:f,contentId:m,activeDescendant:y,openedViaKeyboard:p}=ka(),b=w.useRef(null),v=w.useRef(null),C=_r();w.useEffect(()=>{l&&(typeof l=="function"?l(b.current):l.current=b.current)},[l]);const x=n??"bottom",k=r??"start",S=OT(v,b,u,x,k,o,s);w.useEffect(()=>{if(typeof document>"u")return;const N=document.getElementById(f);N&&(v.current=N)},[f]),AT(b,v,()=>{u&&!i&&d(!1)},u),w.useEffect(()=>{if(typeof document>"u"||!u||!b.current)return;if(p){const M=b.current.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])');M.length>0&&M[0].focus()}const N=M=>{M.key==="Escape"&&(M.preventDefault(),M.stopPropagation(),d(!1),v.current?.focus())};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[u,d,p]);const T=w.useMemo(()=>NT(x),[x]),E=a||C||(typeof document<"u"?document.body:null);if(!E)return null;const D=h.jsx(ma,{mode:"wait",children:u&&h.jsx(pt.div,{ref:b,id:m,role:"menu","aria-labelledby":f,"aria-orientation":"vertical","aria-activedescendant":y||void 0,"data-testid":"dropdown-content",initial:"initial",animate:"animate",exit:"exit",variants:T,transition:{duration:.2,ease:[.16,1,.3,1]},className:R(PT({side:x,align:k}),e),style:{position:"fixed",top:`${S.top}px`,left:`${S.left}px`,pointerEvents:"auto"},...c,children:t})});return Fn.createPortal(h.jsx(w.Suspense,{fallback:null,children:D}),E)});$m.displayName="DropdownContent";const zm=w.forwardRef(({className:e,children:t,disabled:n,preventClose:r=!1,value:o,onClick:s,onKeyDown:a,...i},c)=>{const{setOpen:l,selectedValue:u,setSelectedValue:d,setActiveDescendant:f,animateItems:m}=ka(),y=o!==void 0&&o===u,p=w.useRef(null),v=`dropdown-item-${w.useId()}`,[C,x]=w.useState(!1);w.useEffect(()=>{c&&(typeof c=="function"?c(p.current):c.current=p.current)},[c]);const k=w.useCallback(()=>{n||C||(x(!0),o!==void 0&&d(o),r||l(!1),setTimeout(()=>x(!1),300))},[n,C,o,d,r,l]),S=D=>{n||C||(D.stopPropagation(),s?.(D),k())},T=D=>{if(n)return;const N=p.current;if(!N)return;const M=Array.from(N.closest('[role="menu"]')?.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')||[]),j=M.indexOf(N);switch(D.key){case"Enter":case" ":D.preventDefault(),D.stopPropagation(),a?.(D),k();break;case"ArrowDown":if(D.preventDefault(),D.stopPropagation(),M.length>0){const _=(j+1)%M.length,B=M[_];B?.focus(),f(B.id)}break;case"ArrowUp":if(D.preventDefault(),D.stopPropagation(),M.length>0){const _=j===0?M.length-1:j-1,B=M[_];B?.focus(),f(B.id)}break;case"Home":if(D.preventDefault(),D.stopPropagation(),M.length>0){const _=M[0];_?.focus(),f(_.id)}break;case"End":if(D.preventDefault(),D.stopPropagation(),M.length>0){const _=M[M.length-1];_?.focus(),f(_.id)}break;case"Tab":if(M.length>0)if(D.shiftKey)if(j===0)l(!1);else{D.preventDefault();const _=M[j-1];_?.focus(),f(_.id)}else if(j===M.length-1)l(!1);else{D.preventDefault();const _=M[j+1];_?.focus(),f(_.id)}break;default:a?.(D)}},E=()=>{f(v)};return h.jsx(pt.div,{ref:p,id:v,role:"menuitem",tabIndex:n?-1:0,"aria-disabled":n,"data-disabled":n?"":void 0,"data-selected":y?"":void 0,"data-testid":`dropdown-item-${o||v}`,className:R(MT(),e),onClick:S,onKeyDown:T,onFocus:E,whileHover:n||!m?void 0:{scale:1.01},whileTap:n||!m?void 0:{scale:.98},...i,children:t})});zm.displayName="DropdownItem";const Ym=w.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"separator","aria-orientation":"horizontal","data-testid":"dropdown-separator",className:R("my-1 h-px bg-(--atom-theme-border-primary)",e),...t}));Ym.displayName="DropdownSeparator";const Hm=w.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"presentation","data-testid":"dropdown-label",className:R("px-3 py-1.5 text-xs font-semibold text-(--atom-text-secondary)",e),...t}));Hm.displayName="DropdownLabel";const Gm=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("div",{ref:r,role:"group","data-testid":"dropdown-group",className:R("py-1",e),...n,children:t}));Gm.displayName="DropdownGroup";class jT extends w.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){console.error("Popover Error:",t,n),this.props.onError?.(t,n)}render(){return this.state.hasError?this.props.fallback||null:this.props.children}}const Um=w.createContext(void 0);function Sa(){const e=w.useContext(Um);if(!e)throw new Error("Popover components must be used within Popover");return e}const _T=te(["absolute z-[1000] rounded-lg border shadow-lg","bg-[var(--atom-theme-surface-primary)] border-[var(--atom-theme-border-primary)]","outline-none overflow-hidden"].join(" "),{variants:{side:{top:"",bottom:"",left:"",right:""},align:{start:"",center:"",end:""},size:{sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[32rem]",full:"w-screen max-w-md"}},defaultVariants:{side:"bottom",align:"center",size:"md"}}),IT=te(["inline-flex items-center justify-center","transition-colors duration-150","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--atom-primary)] focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","cursor-pointer"].join(" ")),VT=e=>{const n={top:{y:8,x:0},bottom:{y:-8,x:0},left:{y:0,x:8},right:{y:0,x:-8}};return{initial:{opacity:0,scale:.96,...n[e]},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.95,...n[e]}}};function FT(e,t,n,r=!0){w.useEffect(()=>{if(!r||typeof document>"u")return;const o=s=>{const a=s.target;!e.current||e.current.contains(a)||t.current&&t.current.contains(a)||n()};return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[e,t,n,r])}function LT(e,t,n,r,o,s,a){const[i,c]=w.useState({top:0,left:0}),l=w.useCallback(()=>{if(typeof window>"u"||!n||!e.current||!t.current)return;const u=e.current.getBoundingClientRect(),d=t.current.getBoundingClientRect(),f={width:window.innerWidth,height:window.innerHeight},m=window.scrollY,y=window.scrollX;let p=0,b=0;switch(r){case"top":p=u.top+m-d.height-s;break;case"bottom":p=u.bottom+m+s;break;case"left":case"right":switch(o){case"start":p=u.top+m+a;break;case"center":p=u.top+m+u.height/2-d.height/2;break;case"end":p=u.bottom+m-d.height-a;break}break}switch(r){case"left":b=u.left+y-d.width-s;break;case"right":b=u.right+y+s;break;case"top":case"bottom":switch(o){case"start":b=u.left+y+a;break;case"center":b=u.left+y+u.width/2-d.width/2;break;case"end":b=u.right+y-d.width-a;break}break}const v=8;b<v&&(b=v),b+d.width>f.width-v&&(b=f.width-d.width-v),p<m+v&&(p=m+v),p+d.height>m+f.height-v&&(p=m+f.height-d.height-v),c({top:p,left:b})},[n,r,o,s,a,t,e]);return w.useEffect(()=>{if(typeof window>"u"||!n||!e.current||!t.current)return;l();let u=null;return typeof ResizeObserver<"u"&&t.current&&(u=new ResizeObserver(l),u.observe(t.current)),window.addEventListener("scroll",l,{passive:!0,capture:!0}),window.addEventListener("resize",l,{passive:!0}),()=>{u?.disconnect(),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[l,n,t,e]),i}const qm=({open:e,onOpenChange:t,defaultOpen:n=!1,modal:r=!1,errorFallback:o,onError:s,children:a})=>{const[i,c]=w.useState(n),l=w.useId(),u=`popover-trigger-${l}`,d=`popover-content-${l}`,f=e!==void 0,m=f?e:i,y=w.useCallback(b=>{f||c(b),t?.(b)},[f,t]),p=w.useMemo(()=>({open:m,setOpen:y,triggerId:u,contentId:d,modal:r}),[m,y,u,d,r]);return h.jsx(jT,{fallback:o,onError:s,children:h.jsx(Um.Provider,{value:p,children:h.jsx("div",{className:"relative inline-block",children:a})})})};qm.displayName="Popover";const Km=w.forwardRef(({className:e,children:t,onClick:n,onKeyDown:r,asChild:o=!1,disabled:s,...a},i)=>{const{open:c,setOpen:l,triggerId:u,contentId:d}=Sa(),f=w.useRef(null);w.useEffect(()=>{i&&(typeof i=="function"?i(f.current):i.current=f.current)},[i]);const m=b=>{s||(b.stopPropagation(),l(!c),n?.(b))},y=b=>{s||((b.key==="Enter"||b.key===" ")&&(b.preventDefault(),l(!c)),r?.(b))},p=o?Me:"button";return h.jsx(p,{ref:f,id:u,type:o?void 0:"button","aria-haspopup":"dialog","aria-expanded":c,"aria-controls":c?d:void 0,disabled:s,"data-state":c?"open":"closed","data-testid":"popover-trigger",className:o?e:R(IT(),e),onClick:m,onKeyDown:y,...a,children:t})});Km.displayName="PopoverTrigger";const Xm=w.forwardRef(({className:e,children:t,side:n="bottom",align:r="center",size:o="md",sideOffset:s=8,alignOffset:a=0,container:i,preventClose:c=!1,preventOutsideClick:l=!1,showArrow:u=!1,...d},f)=>{const{open:m,setOpen:y,triggerId:p,contentId:b,modal:v}=Sa(),C=w.useRef(null),x=w.useRef(null),k=_r();w.useEffect(()=>{f&&(typeof f=="function"?f(C.current):f.current=C.current)},[f]);const S=LT(x,C,m,n??"bottom",r??"center",s,a);w.useEffect(()=>{if(typeof document>"u")return;const j=document.getElementById(p);j&&(x.current=j)},[p]),FT(C,x,()=>{m&&!c&&!l&&y(!1)},m),w.useEffect(()=>{if(typeof document>"u"||!m)return;const j=_=>{_.key==="Escape"&&(_.preventDefault(),_.stopPropagation(),y(!1),x.current?.focus())};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[m,y]),w.useEffect(()=>{if(typeof document>"u"||!m||!v)return;const j=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=j}},[m,v]),w.useEffect(()=>{if(typeof document>"u"||!m||!v||!C.current)return;const j=C.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),_=j[0],B=j[j.length-1],z=K=>{K.key==="Tab"&&(K.shiftKey?document.activeElement===_&&(K.preventDefault(),B?.focus()):document.activeElement===B&&(K.preventDefault(),_?.focus()))};return _?.focus(),document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[m,v]);const T=w.useMemo(()=>VT(n??"bottom"),[n]),E=i||k||(typeof document<"u"?document.body:null);if(!E)return null;const D=()=>R("absolute h-2 w-2 rotate-45 bg-[var(--atom-theme-surface-primary)] border-[var(--atom-theme-border-primary)]",{top:"bottom-[-5px] border-r border-b",bottom:"top-[-5px] border-l border-t",left:"right-[-5px] border-t border-r",right:"left-[-5px] border-b border-l"}[n??"bottom"]),N=()=>r==="center"?{left:"calc(50% - 4px)"}:r==="start"?{left:"16px"}:r==="end"?{right:"16px"}:{},M=h.jsx(ma,{mode:"wait",children:m&&h.jsxs(h.Fragment,{children:[v&&h.jsx(pt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-999 bg-black/50 backdrop-blur-sm","data-testid":"popover-backdrop",onClick:()=>!c&&!l&&y(!1),"aria-hidden":"true"}),h.jsxs(pt.div,{ref:C,id:b,role:"dialog","aria-labelledby":p,"aria-modal":v,"data-state":m?"open":"closed","data-testid":"popover-content",initial:"initial",animate:"animate",exit:"exit",variants:T,transition:{duration:.2,ease:[.16,1,.3,1]},className:R(_T({side:n,align:r,size:o}),e),style:{position:"fixed",top:`${S.top}px`,left:`${S.left}px`,pointerEvents:"auto"},...d,children:[u&&h.jsx("div",{className:D(),style:N(),"aria-hidden":"true"}),t]})]})});return Fn.createPortal(h.jsx(w.Suspense,{fallback:null,children:M}),E)});Xm.displayName="PopoverContent";const Zm=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("div",{ref:r,"data-testid":"popover-header",className:R("flex items-center justify-between px-4 py-3 border-b border-(--atom-theme-border-primary)",e),...n,children:t}));Zm.displayName="PopoverHeader";const Qm=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("div",{ref:r,"data-testid":"popover-body",className:R("px-4 py-3",e),...n,children:t}));Qm.displayName="PopoverBody";const Jm=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("div",{ref:r,"data-testid":"popover-footer",className:R("flex items-center justify-end gap-2 px-4 py-3 border-t border-(--atom-theme-border-primary)",e),...n,children:t}));Jm.displayName="PopoverFooter";const eh=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("h3",{ref:r,"data-testid":"popover-title",className:R("text-lg font-semibold text-(--atom-text)",e),...n,children:t}));eh.displayName="PopoverTitle";const th=w.forwardRef(({className:e,children:t,...n},r)=>h.jsx("p",{ref:r,"data-testid":"popover-description",className:R("text-sm text-(--atom-text)",e),...n,children:t}));th.displayName="PopoverDescription";const nh=w.forwardRef(({className:e,children:t,onClick:n,asChild:r=!1,...o},s)=>{const{setOpen:a}=Sa(),i=l=>{a(!1),n?.(l)},c=r?Me:"button";return h.jsx(c,{ref:s,type:r?void 0:"button","data-testid":"popover-close",className:r?e:R("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--atom-primary)","disabled:pointer-events-none disabled:opacity-50","h-8 w-8",e),onClick:i,"aria-label":"Close popover",...o,children:t||h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[h.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})});nh.displayName="PopoverClose";const WT=te(["block w-full rounded-md outline-none leading-none","bg-[var(--atom-input-bg)] text-[var(--atom-input-fg)]","border border-[var(--atom-theme-border-primary)]","transition-[background-color,border-color,box-shadow,color] duration-150 ease-in-out","placeholder:text-[color-mix(in_srgb,var(--atom-input-fg)_55%,transparent)]","caret-[var(--atom-primary)]","selection:bg-[color-mix(in_srgb,var(--atom-primary)_30%,transparent)]","hover:bg-[color-mix(in_srgb,var(--atom-primary)_1%,transparent)]","hover:border-[color-mix(in_srgb,var(--atom-input-border)_70%,var(--atom-primary)_30%)]","focus-visible:border-[var(--atom-input-focus,var(--atom-primary))]","focus-visible:ring-1 focus-visible:ring-[color-mix(in_srgb,var(--atom-primary)_35%,transparent)]","focus-visible:ring-offset-0","disabled:opacity-60 disabled:cursor-not-allowed","disabled:hover:bg-[var(--atom-input-bg)] disabled:hover:border-[var(--atom-input-border)]","read-only:bg-[color-mix(in_srgb,var(--atom-input-bg)_90%,var(--atom-border)_10%)] read-only:cursor-default","read-only:hover:bg-[color-mix(in_srgb,var(--atom-input-bg)_90%,var(--atom-border)_10%)]","placeholder:text-muted-foreground [&:not(:placeholder-shown)]:border-[color-mix(in_srgb,var(--atom-theme-border-primary)_70%,var(--atom-primary))]focus-visible:border-[var(--atom-primary)]"].join(" "),{variants:{size:{sm:"h-9 px-3 text-sm",md:"h-10 px-3.5 text-sm",lg:"h-11 px-4 text-base"},tone:{default:"",invalid:"border-[var(--atom-error)] focus-visible:border-[var(--atom-error)]",success:"border-[var(--atom-success)]"},hasLeft:{true:"pl-9"},hasRight:{true:"pr-9"}},defaultVariants:{size:"md",tone:"default"}}),rh=g.forwardRef(({className:e,size:t,tone:n="default",leftIcon:r,rightIcon:o,hint:s,errorText:a,loading:i=!1,id:c,placeholder:l,label:u,required:d=!1,requiredText:f="This field is required",value:m,onBlur:y,...p},b)=>{const v=g.useId(),C=c??`inp_${v}`,[x,k]=g.useState(!1),S=!!r,T=!!o||i,D=a??(d&&x&&!a&&(m===""||m===void 0)?f:void 0),N=s?`${C}__hint`:void 0,M=D?`${C}__err`:void 0,j=[N,M].filter(Boolean).join(" ")||void 0,_=n==="invalid"||!!D;return h.jsxs("div",{className:"w-full",children:[u&&h.jsxs("label",{htmlFor:C,className:"mb-1 block text-sm font-medium text-[var(--atom-text)]",children:[u,d&&h.jsx("span",{className:"ml-0.5 text-[var(--atom-error)]",children:"*"})]}),h.jsxs("div",{className:"relative",children:[S&&h.jsx("span",{className:"pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 flex w-9 items-center justify-center",children:r}),T&&h.jsx("span",{className:"absolute right-0 top-1/2 -translate-y-1/2 flex w-9 items-center justify-center",children:i?h.jsxs("svg",{viewBox:"0 0 24 24",className:"animate-spin h-4 w-4",fill:"none",stroke:"currentColor",children:[h.jsx("circle",{cx:"12",cy:"12",r:"9",strokeOpacity:".2",strokeWidth:"3"}),h.jsx("path",{d:"M21 12a9 9 0 0 1-9 9",strokeWidth:"3",strokeLinecap:"round"})]}):o}),h.jsx("input",{ref:b,id:C,className:R(WT({size:t,tone:n,hasLeft:S,hasRight:T}),_&&"border-[var(--atom-error)]",e),value:m,placeholder:l??" ","aria-required":d||void 0,"aria-invalid":_||void 0,"aria-errormessage":M,"aria-describedby":j,onBlur:B=>{k(!0),y?.(B)},...p})]}),(s||D)&&h.jsxs("div",{className:"mt-1 text-xs leading-snug",children:[D&&h.jsx("p",{id:M,className:"text-[var(--atom-error)]",children:D}),s&&!D&&h.jsx("p",{id:N,className:"text-[var(--atom-text-muted)]",children:s})]})]})});rh.displayName="Input";var Ur="Switch",[BT]=wt(Ur),[$T,zT]=BT(Ur),oh=g.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:a,disabled:i,value:c="on",onCheckedChange:l,form:u,...d}=e,[f,m]=g.useState(null),y=xe(t,x=>m(x)),p=g.useRef(!1),b=f?u||!!f.closest("form"):!0,[v,C]=zn({prop:o,defaultProp:s??!1,onChange:l,caller:Ur});return h.jsxs($T,{scope:n,checked:v,disabled:i,children:[h.jsx(he.button,{type:"button",role:"switch","aria-checked":v,"aria-required":a,"data-state":ch(v),"data-disabled":i?"":void 0,disabled:i,value:c,...d,ref:y,onClick:ue(e.onClick,x=>{C(k=>!k),b&&(p.current=x.isPropagationStopped(),p.current||x.stopPropagation())})}),b&&h.jsx(ih,{control:f,bubbles:!p.current,name:r,value:c,checked:v,required:a,disabled:i,form:u,style:{transform:"translateX(-100%)"}})]})});oh.displayName=Ur;var sh="SwitchThumb",ah=g.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=zT(sh,n);return h.jsx(he.span,{"data-state":ch(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});ah.displayName=sh;var YT="SwitchBubbleInput",ih=g.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},s)=>{const a=g.useRef(null),i=xe(a,s),c=Xu(n),l=Rs(t);return g.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==n&&m){const y=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(y)}},[c,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ih.displayName=YT;function ch(e){return e?"checked":"unchecked"}var HT=oh,GT=ah;const lh=te(["relative inline-flex shrink-0 cursor-pointer items-center","rounded-full transition-colors","focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-[var(--atom-ring-color)]","disabled:cursor-not-allowed disabled:opacity-50border border-[var(--atom-theme-border-primary)] duration-300 ease-in-out focus-visible:ring-[var(--atom-ring-color)] focus-visible:ring-offset-2focus-visible:ring-offset-[var(--atom-ring-offset)] overflow-visible "].join(" "),{variants:{variant:{default:"bg-[color-mix(in_srgb,var(--atom-border)_40%,transparent)] data-[state=checked]:bg-[var(--atom-primary)] ",theme:"bg-[color-mix(in_srgb,var(--atom-border)_35%,transparent)] data-[state=checked]:bg-[var(--atom-primary)]"},size:{sm:"h-5 w-8 p-0.5",md:"h-6 w-11 p-1",lg:"h-7 w-14 p-1.5"},fullWidth:{true:"w-full",false:""}},defaultVariants:{variant:"default",size:"md",fullWidth:!1}}),uh={sm:{size:"h-3 w-3",translateX:14},md:{size:"h-4 w-4",translateX:20},lg:{size:"h-5 w-5",translateX:26}},UT=pt(GT),qT=({size:e=12})=>h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[h.jsx("circle",{cx:"12",cy:"12",r:"4",fill:"white"}),h.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),KT=({size:e=12})=>h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:h.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"})}),XT=({size:e=8})=>h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:h.jsx("path",{d:"M12 2l3 6.3 7 1-5 4.9 1.2 6.9L12 17.8l-6.2 3.3L7 14.1 2 9.3l7-1z"})}),dh=g.forwardRef(({className:e,variant:t,size:n,fullWidth:r,checked:o,onCheckedChange:s,...a},i)=>{const[c,l]=g.useState(o??!1),[u,d]=g.useState(!1),f=n??"md",m=uh[f],y=f==="sm"?10:f==="md"?12:14;g.useEffect(()=>{o!==void 0&&l(o)},[o]);const p=b=>{d(!0),setTimeout(()=>d(!1),250),l(b),s?.(b)};return h.jsxs(HT,{ref:i,"data-slot":"switch",className:R(lh({variant:t,size:f,fullWidth:r}),e),checked:c,onCheckedChange:p,...a,children:[t==="theme"&&h.jsx(ma,{mode:"wait",children:c?h.jsxs(h.Fragment,{children:[h.jsx(pt.div,{className:"absolute left-1 top-1/2 -translate-y-1/2 text-white/80",initial:{opacity:0,scale:.4},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},transition:{duration:.4,ease:"easeOut"},children:h.jsx(KT,{size:y})},"moon"),h.jsx(pt.div,{className:"absolute right-3 top-1 text-white/60",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,scale:0},transition:{duration:.3,delay:.1,ease:"easeOut"},children:h.jsx(XT,{})},"star")]}):h.jsx(pt.div,{className:"absolute right-1 top-1/2 -translate-y-1/2 text-amber-500",initial:{opacity:0,scale:.4,rotate:-180},animate:{opacity:1,scale:1,rotate:0},exit:{opacity:0,scale:0,rotate:180},transition:{duration:.4,ease:"easeOut"},children:h.jsx(qT,{size:y})},"sun")}),h.jsx(UT,{"data-slot":"switch-thumb",className:R(m.size,"block rounded-full bg-white relative z-10 "),animate:{x:c?m.translateX:0,scaleX:u?[1,1.3,1]:1,scaleY:u?[1,.9,1]:1},transition:{x:{type:"spring",stiffness:500,damping:30},scaleX:{duration:.3,ease:"easeInOut"},scaleY:{duration:.3,ease:"easeInOut"}}})]})});dh.displayName="Switch";exports.Avatar=sl;exports.Badge=Ap;exports.Button=hs;exports.Calendar=zy;exports.Card=Ll;exports.CardBody=zl;exports.CardFooter=Yl;exports.CardHeader=Wl;exports.CardMedia=Hl;exports.CardSubtitle=$l;exports.CardTitle=Bl;exports.Checkbox=Gl;exports.ContentCard=Ul;exports.DataTable=Yw;exports.Dialog=Fx;exports.DialogBody=Mu;exports.DialogContent=Eu;exports.DialogDescription=Au;exports.DialogFooter=Ru;exports.DialogHeader=Pu;exports.DialogOverlay=Ms;exports.DialogPortal=Ps;exports.DialogTitle=Nu;exports.DialogTrigger=Lx;exports.Drawer=Ou;exports.DrawerBody=Vu;exports.DrawerClose=Lu;exports.DrawerDescription=Iu;exports.DrawerFooter=Fu;exports.DrawerHeader=ju;exports.DrawerTitle=_u;exports.Dropdown=Wm;exports.DropdownContent=$m;exports.DropdownGroup=Gm;exports.DropdownItem=zm;exports.DropdownLabel=Hm;exports.DropdownSeparator=Ym;exports.DropdownTrigger=Bm;exports.Heading=Wu;exports.Input=rh;exports.NumberInput=rf;exports.Paper=Bu;exports.Popover=qm;exports.PopoverBody=Qm;exports.PopoverClose=nh;exports.PopoverContent=Xm;exports.PopoverDescription=th;exports.PopoverFooter=Jm;exports.PopoverHeader=Zm;exports.PopoverTitle=eh;exports.PopoverTrigger=Km;exports.ProgressBar=$u;exports.Radio=ld;exports.RadioDescription=fd;exports.RadioGroup=md;exports.RadioLabel=ud;exports.RadioOption=dd;exports.StatCardA=hd;exports.StatCardB=pd;exports.StatCardC=gd;exports.Switch=dh;exports.TabContent=wd;exports.TabTrigger=xd;exports.Tabs=yd;exports.TabsList=vd;exports.Text=Cd;exports.TextArea=kd;exports.Tooltip=nf;exports.avatarVariants=ol;exports.badgeVariants=rl;exports.switchVariants=lh;exports.thumbConfig=uh;
|
|
69
69
|
//# sourceMappingURL=index.cjs.map
|