@moontra/moonui 2.3.2 → 2.3.4

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.
@@ -14,7 +14,7 @@ Error generating stack: `+a.message+`
14
14
  ${p}px !important;
15
15
  top: ${c}px !important;
16
16
  }
17
- `),()=>{m.contains(h)&&m.removeChild(h)}},[t]),(0,PM.jsx)(iC,{isPresent:t,childRef:a,sizeRef:i,children:Kg.cloneElement(e,{ref:a})})}var MM=({children:e,initial:t,isPresent:r,onExitComplete:o,custom:n,presenceAffectsLayout:a,mode:i,anchorX:s,root:l})=>{let u=Un(Sj),c=(0,zf.useId)(),d=!0,f=(0,zf.useMemo)(()=>(d=!1,{id:c,initial:t,isPresent:r,custom:n,onExitComplete:p=>{u.set(p,!0);for(let h of u.values())if(!h)return;o&&o()},register:p=>(u.set(p,!1),()=>u.delete(p))}),[r,u,o]);return a&&d&&(f={...f}),(0,zf.useMemo)(()=>{u.forEach((p,h)=>u.set(h,!1))},[r]),kM.useEffect(()=>{!r&&!u.size&&o&&o()},[r]),i==="popLayout"&&(e=(0,sC.jsx)(TM,{isPresent:r,anchorX:s,root:l,children:e})),(0,sC.jsx)(xi.Provider,{value:f,children:e})};function Sj(){return new Map}var Pi=R(A(),1);function Xg(e=!0){let t=(0,Pi.useContext)(xi);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:o,register:n}=t,a=(0,Pi.useId)();(0,Pi.useEffect)(()=>{if(e)return n(a)},[e]);let i=(0,Pi.useCallback)(()=>e&&o&&o(a),[a,o,e]);return!r&&o?[!1,i]:[!0]}var Yg=R(A(),1),Wf=e=>e.key||"";function lC(e){let t=[];return Yg.Children.forEach(e,r=>{(0,Yg.isValidElement)(r)&&t.push(r)}),t}var fn=({children:e,custom:t,initial:r=!0,onExitComplete:o,presenceAffectsLayout:n=!0,mode:a="sync",propagate:i=!1,anchorX:s="left",root:l})=>{let[u,c]=Xg(i),d=(0,Gn.useMemo)(()=>lC(e),[e]),f=i&&!u?[]:d.map(Wf),p=(0,Gn.useRef)(!0),h=(0,Gn.useRef)(d),m=Un(()=>new Map),[x,v]=(0,Gn.useState)(d),[g,y]=(0,Gn.useState)(d);wu(()=>{p.current=!1,h.current=d;for(let b=0;b<g.length;b++){let S=Wf(g[b]);f.includes(S)?m.delete(S):m.get(S)!==!0&&m.set(S,!1)}},[g,f.length,f.join("-")]);let w=[];if(d!==x){let b=[...d];for(let S=0;S<g.length;S++){let L=g[S],T=Wf(L);f.includes(T)||(b.splice(S,0,L),w.push(L))}return a==="wait"&&w.length&&(b=w),y(lC(b)),v(d),null}let{forceRender:C}=(0,Gn.useContext)(yu);return(0,Gf.jsx)(Gf.Fragment,{children:g.map(b=>{let S=Wf(b),L=i&&!u?!1:d===g||f.includes(S),T=()=>{if(m.has(S))m.set(S,!0);else return;let P=!0;m.forEach(_=>{_||(P=!1)}),P&&(C?.(),y(h.current),i&&c?.(),o&&o())};return(0,Gf.jsx)(MM,{isPresent:L,initial:!p.current||r?void 0:!1,custom:t,presenceAffectsLayout:n,mode:a,root:l,onExitComplete:L?void 0:T,anchorX:s,children:b},S)})})};var EM=R(A(),1),Qg=(0,EM.createContext)({strict:!1});var AM={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"]},Sa={};for(let e in AM)Sa[e]={isEnabled:t=>AM[e].some(r=>!!t[r])};function DM(e){for(let t in e)Sa[t]={...Sa[t],...e[t]}}var bj=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 jf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bj.has(e)}var NM=e=>!jf(e);function Rj(e){typeof e=="function"&&(NM=t=>t.startsWith("on")?!jf(t):e(t))}try{Rj(vU("@emotion/is-prop-valid").default)}catch{}function _M(e,t,r){let o={};for(let n in e)n==="values"&&typeof e.values=="object"||(NM(n)||r===!0&&jf(n)||!t&&!jf(n)||e.draggable&&n.startsWith("onDrag"))&&(o[n]=e[n]);return o}var uh=R(E(),1);var Fu=R(A(),1);var OM=R(A(),1),Ti=(0,OM.createContext)({});var eh=R(A(),1);function ki(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ba(e){return typeof e=="string"||Array.isArray(e)}var Zg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qf=["initial",...Zg];function js(e){return ki(e.animate)||qf.some(t=>ba(e[t]))}function Jg(e){return!!(js(e)||e.variants)}function FM(e,t){if(js(e)){let{initial:r,animate:o}=e;return{initial:r===!1||ba(r)?r:void 0,animate:ba(o)?o:void 0}}return e.inherit!==!1?t:{}}function BM(e){let{initial:t,animate:r}=FM(e,(0,eh.useContext)(Ti));return(0,eh.useMemo)(()=>({initial:t,animate:r}),[VM(t),VM(r)])}function VM(e){return Array.isArray(e)?e.join(" "):e}var Au=R(A(),1);var zM=R(A(),1);var qs={};function HM(e){for(let t in e)qs[t]=e[t],As(t)&&(qs[t].isCSSVariable=!0)}function th(e,{layout:t,layoutId:r}){return po.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!qs[e]||e==="opacity")}var Lj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ij=dn.length;function UM(e,t,r){let o="",n=!0;for(let a=0;a<Ij;a++){let i=dn[a],s=e[i];if(s===void 0)continue;let l=!0;if(typeof s=="number"?l=s===(i.startsWith("scale")?1:0):l=parseFloat(s)===0,!l||r){let u=Bf(s,Hs[i]);if(!l){n=!1;let c=Lj[i]||i;o+=`${c}(${u}) `}r&&(t[i]=u)}}return o=o.trim(),r?o=r(t,n?"":o):n&&(o="none"),o}function ku(e,t,r){let{style:o,vars:n,transformOrigin:a}=e,i=!1,s=!1;for(let l in t){let u=t[l];if(po.has(l)){i=!0;continue}else if(As(l)){n[l]=u;continue}else{let c=Bf(u,Hs[l]);l.startsWith("origin")?(s=!0,a[l]=c):o[l]=c}}if(t.transform||(i||r?o.transform=UM(t,e.transform,r):o.transform&&(o.transform="none")),s){let{originX:l="50%",originY:u="50%",originZ:c=0}=a;o.transformOrigin=`${l} ${u} ${c}`}}var Mu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function uC(e,t,r){for(let o in t)!Ee(t[o])&&!th(o,r)&&(e[o]=t[o])}function Pj({transformTemplate:e},t){return(0,zM.useMemo)(()=>{let r=Mu();return ku(r,t,e),Object.assign({},r.vars,r.style)},[t])}function Tj(e,t){let r=e.style||{},o={};return uC(o,r,e),Object.assign(o,Pj(e,t)),o}function WM(e,t){let r={},o=Tj(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}var jM=R(A(),1);var kj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Mj={offset:"strokeDashoffset",array:"strokeDasharray"};function GM(e,t,r=1,o=0,n=!0){e.pathLength=1;let a=n?kj:Mj;e[a.offset]=oe.transform(-o);let i=oe.transform(t),s=oe.transform(r);e[a.array]=`${i} ${s}`}function rh(e,{attrX:t,attrY:r,attrScale:o,pathLength:n,pathSpacing:a=1,pathOffset:i=0,...s},l,u,c){if(ku(e,s,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{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=c?.transformBox??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),r!==void 0&&(d.y=r),o!==void 0&&(d.scale=o),n!==void 0&&GM(d,n,a,i,!1)}var oh=()=>({...Mu(),attrs:{}});var nh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function qM(e,t,r,o){let n=(0,jM.useMemo)(()=>{let a=oh();return rh(a,t,nh(o),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){let a={};uC(a,e.style,e),n.style={...a,...n.style}}return n}var $M=["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 Eu(e){return typeof e!="string"||e.includes("-")?!1:!!($M.indexOf(e)>-1||/[A-Z]/u.test(e))}function KM(e,t,r,{latestValues:o},n,a=!1){let s=(Eu(e)?qM:WM)(t,o,n,e),l=_M(t,typeof e=="string",a),u=e!==Au.Fragment?{...l,...s,ref:r}:{},{children:c}=t,d=(0,Au.useMemo)(()=>Ee(c)?c.get():c,[c]);return(0,Au.createElement)(e,{...u,children:d})}var cC=R(A(),1);function XM(e){let t=[{},{}];return e?.values.forEach((r,o)=>{t[0][o]=r.get(),t[1][o]=r.getVelocity()}),t}function Du(e,t,r,o){if(typeof t=="function"){let[n,a]=XM(o);t=t(r!==void 0?r:e.custom,n,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[n,a]=XM(o);t=t(r!==void 0?r:e.custom,n,a)}return t}function Nu(e){return Ee(e)?e.get():e}function Ej({scrapeMotionValuesFromProps:e,createRenderState:t},r,o,n){return{latestValues:Aj(r,o,n,e),renderState:t()}}function Aj(e,t,r,o){let n={},a=o(e,{});for(let f in a)n[f]=Nu(a[f]);let{initial:i,animate:s}=e,l=js(e),u=Jg(e);t&&u&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),s===void 0&&(s=t.animate));let c=r?r.initial===!1:!1;c=c||i===!1;let d=c?s:i;if(d&&typeof d!="boolean"&&!ki(d)){let f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){let h=Du(e,f[p]);if(h){let{transitionEnd:m,transition:x,...v}=h;for(let g in v){let y=v[g];if(Array.isArray(y)){let w=c?y.length-1:0;y=y[w]}y!==null&&(n[g]=y)}for(let g in m)n[g]=m[g]}}}return n}var ah=e=>(t,r)=>{let o=(0,cC.useContext)(Ti),n=(0,cC.useContext)(xi),a=()=>Ej(e,t,o,n);return r?a():Un(a)};function _u(e,t,r){let{style:o}=e,n={};for(let a in o)(Ee(o[a])||t.style&&Ee(t.style[a])||th(a,e)||r?.getValue(a)?.liveStyle!==void 0)&&(n[a]=o[a]);return n}var YM=ah({scrapeMotionValuesFromProps:_u,createRenderState:Mu});function ih(e,t,r){let o=_u(e,t,r);for(let n in e)if(Ee(e[n])||Ee(t[n])){let a=dn.indexOf(n)!==-1?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n;o[a]=e[n]}return o}var QM=ah({scrapeMotionValuesFromProps:ih,createRenderState:oh});var ZM=Symbol.for("motionComponentSymbol");var JM=R(A(),1);function Ra(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function eE(e,t,r){return(0,JM.useCallback)(o=>{o&&e.onMount&&e.onMount(o),t&&(o?t.mount(o):t.unmount()),r&&(typeof r=="function"?r(o):Ra(r)&&(r.current=o))},[t])}var Yr=R(A(),1);var Ou=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var Dj="framerAppearId",sh="data-"+Ou(Dj);var tE=R(A(),1),lh=(0,tE.createContext)({});function rE(e,t,r,o,n){let{visualElement:a}=(0,Yr.useContext)(Ti),i=(0,Yr.useContext)(Qg),s=(0,Yr.useContext)(xi),l=(0,Yr.useContext)(Ii).reducedMotion,u=(0,Yr.useRef)(null);o=o||i.renderer,!u.current&&o&&(u.current=o(e,{visualState:t,parent:a,props:r,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:l}));let c=u.current,d=(0,Yr.useContext)(lh);c&&!c.projection&&n&&(c.type==="html"||c.type==="svg")&&Nj(u.current,r,n,d);let f=(0,Yr.useRef)(!1);(0,Yr.useInsertionEffect)(()=>{c&&f.current&&c.update(r,s)});let p=r[sh],h=(0,Yr.useRef)(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return wu(()=>{c&&(f.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),c.scheduleRenderMicrotask(),h.current&&c.animationState&&c.animationState.animateChanges())}),(0,Yr.useEffect)(()=>{c&&(!h.current&&c.animationState&&c.animationState.animateChanges(),h.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),h.current=!1),c.enteringChildren=void 0)}),c}function Nj(e,t,r,o){let{layoutId:n,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:oE(e.parent)),e.projection.setOptions({layoutId:n,layout:a,alwaysMeasureLayout:!!i||s&&Ra(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:o,crossfade:c,layoutScroll:l,layoutRoot:u})}function oE(e){if(e)return e.options.allowProjection!==!1?e.projection:oE(e.parent)}function ch(e,{forwardMotionProps:t=!1}={},r,o){r&&DM(r);let n=Eu(e)?QM:YM;function a(s,l){let u,c={...(0,Fu.useContext)(Ii),...s,layoutId:_j(s)},{isStatic:d}=c,f=BM(s),p=n(s,d);if(!d&&xu){Oj(c,r);let h=Fj(c);u=h.MeasureLayout,f.visualElement=rE(e,p,c,o,h.ProjectionNode)}return(0,uh.jsxs)(Ti.Provider,{value:f,children:[u&&f.visualElement?(0,uh.jsx)(u,{visualElement:f.visualElement,...c}):null,KM(e,s,eE(p,f.visualElement,l),p,d,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;let i=(0,Fu.forwardRef)(a);return i[ZM]=e,i}function _j({layoutId:e}){let t=(0,Fu.useContext)(yu).id;return t&&e!==void 0?t+"-"+e:e}function Oj(e,t){let r=(0,Fu.useContext)(Qg).strict}function Fj(e){let{drag:t,layout:r}=Sa;if(!t&&!r)return{};let o={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function nE(e,t){if(typeof Proxy>"u")return ch;let r=new Map,o=(a,i)=>ch(a,i,e,t),n=(a,i)=>o(a,i);return new Proxy(n,{get:(a,i)=>i==="create"?o:(r.has(i)||r.set(i,ch(i,void 0,e,t)),r.get(i))})}var wE=R(A(),1);function dh({top:e,left:t,right:r,bottom:o}){return{x:{min:t,max:r},y:{min:e,max:o}}}function aE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iE(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:o.y,right:o.x}}function dC(e){return e===void 0||e===1}function fh({scale:e,scaleX:t,scaleY:r}){return!dC(e)||!dC(t)||!dC(r)}function La(e){return fh(e)||fC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function fC(e){return sE(e.x)||sE(e.y)}function sE(e){return e&&e!=="0%"}function $f(e,t,r){let o=e-r,n=t*o;return r+n}function lE(e,t,r,o,n){return n!==void 0&&(e=$f(e,n,o)),$f(e,r,o)+t}function pC(e,t=0,r=1,o,n){e.min=lE(e.min,t,r,o,n),e.max=lE(e.max,t,r,o,n)}function mC(e,{x:t,y:r}){pC(e.x,t.translate,t.scale,t.originPoint),pC(e.y,r.translate,r.scale,r.originPoint)}var uE=.999999999999,cE=1.0000000000001;function fE(e,t,r,o=!1){let n=r.length;if(!n)return;t.x=t.y=1;let a,i;for(let s=0;s<n;s++){a=r[s],i=a.projectionDelta;let{visualElement:l}=a.options;l&&l.props.style&&l.props.style.display==="contents"||(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&$s(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,mC(e,i)),o&&La(a.latestValues)&&$s(e,a.latestValues))}t.x<cE&&t.x>uE&&(t.x=1),t.y<cE&&t.y>uE&&(t.y=1)}function Mi(e,t){e.min=e.min+t,e.max=e.max+t}function dE(e,t,r,o,n=.5){let a=be(e.min,e.max,n);pC(e,t,r,a,o)}function $s(e,t){dE(e.x,t.x,t.scaleX,t.scale,t.originX),dE(e.y,t.y,t.scaleY,t.scale,t.originY)}function gC(e,t){return dh(iE(e.getBoundingClientRect(),t))}function pE(e,t,r){let o=gC(e,r),{scroll:n}=t;return n&&(Mi(o.x,n.offset.x),Mi(o.y,n.offset.y)),o}var mE=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ks=()=>({x:mE(),y:mE()}),gE=()=>({min:0,max:0}),We=()=>({x:gE(),y:gE()});var Kf={current:null},ph={current:!1};function hE(){if(ph.current=!0,!!xu)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Kf.current=e.matches;e.addEventListener("change",t),t()}else Kf.current=!1}var Ei=new WeakMap;function vE(e,t,r){for(let o in t){let n=t[o],a=r[o];if(Ee(n))e.addValue(o,n);else if(Ee(a))e.addValue(o,Xr(n,{owner:e}));else if(a!==n)if(e.hasValue(o)){let i=e.getValue(o);i.liveStyle===!0?i.jump(n):i.hasAnimated||i.set(n)}else{let i=e.getStaticValue(o);e.addValue(o,Xr(i!==void 0?i:n,{owner:e}))}}for(let o in r)t[o]===void 0&&e.removeValue(o);return t}var yE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Vu=class{scrapeMotionValuesFromProps(t,r,o){return{}}constructor({parent:t,props:r,presenceContext:o,reducedMotionConfig:n,blockInitialAnimation:a,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=wa,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=()=>{let f=xt.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,we.render(this.render,!1,!0))};let{latestValues:l,renderState:u}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=r,this.presenceContext=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=js(r),this.isVariantNode=Jg(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...d}=this.scrapeMotionValuesFromProps(r,{},this);for(let f in d){let p=d[f];l[f]!==void 0&&Ee(p)&&p.set(l[f])}}mount(t){this.current=t,Ei.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((r,o)=>this.bindToMotionValue(o,r)),ph.current||hE(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Kf.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),dr(this.notifyUpdate),dr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let r=this.features[t];r&&(r.unmount(),r.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,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let o=po.has(t);o&&this.onBindTransform&&this.onBindTransform();let n=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&we.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{n(),a&&a(),r.owner&&r.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 Sa){let r=Sa[t];if(!r)continue;let{isEnabled:o,Feature:n}=r;if(!this.features[t]&&n&&o(this.props)&&(this.features[t]=new n(this)),this.features[t]){let a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):We()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let o=0;o<yE.length;o++){let n=yE[o];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let a="on"+n,i=t[a];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=vE(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){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let o=this.values.get(t);r!==o&&(o&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let o=this.values.get(t);return o===void 0&&r!==void 0&&(o=Xr(r===null?void 0:r,{owner:this}),this.addValue(t,o)),o}readValue(t,r){let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(sf(o)||uf(o))?o=parseFloat(o):!aC(o)&&pr.test(r)&&(o=Of(t,r)),this.setBaseTarget(t,Ee(o)?o.get():o)),Ee(o)?o.get():o}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let a=Du(this.props,r,this.presenceContext?.custom);a&&(o=a[t])}if(r&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!Ee(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new ha),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){zs.render(this.render)}};var Bu=class extends Vu{constructor(){super(...arguments),this.KeyframeResolver=Ff}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:o}){delete r[t],delete o[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Ee(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};function mh(e,{style:t,vars:r},o,n){let a=e.style,i;for(i in t)a[i]=t[i];n?.applyProjectionStyles(a,o);for(i in r)a.setProperty(i,r[i])}function Vj(e){return window.getComputedStyle(e)}var Hu=class extends Bu{constructor(){super(...arguments),this.type="html",this.renderInstance=mh}readValueFromInstance(t,r){if(po.has(r))return this.projection?.isProjecting?kf(r):Hw(t,r);{let o=Vj(t),n=(As(r)?o.getPropertyValue(r):o[r])||0;return typeof n=="string"?n.trim():n}}measureInstanceViewportBox(t,{transformPagePoint:r}){return gC(t,r)}build(t,r,o){ku(t,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,r,o){return _u(t,r,o)}};var gh=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 xE(e,t,r,o){mh(e,t,void 0,o);for(let n in t.attrs)e.setAttribute(gh.has(n)?n:Ou(n),t.attrs[n])}var Uu=class extends Bu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=We}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(po.has(r)){let o=_f(r);return o&&o.default||0}return r=gh.has(r)?r:Ou(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,o){return ih(t,r,o)}build(t,r,o){rh(t,r,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(t,r,o,n){xE(t,r,o,n)}mount(t){this.isSVGTag=nh(t.tagName),super.mount(t)}};var CE=(e,t)=>Eu(e)?new Uu(t):new Hu(t,{allowProjection:e!==wE.Fragment});function jn(e,t,r){let o=e.getProps();return Du(o,t,r!==void 0?r:o.custom,e)}var Xf=e=>Array.isArray(e);function Bj(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Xr(r))}function Hj(e){return Xf(e)?e[e.length-1]||0:e}function SE(e,t){let r=jn(e,t),{transitionEnd:o={},transition:n={},...a}=r||{};a={...a,...o};for(let i in a){let s=Hj(a[i]);Bj(e,i,s)}}function bE(e){return!!(Ee(e)&&e.add)}function Yf(e,t){let r=e.getValue("willChange");if(bE(r))return r.add(t);if(!r&&cr.WillChange){let o=new cr.WillChange("auto");e.addValue("willChange",o),o.add(t)}}function hh(e){return e.props[sh]}var Uj=e=>e!==null;function RE(e,{repeat:t,repeatType:r="loop"},o){let n=e.filter(Uj),a=t&&r!=="loop"&&t%2===1?0:n.length-1;return!a||o===void 0?n[a]:o}var zj={type:"spring",stiffness:500,damping:25,restSpeed:10},Wj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Gj={type:"keyframes",duration:.8},jj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LE=(e,{keyframes:t})=>t.length>2?Gj:po.has(e)?e.startsWith("scale")?Wj(t[1]):zj:jj;function IE({when:e,delay:t,delayChildren:r,staggerChildren:o,staggerDirection:n,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}var zu=(e,t,r,o={},n,a)=>i=>{let s=Bs(o,e)||{},l=s.delay||o.delay||0,{elapsed:u=0}=o;u=u-St(l);let c={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:n};IE(s)||Object.assign(c,LE(e,c)),c.duration&&(c.duration=St(c.duration)),c.repeatDelay&&(c.repeatDelay=St(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Pu(c),c.delay===0&&(d=!0)),(cr.instantAnimations||cr.skipAnimations)&&(d=!0,Pu(c),c.delay=0),c.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let f=RE(c.keyframes,s);if(f!==void 0){we.update(()=>{c.onUpdate(f),c.onComplete()});return}}return s.isSync?new xa(c):new Ef(c)};function qj({protectedKeys:e,needsAnimating:t},r){let o=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,o}function Wu(e,t,{delay:r=0,transitionOverride:o,type:n}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:i,...s}=t;o&&(a=o);let l=[],u=n&&e.animationState&&e.animationState.getState()[n];for(let c in s){let d=e.getValue(c,e.latestValues[c]??null),f=s[c];if(f===void 0||u&&qj(u,c))continue;let p={delay:r,...Bs(a||{},c)},h=d.get();if(h!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===h&&!p.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){let v=hh(e);if(v){let g=window.MotionHandoffAnimation(v,c,we);g!==null&&(p.startTime=g,m=!0)}}Yf(e,c),d.start(zu(c,d,f,e.shouldReduceMotion&&Df.has(c)?{type:!1}:p,e,m));let x=d.animation;x&&l.push(x)}return i&&Promise.all(l).then(()=>{we.update(()=>{i&&SE(e,i)})}),l}function vh(e,t,r,o=0,n=1){let a=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),i=e.size,s=(i-1)*o;return typeof r=="function"?r(a,i):n===1?a*o:s-a*o}function yh(e,t,r={}){let o=jn(e,t,r.type==="exit"?e.presenceContext?.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(n=r.transitionOverride);let a=o?()=>Promise.all(Wu(e,o,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{let{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=n;return $j(e,t,l,u,c,d,r)}:()=>Promise.resolve(),{when:s}=n;if(s){let[l,u]=s==="beforeChildren"?[a,i]:[i,a];return l().then(()=>u())}else return Promise.all([a(),i(r.delay)])}function $j(e,t,r=0,o=0,n=0,a=1,i){let s=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),s.push(yh(l,t,{...i,delay:r+(typeof o=="function"?0:o)+vh(e.variantChildren,l,o,n,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}function PE(e,t,r={}){e.notify("AnimationStart",t);let o;if(Array.isArray(t)){let n=t.map(a=>yh(e,a,r));o=Promise.all(n)}else if(typeof t=="string")o=yh(e,t,r);else{let n=typeof t=="function"?jn(e,t,r.custom):t;o=Promise.all(Wu(e,n,r))}return o.then(()=>{e.notify("AnimationComplete",t)})}function hC(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let o=0;o<r;o++)if(t[o]!==e[o])return!1;return!0}var Kj=qf.length;function vC(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?vC(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<Kj;r++){let o=qf[r],n=e.props[o];(ba(n)||n===!1)&&(t[o]=n)}return t}var Xj=[...Zg].reverse(),Yj=Zg.length;function Qj(e){return t=>Promise.all(t.map(({animation:r,options:o})=>PE(e,r,o)))}function kE(e){let t=Qj(e),r=TE(),o=!0,n=l=>(u,c)=>{let d=jn(e,c,l==="exit"?e.presenceContext?.custom:void 0);if(d){let{transition:f,transitionEnd:p,...h}=d;u={...u,...h,...p}}return u};function a(l){t=l(e)}function i(l){let{props:u}=e,c=vC(e.parent)||{},d=[],f=new Set,p={},h=1/0;for(let x=0;x<Yj;x++){let v=Xj[x],g=r[v],y=u[v]!==void 0?u[v]:c[v],w=ba(y),C=v===l?g.isActive:null;C===!1&&(h=x);let b=y===c[v]&&y!==u[v]&&w;if(b&&o&&e.manuallyAnimateOnMount&&(b=!1),g.protectedKeys={...p},!g.isActive&&C===null||!y&&!g.prevProp||ki(y)||typeof y=="boolean")continue;let S=Zj(g.prevProp,y),L=S||v===l&&g.isActive&&!b&&w||x>h&&w,T=!1,P=Array.isArray(y)?y:[y],_=P.reduce(n(v),{});C===!1&&(_={});let{prevResolvedValues:F={}}=g,j={...F,..._},D=z=>{L=!0,f.has(z)&&(T=!0,f.delete(z)),g.needsAnimating[z]=!0;let V=e.getValue(z);V&&(V.liveStyle=!1)};for(let z in j){let V=_[z],k=F[z];if(p.hasOwnProperty(z))continue;let K=!1;Xf(V)&&Xf(k)?K=!hC(V,k):K=V!==k,K?V!=null?D(z):f.add(z):V!==void 0&&f.has(z)?D(z):g.protectedKeys[z]=!0}g.prevProp=y,g.prevResolvedValues=_,g.isActive&&(p={...p,..._}),o&&e.blockInitialAnimation&&(L=!1);let W=b&&S;L&&(!W||T)&&d.push(...P.map(z=>{let V={type:v};if(typeof z=="string"&&o&&!W&&e.manuallyAnimateOnMount&&e.parent){let{parent:k}=e,K=jn(k,z);if(k.enteringChildren&&K){let{delayChildren:de}=K.transition||{};V.delay=vh(k.enteringChildren,e,de)}}return{animation:z,options:V}}))}if(f.size){let x={};if(typeof u.initial!="boolean"){let v=jn(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(x.transition=v.transition)}f.forEach(v=>{let g=e.getBaseTarget(v),y=e.getValue(v);y&&(y.liveStyle=!0),x[v]=g??null}),d.push({animation:x})}let m=!!d.length;return o&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(m=!1),o=!1,m?t(d):Promise.resolve()}function s(l,u){if(r[l].isActive===u)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(l,u)),r[l].isActive=u;let c=i(l);for(let d in r)r[d].protectedKeys={};return c}return{animateChanges:i,setActive:s,setAnimateFunction:a,getState:()=>r,reset:()=>{r=TE(),o=!0}}}function Zj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function Xs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function TE(){return{animate:Xs(!0),whileInView:Xs(),whileHover:Xs(),whileTap:Xs(),whileDrag:Xs(),whileFocus:Xs(),exit:Xs()}}var zt=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var xh=class extends zt{constructor(t){super(t),t.animationState||(t.animationState=kE(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();ki(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};var Jj=0,wh=class extends zt{constructor(){super(...arguments),this.id=Jj++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;let n=this.node.animationState.setActive("exit",!t);r&&!t&&n.then(()=>{r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var ME={animation:{Feature:xh},exit:{Feature:wh}};function Ia(e,t,r,o={passive:!0}){return e.addEventListener(t,r,o),()=>e.removeEventListener(t,r)}function Pa(e){return{point:{x:e.pageX,y:e.pageY}}}var EE=e=>t=>Ws(t)&&e(t,Pa(t));function Ai(e,t,r,o){return Ia(e,t,EE(r),o)}var _E=1e-4,eq=1-_E,tq=1+_E,OE=.01,rq=0-OE,oq=0+OE;function Dt(e){return e.max-e.min}function FE(e,t,r){return Math.abs(e-t)<=r}function AE(e,t,r,o=.5){e.origin=o,e.originPoint=be(t.min,t.max,e.origin),e.scale=Dt(r)/Dt(t),e.translate=be(r.min,r.max,e.origin)-e.originPoint,(e.scale>=eq&&e.scale<=tq||isNaN(e.scale))&&(e.scale=1),(e.translate>=rq&&e.translate<=oq||isNaN(e.translate))&&(e.translate=0)}function Gu(e,t,r,o){AE(e.x,t.x,r.x,o?o.originX:void 0),AE(e.y,t.y,r.y,o?o.originY:void 0)}function DE(e,t,r){e.min=r.min+t.min,e.max=e.min+Dt(t)}function VE(e,t,r){DE(e.x,t.x,r.x),DE(e.y,t.y,r.y)}function NE(e,t,r){e.min=t.min-r.min,e.max=e.min+Dt(t)}function ju(e,t,r){NE(e.x,t.x,r.x),NE(e.y,t.y,r.y)}function Qr(e){return[e("x"),e("y")]}var Ch=({current:e})=>e?e.ownerDocument.defaultView:null;var BE=(e,t)=>Math.abs(e-t);function HE(e,t){let r=BE(e.x,t.x),o=BE(e.y,t.y);return Math.sqrt(r**2+o**2)}var qu=class{constructor(t,r,{transformPagePoint:o,contextWindow:n=window,dragSnapToOrigin:a=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let f=xC(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=HE(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!h)return;let{point:m}=f,{timestamp:x}=yt;this.history.push({...m,timestamp:x});let{onStart:v,onMove:g}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=yC(p,this.transformPagePoint),we.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();let{onEnd:h,onSessionEnd:m,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let v=xC(f.type==="pointercancel"?this.lastMoveEventInfo:yC(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,v),m&&m(f,v)},!Ws(t))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=o,this.distanceThreshold=i,this.contextWindow=n||window;let s=Pa(t),l=yC(s,this.transformPagePoint),{point:u}=l,{timestamp:c}=yt;this.history=[{...u,timestamp:c}];let{onSessionStart:d}=r;d&&d(t,xC(l,this.history)),this.removeListeners=ln(Ai(this.contextWindow,"pointermove",this.handlePointerMove),Ai(this.contextWindow,"pointerup",this.handlePointerUp),Ai(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),dr(this.updatePoint)}};function yC(e,t){return t?{point:t(e.point)}:e}function UE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xC({point:e},t){return{point:e,delta:UE(e,zE(t)),offset:UE(e,nq(t)),velocity:aq(t,.1)}}function nq(e){return e[0]}function zE(e){return e[e.length-1]}function aq(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,o=null,n=zE(e);for(;r>=0&&(o=e[r],!(n.timestamp-o.timestamp>St(t)));)r--;if(!o)return{x:0,y:0};let a=Jt(n.timestamp-o.timestamp);if(a===0)return{x:0,y:0};let i={x:(n.x-o.x)/a,y:(n.y-o.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function $E(e,{min:t,max:r},o){return t!==void 0&&e<t?e=o?be(t,e,o.min):Math.max(e,t):r!==void 0&&e>r&&(e=o?be(r,e,o.max):Math.min(e,r)),e}function WE(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function KE(e,{top:t,left:r,bottom:o,right:n}){return{x:WE(e.x,r,n),y:WE(e.y,t,o)}}function GE(e,t){let r=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,o]=[o,r]),{min:r,max:o}}function XE(e,t){return{x:GE(e.x,t.x),y:GE(e.y,t.y)}}function YE(e,t){let r=.5,o=Dt(e),n=Dt(t);return n>o?r=Eo(t.min,t.max-o,e.min):o>n&&(r=Eo(e.min,e.max-n,t.min)),Ut(0,1,r)}function QE(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var Sh=.35;function ZE(e=Sh){return e===!1?e=0:e===!0&&(e=Sh),{x:jE(e,"left","right"),y:jE(e,"top","bottom")}}function jE(e,t,r){return{min:qE(e,t),max:qE(e,r)}}function qE(e,t){return typeof e=="number"?e:e[t]||0}var iq=new WeakMap,Rh=class{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=We(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:o}={}){let{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;let a=d=>{let{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Pa(d).point)},i=(d,f)=>{let{drag:p,dragPropagation:h,onDragStart:m}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Jw(p),!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),Qr(v=>{let g=this.getAxisMotionValue(v).get()||0;if(fr.test(g)){let{projection:y}=this.visualElement;if(y&&y.layout){let w=y.layout.layoutBox[v];w&&(g=Dt(w)*(parseFloat(g)/100))}}this.originPoint[v]=g}),m&&we.postRender(()=>m(d,f)),Yf(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},s=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;let{dragPropagation:p,dragDirectionLock:h,onDirectionLock:m,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;let{offset:v}=f;if(h&&this.currentDirection===null){this.currentDirection=sq(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),x&&x(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Qr(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new qu(t,{onSessionStart:a,onStart:i,onMove:s,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:o,contextWindow:Ch(this.visualElement)})}stop(t,r){let o=t||this.latestPointerEvent,n=r||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!n||!o)return;let{velocity:i}=n;this.startAnimation(i);let{onDragEnd:s}=this.getProps();s&&we.postRender(()=>s(o,n))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,o){let{drag:n}=this.getProps();if(!o||!bh(t,n,this.currentDirection))return;let a=this.getAxisMotionValue(t),i=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(i=$E(i,this.constraints[t],this.elastic[t])),a.set(i)}resolveConstraints(){let{dragConstraints:t,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&Ra(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=KE(o.layoutBox,t):this.constraints=!1,this.elastic=ZE(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Qr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=QE(o.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Ra(t))return!1;let o=t.current;Zt(o!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:n}=this.visualElement;if(!n||!n.layout)return!1;let a=pE(o,n.root,this.visualElement.getTransformPagePoint()),i=XE(n.layout.layoutBox,a);if(r){let s=r(aE(i));this.hasMutatedConstraints=!!s,s&&(i=dh(s))}return i}startAnimation(t){let{drag:r,dragMomentum:o,dragElastic:n,dragTransition:a,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Qr(c=>{if(!bh(c,r,this.currentDirection))return;let d=l&&l[c]||{};i&&(d={min:0,max:0});let f=n?200:1e6,p=n?40:1e7,h={type:"inertia",velocity:o?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(c,h)});return Promise.all(u).then(s)}startAxisValueAnimation(t,r){let o=this.getAxisMotionValue(t);return Yf(this.visualElement,t),o.start(zu(t,o,0,r,this.visualElement,!1))}stopAnimation(){Qr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Qr(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){let r=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps(),n=o[r];return n||this.visualElement.getValue(t,(o.initial?o.initial[t]:void 0)||0)}snapToCursor(t){Qr(r=>{let{drag:o}=this.getProps();if(!bh(r,o,this.currentDirection))return;let{projection:n}=this.visualElement,a=this.getAxisMotionValue(r);if(n&&n.layout){let{min:i,max:s}=n.layout.layoutBox[r];a.set(t[r]-be(i,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:o}=this.visualElement;if(!Ra(r)||!o||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};Qr(i=>{let s=this.getAxisMotionValue(i);if(s&&this.constraints!==!1){let l=s.get();n[i]=YE({min:l,max:l},this.constraints[i])}});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Qr(i=>{if(!bh(i,t,null))return;let s=this.getAxisMotionValue(i),{min:l,max:u}=this.constraints[i];s.set(be(l,u,n[i]))})}addListeners(){if(!this.visualElement.current)return;iq.set(this.visualElement,this);let t=this.visualElement.current,r=Ai(t,"pointerdown",l=>{let{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),o=()=>{let{dragConstraints:l}=this.getProps();Ra(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,a=n.addEventListener("measure",o);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),we.read(o);let i=Ia(window,"resize",()=>this.scalePositionWithinConstraints()),s=n.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Qr(c=>{let d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{i(),r(),a(),s&&s()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:o=!1,dragPropagation:n=!1,dragConstraints:a=!1,dragElastic:i=Sh,dragMomentum:s=!0}=t;return{...t,drag:r,dragDirectionLock:o,dragPropagation:n,dragConstraints:a,dragElastic:i,dragMomentum:s}}};function bh(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function sq(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var Lh=class extends zt{constructor(t){super(t),this.removeGroupControls=mt,this.removeListeners=mt,this.controls=new Rh(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mt}unmount(){this.removeGroupControls(),this.removeListeners()}};var JE=e=>(t,r)=>{e&&we.postRender(()=>e(t,r))},Ih=class extends zt{constructor(){super(...arguments),this.removePointerDownListener=mt}onPointerDown(t){this.session=new qu(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ch(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:o,onPanEnd:n}=this.node.getProps();return{onSessionStart:JE(t),onStart:JE(r),onMove:o,onEnd:(a,i)=>{delete this.session,n&&we.postRender(()=>n(a,i))}}}mount(){this.removePointerDownListener=Ai(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var rA=R(E(),1);var Qf=R(A(),1);var $u={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function eA(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ku={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(oe.test(e))e=parseFloat(e);else return e;let r=eA(e,t.target.x),o=eA(e,t.target.y);return`${r}% ${o}%`}};var tA={correct:(e,{treeScale:t,projectionDelta:r})=>{let o=e,n=pr.parse(e);if(n.length>5)return o;let a=pr.createTransformer(e),i=typeof n[0]!="number"?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;n[0+i]/=s,n[1+i]/=l;let u=be(s,l,.5);return typeof n[2+i]=="number"&&(n[2+i]/=u),typeof n[3+i]=="number"&&(n[3+i]/=u),a(n)}};var wC=!1,CC=class extends Qf.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:o,layoutId:n}=this.props,{projection:a}=t;HM(lq),a&&(r.group&&r.group.add(a),o&&o.register&&n&&o.register(a),wC&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),$u.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:o,drag:n,isPresent:a}=this.props,{projection:i}=o;return i&&(i.isPresent=a,wC=!0,n||t.layoutDependency!==r||r===void 0||t.isPresent!==a?i.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?i.promote():i.relegate()||we.postRender(()=>{let s=i.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zs.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:o}=this.props,{projection:n}=t;wC=!0,n&&(n.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(n),o&&o.deregister&&o.deregister(n))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function Ph(e){let[t,r]=Xg(),o=(0,Qf.useContext)(yu);return(0,rA.jsx)(CC,{...e,layoutGroup:o,switchLayoutGroup:(0,Qf.useContext)(lh),isPresent:t,safeToRemove:r})}var lq={borderRadius:{...Ku,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ku,borderTopRightRadius:Ku,borderBottomLeftRadius:Ku,borderBottomRightRadius:Ku,boxShadow:tA};function Th(e,t,r){let o=Ee(e)?e:Xr(e);return o.start(zu("",o,t,r)),o.animation}var oA=(e,t)=>e.depth-t.depth;var kh=class{constructor(){this.children=[],this.isDirty=!1}add(t){Ms(this.children,t),this.isDirty=!0}remove(t){sn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(oA),this.isDirty=!1,this.children.forEach(t)}};function nA(e,t){let r=xt.now(),o=({timestamp:n})=>{let a=n-r;a>=t&&(dr(o),e(a-t))};return we.setup(o,!0),()=>dr(o)}var lA=["TopLeft","TopRight","BottomLeft","BottomRight"],uq=lA.length,aA=e=>typeof e=="string"?parseFloat(e):e,iA=e=>typeof e=="number"||oe.test(e);function uA(e,t,r,o,n,a){n?(e.opacity=be(0,r.opacity??1,cq(o)),e.opacityExit=be(t.opacity??1,0,dq(o))):a&&(e.opacity=be(t.opacity??1,r.opacity??1,o));for(let i=0;i<uq;i++){let s=`border${lA[i]}Radius`,l=sA(t,s),u=sA(r,s);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||iA(l)===iA(u)?(e[s]=Math.max(be(aA(l),aA(u),o),0),(fr.test(u)||fr.test(l))&&(e[s]+="%")):e[s]=u}(t.rotate||r.rotate)&&(e.rotate=be(t.rotate||0,r.rotate||0,o))}function sA(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var cq=cA(0,.5,mf),dq=cA(.5,.95,mt);function cA(e,t,r){return o=>o<e?0:o>t?1:r(Eo(e,t,o))}function dA(e,t){e.min=t.min,e.max=t.max}function mo(e,t){dA(e.x,t.x),dA(e.y,t.y)}function SC(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function fA(e,t,r,o,n){return e-=t,e=$f(e,1/r,o),n!==void 0&&(e=$f(e,1/n,o)),e}function fq(e,t=0,r=1,o=.5,n,a=e,i=e){if(fr.test(t)&&(t=parseFloat(t),t=be(i.min,i.max,t/100)-i.min),typeof t!="number")return;let s=be(a.min,a.max,o);e===a&&(s-=t),e.min=fA(e.min,t,r,s,n),e.max=fA(e.max,t,r,s,n)}function pA(e,t,[r,o,n],a,i){fq(e,t[r],t[o],t[n],t.scale,a,i)}var pq=["x","scaleX","originX"],mq=["y","scaleY","originY"];function bC(e,t,r,o){pA(e.x,t,pq,r?r.x:void 0,o?o.x:void 0),pA(e.y,t,mq,r?r.y:void 0,o?o.y:void 0)}function mA(e){return e.translate===0&&e.scale===1}function RC(e){return mA(e.x)&&mA(e.y)}function gA(e,t){return e.min===t.min&&e.max===t.max}function vA(e,t){return gA(e.x,t.x)&&gA(e.y,t.y)}function hA(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function LC(e,t){return hA(e.x,t.x)&&hA(e.y,t.y)}function IC(e){return Dt(e.x)/Dt(e.y)}function PC(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Mh=class{constructor(){this.members=[]}add(t){Ms(this.members,t),t.scheduleRender()}remove(t){if(sn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){let r=this.members.findIndex(n=>t===n);if(r===0)return!1;let o;for(let n=r;n>=0;n--){let a=this.members[n];if(a.isPresent!==!1){o=a;break}}return o?(this.promote(o),!0):!1}promote(t,r){let o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,r&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:n}=t.options;n===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:r,resumingFrom:o}=t;r.onExitComplete&&r.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function yA(e,t,r){let o="",n=e.x.translate/t.x,a=e.y.translate/t.y,i=r?.z||0;if((n||a||i)&&(o=`translate3d(${n}px, ${a}px, ${i}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:h}=r;u&&(o=`perspective(${u}px) ${o}`),c&&(o+=`rotate(${c}deg) `),d&&(o+=`rotateX(${d}deg) `),f&&(o+=`rotateY(${f}deg) `),p&&(o+=`skewX(${p}deg) `),h&&(o+=`skewY(${h}deg) `)}let s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(o+=`scale(${s}, ${l})`),o||"none"}var Ys={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},TC=["","X","Y","Z"],gq=1e3,hq=0;function kC(e,t,r,o){let{latestValues:n}=t;n[e]&&(r[e]=n[e],t.setStaticValue(e,0),o&&(o[e]=0))}function PA(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=hh(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:n,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",we,!(n||a))}let{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&PA(o)}function Eh({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:o,resetTransform:n}){return class{constructor(i={},s=t?.()){this.id=hq++,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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Kr.value&&(Ys.nodes=Ys.calculatedTargetDeltas=Ys.calculatedProjections=0),this.nodes.forEach(xq),this.nodes.forEach(bq),this.nodes.forEach(Rq),this.nodes.forEach(wq),Kr.addProjectionMetrics&&Kr.addProjectionMetrics(Ys)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new kh)}addEventListener(i,s){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new ha),this.eventHandlers.get(i).add(s)}notifyListeners(i,...s){let l=this.eventHandlers.get(i);l&&l.notify(...s)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Gs(i)&&!Uf(i),this.instance=i;let{layoutId:s,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||s)&&(this.isLayoutDirty=!0),e){let c,d=0,f=()=>this.root.updateBlockedByResize=!1;we.read(()=>{d=window.innerWidth}),e(i,()=>{let p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,c&&c(),c=nA(f,250),$u.hasAnimatedSinceResize&&($u.hasAnimatedSinceResize=!1,this.nodes.forEach(CA)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&u&&(s||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let h=this.options.transition||u.getDefaultTransition()||kq,{onLayoutAnimationStart:m,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!LC(this.targetLayout,p),g=!d&&f;if(this.options.layoutRoot||this.resumeFrom||g||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let y={...Bs(h,"layout"),onPlay:m,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(c,g)}else d||CA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),dr(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(Lq),this.animationId++)}getTransformTemplate(){let{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&PA(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){let d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}let{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(wA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sq),this.nodes.forEach(vq),this.nodes.forEach(yq)):this.nodes.forEach(wA),this.clearAllSnapshots();let s=xt.now();yt.delta=Ut(0,1e3/60,s-yt.timestamp),yt.timestamp=s,yt.isProcessing=!0,Cf.update.process(yt),Cf.preRender.process(yt),Cf.render.process(yt),yt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cq),this.sharedNodes.forEach(Iq)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,we.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){we.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();let i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=We(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(s=!1),s&&this.instance){let l=o(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!n)return;let i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!RC(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;i&&this.instance&&(s||La(this.latestValues)||c)&&(n(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){let s=this.measurePageBox(),l=this.removeElementScroll(s);return i&&(l=this.removeTransform(l)),Mq(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:i}=this.options;if(!i)return We();let s=i.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Eq))){let{scroll:u}=this.root;u&&(Mi(s.x,u.offset.x),Mi(s.y,u.offset.y))}return s}removeElementScroll(i){let s=We();if(mo(s,i),this.scroll?.wasRoot)return s;for(let l=0;l<this.path.length;l++){let u=this.path[l],{scroll:c,options:d}=u;u!==this.root&&c&&d.layoutScroll&&(c.wasRoot&&mo(s,i),Mi(s.x,c.offset.x),Mi(s.y,c.offset.y))}return s}applyTransform(i,s=!1){let l=We();mo(l,i);for(let u=0;u<this.path.length;u++){let c=this.path[u];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&$s(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),La(c.latestValues)&&$s(l,c.latestValues)}return La(this.latestValues)&&$s(l,this.latestValues),l}removeTransform(i){let s=We();mo(s,i);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!La(u.latestValues))continue;fh(u.latestValues)&&u.updateSnapshot();let c=We(),d=u.measurePageBox();mo(c,d),bC(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return La(this.latestValues)&&bC(s,this.latestValues),s}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.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!==yt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){let s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);let l=!!this.resumingFrom||this!==s;if(!(i||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:d}=this.options;if(!(!this.layout||!(c||d))){if(this.resolvedRelativeTargetAt=yt.timestamp,!this.targetDelta&&!this.relativeTarget){let f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=We(),this.relativeTargetOrigin=We(),ju(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),mo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=We(),this.targetWithTransforms=We()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),VE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mo(this.target,this.layout.layoutBox),mC(this.target,this.targetDelta)):mo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=We(),this.relativeTargetOrigin=We(),ju(this.relativeTargetOrigin,this.target,f.target),mo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Kr.value&&Ys.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||fh(this.parent.latestValues)||fC(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let i=this.getLead(),s=!!this.resumingFrom||this!==i,l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===yt.timestamp&&(l=!1),l)return;let{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;mo(this.layoutCorrected,this.layout.layoutBox);let d=this.treeScale.x,f=this.treeScale.y;fE(this.layoutCorrected,this.treeScale,this.path,s),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=We());let{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(SC(this.prevProjectionDelta.x,this.projectionDelta.x),SC(this.prevProjectionDelta.y,this.projectionDelta.y)),Gu(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!PC(this.projectionDelta.x,this.prevProjectionDelta.x)||!PC(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Kr.value&&Ys.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){if(this.options.visualElement?.scheduleRender(),i){let s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ks(),this.projectionDelta=Ks(),this.projectionDeltaWithTransform=Ks()}setAnimationOrigin(i,s=!1){let l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=Ks();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;let f=We(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,m=p!==h,x=this.getStack(),v=!x||x.members.length<=1,g=!!(m&&!v&&this.options.crossfade===!0&&!this.path.some(Tq));this.animationProgress=0;let y;this.mixTargetDelta=w=>{let C=w/1e3;SA(d.x,i.x,C),SA(d.y,i.y,C),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ju(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Pq(this.relativeTarget,this.relativeTargetOrigin,f,C),y&&vA(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=We()),mo(y,this.relativeTarget)),m&&(this.animationValues=c,uA(c,u,this.latestValues,C,g,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(dr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=we.update(()=>{$u.hasAnimatedSinceResize=!0,un.layout++,this.motionValue||(this.motionValue=Xr(0)),this.currentAnimation=Th(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:s=>{this.mixTargetDelta(s),i.onUpdate&&i.onUpdate(s)},onStop:()=>{un.layout--},onComplete:()=>{un.layout--,i.onComplete&&i.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);let i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(gq),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let i=this.getLead(),{targetWithTransforms:s,target:l,layout:u,latestValues:c}=i;if(!(!s||!l||!u)){if(this!==i&&this.layout&&u&&TA(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||We();let d=Dt(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;let f=Dt(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}mo(s,l),$s(s,c),Gu(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(i,s){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Mh),this.sharedNodes.get(i).add(s);let u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){let i=this.getStack();return i?i.lead===this:!0}getLead(){let{layoutId:i}=this.options;return i?this.getStack()?.lead||this:this}getPrevLead(){let{layoutId:i}=this.options;return i?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:s,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){let i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){let{visualElement:i}=this.options;if(!i)return;let s=!1,{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;let u={};l.z&&kC("z",i,u,this.animationValues);for(let c=0;c<TC.length;c++)kC(`rotate${TC[c]}`,i,u,this.animationValues),kC(`skew${TC[c]}`,i,u,this.animationValues);i.render();for(let c in u)i.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);i.scheduleRender()}applyProjectionStyles(i,s){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}let l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Nu(s?.pointerEvents)||"",i.transform=l?l(this.latestValues,""):"none";return}let u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Nu(s?.pointerEvents)||""),this.hasProjected&&!La(this.latestValues)&&(i.transform=l?l({},""):"none",this.hasProjected=!1);return}i.visibility="";let c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let d=yA(this.projectionDeltaWithTransform,this.treeScale,c);l&&(d=l(c,d)),i.transform=d;let{x:f,y:p}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,u.animationValues?i.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:i.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(let h in qs){if(c[h]===void 0)continue;let{correct:m,applyTo:x,isCSSVariable:v}=qs[h],g=d==="none"?c[h]:m(c[h],u);if(x){let y=x.length;for(let w=0;w<y;w++)i[x[w]]=g}else v?this.options.visualElement.renderState.vars[h]=g:i[h]=g}this.options.layoutId&&(i.pointerEvents=u===this?Nu(s?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>i.currentAnimation?.stop()),this.root.nodes.forEach(xA),this.root.sharedNodes.clear()}}}function vq(e){e.updateLayout()}function yq(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=e.layout,{animationType:n}=e.options,a=t.source!==e.layout.source;n==="size"?Qr(c=>{let d=a?t.measuredBox[c]:t.layoutBox[c],f=Dt(d);d.min=r[c].min,d.max=d.min+f}):TA(n,t.layoutBox,r)&&Qr(c=>{let d=a?t.measuredBox[c]:t.layoutBox[c],f=Dt(r[c]);d.max=d.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+f)});let i=Ks();Gu(i,r,t.layoutBox);let s=Ks();a?Gu(s,e.applyTransform(o,!0),t.measuredBox):Gu(s,r,t.layoutBox);let l=!RC(i),u=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:d,layout:f}=c;if(d&&f){let p=We();ju(p,t.layoutBox,d.layoutBox);let h=We();ju(h,r,f.layoutBox),LC(p,h)||(u=!0),c.options.layoutRoot&&(e.relativeTarget=h,e.relativeTargetOrigin=p,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function xq(e){Kr.value&&Ys.nodes++,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 wq(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Cq(e){e.clearSnapshot()}function xA(e){e.clearMeasurements()}function wA(e){e.isLayoutDirty=!1}function Sq(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function CA(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bq(e){e.resolveTargetDelta()}function Rq(e){e.calcProjection()}function Lq(e){e.resetSkewAndRotation()}function Iq(e){e.removeLeadSnapshot()}function SA(e,t,r){e.translate=be(t.translate,0,r),e.scale=be(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function bA(e,t,r,o){e.min=be(t.min,r.min,o),e.max=be(t.max,r.max,o)}function Pq(e,t,r,o){bA(e.x,t.x,r.x,o),bA(e.y,t.y,r.y,o)}function Tq(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var kq={duration:.45,ease:[.4,0,.1,1]},RA=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),LA=RA("applewebkit/")&&!RA("chrome/")?Math.round:mt;function IA(e){e.min=LA(e.min),e.max=LA(e.max)}function Mq(e){IA(e.x),IA(e.y)}function TA(e,t,r){return e==="position"||e==="preserve-aspect"&&!FE(IC(t),IC(r),.2)}function Eq(e){return e!==e.root&&e.scroll?.wasRoot}var kA=Eh({attachResizeListener:(e,t)=>Ia(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var MC={current:void 0},Ah=Eh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!MC.current){let e=new kA({});e.mount(window),e.setOptions({layoutScroll:!0}),MC.current=e}return MC.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var MA={pan:{Feature:Ih},drag:{Feature:Lh,ProjectionNode:Ah,MeasureLayout:Ph}};function EA(e,t,r){let{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",r==="Start");let n="onHover"+r,a=o[n];a&&we.postRender(()=>a(t,Pa(t)))}var Dh=class extends zt{mount(){let{current:t}=this.node;t&&(this.unmount=eC(t,(r,o)=>(EA(this.node,o,"Start"),n=>EA(this.node,n,"End"))))}unmount(){}};var Nh=class extends zt{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=ln(Ia(this.node.current,"focus",()=>this.onFocus()),Ia(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function AA(e,t,r){let{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",r==="Start");let n="onTap"+(r==="End"?"":r),a=o[n];a&&we.postRender(()=>a(t,Pa(t)))}var _h=class extends zt{mount(){let{current:t}=this.node;t&&(this.unmount=oC(t,(r,o)=>(AA(this.node,o,"Start"),(n,{success:a})=>AA(this.node,n,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var AC=new WeakMap,EC=new WeakMap,Aq=e=>{let t=AC.get(e.target);t&&t(e)},Dq=e=>{e.forEach(Aq)};function Nq({root:e,...t}){let r=e||document;EC.has(r)||EC.set(r,{});let o=EC.get(r),n=JSON.stringify(t);return o[n]||(o[n]=new IntersectionObserver(Dq,{root:e,...t})),o[n]}function DA(e,t,r){let o=Nq(t);return AC.set(e,r),o.observe(e),()=>{AC.delete(e),o.unobserve(e)}}var _q={some:0,all:1},Oh=class extends zt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:r,margin:o,amount:n="some",once:a}=t,i={root:r?r.current:void 0,rootMargin:o,threshold:typeof n=="number"?n:_q[n]},s=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return DA(this.node.current,i,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Oq(t,r))&&this.startObserver()}unmount(){}};function Oq({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var NA={inView:{Feature:Oh},tap:{Feature:_h},focus:{Feature:Nh},hover:{Feature:Dh}};var _A={layout:{ProjectionNode:Ah,MeasureLayout:Ph}};var OA={...ME,...NA,...MA,..._A};var Ve=nE(OA,CE);var Xu=R(A(),1);function Yu(e){let t=Un(()=>Xr(e)),{isStatic:r}=(0,Xu.useContext)(Ii);if(r){let[,o]=(0,Xu.useState)(e);(0,Xu.useEffect)(()=>t.on("change",o),[])}return t}function Fh(e,t){let r=Yu(t()),o=()=>r.set(t());return o(),wu(()=>{let n=()=>we.preRender(o,!1,!0),a=e.map(i=>i.on("change",n));return()=>{a.forEach(i=>i()),dr(o)}}),r}function FA(e){Us.current=[],e();let t=Fh(Us.current,e);return Us.current=void 0,t}function DC(e,t,r,o){if(typeof e=="function")return FA(e);let n=typeof t=="function"?t:nC(t,r,o);return Array.isArray(e)?VA(e,n):VA([e],([a])=>n(a))}function VA(e,t){let r=Un(()=>[]);return Fh(e,()=>{r.length=0;let o=e.length;for(let n=0;n<o;n++)r[n]=e[n].get();return t(r)})}function Zf(e){return typeof e=="object"&&!Array.isArray(e)}function Vh(e,t,r,o){return typeof e=="string"&&Zf(t)?Vf(e,r,o):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function BA(e,t,r){return e*(t+1)}function NC(e,t,r,o){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?r:t.startsWith("<")?Math.max(0,r+parseFloat(t.slice(1))):o.get(t)??e}function Fq(e,t,r){for(let o=0;o<e.length;o++){let n=e[o];n.at>t&&n.at<r&&(sn(e,n),o--)}}function HA(e,t,r,o,n,a){Fq(e,n,a);for(let i=0;i<t.length;i++)e.push({value:t[i],at:be(n,a,o[i]),easing:yf(r,i)})}function UA(e,t){for(let r=0;r<e.length;r++)e[r]=e[r]/(t+1)}function zA(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Vq="easeInOut",Bq=20;function jA(e,{defaultTransition:t={},...r}={},o,n){let a=t.duration||.3,i=new Map,s=new Map,l={},u=new Map,c=0,d=0,f=0;for(let p=0;p<e.length;p++){let h=e[p];if(typeof h=="string"){u.set(h,d);continue}else if(!Array.isArray(h)){u.set(h.name,NC(d,h.at,c,u));continue}let[m,x,v={}]=h;v.at!==void 0&&(d=NC(d,v.at,c,u));let g=0,y=(w,C,b,S=0,L=0)=>{let T=Hq(w),{delay:P=0,times:_=Tf(T),type:F="keyframes",repeat:j,repeatType:D,repeatDelay:W=0,...N}=C,{ease:z=t.ease||"easeOut",duration:V}=C,k=typeof P=="function"?P(S,L):P,K=T.length,de=Vs(F)?F:n?.[F||"keyframes"];if(K<=2&&de){let J=100;if(K===2&&Wq(T)){let ge=T[1]-T[0];J=Math.abs(ge)}let fe={...N};V!==void 0&&(fe.duration=St(V));let q=Lf(fe,J,de);z=q.ease,V=q.duration}V??(V=a);let M=d+k;_.length===1&&_[0]===0&&(_[1]=1);let Y=_.length-T.length;if(Y>0&&Pf(_,Y),T.length===1&&T.unshift(null),j){Zt(j<Bq,"Repeat count too high, must be less than 20","repeat-count-high"),V=BA(V,j);let J=[...T],fe=[..._];z=Array.isArray(z)?[...z]:[z];let q=[...z];for(let ge=0;ge<j;ge++){T.push(...J);for(let Re=0;Re<J.length;Re++)_.push(fe[Re]+(ge+1)),z.push(Re===0?"linear":yf(q,Re-1))}UA(_,j)}let le=M+V;HA(b,T,z,_,M,le),g=Math.max(k+V,g),f=Math.max(le,f)};if(Ee(m)){let w=WA(m,s);y(x,v,GA("default",w))}else{let w=Vh(m,x,o,l),C=w.length;for(let b=0;b<C;b++){x=x,v=v;let S=w[b],L=WA(S,s);for(let T in x)y(x[T],Uq(v,T),GA(T,L),b,C)}}c=d,d+=g}return s.forEach((p,h)=>{for(let m in p){let x=p[m];x.sort(zA);let v=[],g=[],y=[];for(let C=0;C<x.length;C++){let{at:b,value:S,easing:L}=x[C];v.push(S),g.push(Eo(0,f,b)),y.push(L||"easeOut")}g[0]!==0&&(g.unshift(0),v.unshift(v[0]),y.unshift(Vq)),g[g.length-1]!==1&&(g.push(1),v.push(null)),i.has(h)||i.set(h,{keyframes:{},transition:{}});let w=i.get(h);w.keyframes[m]=v,w.transition[m]={...t,duration:f,ease:y,times:g,...r}}}),i}function WA(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function GA(e,t){return t[e]||(t[e]=[]),t[e]}function Hq(e){return Array.isArray(e)?e:[e]}function Uq(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var zq=e=>typeof e=="number",Wq=e=>e.every(zq);function Gq(e,t){return e in t}var Bh=class extends Vu{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,r){if(Gq(r,t)){let o=t[r];if(typeof o=="string"||typeof o=="number")return o}}getBaseTargetFromProps(){}removeValueFromRenderState(t,r){delete r.output[t]}measureInstanceViewportBox(){return We()}build(t,r){Object.assign(t.output,r)}renderInstance(t,{output:r}){Object.assign(t,r)}sortInstanceNodePosition(){return 0}};function qA(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},r=Gs(e)&&!Uf(e)?new Uu(t):new Hu(t);r.mount(e),Ei.set(e,r)}function $A(e){let t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},r=new Bh(t);r.mount(e),Ei.set(e,r)}function jq(e,t){return Ee(e)||typeof e=="number"||typeof e=="string"&&!Zf(t)}function Hh(e,t,r,o){let n=[];if(jq(e,t))n.push(Th(e,Zf(t)&&t.default||t,r&&(r.default||r)));else{let a=Vh(e,t,o),i=a.length;Zt(!!i,"No valid elements provided.","no-valid-elements");for(let s=0;s<i;s++){let l=a[s];Zt(l!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let u=l instanceof Element?qA:$A;Ei.has(l)||u(l);let c=Ei.get(l),d={...r};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(s,i)),n.push(...Wu(c,{...t,transition:d},{}))}}return n}function KA(e,t,r){let o=[];return jA(e,t,r,{spring:ya}).forEach(({keyframes:a,transition:i},s)=>{o.push(...Hh(s,a,i))}),o}function qq(e){return Array.isArray(e)&&e.some(Array.isArray)}function XA(e){function t(r,o,n){let a=[];qq(r)?a=KA(r,o,e):a=Hh(r,o,n,e);let i=new Af(a);return e&&(e.animations.push(i),i.finished.then(()=>{sn(e.animations,i)})),i}return t}var _C=XA();var d0e=te("",{variants:{hover:{lift:["transition-all duration-200 ease-out","hover:-translate-y-0.5","hover:shadow-md"],glow:["transition-all duration-300 ease-out","hover:shadow-lg","hover:shadow-primary/20"],scale:["transition-transform duration-200 ease-out","hover:scale-105","active:scale-95"],brightness:["transition-all duration-200 ease-out","hover:brightness-110","active:brightness-95"],border:["transition-all duration-200 ease-out","hover:border-primary/50"]},focus:{ring:["focus:outline-none","focus-visible:ring-2","focus-visible:ring-primary/50","focus-visible:ring-offset-2"],glow:["focus:outline-none","focus-visible:shadow-lg","focus-visible:shadow-primary/30"],border:["focus:outline-none","focus-visible:border-primary","focus-visible:border-2"]},active:{scale:["active:scale-95","transition-transform duration-100"],darken:["active:brightness-90","transition-all duration-100"],depress:["active:translate-y-0.5","active:shadow-sm","transition-all duration-100"]},cursor:{pointer:"cursor-pointer",grab:"cursor-grab active:cursor-grabbing",text:"cursor-text",wait:"cursor-wait",help:"cursor-help",notAllowed:"cursor-not-allowed"}},defaultVariants:{hover:"lift",focus:"ring",active:"scale",cursor:"pointer"}}),pn={smooth:{type:"spring",stiffness:260,damping:20},bouncy:{type:"spring",stiffness:300,damping:15},stiff:{type:"spring",stiffness:400,damping:25},gentle:{type:"spring",stiffness:150,damping:15}},Uh={lift:{y:-2,transition:pn.smooth},scale:{scale:1.05,transition:pn.smooth},glow:{boxShadow:"0 0 20px rgba(var(--primary), 0.3)",transition:pn.smooth},rotate:{rotate:2,transition:pn.bouncy}},YA={scale:{scale:.95,transition:{duration:.1}},depress:{y:1,transition:{duration:.1}}},f0e={ring:{boxShadow:"0 0 0 2px var(--background), 0 0 0 4px var(--primary)",transition:pn.smooth},glow:{boxShadow:"0 0 0 3px rgba(var(--primary), 0.3)",transition:pn.smooth}},p0e={container:{hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},item:{hidden:{opacity:0,y:20},show:{opacity:1,y:0,transition:pn.smooth}}},m0e={fadeIn:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},slideUp:{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:pn.smooth},slideRight:{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:pn.smooth},scale:{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.05},transition:pn.smooth}},QA={initial:{opacity:.5},animate:{opacity:[.5,.8,.5],transition:{duration:1.5,repeat:1/0,ease:"easeInOut"}}};var g0e={initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95,transition:{duration:.15}},transition:pn.bouncy};var Di=R(E()),ZA=te("rounded-lg border bg-card text-card-foreground shadow-sm dark:shadow-gray-900/20 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-100 transition-all duration-200",{variants:{variant:{default:"",outline:"border border-border shadow-none bg-transparent dark:border-gray-700 dark:bg-transparent dark:text-gray-200",filled:"border-none bg-secondary dark:bg-gray-800 dark:text-gray-100 dark:shadow-inner dark:shadow-gray-950/10",elevated:"border-none shadow-md dark:shadow-lg dark:shadow-gray-900/30 dark:bg-gray-850 dark:text-gray-100",gradient:"border-none bg-gradient-to-br from-primary/5 to-primary/10 dark:from-primary/10 dark:to-primary/20",glass:"border border-white/20 bg-white/10 backdrop-blur-md dark:border-gray-700/30 dark:bg-gray-800/10"},size:{default:"p-6",sm:"p-4",lg:"p-8",xl:"p-10"},radius:{default:"rounded-lg",sm:"rounded-md",lg:"rounded-xl",full:"rounded-3xl",none:"rounded-none"},interactive:{true:"cursor-pointer hover:shadow-lg hover:border-primary/20 dark:hover:border-primary/30 hover:-translate-y-0.5 active:translate-y-0 active:shadow-sm",false:""}},defaultVariants:{variant:"default",size:"default",radius:"default"}}),JA=Qs.forwardRef(({className:e,variant:t,size:r,radius:o,interactive:n,microInteraction:a="lift",...i},s)=>{if(n&&a!=="none"){let l={whileHover:a==="scale"?Uh.scale:a==="glow"?Uh.glow:Uh.lift,whileTap:YA.scale};return(0,Di.jsx)(Ve.div,{ref:s,className:I("moonui-theme",ZA({variant:t,size:r,radius:o,interactive:n,className:e})),...l,...i})}return(0,Di.jsx)("div",{ref:s,className:I("moonui-theme",ZA({variant:t,size:r,radius:o,interactive:n,className:e})),...i})});JA.displayName="Card";var eD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("div",{ref:r,className:I("moonui-theme","flex flex-col space-y-1.5",e),...t}));eD.displayName="CardHeader";var tD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("h3",{ref:r,className:I("moonui-theme","text-lg font-semibold leading-none tracking-tight",e),...t}));tD.displayName="CardTitle";var rD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("p",{ref:r,className:I("moonui-theme","text-sm text-muted-foreground",e),...t}));rD.displayName="CardDescription";var oD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("div",{ref:r,className:I("moonui-theme","pt-0",e),...t}));oD.displayName="CardContent";var nD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("div",{ref:r,className:I("moonui-theme","flex items-center pt-4",e),...t}));nD.displayName="CardFooter";var Zs=R(A());var Ni=R(E()),$q=e=>{let t={visa:/^4/,mastercard:/^5[1-5]/,amex:/^3[47]/,discover:/^6(?:011|5)/,diners:/^3(?:0[0-5]|[68])/,jcb:/^35/};for(let[r,o]of Object.entries(t))if(o.test(e))return r;return"unknown"},aD=(e,t)=>{let r=e.replace(/\s+/g,""),o=t==="amex"?[4,6,5]:[4,4,4,4],n="",a=0;for(let i of o){if(a>=r.length)break;n&&(n+=" "),n+=r.slice(a,a+i),a+=i}return n},iD=Zs.forwardRef(({className:e,value:t="",onChange:r,showIcon:o=!0,size:n,...a},i)=>{let[s,l]=Zs.useState("unknown"),u=c=>{let d=c.target.value.replace(/\D/g,""),f=$q(d);l(f);let p=f==="amex"?15:16,h=d.slice(0,p),m=aD(h,f);r?.(h,f),c.target.value=m};return(0,Ni.jsxs)("div",{className:"relative",children:[(0,Ni.jsx)(mr,{ref:i,type:"text",inputMode:"numeric",autoComplete:"cc-number",placeholder:"1234 5678 9012 3456",value:aD(t,s),onChange:u,className:I(o&&"pl-10",e),...a}),o&&(0,Ni.jsx)(_d,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"})]})});iD.displayName="CardNumberInput";var sD=Zs.forwardRef(({className:e,value:t="",onChange:r,size:o,...n},a)=>{let i=l=>{let u=l.target.value.replace(/\D/g,"");if(u.length>=2){let d=parseInt(u.slice(0,2));d>12?u="12"+u.slice(2):d===0&&(u="01"+u.slice(2))}u=u.slice(0,4);let c=u;u.length>=2&&(c=u.slice(0,2)+"/"+u.slice(2)),r?.(u),l.target.value=c},s=t.length>=2?t.slice(0,2)+"/"+t.slice(2):t;return(0,Ni.jsx)(mr,{ref:a,type:"text",inputMode:"numeric",autoComplete:"cc-exp",placeholder:"MM/YY",value:s,onChange:i,className:e,...n})});sD.displayName="CardExpiryInput";var lD=Zs.forwardRef(({className:e,value:t="",onChange:r,cardType:o="unknown",size:n,...a},i)=>{let s=o==="amex"?4:3;return(0,Ni.jsx)(mr,{ref:i,type:"text",inputMode:"numeric",autoComplete:"cc-csc",placeholder:o==="amex"?"1234":"123",value:t,onChange:u=>{let c=u.target.value.replace(/\D/g,"").slice(0,s);r?.(c)},maxLength:s,className:e,...a})});lD.displayName="CardCVCInput";var uD=Zs.forwardRef(({className:e,value:t="",onChange:r,format:o="US",size:n,...a},i)=>{let s=u=>{let c=u.target.value;switch(o){case"US":c=c.replace(/\D/g,"").slice(0,5);break;case"CA":c=c.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6),c.length>=3&&(c=c.slice(0,3)+" "+c.slice(3));break;case"UK":c=c.toUpperCase().replace(/[^A-Z0-9\s]/g,"").slice(0,8);break;default:c=c.slice(0,10)}r?.(c.replace(/\s/g,"")),u.target.value=c};return(0,Ni.jsx)(mr,{ref:i,type:"text",autoComplete:"postal-code",placeholder:(()=>{switch(o){case"US":return"12345";case"CA":return"K1A 0B1";case"UK":return"SW1A 1AA";default:return"Postal Code"}})(),value:t,onChange:s,className:e,...a})});uD.displayName="CardZipInput";var mn=R(A());var Ar=R(A(),1);var zh=R(A(),1);function Qu(e){let t=zh.useRef({value:e,previous:e});return zh.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cD=R(A(),1);function Zu(e){let[t,r]=cD.useState(void 0);return Me(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let a=n[0],i,s;if("borderBoxSize"in a){let l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,s=u.blockSize}else i=e.offsetWidth,s=e.offsetHeight;r({width:i,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var go=R(E(),1),Wh="Checkbox",[Kq,V0e]=ke(Wh),[Xq,OC]=Kq(Wh);function Yq(e){let{__scopeCheckbox:t,checked:r,children:o,defaultChecked:n,disabled:a,form:i,name:s,onCheckedChange:l,required:u,value:c="on",internal_do_not_use_render:d}=e,[f,p]=ze({prop:r,defaultProp:n??!1,onChange:l,caller:Wh}),[h,m]=Ar.useState(null),[x,v]=Ar.useState(null),g=Ar.useRef(!1),y=h?!!i||!!h.closest("form"):!0,w={checked:f,disabled:a,setChecked:p,control:h,setControl:m,name:s,form:i,value:c,hasConsumerStoppedPropagationRef:g,required:u,defaultChecked:_i(n)?!1:n,isFormControl:y,bubbleInput:x,setBubbleInput:v};return(0,go.jsx)(Xq,{scope:t,...w,children:Qq(d)?d(w):o})}var dD="CheckboxTrigger",fD=Ar.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...o},n)=>{let{control:a,value:i,disabled:s,checked:l,required:u,setControl:c,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:h}=OC(dD,e),m=ae(n,c),x=Ar.useRef(l);return Ar.useEffect(()=>{let v=a?.form;if(v){let g=()=>d(x.current);return v.addEventListener("reset",g),()=>v.removeEventListener("reset",g)}},[a,d]),(0,go.jsx)(X.button,{type:"button",role:"checkbox","aria-checked":_i(l)?"mixed":l,"aria-required":u,"data-state":hD(l),"data-disabled":s?"":void 0,disabled:s,value:i,...o,ref:m,onKeyDown:H(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:H(r,v=>{d(g=>_i(g)?!0:!g),h&&p&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})})});fD.displayName=dD;var Gh=Ar.forwardRef((e,t)=>{let{__scopeCheckbox:r,name:o,checked:n,defaultChecked:a,required:i,disabled:s,value:l,onCheckedChange:u,form:c,...d}=e;return(0,go.jsx)(Yq,{__scopeCheckbox:r,checked:n,defaultChecked:a,disabled:s,required:i,onCheckedChange:u,name:o,form:c,value:l,internal_do_not_use_render:({isFormControl:f})=>(0,go.jsxs)(go.Fragment,{children:[(0,go.jsx)(fD,{...d,ref:t,__scopeCheckbox:r}),f&&(0,go.jsx)(gD,{__scopeCheckbox:r})]})})});Gh.displayName=Wh;var pD="CheckboxIndicator",FC=Ar.forwardRef((e,t)=>{let{__scopeCheckbox:r,forceMount:o,...n}=e,a=OC(pD,r);return(0,go.jsx)(it,{present:o||_i(a.checked)||a.checked===!0,children:(0,go.jsx)(X.span,{"data-state":hD(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t,style:{pointerEvents:"none",...e.style}})})});FC.displayName=pD;var mD="CheckboxBubbleInput",gD=Ar.forwardRef(({__scopeCheckbox:e,...t},r)=>{let{control:o,hasConsumerStoppedPropagationRef:n,checked:a,defaultChecked:i,required:s,disabled:l,name:u,value:c,form:d,bubbleInput:f,setBubbleInput:p}=OC(mD,e),h=ae(r,p),m=Qu(a),x=Zu(o);Ar.useEffect(()=>{let g=f;if(!g)return;let y=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(y,"checked").set,b=!n.current;if(m!==a&&C){let S=new Event("click",{bubbles:b});g.indeterminate=_i(a),C.call(g,_i(a)?!1:a),g.dispatchEvent(S)}},[f,m,a,n]);let v=Ar.useRef(_i(a)?!1:a);return(0,go.jsx)(X.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??v.current,required:s,disabled:l,name:u,value:c,form:d,...t,tabIndex:-1,ref:h,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});gD.displayName=mD;function Qq(e){return typeof e=="function"}function _i(e){return e==="indeterminate"}function hD(e){return _i(e)?"indeterminate":e?"checked":"unchecked"}var Do=R(E()),Jq=te("peer shrink-0 border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary-foreground",{variants:{variant:{default:"border-border bg-background data-[state=checked]:bg-primary data-[state=checked]:border-primary",outline:"border-border bg-transparent data-[state=checked]:bg-primary data-[state=checked]:border-primary",muted:"border-border bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary",ghost:"border-transparent bg-transparent hover:bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary"},size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-sm",md:"rounded-md",full:"rounded-full"},animation:{none:"",subtle:"transition-all duration-200",default:"transition-all duration-200",bounce:"transition-all duration-200"}},defaultVariants:{variant:"default",size:"default",radius:"default",animation:"default"}}),VC=mn.forwardRef(({className:e,variant:t,size:r,radius:o,animation:n,indeterminate:a=!1,icon:i,checked:s,...l},u)=>{let[c,d]=mn.useState(a);return mn.useEffect(()=>{d(a)},[a]),(0,Do.jsx)(Gh,{ref:u,checked:c?!1:s,className:I("moonui-theme",Jq({variant:t,size:r,radius:o,animation:n}),e),...l,children:(0,Do.jsx)(FC,{className:I("flex items-center justify-center text-current",n==="bounce"&&"data-[state=checked]:animate-bounce"),children:c?(0,Do.jsx)(jd,{className:"h-[65%] w-[65%]"}):i||(0,Do.jsx)(lr,{className:"h-[65%] w-[65%]"})})})});VC.displayName=Gh.displayName;var vD=mn.forwardRef(({className:e,orientation:t="vertical",spacing:r="1rem",children:o,...n},a)=>(0,Do.jsx)("div",{ref:a,className:I("flex",t==="vertical"?"flex-col":"flex-row flex-wrap",e),style:{gap:r},role:"group",...n,children:o}));vD.displayName="CheckboxGroup";var jh=mn.forwardRef(({className:e,htmlFor:t,children:r,position:o="end",disabled:n=!1,...a},i)=>(0,Do.jsx)("label",{ref:i,htmlFor:t,className:I("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",o==="start"?"mr-2":"ml-2",n&&"cursor-not-allowed opacity-70",e),...a,children:r}));jh.displayName="CheckboxLabel";var yD=mn.forwardRef(({id:e,label:t,labelPosition:r="end",labelClassName:o,...n},a)=>{let i=mn.useId(),s=e||i;return(0,Do.jsxs)("div",{className:"flex items-center",children:[r==="start"&&(0,Do.jsx)(jh,{htmlFor:s,position:"start",disabled:n.disabled,className:o,children:t}),(0,Do.jsx)(VC,{ref:a,id:s,...n}),r==="end"&&(0,Do.jsx)(jh,{htmlFor:s,position:"end",disabled:n.disabled,className:o,children:t})]})});yD.displayName="CheckboxWithLabel";var BC=R(A());var Js=R(E()),e6=dg,xD=te("flex w-full items-center justify-between transition-all",{variants:{variant:{default:"text-foreground hover:text-primary",ghost:"text-foreground hover:bg-accent/10 rounded",outline:"text-foreground border border-border rounded-t-md hover:bg-accent/5"},size:{sm:"text-xs py-2 px-3",default:"text-sm py-3 px-4",md:"text-base py-4 px-4",lg:"text-lg py-5 px-5"}},defaultVariants:{variant:"default",size:"default"}}),wD=BC.forwardRef(({className:e,children:t,variant:r,size:o,asChild:n,...a},i)=>n?(0,Js.jsx)(ou,{ref:i,className:I("moonui-theme",xD({variant:r,size:o}),e),asChild:n,...a,children:t}):(0,Js.jsxs)(ou,{ref:i,className:I("moonui-theme",xD({variant:r,size:o}),e),...a,children:[t,(0,Js.jsx)(Vn,{className:"h-4 w-4 shrink-0 ml-auto transition-transform duration-200 [&[data-state=open]]:rotate-180"})]}));wD.displayName=ou.displayName;var t6=te("overflow-hidden transition-all data-[state=closed]:animate-collapse-up data-[state=open]:animate-collapse-down",{variants:{variant:{default:"text-muted-foreground",ghost:"text-muted-foreground rounded-b",outline:"text-muted-foreground border border-t-0 border-border rounded-b-md"},size:{sm:"text-xs",default:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{variant:"default",size:"default"}}),CD=BC.forwardRef(({className:e,children:t,variant:r,size:o,...n},a)=>(0,Js.jsx)(Sd,{ref:a,className:I("moonui-theme",t6({variant:r,size:o}),e),...n,children:(0,Js.jsx)("div",{className:"p-4",children:t})}));CD.displayName=Sd.displayName;var Ho=R(A());var SD=R(A());var No=R(E()),r6=te("group relative flex items-center w-full transition-colors",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),o6=te(["w-full bg-background transition-all duration-200","text-foreground placeholder:text-muted-foreground dark:placeholder:text-gray-500","disabled:cursor-not-allowed disabled:opacity-50","file:border-0 file:bg-transparent file:font-medium","focus-visible:outline-none dark:text-gray-200"],{variants:{variant:{standard:"border border-gray-300 dark:border-gray-700 rounded-md px-3 py-2 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:bg-gray-900/60 dark:shadow-inner dark:shadow-gray-950/10",filled:"border border-transparent bg-gray-100 dark:bg-gray-800/90 rounded-md px-3 py-2 hover:bg-gray-200 dark:hover:bg-gray-700/90 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 dark:shadow-inner dark:shadow-gray-950/10",ghost:"border-none bg-transparent shadow-none px-1 dark:text-gray-300 dark:placeholder:text-gray-500 hover:bg-gray-100/50 dark:hover:bg-gray-800/30 focus-visible:bg-transparent",underline:"border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 py-2 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:text-gray-300"},size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},hasLeftIcon:{true:"pl-10",false:""},hasRightIcon:{true:"pr-10",false:""},hasRightButton:{true:"pr-10",false:""},isError:{true:"border-error focus-visible:ring-error/30 focus-visible:border-error hover:border-error/80 dark:hover:border-error/80",false:""},isSuccess:{true:"border-success focus-visible:ring-success/30 focus-visible:border-success hover:border-success/80 dark:hover:border-success/80",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800/50 pointer-events-none",false:""}},defaultVariants:{variant:"standard",size:"md",isError:!1,isSuccess:!1,isDisabled:!1,hasLeftIcon:!1,hasRightIcon:!1,hasRightButton:!1}}),mr=SD.forwardRef(({className:e,wrapperClassName:t,messageClassName:r,variant:o,size:n,isError:a,disabled:i,error:s,success:l,loading:u,leftIcon:c,rightIcon:d,rightButton:f,alwaysShowMessage:p=!1,...h},m)=>{let x=p||s||l,v=s?"error":l?"success":"normal";return(0,No.jsxs)("div",{className:"space-y-1.5 w-full",children:[(0,No.jsxs)("div",{className:I("moonui-theme",r6({size:n}),t),children:[c&&(0,No.jsx)("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:u?(0,No.jsx)(Qt,{className:"h-4 w-4 animate-spin"}):c}),(0,No.jsx)("input",{className:I(o6({variant:o,size:n,isError:!!s||a,isSuccess:!!l,isDisabled:i||u,hasLeftIcon:!!c||u,hasRightIcon:!!d,hasRightButton:!!f}),e),ref:m,disabled:i||u,"data-loading":u?"":void 0,"data-error":s?"":void 0,"data-success":l?"":void 0,"aria-invalid":!!s||!!a||void 0,"aria-describedby":s?`${h.id||""}-error`:l?`${h.id||""}-success`:void 0,...h}),d&&!u&&(0,No.jsx)("div",{className:"absolute right-3 text-gray-500 flex items-center justify-center pointer-events-none",children:d}),f&&(0,No.jsx)("div",{className:"absolute right-3",children:f}),u&&!c&&(0,No.jsx)("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:(0,No.jsx)(Qt,{className:"h-4 w-4 animate-spin","aria-hidden":"true"})})]}),x&&(0,No.jsx)("p",{className:I("text-xs transition-all",v==="error"&&"text-error",v==="success"&&"text-success",v==="normal"&&"text-muted-foreground",r),id:s?`${h.id||""}-error`:l?`${h.id||""}-success`:void 0,children:s||l||""})]})});mr.displayName="Input";var ID=R(A());var bD=R(A(),1);var RD=R(E(),1),n6="Label",LD=bD.forwardRef((e,t)=>(0,RD.jsx)(X.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));LD.displayName=n6;var HC=LD;var PD=R(E()),i6=te("text-sm font-medium leading-none text-gray-900 dark:text-gray-200 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:peer-disabled:opacity-60 transition-colors duration-200"),Zr=ID.forwardRef(({className:e,...t},r)=>(0,PD.jsx)(HC,{ref:r,className:I(i6(),e),...t}));Zr.displayName=HC.displayName;var O2=R(A());var lt=R(A(),1);var gt=R(A(),1);var TD=R(A(),1);function kD(e,t=globalThis?.document){let r=et(e);TD.useEffect(()=>{let o=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var zC=R(E(),1),s6="DismissableLayer",UC="dismissableLayer.update",l6="dismissableLayer.pointerDownOutside",u6="dismissableLayer.focusOutside",MD,AD=gt.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_o=gt.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:n,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...l}=e,u=gt.useContext(AD),[c,d]=gt.useState(null),f=c?.ownerDocument??globalThis?.document,[,p]=gt.useState({}),h=ae(t,S=>d(S)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(x),g=c?m.indexOf(c):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,w=g>=v,C=d6(S=>{let L=S.target,T=[...u.branches].some(P=>P.contains(L));!w||T||(n?.(S),i?.(S),S.defaultPrevented||s?.())},f),b=f6(S=>{let L=S.target;[...u.branches].some(P=>P.contains(L))||(a?.(S),i?.(S),S.defaultPrevented||s?.())},f);return kD(S=>{g===u.layers.size-1&&(o?.(S),!S.defaultPrevented&&s&&(S.preventDefault(),s()))},f),gt.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(MD=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),ED(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=MD)}},[c,f,r,u]),gt.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),ED())},[c,u]),gt.useEffect(()=>{let S=()=>p({});return document.addEventListener(UC,S),()=>document.removeEventListener(UC,S)},[]),(0,zC.jsx)(X.div,{...l,ref:h,style:{pointerEvents:y?w?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,b.onFocusCapture),onBlurCapture:H(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});_o.displayName=s6;var c6="DismissableLayerBranch",DD=gt.forwardRef((e,t)=>{let r=gt.useContext(AD),o=gt.useRef(null),n=ae(t,o);return gt.useEffect(()=>{let a=o.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),(0,zC.jsx)(X.div,{...e,ref:n})});DD.displayName=c6;function d6(e,t=globalThis?.document){let r=et(e),o=gt.useRef(!1),n=gt.useRef(()=>{});return gt.useEffect(()=>{let a=s=>{if(s.target&&!o.current){let u=function(){ND(l6,r,c,{discrete:!0})};var l=u;let c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=u,t.addEventListener("click",n.current,{once:!0})):u()}else t.removeEventListener("click",n.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function f6(e,t=globalThis?.document){let r=et(e),o=gt.useRef(!1);return gt.useEffect(()=>{let n=a=>{a.target&&!o.current&&ND(u6,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function ED(){let e=new CustomEvent(UC);document.dispatchEvent(e)}function ND(e,t,r,{discrete:o}){let n=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?ru(n,a):n.dispatchEvent(a)}var _D=_o,OD=DD;var VD=R(A(),1),WC=0;function Oi(){VD.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??FD()),document.body.insertAdjacentElement("beforeend",e[1]??FD()),WC++,()=>{WC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),WC--}},[])}function FD(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Oo=R(A(),1);var WD=R(E(),1),GC="focusScope.autoFocusOnMount",jC="focusScope.autoFocusOnUnmount",BD={bubbles:!1,cancelable:!0},m6="FocusScope",Ta=Oo.forwardRef((e,t)=>{let{loop:r=!1,trapped:o=!1,onMountAutoFocus:n,onUnmountAutoFocus:a,...i}=e,[s,l]=Oo.useState(null),u=et(n),c=et(a),d=Oo.useRef(null),f=ae(t,m=>l(m)),p=Oo.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Oo.useEffect(()=>{if(o){let g=function(b){if(p.paused||!s)return;let S=b.target;s.contains(S)?d.current=S:Fi(d.current,{select:!0})},y=function(b){if(p.paused||!s)return;let S=b.relatedTarget;S!==null&&(s.contains(S)||Fi(d.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(let L of b)L.removedNodes.length>0&&Fi(s)};var m=g,x=y,v=w;document.addEventListener("focusin",g),document.addEventListener("focusout",y);let C=new MutationObserver(w);return s&&C.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),C.disconnect()}}},[o,s,p.paused]),Oo.useEffect(()=>{if(s){UD.add(p);let m=document.activeElement;if(!s.contains(m)){let v=new CustomEvent(GC,BD);s.addEventListener(GC,u),s.dispatchEvent(v),v.defaultPrevented||(g6(w6(GD(s)),{select:!0}),document.activeElement===m&&Fi(s))}return()=>{s.removeEventListener(GC,u),setTimeout(()=>{let v=new CustomEvent(jC,BD);s.addEventListener(jC,c),s.dispatchEvent(v),v.defaultPrevented||Fi(m??document.body,{select:!0}),s.removeEventListener(jC,c),UD.remove(p)},0)}}},[s,u,c,p]);let h=Oo.useCallback(m=>{if(!r&&!o||p.paused)return;let x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(x&&v){let g=m.currentTarget,[y,w]=h6(g);y&&w?!m.shiftKey&&v===w?(m.preventDefault(),r&&Fi(y,{select:!0})):m.shiftKey&&v===y&&(m.preventDefault(),r&&Fi(w,{select:!0})):v===g&&m.preventDefault()}},[r,o,p.paused]);return(0,WD.jsx)(X.div,{tabIndex:-1,...i,ref:f,onKeyDown:h})});Ta.displayName=m6;function g6(e,{select:t=!1}={}){let r=document.activeElement;for(let o of e)if(Fi(o,{select:t}),document.activeElement!==r)return}function h6(e){let t=GD(e),r=HD(t,e),o=HD(t.reverse(),e);return[r,o]}function GD(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let n=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||n?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function HD(e,t){for(let r of e)if(!v6(r,{upTo:t}))return r}function v6(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function y6(e){return e instanceof HTMLInputElement&&"select"in e}function Fi(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&y6(e)&&t&&e.select()}}var UD=x6();function x6(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),e=zD(e,t),e.unshift(t)},remove(t){e=zD(e,t),e[0]?.resume()}}}function zD(e,t){let r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function w6(e){return e.filter(t=>t.tagName!=="A")}var eo=R(A(),1);var $D=["top","right","bottom","left"];var qn=Math.min,Dr=Math.max,ep=Math.round,tp=Math.floor,gn=e=>({x:e,y:e}),C6={left:"right",right:"left",bottom:"top",top:"bottom"},S6={start:"end",end:"start"};function $h(e,t,r){return Dr(e,qn(t,r))}function $n(e,t){return typeof e=="function"?e(t):e}function Kn(e){return e.split("-")[0]}function el(e){return e.split("-")[1]}function Kh(e){return e==="x"?"y":"x"}function Xh(e){return e==="y"?"height":"width"}var b6=new Set(["top","bottom"]);function hn(e){return b6.has(Kn(e))?"y":"x"}function Yh(e){return Kh(hn(e))}function KD(e,t,r){r===void 0&&(r=!1);let o=el(e),n=Yh(e),a=Xh(n),i=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Jf(i)),[i,Jf(i)]}function XD(e){let t=Jf(e);return[qh(e),t,qh(t)]}function qh(e){return e.replace(/start|end/g,t=>S6[t])}var jD=["left","right"],qD=["right","left"],R6=["top","bottom"],L6=["bottom","top"];function I6(e,t,r){switch(e){case"top":case"bottom":return r?t?qD:jD:t?jD:qD;case"left":case"right":return t?R6:L6;default:return[]}}function YD(e,t,r,o){let n=el(e),a=I6(Kn(e),r==="start",o);return n&&(a=a.map(i=>i+"-"+n),t&&(a=a.concat(a.map(qh)))),a}function Jf(e){return e.replace(/left|right|bottom|top/g,t=>C6[t])}function P6(e){return{top:0,right:0,bottom:0,left:0,...e}}function qC(e){return typeof e!="number"?P6(e):{top:e,right:e,bottom:e,left:e}}function tl(e){let{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function QD(e,t,r){let{reference:o,floating:n}=e,a=hn(t),i=Yh(t),s=Xh(i),l=Kn(t),u=a==="y",c=o.x+o.width/2-n.width/2,d=o.y+o.height/2-n.height/2,f=o[s]/2-n[s]/2,p;switch(l){case"top":p={x:c,y:o.y-n.height};break;case"bottom":p={x:c,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-n.width,y:d};break;default:p={x:o.x,y:o.y}}switch(el(t)){case"start":p[i]-=f*(r&&u?-1:1);break;case"end":p[i]+=f*(r&&u?-1:1);break}return p}var eN=async(e,t,r)=>{let{placement:o="bottom",strategy:n="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t)),u=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:c,y:d}=QD(u,o,l),f=o,p={},h=0;for(let m=0;m<s.length;m++){let{name:x,fn:v}=s[m],{x:g,y,data:w,reset:C}=await v({x:c,y:d,initialPlacement:o,placement:f,strategy:n,middlewareData:p,rects:u,platform:i,elements:{reference:e,floating:t}});c=g??c,d=y??d,p={...p,[x]:{...p[x],...w}},C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:n}):C.rects),{x:c,y:d}=QD(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:n,middlewareData:p}};async function Ju(e,t){var r;t===void 0&&(t={});let{x:o,y:n,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=$n(t,e),h=qC(p),x=s[f?d==="floating"?"reference":"floating":d],v=tl(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),g=d==="floating"?{x:o,y:n,width:i.floating.width,height:i.floating.height}:i.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),w=await(a.isElement==null?void 0:a.isElement(y))?await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1}:{x:1,y:1},C=tl(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:y,strategy:l}):g);return{top:(v.top-C.top+h.top)/w.y,bottom:(C.bottom-v.bottom+h.bottom)/w.y,left:(v.left-C.left+h.left)/w.x,right:(C.right-v.right+h.right)/w.x}}var tN=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:o,placement:n,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=$n(e,t)||{};if(u==null)return{};let d=qC(c),f={x:r,y:o},p=Yh(n),h=Xh(p),m=await i.getDimensions(u),x=p==="y",v=x?"top":"left",g=x?"bottom":"right",y=x?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],C=f[p]-a.reference[p],b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),S=b?b[y]:0;(!S||!await(i.isElement==null?void 0:i.isElement(b)))&&(S=s.floating[y]||a.floating[h]);let L=w/2-C/2,T=S/2-m[h]/2-1,P=qn(d[v],T),_=qn(d[g],T),F=P,j=S-m[h]-_,D=S/2-m[h]/2+L,W=$h(F,D,j),N=!l.arrow&&el(n)!=null&&D!==W&&a.reference[h]/2-(D<F?P:_)-m[h]/2<0,z=N?D<F?D-F:D-j:0;return{[p]:f[p]+z,data:{[p]:W,centerOffset:D-W-z,...N&&{alignmentOffset:z}},reset:N}}});var rN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;let{placement:n,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...x}=$n(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};let v=Kn(n),g=hn(s),y=Kn(s)===s,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=f||(y||!m?[Jf(s)]:XD(s)),b=h!=="none";!f&&b&&C.push(...YD(s,m,h,w));let S=[s,...C],L=await Ju(t,x),T=[],P=((o=a.flip)==null?void 0:o.overflows)||[];if(c&&T.push(L[v]),d){let D=KD(n,i,w);T.push(L[D[0]],L[D[1]])}if(P=[...P,{placement:n,overflows:T}],!T.every(D=>D<=0)){var _,F;let D=(((_=a.flip)==null?void 0:_.index)||0)+1,W=S[D];if(W&&(!(d==="alignment"?g!==hn(W):!1)||P.every(V=>hn(V.placement)===g?V.overflows[0]>0:!0)))return{data:{index:D,overflows:P},reset:{placement:W}};let N=(F=P.filter(z=>z.overflows[0]<=0).sort((z,V)=>z.overflows[1]-V.overflows[1])[0])==null?void 0:F.placement;if(!N)switch(p){case"bestFit":{var j;let z=(j=P.filter(V=>{if(b){let k=hn(V.placement);return k===g||k==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(k=>k>0).reduce((k,K)=>k+K,0)]).sort((V,k)=>V[1]-k[1])[0])==null?void 0:j[0];z&&(N=z);break}case"initialPlacement":N=s;break}if(n!==N)return{reset:{placement:N}}}return{}}}};function ZD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JD(e){return $D.some(t=>e[t]>=0)}var oN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:o="referenceHidden",...n}=$n(e,t);switch(o){case"referenceHidden":{let a=await Ju(t,{...n,elementContext:"reference"}),i=ZD(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:JD(i)}}}case"escaped":{let a=await Ju(t,{...n,altBoundary:!0}),i=ZD(a,r.floating);return{data:{escapedOffsets:i,escaped:JD(i)}}}default:return{}}}}};var nN=new Set(["left","top"]);async function T6(e,t){let{placement:r,platform:o,elements:n}=e,a=await(o.isRTL==null?void 0:o.isRTL(n.floating)),i=Kn(r),s=el(r),l=hn(r)==="y",u=nN.has(i)?-1:1,c=a&&l?-1:1,d=$n(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),l?{x:p*c,y:f*u}:{x:f*u,y:p*c}}var aN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;let{x:n,y:a,placement:i,middlewareData:s}=t,l=await T6(t,e);return i===((r=s.offset)==null?void 0:r.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:n+l.x,y:a+l.y,data:{...l,placement:i}}}}},iN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:o,placement:n}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:x=>{let{x:v,y:g}=x;return{x:v,y:g}}},...l}=$n(e,t),u={x:r,y:o},c=await Ju(t,l),d=hn(Kn(n)),f=Kh(d),p=u[f],h=u[d];if(a){let x=f==="y"?"top":"left",v=f==="y"?"bottom":"right",g=p+c[x],y=p-c[v];p=$h(g,p,y)}if(i){let x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",g=h+c[x],y=h-c[v];h=$h(g,h,y)}let m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-r,y:m.y-o,enabled:{[f]:a,[d]:i}}}}}},sN=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:o,placement:n,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=$n(e,t),c={x:r,y:o},d=hn(n),f=Kh(d),p=c[f],h=c[d],m=$n(s,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let y=f==="y"?"height":"width",w=a.reference[f]-a.floating[y]+x.mainAxis,C=a.reference[f]+a.reference[y]-x.mainAxis;p<w?p=w:p>C&&(p=C)}if(u){var v,g;let y=f==="y"?"width":"height",w=nN.has(Kn(n)),C=a.reference[d]-a.floating[y]+(w&&((v=i.offset)==null?void 0:v[d])||0)+(w?0:x.crossAxis),b=a.reference[d]+a.reference[y]+(w?0:((g=i.offset)==null?void 0:g[d])||0)-(w?x.crossAxis:0);h<C?h=C:h>b&&(h=b)}return{[f]:p,[d]:h}}}},lN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;let{placement:n,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...u}=$n(e,t),c=await Ju(t,u),d=Kn(n),f=el(n),p=hn(n)==="y",{width:h,height:m}=a.floating,x,v;d==="top"||d==="bottom"?(x=d,v=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,x=f==="end"?"top":"bottom");let g=m-c.top-c.bottom,y=h-c.left-c.right,w=qn(m-c[x],g),C=qn(h-c[v],y),b=!t.middlewareData.shift,S=w,L=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(L=y),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(S=g),b&&!f){let P=Dr(c.left,0),_=Dr(c.right,0),F=Dr(c.top,0),j=Dr(c.bottom,0);p?L=h-2*(P!==0||_!==0?P+_:Dr(c.left,c.right)):S=m-2*(F!==0||j!==0?F+j:Dr(c.top,c.bottom))}await l({...t,availableWidth:L,availableHeight:S});let T=await i.getDimensions(s.floating);return h!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function Qh(){return typeof window<"u"}function ol(e){return cN(e)?(e.nodeName||"").toLowerCase():"#document"}function Jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vn(e){var t;return(t=(cN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cN(e){return Qh()?e instanceof Node||e instanceof Jr(e).Node:!1}function Fo(e){return Qh()?e instanceof Element||e instanceof Jr(e).Element:!1}function yn(e){return Qh()?e instanceof HTMLElement||e instanceof Jr(e).HTMLElement:!1}function uN(e){return!Qh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jr(e).ShadowRoot}var k6=new Set(["inline","contents"]);function ec(e){let{overflow:t,overflowX:r,overflowY:o,display:n}=Vo(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!k6.has(n)}var M6=new Set(["table","td","th"]);function dN(e){return M6.has(ol(e))}var E6=[":popover-open",":modal"];function rp(e){return E6.some(t=>{try{return e.matches(t)}catch{return!1}})}var A6=["transform","translate","scale","rotate","perspective"],D6=["transform","translate","scale","rotate","perspective","filter"],N6=["paint","layout","strict","content"];function Zh(e){let t=Jh(),r=Fo(e)?Vo(e):e;return A6.some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||D6.some(o=>(r.willChange||"").includes(o))||N6.some(o=>(r.contain||"").includes(o))}function fN(e){let t=ka(e);for(;yn(t)&&!nl(t);){if(Zh(t))return t;if(rp(t))return null;t=ka(t)}return null}function Jh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var _6=new Set(["html","body","#document"]);function nl(e){return _6.has(ol(e))}function Vo(e){return Jr(e).getComputedStyle(e)}function op(e){return Fo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ka(e){if(ol(e)==="html")return e;let t=e.assignedSlot||e.parentNode||uN(e)&&e.host||vn(e);return uN(t)?t.host:t}function pN(e){let t=ka(e);return nl(t)?e.ownerDocument?e.ownerDocument.body:e.body:yn(t)&&ec(t)?t:pN(t)}function rl(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let n=pN(e),a=n===((o=e.ownerDocument)==null?void 0:o.body),i=Jr(n);if(a){let s=ev(i);return t.concat(i,i.visualViewport||[],ec(n)?n:[],s&&r?rl(s):[])}return t.concat(n,rl(n,[],r))}function ev(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hN(e){let t=Vo(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=yn(e),a=n?e.offsetWidth:r,i=n?e.offsetHeight:o,s=ep(r)!==a||ep(o)!==i;return s&&(r=a,o=i),{width:r,height:o,$:s}}function KC(e){return Fo(e)?e:e.contextElement}function tc(e){let t=KC(e);if(!yn(t))return gn(1);let r=t.getBoundingClientRect(),{width:o,height:n,$:a}=hN(t),i=(a?ep(r.width):r.width)/o,s=(a?ep(r.height):r.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var O6=gn(0);function vN(e){let t=Jr(e);return!Jh()||!t.visualViewport?O6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function F6(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Jr(e)?!1:t}function al(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let n=e.getBoundingClientRect(),a=KC(e),i=gn(1);t&&(o?Fo(o)&&(i=tc(o)):i=tc(e));let s=F6(a,r,o)?vN(a):gn(0),l=(n.left+s.x)/i.x,u=(n.top+s.y)/i.y,c=n.width/i.x,d=n.height/i.y;if(a){let f=Jr(a),p=o&&Fo(o)?Jr(o):o,h=f,m=ev(h);for(;m&&o&&p!==h;){let x=tc(m),v=m.getBoundingClientRect(),g=Vo(m),y=v.left+(m.clientLeft+parseFloat(g.paddingLeft))*x.x,w=v.top+(m.clientTop+parseFloat(g.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=y,u+=w,h=Jr(m),m=ev(h)}}return tl({width:c,height:d,x:l,y:u})}function XC(e,t){let r=op(e).scrollLeft;return t?t.left+r:al(vn(e)).left+r}function yN(e,t,r){r===void 0&&(r=!1);let o=e.getBoundingClientRect(),n=o.left+t.scrollLeft-(r?0:XC(e,o)),a=o.top+t.scrollTop;return{x:n,y:a}}function V6(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e,a=n==="fixed",i=vn(o),s=t?rp(t.floating):!1;if(o===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=gn(1),c=gn(0),d=yn(o);if((d||!d&&!a)&&((ol(o)!=="body"||ec(i))&&(l=op(o)),yn(o))){let p=al(o);u=tc(o),c.x=p.x+o.clientLeft,c.y=p.y+o.clientTop}let f=i&&!d&&!a?yN(i,l,!0):gn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}}function B6(e){return Array.from(e.getClientRects())}function H6(e){let t=vn(e),r=op(e),o=e.ownerDocument.body,n=Dr(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Dr(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),i=-r.scrollLeft+XC(e),s=-r.scrollTop;return Vo(o).direction==="rtl"&&(i+=Dr(t.clientWidth,o.clientWidth)-n),{width:n,height:a,x:i,y:s}}function U6(e,t){let r=Jr(e),o=vn(e),n=r.visualViewport,a=o.clientWidth,i=o.clientHeight,s=0,l=0;if(n){a=n.width,i=n.height;let u=Jh();(!u||u&&t==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}return{width:a,height:i,x:s,y:l}}var z6=new Set(["absolute","fixed"]);function W6(e,t){let r=al(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,a=yn(e)?tc(e):gn(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=n*a.x,u=o*a.y;return{width:i,height:s,x:l,y:u}}function mN(e,t,r){let o;if(t==="viewport")o=U6(e,r);else if(t==="document")o=H6(vn(e));else if(Fo(t))o=W6(t,r);else{let n=vN(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return tl(o)}function xN(e,t){let r=ka(e);return r===t||!Fo(r)||nl(r)?!1:Vo(r).position==="fixed"||xN(r,t)}function G6(e,t){let r=t.get(e);if(r)return r;let o=rl(e,[],!1).filter(s=>Fo(s)&&ol(s)!=="body"),n=null,a=Vo(e).position==="fixed",i=a?ka(e):e;for(;Fo(i)&&!nl(i);){let s=Vo(i),l=Zh(i);!l&&s.position==="fixed"&&(n=null),(a?!l&&!n:!l&&s.position==="static"&&!!n&&z6.has(n.position)||ec(i)&&!l&&xN(e,i))?o=o.filter(c=>c!==i):n=s,i=ka(i)}return t.set(e,o),o}function j6(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e,i=[...r==="clippingAncestors"?rp(t)?[]:G6(t,this._c):[].concat(r),o],s=i[0],l=i.reduce((u,c)=>{let d=mN(t,c,n);return u.top=Dr(d.top,u.top),u.right=qn(d.right,u.right),u.bottom=qn(d.bottom,u.bottom),u.left=Dr(d.left,u.left),u},mN(t,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function q6(e){let{width:t,height:r}=hN(e);return{width:t,height:r}}function $6(e,t,r){let o=yn(t),n=vn(t),a=r==="fixed",i=al(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=gn(0);function u(){l.x=XC(n)}if(o||!o&&!a)if((ol(t)!=="body"||ec(n))&&(s=op(t)),o){let p=al(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else n&&u();a&&!o&&n&&u();let c=n&&!o&&!a?yN(n,s):gn(0),d=i.left+s.scrollLeft-l.x-c.x,f=i.top+s.scrollTop-l.y-c.y;return{x:d,y:f,width:i.width,height:i.height}}function $C(e){return Vo(e).position==="static"}function gN(e,t){if(!yn(e)||Vo(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return vn(e)===r&&(r=r.ownerDocument.body),r}function wN(e,t){let r=Jr(e);if(rp(e))return r;if(!yn(e)){let n=ka(e);for(;n&&!nl(n);){if(Fo(n)&&!$C(n))return n;n=ka(n)}return r}let o=gN(e,t);for(;o&&dN(o)&&$C(o);)o=gN(o,t);return o&&nl(o)&&$C(o)&&!Zh(o)?r:o||fN(e)||r}var K6=async function(e){let t=this.getOffsetParent||wN,r=this.getDimensions,o=await r(e.floating);return{reference:$6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function X6(e){return Vo(e).direction==="rtl"}var CN={convertOffsetParentRelativeRectToViewportRelativeRect:V6,getDocumentElement:vn,getClippingRect:j6,getOffsetParent:wN,getElementRects:K6,getClientRects:B6,getDimensions:q6,getScale:tc,isElement:Fo,isRTL:X6};function SN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Y6(e,t){let r=null,o,n=vn(e);function a(){var s;clearTimeout(o),(s=r)==null||s.disconnect(),r=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:p}=u;if(s||t(),!f||!p)return;let h=tp(d),m=tp(n.clientWidth-(c+f)),x=tp(n.clientHeight-(d+p)),v=tp(c),y={rootMargin:-h+"px "+-m+"px "+-x+"px "+-v+"px",threshold:Dr(0,qn(1,l))||1},w=!0;function C(b){let S=b[0].intersectionRatio;if(S!==l){if(!w)return i();S?i(!1,S):o=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!SN(u,e.getBoundingClientRect())&&i(),w=!1}try{r=new IntersectionObserver(C,{...y,root:n.ownerDocument})}catch{r=new IntersectionObserver(C,y)}r.observe(e)}return i(!0),a}function YC(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=KC(e),c=n||a?[...u?rl(u):[],...rl(t)]:[];c.forEach(v=>{n&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});let d=u&&s?Y6(u,r):null,f=-1,p=null;i&&(p=new ResizeObserver(v=>{let[g]=v;g&&g.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),r()}),u&&!l&&p.observe(u),p.observe(t));let h,m=l?al(e):null;l&&x();function x(){let v=al(e);m&&!SN(m,v)&&r(),m=v,h=requestAnimationFrame(x)}return r(),()=>{var v;c.forEach(g=>{n&&g.removeEventListener("scroll",r),a&&g.removeEventListener("resize",r)}),d?.(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var bN=aN;var RN=iN,LN=rN,IN=lN,PN=oN,QC=tN;var TN=sN,ZC=(e,t,r)=>{let o=new Map,n={platform:CN,...r},a={...n.platform,_c:o};return eN(e,t,{...n,platform:a})};var Lt=R(A(),1),MN=R(A(),1),EN=R(tu(),1),Q6=typeof document<"u",Z6=function(){},tv=Q6?MN.useLayoutEffect:Z6;function rv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!rv(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){let a=n[o];if(!(a==="_owner"&&e.$$typeof)&&!rv(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function AN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kN(e,t){let r=AN(e);return Math.round(t*r)/r}function JC(e){let t=Lt.useRef(e);return tv(()=>{t.current=e}),t}function DN(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=Lt.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Lt.useState(o);rv(f,o)||p(o);let[h,m]=Lt.useState(null),[x,v]=Lt.useState(null),g=Lt.useCallback(V=>{V!==b.current&&(b.current=V,m(V))},[]),y=Lt.useCallback(V=>{V!==S.current&&(S.current=V,v(V))},[]),w=a||h,C=i||x,b=Lt.useRef(null),S=Lt.useRef(null),L=Lt.useRef(c),T=l!=null,P=JC(l),_=JC(n),F=JC(u),j=Lt.useCallback(()=>{if(!b.current||!S.current)return;let V={placement:t,strategy:r,middleware:f};_.current&&(V.platform=_.current),ZC(b.current,S.current,V).then(k=>{let K={...k,isPositioned:F.current!==!1};D.current&&!rv(L.current,K)&&(L.current=K,EN.flushSync(()=>{d(K)}))})},[f,t,r,_,F]);tv(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[u]);let D=Lt.useRef(!1);tv(()=>(D.current=!0,()=>{D.current=!1}),[]),tv(()=>{if(w&&(b.current=w),C&&(S.current=C),w&&C){if(P.current)return P.current(w,C,j);j()}},[w,C,j,P,T]);let W=Lt.useMemo(()=>({reference:b,floating:S,setReference:g,setFloating:y}),[g,y]),N=Lt.useMemo(()=>({reference:w,floating:C}),[w,C]),z=Lt.useMemo(()=>{let V={position:r,left:0,top:0};if(!N.floating)return V;let k=kN(N.floating,c.x),K=kN(N.floating,c.y);return s?{...V,transform:"translate("+k+"px, "+K+"px)",...AN(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:k,top:K}},[r,s,N.floating,c.x,c.y]);return Lt.useMemo(()=>({...c,update:j,refs:W,elements:N,floatingStyles:z}),[c,j,W,N,z])}var J6=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:o,padding:n}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?QC({element:o.current,padding:n}).fn(r):{}:o?QC({element:o,padding:n}).fn(r):{}}}},NN=(e,t)=>({...bN(e),options:[e,t]}),_N=(e,t)=>({...RN(e),options:[e,t]}),ON=(e,t)=>({...TN(e),options:[e,t]}),FN=(e,t)=>({...LN(e),options:[e,t]}),VN=(e,t)=>({...IN(e),options:[e,t]});var BN=(e,t)=>({...PN(e),options:[e,t]});var HN=(e,t)=>({...J6(e),options:[e,t]});var UN=R(A(),1);var eS=R(E(),1),e8="Arrow",zN=UN.forwardRef((e,t)=>{let{children:r,width:o=10,height:n=5,...a}=e;return(0,eS.jsx)(X.svg,{...a,ref:t,width:o,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,eS.jsx)("polygon",{points:"0,0 30,0 15,10"})})});zN.displayName=e8;var WN=zN;var Vi=R(E(),1);var tS="Popper",[GN,Bo]=ke(tS),[r8,jN]=GN(tS),qN=e=>{let{__scopePopper:t,children:r}=e,[o,n]=eo.useState(null);return(0,Vi.jsx)(r8,{scope:t,anchor:o,onAnchorChange:n,children:r})};qN.displayName=tS;var $N="PopperAnchor",KN=eo.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:o,...n}=e,a=jN($N,r),i=eo.useRef(null),s=ae(t,i),l=eo.useRef(null);return eo.useEffect(()=>{let u=l.current;l.current=o?.current||i.current,u!==l.current&&a.onAnchorChange(l.current)}),o?null:(0,Vi.jsx)(X.div,{...n,ref:s})});KN.displayName=$N;var rS="PopperContent",[o8,n8]=GN(rS),XN=eo.forwardRef((e,t)=>{let{__scopePopper:r,side:o="bottom",sideOffset:n=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:h,...m}=e,x=jN(rS,r),[v,g]=eo.useState(null),y=ae(t,q=>g(q)),[w,C]=eo.useState(null),b=Zu(w),S=b?.width??0,L=b?.height??0,T=o+(a!=="center"?"-"+a:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},_=Array.isArray(u)?u:[u],F=_.length>0,j={padding:P,boundary:_.filter(i8),altBoundary:F},{refs:D,floatingStyles:W,placement:N,isPositioned:z,middlewareData:V}=DN({strategy:"fixed",placement:T,whileElementsMounted:(...q)=>YC(...q,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[NN({mainAxis:n+L,alignmentAxis:i}),l&&_N({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?ON():void 0,...j}),l&&FN({...j}),VN({...j,apply:({elements:q,rects:ge,availableWidth:Re,availableHeight:_e})=>{let{width:nt,height:bt}=ge.reference,wo=q.floating.style;wo.setProperty("--radix-popper-available-width",`${Re}px`),wo.setProperty("--radix-popper-available-height",`${_e}px`),wo.setProperty("--radix-popper-anchor-width",`${nt}px`),wo.setProperty("--radix-popper-anchor-height",`${bt}px`)}}),w&&HN({element:w,padding:s}),s8({arrowWidth:S,arrowHeight:L}),f&&BN({strategy:"referenceHidden",...j})]}),[k,K]=ZN(N),de=et(h);Me(()=>{z&&de?.()},[z,de]);let M=V.arrow?.x,Y=V.arrow?.y,le=V.arrow?.centerOffset!==0,[J,fe]=eo.useState();return Me(()=>{v&&fe(window.getComputedStyle(v).zIndex)},[v]),(0,Vi.jsx)("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:z?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,Vi.jsx)(o8,{scope:r,placedSide:k,onArrowChange:C,arrowX:M,arrowY:Y,shouldHideArrow:le,children:(0,Vi.jsx)(X.div,{"data-side":k,"data-align":K,...m,ref:y,style:{...m.style,animation:z?void 0:"none"}})})})});XN.displayName=rS;var YN="PopperArrow",a8={top:"bottom",right:"left",bottom:"top",left:"right"},QN=eo.forwardRef(function(t,r){let{__scopePopper:o,...n}=t,a=n8(YN,o),i=a8[a.placedSide];return(0,Vi.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,Vi.jsx)(WN,{...n,ref:r,style:{...n.style,display:"block"}})})});QN.displayName=YN;function i8(e){return e!==null}var s8=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:o,middlewareData:n}=t,i=n.arrow?.centerOffset!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,c]=ZN(r),d={start:"0%",center:"50%",end:"100%"}[c],f=(n.arrow?.x??0)+s/2,p=(n.arrow?.y??0)+l/2,h="",m="";return u==="bottom"?(h=i?d:`${f}px`,m=`${-l}px`):u==="top"?(h=i?d:`${f}px`,m=`${o.floating.height+l}px`):u==="right"?(h=`${-l}px`,m=i?d:`${p}px`):u==="left"&&(h=`${o.floating.width+l}px`,m=i?d:`${p}px`),{data:{x:h,y:m}}}});function ZN(e){let[t,r="center"]=e.split("-");return[t,r]}var Ma=qN,Ea=KN,Bi=XN,Hi=QN;var nv=R(A(),1),JN=R(tu(),1);var e2=R(E(),1),l8="Portal",ho=nv.forwardRef((e,t)=>{let{container:r,...o}=e,[n,a]=nv.useState(!1);Me(()=>a(!0),[]);let i=r||n&&globalThis?.document?.body;return i?JN.default.createPortal((0,e2.jsx)(X.div,{...o,ref:t}),i):null});ho.displayName=l8;var u8=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rc=new WeakMap,av=new WeakMap,iv={},oS=0,t2=function(e){return e&&(e.host||t2(e.parentNode))},c8=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=t2(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},d8=function(e,t,r,o){var n=c8(t,Array.isArray(e)?e:[e]);iv[r]||(iv[r]=new WeakMap);var a=iv[r],i=[],s=new Set,l=new Set(n),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};n.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))c(f);else try{var p=f.getAttribute(o),h=p!==null&&p!=="false",m=(rc.get(f)||0)+1,x=(a.get(f)||0)+1;rc.set(f,m),a.set(f,x),i.push(f),m===1&&h&&av.set(f,!0),x===1&&f.setAttribute(r,"true"),h||f.setAttribute(o,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return c(t),s.clear(),oS++,function(){i.forEach(function(d){var f=rc.get(d)-1,p=a.get(d)-1;rc.set(d,f),a.set(d,p),f||(av.has(d)||d.removeAttribute(o),av.delete(d)),p||d.removeAttribute(r)}),oS--,oS||(rc=new WeakMap,rc=new WeakMap,av=new WeakMap,iv={})}},Ui=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),n=t||u8(e);return n?(o.push.apply(o,Array.from(n.querySelectorAll("[aria-live], script"))),d8(o,n,r,"aria-hidden")):function(){return null}};var to=function(){return to=Object.assign||function(t){for(var r,o=1,n=arguments.length;o<n;o++){r=arguments[o];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},to.apply(this,arguments)};function sv(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function r2(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,a;o<n;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))}var fv=R(A());var gr=R(A());var il="right-scroll-bar-position",sl="width-before-scroll-bar",nS="with-scroll-bars-hidden",aS="--removed-body-scroll-bar-size";function lv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}var o2=R(A());function n2(e,t){var r=(0,o2.useState)(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var n=r.value;n!==o&&(r.value=o,r.callback(o,n))}}}})[0];return r.callback=t,r.facade}var uv=R(A());var f8=typeof window<"u"?uv.useLayoutEffect:uv.useEffect,a2=new WeakMap;function iS(e,t){var r=n2(t||null,function(o){return e.forEach(function(n){return lv(n,o)})});return f8(function(){var o=a2.get(r);if(o){var n=new Set(o),a=new Set(e),i=r.current;n.forEach(function(s){a.has(s)||lv(s,null)}),a.forEach(function(s){n.has(s)||lv(s,i)})}a2.set(r,e)},[e]),r}function p8(e){return e}function m8(e,t){t===void 0&&(t=p8);var r=[],o=!1,n={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,o);return r.push(i),function(){r=r.filter(function(s){return s!==i})}},assignSyncMedium:function(a){for(o=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(s){return a(s)},filter:function(){return r}}},assignMedium:function(a){o=!0;var i=[];if(r.length){var s=r;r=[],s.forEach(a),i=r}var l=function(){var c=i;i=[],c.forEach(a)},u=function(){return Promise.resolve().then(l)};u(),r={push:function(c){i.push(c),u()},filter:function(c){return i=i.filter(c),r}}}};return n}function sS(e){e===void 0&&(e={});var t=m8(null);return t.options=to({async:!0,ssr:!1},e),t}var i2=R(A()),s2=function(e){var t=e.sideCar,r=sv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return i2.createElement(o,to({},r))};s2.isSideCarExport=!0;function lS(e,t){return e.useMedium(t),s2}var cv=sS();var uS=function(){},np=gr.forwardRef(function(e,t){var r=gr.useRef(null),o=gr.useState({onScrollCapture:uS,onWheelCapture:uS,onTouchMoveCapture:uS}),n=o[0],a=o[1],i=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,m=e.inert,x=e.allowPinchZoom,v=e.as,g=v===void 0?"div":v,y=e.gapMode,w=sv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,b=iS([r,t]),S=to(to({},w),n);return gr.createElement(gr.Fragment,null,c&&gr.createElement(C,{sideCar:cv,removeScrollBar:u,shards:d,noRelative:p,noIsolation:h,inert:m,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:y}),i?gr.cloneElement(gr.Children.only(s),to(to({},S),{ref:b})):gr.createElement(g,to({},S,{className:l,ref:b}),s))});np.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};np.classNames={fullWidth:sl,zeroRight:il};var rt=R(A());var nc=R(A());var c2=R(A());var l2;var u2=function(){if(l2)return l2;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function g8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=u2();return t&&e.setAttribute("nonce",t),e}function h8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function v8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var cS=function(){var e=0,t=null;return{add:function(r){e==0&&(t=g8())&&(h8(t,r),v8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var dS=function(){var e=cS();return function(t,r){c2.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}};var ap=function(){var e=dS(),t=function(r){var o=r.styles,n=r.dynamic;return e(o,n),null};return t};var y8={left:0,top:0,right:0,gap:0},fS=function(e){return parseInt(e||"",10)||0},x8=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],n=t[e==="padding"?"paddingRight":"marginRight"];return[fS(r),fS(o),fS(n)]},pS=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return y8;var t=x8(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}};var w8=ap(),oc="data-scroll-locked",C8=function(e,t,r,o){var n=e.left,a=e.top,i=e.right,s=e.gap;return r===void 0&&(r="margin"),`
17
+ `),()=>{m.contains(h)&&m.removeChild(h)}},[t]),(0,PM.jsx)(iC,{isPresent:t,childRef:a,sizeRef:i,children:Kg.cloneElement(e,{ref:a})})}var MM=({children:e,initial:t,isPresent:r,onExitComplete:o,custom:n,presenceAffectsLayout:a,mode:i,anchorX:s,root:l})=>{let u=Un(Sj),c=(0,zf.useId)(),d=!0,f=(0,zf.useMemo)(()=>(d=!1,{id:c,initial:t,isPresent:r,custom:n,onExitComplete:p=>{u.set(p,!0);for(let h of u.values())if(!h)return;o&&o()},register:p=>(u.set(p,!1),()=>u.delete(p))}),[r,u,o]);return a&&d&&(f={...f}),(0,zf.useMemo)(()=>{u.forEach((p,h)=>u.set(h,!1))},[r]),kM.useEffect(()=>{!r&&!u.size&&o&&o()},[r]),i==="popLayout"&&(e=(0,sC.jsx)(TM,{isPresent:r,anchorX:s,root:l,children:e})),(0,sC.jsx)(xi.Provider,{value:f,children:e})};function Sj(){return new Map}var Pi=R(A(),1);function Xg(e=!0){let t=(0,Pi.useContext)(xi);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:o,register:n}=t,a=(0,Pi.useId)();(0,Pi.useEffect)(()=>{if(e)return n(a)},[e]);let i=(0,Pi.useCallback)(()=>e&&o&&o(a),[a,o,e]);return!r&&o?[!1,i]:[!0]}var Yg=R(A(),1),Wf=e=>e.key||"";function lC(e){let t=[];return Yg.Children.forEach(e,r=>{(0,Yg.isValidElement)(r)&&t.push(r)}),t}var fn=({children:e,custom:t,initial:r=!0,onExitComplete:o,presenceAffectsLayout:n=!0,mode:a="sync",propagate:i=!1,anchorX:s="left",root:l})=>{let[u,c]=Xg(i),d=(0,Gn.useMemo)(()=>lC(e),[e]),f=i&&!u?[]:d.map(Wf),p=(0,Gn.useRef)(!0),h=(0,Gn.useRef)(d),m=Un(()=>new Map),[x,v]=(0,Gn.useState)(d),[g,y]=(0,Gn.useState)(d);wu(()=>{p.current=!1,h.current=d;for(let b=0;b<g.length;b++){let S=Wf(g[b]);f.includes(S)?m.delete(S):m.get(S)!==!0&&m.set(S,!1)}},[g,f.length,f.join("-")]);let w=[];if(d!==x){let b=[...d];for(let S=0;S<g.length;S++){let L=g[S],T=Wf(L);f.includes(T)||(b.splice(S,0,L),w.push(L))}return a==="wait"&&w.length&&(b=w),y(lC(b)),v(d),null}let{forceRender:C}=(0,Gn.useContext)(yu);return(0,Gf.jsx)(Gf.Fragment,{children:g.map(b=>{let S=Wf(b),L=i&&!u?!1:d===g||f.includes(S),T=()=>{if(m.has(S))m.set(S,!0);else return;let P=!0;m.forEach(_=>{_||(P=!1)}),P&&(C?.(),y(h.current),i&&c?.(),o&&o())};return(0,Gf.jsx)(MM,{isPresent:L,initial:!p.current||r?void 0:!1,custom:t,presenceAffectsLayout:n,mode:a,root:l,onExitComplete:L?void 0:T,anchorX:s,children:b},S)})})};var EM=R(A(),1),Qg=(0,EM.createContext)({strict:!1});var AM={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"]},Sa={};for(let e in AM)Sa[e]={isEnabled:t=>AM[e].some(r=>!!t[r])};function DM(e){for(let t in e)Sa[t]={...Sa[t],...e[t]}}var bj=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 jf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||bj.has(e)}var NM=e=>!jf(e);function Rj(e){typeof e=="function"&&(NM=t=>t.startsWith("on")?!jf(t):e(t))}try{Rj(vU("@emotion/is-prop-valid").default)}catch{}function _M(e,t,r){let o={};for(let n in e)n==="values"&&typeof e.values=="object"||(NM(n)||r===!0&&jf(n)||!t&&!jf(n)||e.draggable&&n.startsWith("onDrag"))&&(o[n]=e[n]);return o}var uh=R(E(),1);var Fu=R(A(),1);var OM=R(A(),1),Ti=(0,OM.createContext)({});var eh=R(A(),1);function ki(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ba(e){return typeof e=="string"||Array.isArray(e)}var Zg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qf=["initial",...Zg];function js(e){return ki(e.animate)||qf.some(t=>ba(e[t]))}function Jg(e){return!!(js(e)||e.variants)}function FM(e,t){if(js(e)){let{initial:r,animate:o}=e;return{initial:r===!1||ba(r)?r:void 0,animate:ba(o)?o:void 0}}return e.inherit!==!1?t:{}}function BM(e){let{initial:t,animate:r}=FM(e,(0,eh.useContext)(Ti));return(0,eh.useMemo)(()=>({initial:t,animate:r}),[VM(t),VM(r)])}function VM(e){return Array.isArray(e)?e.join(" "):e}var Au=R(A(),1);var zM=R(A(),1);var qs={};function HM(e){for(let t in e)qs[t]=e[t],As(t)&&(qs[t].isCSSVariable=!0)}function th(e,{layout:t,layoutId:r}){return po.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!qs[e]||e==="opacity")}var Lj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ij=dn.length;function UM(e,t,r){let o="",n=!0;for(let a=0;a<Ij;a++){let i=dn[a],s=e[i];if(s===void 0)continue;let l=!0;if(typeof s=="number"?l=s===(i.startsWith("scale")?1:0):l=parseFloat(s)===0,!l||r){let u=Bf(s,Hs[i]);if(!l){n=!1;let c=Lj[i]||i;o+=`${c}(${u}) `}r&&(t[i]=u)}}return o=o.trim(),r?o=r(t,n?"":o):n&&(o="none"),o}function ku(e,t,r){let{style:o,vars:n,transformOrigin:a}=e,i=!1,s=!1;for(let l in t){let u=t[l];if(po.has(l)){i=!0;continue}else if(As(l)){n[l]=u;continue}else{let c=Bf(u,Hs[l]);l.startsWith("origin")?(s=!0,a[l]=c):o[l]=c}}if(t.transform||(i||r?o.transform=UM(t,e.transform,r):o.transform&&(o.transform="none")),s){let{originX:l="50%",originY:u="50%",originZ:c=0}=a;o.transformOrigin=`${l} ${u} ${c}`}}var Mu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function uC(e,t,r){for(let o in t)!Ee(t[o])&&!th(o,r)&&(e[o]=t[o])}function Pj({transformTemplate:e},t){return(0,zM.useMemo)(()=>{let r=Mu();return ku(r,t,e),Object.assign({},r.vars,r.style)},[t])}function Tj(e,t){let r=e.style||{},o={};return uC(o,r,e),Object.assign(o,Pj(e,t)),o}function WM(e,t){let r={},o=Tj(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}var jM=R(A(),1);var kj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Mj={offset:"strokeDashoffset",array:"strokeDasharray"};function GM(e,t,r=1,o=0,n=!0){e.pathLength=1;let a=n?kj:Mj;e[a.offset]=oe.transform(-o);let i=oe.transform(t),s=oe.transform(r);e[a.array]=`${i} ${s}`}function rh(e,{attrX:t,attrY:r,attrScale:o,pathLength:n,pathSpacing:a=1,pathOffset:i=0,...s},l,u,c){if(ku(e,s,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{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=c?.transformBox??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),r!==void 0&&(d.y=r),o!==void 0&&(d.scale=o),n!==void 0&&GM(d,n,a,i,!1)}var oh=()=>({...Mu(),attrs:{}});var nh=e=>typeof e=="string"&&e.toLowerCase()==="svg";function qM(e,t,r,o){let n=(0,jM.useMemo)(()=>{let a=oh();return rh(a,t,nh(o),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){let a={};uC(a,e.style,e),n.style={...a,...n.style}}return n}var $M=["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 Eu(e){return typeof e!="string"||e.includes("-")?!1:!!($M.indexOf(e)>-1||/[A-Z]/u.test(e))}function KM(e,t,r,{latestValues:o},n,a=!1){let s=(Eu(e)?qM:WM)(t,o,n,e),l=_M(t,typeof e=="string",a),u=e!==Au.Fragment?{...l,...s,ref:r}:{},{children:c}=t,d=(0,Au.useMemo)(()=>Ee(c)?c.get():c,[c]);return(0,Au.createElement)(e,{...u,children:d})}var cC=R(A(),1);function XM(e){let t=[{},{}];return e?.values.forEach((r,o)=>{t[0][o]=r.get(),t[1][o]=r.getVelocity()}),t}function Du(e,t,r,o){if(typeof t=="function"){let[n,a]=XM(o);t=t(r!==void 0?r:e.custom,n,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[n,a]=XM(o);t=t(r!==void 0?r:e.custom,n,a)}return t}function Nu(e){return Ee(e)?e.get():e}function Ej({scrapeMotionValuesFromProps:e,createRenderState:t},r,o,n){return{latestValues:Aj(r,o,n,e),renderState:t()}}function Aj(e,t,r,o){let n={},a=o(e,{});for(let f in a)n[f]=Nu(a[f]);let{initial:i,animate:s}=e,l=js(e),u=Jg(e);t&&u&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),s===void 0&&(s=t.animate));let c=r?r.initial===!1:!1;c=c||i===!1;let d=c?s:i;if(d&&typeof d!="boolean"&&!ki(d)){let f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){let h=Du(e,f[p]);if(h){let{transitionEnd:m,transition:x,...v}=h;for(let g in v){let y=v[g];if(Array.isArray(y)){let w=c?y.length-1:0;y=y[w]}y!==null&&(n[g]=y)}for(let g in m)n[g]=m[g]}}}return n}var ah=e=>(t,r)=>{let o=(0,cC.useContext)(Ti),n=(0,cC.useContext)(xi),a=()=>Ej(e,t,o,n);return r?a():Un(a)};function _u(e,t,r){let{style:o}=e,n={};for(let a in o)(Ee(o[a])||t.style&&Ee(t.style[a])||th(a,e)||r?.getValue(a)?.liveStyle!==void 0)&&(n[a]=o[a]);return n}var YM=ah({scrapeMotionValuesFromProps:_u,createRenderState:Mu});function ih(e,t,r){let o=_u(e,t,r);for(let n in e)if(Ee(e[n])||Ee(t[n])){let a=dn.indexOf(n)!==-1?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n;o[a]=e[n]}return o}var QM=ah({scrapeMotionValuesFromProps:ih,createRenderState:oh});var ZM=Symbol.for("motionComponentSymbol");var JM=R(A(),1);function Ra(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function eE(e,t,r){return(0,JM.useCallback)(o=>{o&&e.onMount&&e.onMount(o),t&&(o?t.mount(o):t.unmount()),r&&(typeof r=="function"?r(o):Ra(r)&&(r.current=o))},[t])}var Yr=R(A(),1);var Ou=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var Dj="framerAppearId",sh="data-"+Ou(Dj);var tE=R(A(),1),lh=(0,tE.createContext)({});function rE(e,t,r,o,n){let{visualElement:a}=(0,Yr.useContext)(Ti),i=(0,Yr.useContext)(Qg),s=(0,Yr.useContext)(xi),l=(0,Yr.useContext)(Ii).reducedMotion,u=(0,Yr.useRef)(null);o=o||i.renderer,!u.current&&o&&(u.current=o(e,{visualState:t,parent:a,props:r,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:l}));let c=u.current,d=(0,Yr.useContext)(lh);c&&!c.projection&&n&&(c.type==="html"||c.type==="svg")&&Nj(u.current,r,n,d);let f=(0,Yr.useRef)(!1);(0,Yr.useInsertionEffect)(()=>{c&&f.current&&c.update(r,s)});let p=r[sh],h=(0,Yr.useRef)(!!p&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return wu(()=>{c&&(f.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),c.scheduleRenderMicrotask(),h.current&&c.animationState&&c.animationState.animateChanges())}),(0,Yr.useEffect)(()=>{c&&(!h.current&&c.animationState&&c.animationState.animateChanges(),h.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),h.current=!1),c.enteringChildren=void 0)}),c}function Nj(e,t,r,o){let{layoutId:n,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:oE(e.parent)),e.projection.setOptions({layoutId:n,layout:a,alwaysMeasureLayout:!!i||s&&Ra(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:o,crossfade:c,layoutScroll:l,layoutRoot:u})}function oE(e){if(e)return e.options.allowProjection!==!1?e.projection:oE(e.parent)}function ch(e,{forwardMotionProps:t=!1}={},r,o){r&&DM(r);let n=Eu(e)?QM:YM;function a(s,l){let u,c={...(0,Fu.useContext)(Ii),...s,layoutId:_j(s)},{isStatic:d}=c,f=BM(s),p=n(s,d);if(!d&&xu){Oj(c,r);let h=Fj(c);u=h.MeasureLayout,f.visualElement=rE(e,p,c,o,h.ProjectionNode)}return(0,uh.jsxs)(Ti.Provider,{value:f,children:[u&&f.visualElement?(0,uh.jsx)(u,{visualElement:f.visualElement,...c}):null,KM(e,s,eE(p,f.visualElement,l),p,d,t)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;let i=(0,Fu.forwardRef)(a);return i[ZM]=e,i}function _j({layoutId:e}){let t=(0,Fu.useContext)(yu).id;return t&&e!==void 0?t+"-"+e:e}function Oj(e,t){let r=(0,Fu.useContext)(Qg).strict}function Fj(e){let{drag:t,layout:r}=Sa;if(!t&&!r)return{};let o={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function nE(e,t){if(typeof Proxy>"u")return ch;let r=new Map,o=(a,i)=>ch(a,i,e,t),n=(a,i)=>o(a,i);return new Proxy(n,{get:(a,i)=>i==="create"?o:(r.has(i)||r.set(i,ch(i,void 0,e,t)),r.get(i))})}var wE=R(A(),1);function dh({top:e,left:t,right:r,bottom:o}){return{x:{min:t,max:r},y:{min:e,max:o}}}function aE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iE(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:o.y,right:o.x}}function dC(e){return e===void 0||e===1}function fh({scale:e,scaleX:t,scaleY:r}){return!dC(e)||!dC(t)||!dC(r)}function La(e){return fh(e)||fC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function fC(e){return sE(e.x)||sE(e.y)}function sE(e){return e&&e!=="0%"}function $f(e,t,r){let o=e-r,n=t*o;return r+n}function lE(e,t,r,o,n){return n!==void 0&&(e=$f(e,n,o)),$f(e,r,o)+t}function pC(e,t=0,r=1,o,n){e.min=lE(e.min,t,r,o,n),e.max=lE(e.max,t,r,o,n)}function mC(e,{x:t,y:r}){pC(e.x,t.translate,t.scale,t.originPoint),pC(e.y,r.translate,r.scale,r.originPoint)}var uE=.999999999999,cE=1.0000000000001;function fE(e,t,r,o=!1){let n=r.length;if(!n)return;t.x=t.y=1;let a,i;for(let s=0;s<n;s++){a=r[s],i=a.projectionDelta;let{visualElement:l}=a.options;l&&l.props.style&&l.props.style.display==="contents"||(o&&a.options.layoutScroll&&a.scroll&&a!==a.root&&$s(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,mC(e,i)),o&&La(a.latestValues)&&$s(e,a.latestValues))}t.x<cE&&t.x>uE&&(t.x=1),t.y<cE&&t.y>uE&&(t.y=1)}function Mi(e,t){e.min=e.min+t,e.max=e.max+t}function dE(e,t,r,o,n=.5){let a=be(e.min,e.max,n);pC(e,t,r,a,o)}function $s(e,t){dE(e.x,t.x,t.scaleX,t.scale,t.originX),dE(e.y,t.y,t.scaleY,t.scale,t.originY)}function gC(e,t){return dh(iE(e.getBoundingClientRect(),t))}function pE(e,t,r){let o=gC(e,r),{scroll:n}=t;return n&&(Mi(o.x,n.offset.x),Mi(o.y,n.offset.y)),o}var mE=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ks=()=>({x:mE(),y:mE()}),gE=()=>({min:0,max:0}),We=()=>({x:gE(),y:gE()});var Kf={current:null},ph={current:!1};function hE(){if(ph.current=!0,!!xu)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Kf.current=e.matches;e.addEventListener("change",t),t()}else Kf.current=!1}var Ei=new WeakMap;function vE(e,t,r){for(let o in t){let n=t[o],a=r[o];if(Ee(n))e.addValue(o,n);else if(Ee(a))e.addValue(o,Xr(n,{owner:e}));else if(a!==n)if(e.hasValue(o)){let i=e.getValue(o);i.liveStyle===!0?i.jump(n):i.hasAnimated||i.set(n)}else{let i=e.getStaticValue(o);e.addValue(o,Xr(i!==void 0?i:n,{owner:e}))}}for(let o in r)t[o]===void 0&&e.removeValue(o);return t}var yE=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Vu=class{scrapeMotionValuesFromProps(t,r,o){return{}}constructor({parent:t,props:r,presenceContext:o,reducedMotionConfig:n,blockInitialAnimation:a,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=wa,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=()=>{let f=xt.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,we.render(this.render,!1,!0))};let{latestValues:l,renderState:u}=i;this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=r,this.presenceContext=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=js(r),this.isVariantNode=Jg(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...d}=this.scrapeMotionValuesFromProps(r,{},this);for(let f in d){let p=d[f];l[f]!==void 0&&Ee(p)&&p.set(l[f])}}mount(t){this.current=t,Ei.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((r,o)=>this.bindToMotionValue(o,r)),ph.current||hE(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Kf.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),dr(this.notifyUpdate),dr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let r=this.features[t];r&&(r.unmount(),r.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,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let o=po.has(t);o&&this.onBindTransform&&this.onBindTransform();let n=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&we.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{n(),a&&a(),r.owner&&r.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 Sa){let r=Sa[t];if(!r)continue;let{isEnabled:o,Feature:n}=r;if(!this.features[t]&&n&&o(this.props)&&(this.features[t]=new n(this)),this.features[t]){let a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):We()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let o=0;o<yE.length;o++){let n=yE[o];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let a="on"+n,i=t[a];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=vE(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){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let o=this.values.get(t);r!==o&&(o&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let o=this.values.get(t);return o===void 0&&r!==void 0&&(o=Xr(r===null?void 0:r,{owner:this}),this.addValue(t,o)),o}readValue(t,r){let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(sf(o)||uf(o))?o=parseFloat(o):!aC(o)&&pr.test(r)&&(o=Of(t,r)),this.setBaseTarget(t,Ee(o)?o.get():o)),Ee(o)?o.get():o}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let a=Du(this.props,r,this.presenceContext?.custom);a&&(o=a[t])}if(r&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!Ee(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new ha),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){zs.render(this.render)}};var Bu=class extends Vu{constructor(){super(...arguments),this.KeyframeResolver=Ff}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:o}){delete r[t],delete o[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Ee(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};function mh(e,{style:t,vars:r},o,n){let a=e.style,i;for(i in t)a[i]=t[i];n?.applyProjectionStyles(a,o);for(i in r)a.setProperty(i,r[i])}function Vj(e){return window.getComputedStyle(e)}var Hu=class extends Bu{constructor(){super(...arguments),this.type="html",this.renderInstance=mh}readValueFromInstance(t,r){if(po.has(r))return this.projection?.isProjecting?kf(r):Hw(t,r);{let o=Vj(t),n=(As(r)?o.getPropertyValue(r):o[r])||0;return typeof n=="string"?n.trim():n}}measureInstanceViewportBox(t,{transformPagePoint:r}){return gC(t,r)}build(t,r,o){ku(t,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,r,o){return _u(t,r,o)}};var gh=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 xE(e,t,r,o){mh(e,t,void 0,o);for(let n in t.attrs)e.setAttribute(gh.has(n)?n:Ou(n),t.attrs[n])}var Uu=class extends Bu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=We}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(po.has(r)){let o=_f(r);return o&&o.default||0}return r=gh.has(r)?r:Ou(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,o){return ih(t,r,o)}build(t,r,o){rh(t,r,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(t,r,o,n){xE(t,r,o,n)}mount(t){this.isSVGTag=nh(t.tagName),super.mount(t)}};var CE=(e,t)=>Eu(e)?new Uu(t):new Hu(t,{allowProjection:e!==wE.Fragment});function jn(e,t,r){let o=e.getProps();return Du(o,t,r!==void 0?r:o.custom,e)}var Xf=e=>Array.isArray(e);function Bj(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Xr(r))}function Hj(e){return Xf(e)?e[e.length-1]||0:e}function SE(e,t){let r=jn(e,t),{transitionEnd:o={},transition:n={},...a}=r||{};a={...a,...o};for(let i in a){let s=Hj(a[i]);Bj(e,i,s)}}function bE(e){return!!(Ee(e)&&e.add)}function Yf(e,t){let r=e.getValue("willChange");if(bE(r))return r.add(t);if(!r&&cr.WillChange){let o=new cr.WillChange("auto");e.addValue("willChange",o),o.add(t)}}function hh(e){return e.props[sh]}var Uj=e=>e!==null;function RE(e,{repeat:t,repeatType:r="loop"},o){let n=e.filter(Uj),a=t&&r!=="loop"&&t%2===1?0:n.length-1;return!a||o===void 0?n[a]:o}var zj={type:"spring",stiffness:500,damping:25,restSpeed:10},Wj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Gj={type:"keyframes",duration:.8},jj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LE=(e,{keyframes:t})=>t.length>2?Gj:po.has(e)?e.startsWith("scale")?Wj(t[1]):zj:jj;function IE({when:e,delay:t,delayChildren:r,staggerChildren:o,staggerDirection:n,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}var zu=(e,t,r,o={},n,a)=>i=>{let s=Bs(o,e)||{},l=s.delay||o.delay||0,{elapsed:u=0}=o;u=u-St(l);let c={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:n};IE(s)||Object.assign(c,LE(e,c)),c.duration&&(c.duration=St(c.duration)),c.repeatDelay&&(c.repeatDelay=St(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Pu(c),c.delay===0&&(d=!0)),(cr.instantAnimations||cr.skipAnimations)&&(d=!0,Pu(c),c.delay=0),c.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let f=RE(c.keyframes,s);if(f!==void 0){we.update(()=>{c.onUpdate(f),c.onComplete()});return}}return s.isSync?new xa(c):new Ef(c)};function qj({protectedKeys:e,needsAnimating:t},r){let o=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,o}function Wu(e,t,{delay:r=0,transitionOverride:o,type:n}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:i,...s}=t;o&&(a=o);let l=[],u=n&&e.animationState&&e.animationState.getState()[n];for(let c in s){let d=e.getValue(c,e.latestValues[c]??null),f=s[c];if(f===void 0||u&&qj(u,c))continue;let p={delay:r,...Bs(a||{},c)},h=d.get();if(h!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===h&&!p.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){let v=hh(e);if(v){let g=window.MotionHandoffAnimation(v,c,we);g!==null&&(p.startTime=g,m=!0)}}Yf(e,c),d.start(zu(c,d,f,e.shouldReduceMotion&&Df.has(c)?{type:!1}:p,e,m));let x=d.animation;x&&l.push(x)}return i&&Promise.all(l).then(()=>{we.update(()=>{i&&SE(e,i)})}),l}function vh(e,t,r,o=0,n=1){let a=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),i=e.size,s=(i-1)*o;return typeof r=="function"?r(a,i):n===1?a*o:s-a*o}function yh(e,t,r={}){let o=jn(e,t,r.type==="exit"?e.presenceContext?.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(n=r.transitionOverride);let a=o?()=>Promise.all(Wu(e,o,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(l=0)=>{let{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=n;return $j(e,t,l,u,c,d,r)}:()=>Promise.resolve(),{when:s}=n;if(s){let[l,u]=s==="beforeChildren"?[a,i]:[i,a];return l().then(()=>u())}else return Promise.all([a(),i(r.delay)])}function $j(e,t,r=0,o=0,n=0,a=1,i){let s=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),s.push(yh(l,t,{...i,delay:r+(typeof o=="function"?0:o)+vh(e.variantChildren,l,o,n,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}function PE(e,t,r={}){e.notify("AnimationStart",t);let o;if(Array.isArray(t)){let n=t.map(a=>yh(e,a,r));o=Promise.all(n)}else if(typeof t=="string")o=yh(e,t,r);else{let n=typeof t=="function"?jn(e,t,r.custom):t;o=Promise.all(Wu(e,n,r))}return o.then(()=>{e.notify("AnimationComplete",t)})}function hC(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let o=0;o<r;o++)if(t[o]!==e[o])return!1;return!0}var Kj=qf.length;function vC(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?vC(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<Kj;r++){let o=qf[r],n=e.props[o];(ba(n)||n===!1)&&(t[o]=n)}return t}var Xj=[...Zg].reverse(),Yj=Zg.length;function Qj(e){return t=>Promise.all(t.map(({animation:r,options:o})=>PE(e,r,o)))}function kE(e){let t=Qj(e),r=TE(),o=!0,n=l=>(u,c)=>{let d=jn(e,c,l==="exit"?e.presenceContext?.custom:void 0);if(d){let{transition:f,transitionEnd:p,...h}=d;u={...u,...h,...p}}return u};function a(l){t=l(e)}function i(l){let{props:u}=e,c=vC(e.parent)||{},d=[],f=new Set,p={},h=1/0;for(let x=0;x<Yj;x++){let v=Xj[x],g=r[v],y=u[v]!==void 0?u[v]:c[v],w=ba(y),C=v===l?g.isActive:null;C===!1&&(h=x);let b=y===c[v]&&y!==u[v]&&w;if(b&&o&&e.manuallyAnimateOnMount&&(b=!1),g.protectedKeys={...p},!g.isActive&&C===null||!y&&!g.prevProp||ki(y)||typeof y=="boolean")continue;let S=Zj(g.prevProp,y),L=S||v===l&&g.isActive&&!b&&w||x>h&&w,T=!1,P=Array.isArray(y)?y:[y],_=P.reduce(n(v),{});C===!1&&(_={});let{prevResolvedValues:F={}}=g,j={...F,..._},D=z=>{L=!0,f.has(z)&&(T=!0,f.delete(z)),g.needsAnimating[z]=!0;let V=e.getValue(z);V&&(V.liveStyle=!1)};for(let z in j){let V=_[z],k=F[z];if(p.hasOwnProperty(z))continue;let K=!1;Xf(V)&&Xf(k)?K=!hC(V,k):K=V!==k,K?V!=null?D(z):f.add(z):V!==void 0&&f.has(z)?D(z):g.protectedKeys[z]=!0}g.prevProp=y,g.prevResolvedValues=_,g.isActive&&(p={...p,..._}),o&&e.blockInitialAnimation&&(L=!1);let W=b&&S;L&&(!W||T)&&d.push(...P.map(z=>{let V={type:v};if(typeof z=="string"&&o&&!W&&e.manuallyAnimateOnMount&&e.parent){let{parent:k}=e,K=jn(k,z);if(k.enteringChildren&&K){let{delayChildren:de}=K.transition||{};V.delay=vh(k.enteringChildren,e,de)}}return{animation:z,options:V}}))}if(f.size){let x={};if(typeof u.initial!="boolean"){let v=jn(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(x.transition=v.transition)}f.forEach(v=>{let g=e.getBaseTarget(v),y=e.getValue(v);y&&(y.liveStyle=!0),x[v]=g??null}),d.push({animation:x})}let m=!!d.length;return o&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(m=!1),o=!1,m?t(d):Promise.resolve()}function s(l,u){if(r[l].isActive===u)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(l,u)),r[l].isActive=u;let c=i(l);for(let d in r)r[d].protectedKeys={};return c}return{animateChanges:i,setActive:s,setAnimateFunction:a,getState:()=>r,reset:()=>{r=TE(),o=!0}}}function Zj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!hC(t,e):!1}function Xs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function TE(){return{animate:Xs(!0),whileInView:Xs(),whileHover:Xs(),whileTap:Xs(),whileDrag:Xs(),whileFocus:Xs(),exit:Xs()}}var zt=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var xh=class extends zt{constructor(t){super(t),t.animationState||(t.animationState=kE(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();ki(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};var Jj=0,wh=class extends zt{constructor(){super(...arguments),this.id=Jj++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;let n=this.node.animationState.setActive("exit",!t);r&&!t&&n.then(()=>{r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var ME={animation:{Feature:xh},exit:{Feature:wh}};function Ia(e,t,r,o={passive:!0}){return e.addEventListener(t,r,o),()=>e.removeEventListener(t,r)}function Pa(e){return{point:{x:e.pageX,y:e.pageY}}}var EE=e=>t=>Ws(t)&&e(t,Pa(t));function Ai(e,t,r,o){return Ia(e,t,EE(r),o)}var _E=1e-4,eq=1-_E,tq=1+_E,OE=.01,rq=0-OE,oq=0+OE;function Dt(e){return e.max-e.min}function FE(e,t,r){return Math.abs(e-t)<=r}function AE(e,t,r,o=.5){e.origin=o,e.originPoint=be(t.min,t.max,e.origin),e.scale=Dt(r)/Dt(t),e.translate=be(r.min,r.max,e.origin)-e.originPoint,(e.scale>=eq&&e.scale<=tq||isNaN(e.scale))&&(e.scale=1),(e.translate>=rq&&e.translate<=oq||isNaN(e.translate))&&(e.translate=0)}function Gu(e,t,r,o){AE(e.x,t.x,r.x,o?o.originX:void 0),AE(e.y,t.y,r.y,o?o.originY:void 0)}function DE(e,t,r){e.min=r.min+t.min,e.max=e.min+Dt(t)}function VE(e,t,r){DE(e.x,t.x,r.x),DE(e.y,t.y,r.y)}function NE(e,t,r){e.min=t.min-r.min,e.max=e.min+Dt(t)}function ju(e,t,r){NE(e.x,t.x,r.x),NE(e.y,t.y,r.y)}function Qr(e){return[e("x"),e("y")]}var Ch=({current:e})=>e?e.ownerDocument.defaultView:null;var BE=(e,t)=>Math.abs(e-t);function HE(e,t){let r=BE(e.x,t.x),o=BE(e.y,t.y);return Math.sqrt(r**2+o**2)}var qu=class{constructor(t,r,{transformPagePoint:o,contextWindow:n=window,dragSnapToOrigin:a=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let f=xC(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=HE(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!h)return;let{point:m}=f,{timestamp:x}=yt;this.history.push({...m,timestamp:x});let{onStart:v,onMove:g}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=yC(p,this.transformPagePoint),we.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();let{onEnd:h,onSessionEnd:m,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let v=xC(f.type==="pointercancel"?this.lastMoveEventInfo:yC(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,v),m&&m(f,v)},!Ws(t))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=o,this.distanceThreshold=i,this.contextWindow=n||window;let s=Pa(t),l=yC(s,this.transformPagePoint),{point:u}=l,{timestamp:c}=yt;this.history=[{...u,timestamp:c}];let{onSessionStart:d}=r;d&&d(t,xC(l,this.history)),this.removeListeners=ln(Ai(this.contextWindow,"pointermove",this.handlePointerMove),Ai(this.contextWindow,"pointerup",this.handlePointerUp),Ai(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),dr(this.updatePoint)}};function yC(e,t){return t?{point:t(e.point)}:e}function UE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xC({point:e},t){return{point:e,delta:UE(e,zE(t)),offset:UE(e,nq(t)),velocity:aq(t,.1)}}function nq(e){return e[0]}function zE(e){return e[e.length-1]}function aq(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,o=null,n=zE(e);for(;r>=0&&(o=e[r],!(n.timestamp-o.timestamp>St(t)));)r--;if(!o)return{x:0,y:0};let a=Jt(n.timestamp-o.timestamp);if(a===0)return{x:0,y:0};let i={x:(n.x-o.x)/a,y:(n.y-o.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function $E(e,{min:t,max:r},o){return t!==void 0&&e<t?e=o?be(t,e,o.min):Math.max(e,t):r!==void 0&&e>r&&(e=o?be(r,e,o.max):Math.min(e,r)),e}function WE(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function KE(e,{top:t,left:r,bottom:o,right:n}){return{x:WE(e.x,r,n),y:WE(e.y,t,o)}}function GE(e,t){let r=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,o]=[o,r]),{min:r,max:o}}function XE(e,t){return{x:GE(e.x,t.x),y:GE(e.y,t.y)}}function YE(e,t){let r=.5,o=Dt(e),n=Dt(t);return n>o?r=Eo(t.min,t.max-o,e.min):o>n&&(r=Eo(e.min,e.max-n,t.min)),Ut(0,1,r)}function QE(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var Sh=.35;function ZE(e=Sh){return e===!1?e=0:e===!0&&(e=Sh),{x:jE(e,"left","right"),y:jE(e,"top","bottom")}}function jE(e,t,r){return{min:qE(e,t),max:qE(e,r)}}function qE(e,t){return typeof e=="number"?e:e[t]||0}var iq=new WeakMap,Rh=class{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=We(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:o}={}){let{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;let a=d=>{let{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Pa(d).point)},i=(d,f)=>{let{drag:p,dragPropagation:h,onDragStart:m}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Jw(p),!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),Qr(v=>{let g=this.getAxisMotionValue(v).get()||0;if(fr.test(g)){let{projection:y}=this.visualElement;if(y&&y.layout){let w=y.layout.layoutBox[v];w&&(g=Dt(w)*(parseFloat(g)/100))}}this.originPoint[v]=g}),m&&we.postRender(()=>m(d,f)),Yf(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},s=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;let{dragPropagation:p,dragDirectionLock:h,onDirectionLock:m,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;let{offset:v}=f;if(h&&this.currentDirection===null){this.currentDirection=sq(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),x&&x(d,f)},l=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Qr(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new qu(t,{onSessionStart:a,onStart:i,onMove:s,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:o,contextWindow:Ch(this.visualElement)})}stop(t,r){let o=t||this.latestPointerEvent,n=r||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!n||!o)return;let{velocity:i}=n;this.startAnimation(i);let{onDragEnd:s}=this.getProps();s&&we.postRender(()=>s(o,n))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,o){let{drag:n}=this.getProps();if(!o||!bh(t,n,this.currentDirection))return;let a=this.getAxisMotionValue(t),i=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(i=$E(i,this.constraints[t],this.elastic[t])),a.set(i)}resolveConstraints(){let{dragConstraints:t,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,n=this.constraints;t&&Ra(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=KE(o.layoutBox,t):this.constraints=!1,this.elastic=ZE(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Qr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=QE(o.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Ra(t))return!1;let o=t.current;Zt(o!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:n}=this.visualElement;if(!n||!n.layout)return!1;let a=pE(o,n.root,this.visualElement.getTransformPagePoint()),i=XE(n.layout.layoutBox,a);if(r){let s=r(aE(i));this.hasMutatedConstraints=!!s,s&&(i=dh(s))}return i}startAnimation(t){let{drag:r,dragMomentum:o,dragElastic:n,dragTransition:a,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Qr(c=>{if(!bh(c,r,this.currentDirection))return;let d=l&&l[c]||{};i&&(d={min:0,max:0});let f=n?200:1e6,p=n?40:1e7,h={type:"inertia",velocity:o?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...a,...d};return this.startAxisValueAnimation(c,h)});return Promise.all(u).then(s)}startAxisValueAnimation(t,r){let o=this.getAxisMotionValue(t);return Yf(this.visualElement,t),o.start(zu(t,o,0,r,this.visualElement,!1))}stopAnimation(){Qr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Qr(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){let r=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps(),n=o[r];return n||this.visualElement.getValue(t,(o.initial?o.initial[t]:void 0)||0)}snapToCursor(t){Qr(r=>{let{drag:o}=this.getProps();if(!bh(r,o,this.currentDirection))return;let{projection:n}=this.visualElement,a=this.getAxisMotionValue(r);if(n&&n.layout){let{min:i,max:s}=n.layout.layoutBox[r];a.set(t[r]-be(i,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:o}=this.visualElement;if(!Ra(r)||!o||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};Qr(i=>{let s=this.getAxisMotionValue(i);if(s&&this.constraints!==!1){let l=s.get();n[i]=YE({min:l,max:l},this.constraints[i])}});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Qr(i=>{if(!bh(i,t,null))return;let s=this.getAxisMotionValue(i),{min:l,max:u}=this.constraints[i];s.set(be(l,u,n[i]))})}addListeners(){if(!this.visualElement.current)return;iq.set(this.visualElement,this);let t=this.visualElement.current,r=Ai(t,"pointerdown",l=>{let{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),o=()=>{let{dragConstraints:l}=this.getProps();Ra(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,a=n.addEventListener("measure",o);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),we.read(o);let i=Ia(window,"resize",()=>this.scalePositionWithinConstraints()),s=n.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Qr(c=>{let d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{i(),r(),a(),s&&s()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:o=!1,dragPropagation:n=!1,dragConstraints:a=!1,dragElastic:i=Sh,dragMomentum:s=!0}=t;return{...t,drag:r,dragDirectionLock:o,dragPropagation:n,dragConstraints:a,dragElastic:i,dragMomentum:s}}};function bh(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function sq(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var Lh=class extends zt{constructor(t){super(t),this.removeGroupControls=mt,this.removeListeners=mt,this.controls=new Rh(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mt}unmount(){this.removeGroupControls(),this.removeListeners()}};var JE=e=>(t,r)=>{e&&we.postRender(()=>e(t,r))},Ih=class extends zt{constructor(){super(...arguments),this.removePointerDownListener=mt}onPointerDown(t){this.session=new qu(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ch(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:o,onPanEnd:n}=this.node.getProps();return{onSessionStart:JE(t),onStart:JE(r),onMove:o,onEnd:(a,i)=>{delete this.session,n&&we.postRender(()=>n(a,i))}}}mount(){this.removePointerDownListener=Ai(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var rA=R(E(),1);var Qf=R(A(),1);var $u={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function eA(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ku={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(oe.test(e))e=parseFloat(e);else return e;let r=eA(e,t.target.x),o=eA(e,t.target.y);return`${r}% ${o}%`}};var tA={correct:(e,{treeScale:t,projectionDelta:r})=>{let o=e,n=pr.parse(e);if(n.length>5)return o;let a=pr.createTransformer(e),i=typeof n[0]!="number"?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;n[0+i]/=s,n[1+i]/=l;let u=be(s,l,.5);return typeof n[2+i]=="number"&&(n[2+i]/=u),typeof n[3+i]=="number"&&(n[3+i]/=u),a(n)}};var wC=!1,CC=class extends Qf.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:o,layoutId:n}=this.props,{projection:a}=t;HM(lq),a&&(r.group&&r.group.add(a),o&&o.register&&n&&o.register(a),wC&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),$u.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:o,drag:n,isPresent:a}=this.props,{projection:i}=o;return i&&(i.isPresent=a,wC=!0,n||t.layoutDependency!==r||r===void 0||t.isPresent!==a?i.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?i.promote():i.relegate()||we.postRender(()=>{let s=i.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zs.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:o}=this.props,{projection:n}=t;wC=!0,n&&(n.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(n),o&&o.deregister&&o.deregister(n))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function Ph(e){let[t,r]=Xg(),o=(0,Qf.useContext)(yu);return(0,rA.jsx)(CC,{...e,layoutGroup:o,switchLayoutGroup:(0,Qf.useContext)(lh),isPresent:t,safeToRemove:r})}var lq={borderRadius:{...Ku,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ku,borderTopRightRadius:Ku,borderBottomLeftRadius:Ku,borderBottomRightRadius:Ku,boxShadow:tA};function Th(e,t,r){let o=Ee(e)?e:Xr(e);return o.start(zu("",o,t,r)),o.animation}var oA=(e,t)=>e.depth-t.depth;var kh=class{constructor(){this.children=[],this.isDirty=!1}add(t){Ms(this.children,t),this.isDirty=!0}remove(t){sn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(oA),this.isDirty=!1,this.children.forEach(t)}};function nA(e,t){let r=xt.now(),o=({timestamp:n})=>{let a=n-r;a>=t&&(dr(o),e(a-t))};return we.setup(o,!0),()=>dr(o)}var lA=["TopLeft","TopRight","BottomLeft","BottomRight"],uq=lA.length,aA=e=>typeof e=="string"?parseFloat(e):e,iA=e=>typeof e=="number"||oe.test(e);function uA(e,t,r,o,n,a){n?(e.opacity=be(0,r.opacity??1,cq(o)),e.opacityExit=be(t.opacity??1,0,dq(o))):a&&(e.opacity=be(t.opacity??1,r.opacity??1,o));for(let i=0;i<uq;i++){let s=`border${lA[i]}Radius`,l=sA(t,s),u=sA(r,s);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||iA(l)===iA(u)?(e[s]=Math.max(be(aA(l),aA(u),o),0),(fr.test(u)||fr.test(l))&&(e[s]+="%")):e[s]=u}(t.rotate||r.rotate)&&(e.rotate=be(t.rotate||0,r.rotate||0,o))}function sA(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var cq=cA(0,.5,mf),dq=cA(.5,.95,mt);function cA(e,t,r){return o=>o<e?0:o>t?1:r(Eo(e,t,o))}function dA(e,t){e.min=t.min,e.max=t.max}function mo(e,t){dA(e.x,t.x),dA(e.y,t.y)}function SC(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function fA(e,t,r,o,n){return e-=t,e=$f(e,1/r,o),n!==void 0&&(e=$f(e,1/n,o)),e}function fq(e,t=0,r=1,o=.5,n,a=e,i=e){if(fr.test(t)&&(t=parseFloat(t),t=be(i.min,i.max,t/100)-i.min),typeof t!="number")return;let s=be(a.min,a.max,o);e===a&&(s-=t),e.min=fA(e.min,t,r,s,n),e.max=fA(e.max,t,r,s,n)}function pA(e,t,[r,o,n],a,i){fq(e,t[r],t[o],t[n],t.scale,a,i)}var pq=["x","scaleX","originX"],mq=["y","scaleY","originY"];function bC(e,t,r,o){pA(e.x,t,pq,r?r.x:void 0,o?o.x:void 0),pA(e.y,t,mq,r?r.y:void 0,o?o.y:void 0)}function mA(e){return e.translate===0&&e.scale===1}function RC(e){return mA(e.x)&&mA(e.y)}function gA(e,t){return e.min===t.min&&e.max===t.max}function vA(e,t){return gA(e.x,t.x)&&gA(e.y,t.y)}function hA(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function LC(e,t){return hA(e.x,t.x)&&hA(e.y,t.y)}function IC(e){return Dt(e.x)/Dt(e.y)}function PC(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Mh=class{constructor(){this.members=[]}add(t){Ms(this.members,t),t.scheduleRender()}remove(t){if(sn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){let r=this.members.findIndex(n=>t===n);if(r===0)return!1;let o;for(let n=r;n>=0;n--){let a=this.members[n];if(a.isPresent!==!1){o=a;break}}return o?(this.promote(o),!0):!1}promote(t,r){let o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,r&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:n}=t.options;n===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:r,resumingFrom:o}=t;r.onExitComplete&&r.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function yA(e,t,r){let o="",n=e.x.translate/t.x,a=e.y.translate/t.y,i=r?.z||0;if((n||a||i)&&(o=`translate3d(${n}px, ${a}px, ${i}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:h}=r;u&&(o=`perspective(${u}px) ${o}`),c&&(o+=`rotate(${c}deg) `),d&&(o+=`rotateX(${d}deg) `),f&&(o+=`rotateY(${f}deg) `),p&&(o+=`skewX(${p}deg) `),h&&(o+=`skewY(${h}deg) `)}let s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(o+=`scale(${s}, ${l})`),o||"none"}var Ys={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},TC=["","X","Y","Z"],gq=1e3,hq=0;function kC(e,t,r,o){let{latestValues:n}=t;n[e]&&(r[e]=n[e],t.setStaticValue(e,0),o&&(o[e]=0))}function PA(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=hh(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:n,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",we,!(n||a))}let{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&PA(o)}function Eh({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:o,resetTransform:n}){return class{constructor(i={},s=t?.()){this.id=hq++,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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Kr.value&&(Ys.nodes=Ys.calculatedTargetDeltas=Ys.calculatedProjections=0),this.nodes.forEach(xq),this.nodes.forEach(bq),this.nodes.forEach(Rq),this.nodes.forEach(wq),Kr.addProjectionMetrics&&Kr.addProjectionMetrics(Ys)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new kh)}addEventListener(i,s){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new ha),this.eventHandlers.get(i).add(s)}notifyListeners(i,...s){let l=this.eventHandlers.get(i);l&&l.notify(...s)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Gs(i)&&!Uf(i),this.instance=i;let{layoutId:s,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||s)&&(this.isLayoutDirty=!0),e){let c,d=0,f=()=>this.root.updateBlockedByResize=!1;we.read(()=>{d=window.innerWidth}),e(i,()=>{let p=window.innerWidth;p!==d&&(d=p,this.root.updateBlockedByResize=!0,c&&c(),c=nA(f,250),$u.hasAnimatedSinceResize&&($u.hasAnimatedSinceResize=!1,this.nodes.forEach(CA)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&u&&(s||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let h=this.options.transition||u.getDefaultTransition()||kq,{onLayoutAnimationStart:m,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!LC(this.targetLayout,p),g=!d&&f;if(this.options.layoutRoot||this.resumeFrom||g||d&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let y={...Bs(h,"layout"),onPlay:m,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(c,g)}else d||CA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),dr(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(Lq),this.animationId++)}getTransformTemplate(){let{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&PA(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){let d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}let{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(wA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sq),this.nodes.forEach(vq),this.nodes.forEach(yq)):this.nodes.forEach(wA),this.clearAllSnapshots();let s=xt.now();yt.delta=Ut(0,1e3/60,s-yt.timestamp),yt.timestamp=s,yt.isProcessing=!0,Cf.update.process(yt),Cf.preRender.process(yt),Cf.render.process(yt),yt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cq),this.sharedNodes.forEach(Iq)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,we.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){we.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();let i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=We(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(s=!1),s&&this.instance){let l=o(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!n)return;let i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!RC(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;i&&this.instance&&(s||La(this.latestValues)||c)&&(n(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){let s=this.measurePageBox(),l=this.removeElementScroll(s);return i&&(l=this.removeTransform(l)),Mq(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:i}=this.options;if(!i)return We();let s=i.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Eq))){let{scroll:u}=this.root;u&&(Mi(s.x,u.offset.x),Mi(s.y,u.offset.y))}return s}removeElementScroll(i){let s=We();if(mo(s,i),this.scroll?.wasRoot)return s;for(let l=0;l<this.path.length;l++){let u=this.path[l],{scroll:c,options:d}=u;u!==this.root&&c&&d.layoutScroll&&(c.wasRoot&&mo(s,i),Mi(s.x,c.offset.x),Mi(s.y,c.offset.y))}return s}applyTransform(i,s=!1){let l=We();mo(l,i);for(let u=0;u<this.path.length;u++){let c=this.path[u];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&$s(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),La(c.latestValues)&&$s(l,c.latestValues)}return La(this.latestValues)&&$s(l,this.latestValues),l}removeTransform(i){let s=We();mo(s,i);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!La(u.latestValues))continue;fh(u.latestValues)&&u.updateSnapshot();let c=We(),d=u.measurePageBox();mo(c,d),bC(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return La(this.latestValues)&&bC(s,this.latestValues),s}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.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!==yt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){let s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);let l=!!this.resumingFrom||this!==s;if(!(i||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:d}=this.options;if(!(!this.layout||!(c||d))){if(this.resolvedRelativeTargetAt=yt.timestamp,!this.targetDelta&&!this.relativeTarget){let f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=We(),this.relativeTargetOrigin=We(),ju(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),mo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=We(),this.targetWithTransforms=We()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),VE(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mo(this.target,this.layout.layoutBox),mC(this.target,this.targetDelta)):mo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=We(),this.relativeTargetOrigin=We(),ju(this.relativeTargetOrigin,this.target,f.target),mo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Kr.value&&Ys.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||fh(this.parent.latestValues)||fC(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){let i=this.getLead(),s=!!this.resumingFrom||this!==i,l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===yt.timestamp&&(l=!1),l)return;let{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;mo(this.layoutCorrected,this.layout.layoutBox);let d=this.treeScale.x,f=this.treeScale.y;fE(this.layoutCorrected,this.treeScale,this.path,s),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=We());let{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(SC(this.prevProjectionDelta.x,this.projectionDelta.x),SC(this.prevProjectionDelta.y,this.projectionDelta.y)),Gu(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!PC(this.projectionDelta.x,this.prevProjectionDelta.x)||!PC(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Kr.value&&Ys.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){if(this.options.visualElement?.scheduleRender(),i){let s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ks(),this.projectionDelta=Ks(),this.projectionDeltaWithTransform=Ks()}setAnimationOrigin(i,s=!1){let l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=Ks();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;let f=We(),p=l?l.source:void 0,h=this.layout?this.layout.source:void 0,m=p!==h,x=this.getStack(),v=!x||x.members.length<=1,g=!!(m&&!v&&this.options.crossfade===!0&&!this.path.some(Tq));this.animationProgress=0;let y;this.mixTargetDelta=w=>{let C=w/1e3;SA(d.x,i.x,C),SA(d.y,i.y,C),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ju(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Pq(this.relativeTarget,this.relativeTargetOrigin,f,C),y&&vA(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=We()),mo(y,this.relativeTarget)),m&&(this.animationValues=c,uA(c,u,this.latestValues,C,g,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(dr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=we.update(()=>{$u.hasAnimatedSinceResize=!0,un.layout++,this.motionValue||(this.motionValue=Xr(0)),this.currentAnimation=Th(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:s=>{this.mixTargetDelta(s),i.onUpdate&&i.onUpdate(s)},onStop:()=>{un.layout--},onComplete:()=>{un.layout--,i.onComplete&&i.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);let i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(gq),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let i=this.getLead(),{targetWithTransforms:s,target:l,layout:u,latestValues:c}=i;if(!(!s||!l||!u)){if(this!==i&&this.layout&&u&&TA(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||We();let d=Dt(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;let f=Dt(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}mo(s,l),$s(s,c),Gu(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(i,s){this.sharedNodes.has(i)||this.sharedNodes.set(i,new Mh),this.sharedNodes.get(i).add(s);let u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){let i=this.getStack();return i?i.lead===this:!0}getLead(){let{layoutId:i}=this.options;return i?this.getStack()?.lead||this:this}getPrevLead(){let{layoutId:i}=this.options;return i?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:s,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){let i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){let{visualElement:i}=this.options;if(!i)return;let s=!1,{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;let u={};l.z&&kC("z",i,u,this.animationValues);for(let c=0;c<TC.length;c++)kC(`rotate${TC[c]}`,i,u,this.animationValues),kC(`skew${TC[c]}`,i,u,this.animationValues);i.render();for(let c in u)i.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);i.scheduleRender()}applyProjectionStyles(i,s){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}let l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=Nu(s?.pointerEvents)||"",i.transform=l?l(this.latestValues,""):"none";return}let u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=Nu(s?.pointerEvents)||""),this.hasProjected&&!La(this.latestValues)&&(i.transform=l?l({},""):"none",this.hasProjected=!1);return}i.visibility="";let c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let d=yA(this.projectionDeltaWithTransform,this.treeScale,c);l&&(d=l(c,d)),i.transform=d;let{x:f,y:p}=this.projectionDelta;i.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,u.animationValues?i.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:i.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(let h in qs){if(c[h]===void 0)continue;let{correct:m,applyTo:x,isCSSVariable:v}=qs[h],g=d==="none"?c[h]:m(c[h],u);if(x){let y=x.length;for(let w=0;w<y;w++)i[x[w]]=g}else v?this.options.visualElement.renderState.vars[h]=g:i[h]=g}this.options.layoutId&&(i.pointerEvents=u===this?Nu(s?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>i.currentAnimation?.stop()),this.root.nodes.forEach(xA),this.root.sharedNodes.clear()}}}function vq(e){e.updateLayout()}function yq(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=e.layout,{animationType:n}=e.options,a=t.source!==e.layout.source;n==="size"?Qr(c=>{let d=a?t.measuredBox[c]:t.layoutBox[c],f=Dt(d);d.min=r[c].min,d.max=d.min+f}):TA(n,t.layoutBox,r)&&Qr(c=>{let d=a?t.measuredBox[c]:t.layoutBox[c],f=Dt(r[c]);d.max=d.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+f)});let i=Ks();Gu(i,r,t.layoutBox);let s=Ks();a?Gu(s,e.applyTransform(o,!0),t.measuredBox):Gu(s,r,t.layoutBox);let l=!RC(i),u=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:d,layout:f}=c;if(d&&f){let p=We();ju(p,t.layoutBox,d.layoutBox);let h=We();ju(h,r,f.layoutBox),LC(p,h)||(u=!0),c.options.layoutRoot&&(e.relativeTarget=h,e.relativeTargetOrigin=p,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function xq(e){Kr.value&&Ys.nodes++,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 wq(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Cq(e){e.clearSnapshot()}function xA(e){e.clearMeasurements()}function wA(e){e.isLayoutDirty=!1}function Sq(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function CA(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bq(e){e.resolveTargetDelta()}function Rq(e){e.calcProjection()}function Lq(e){e.resetSkewAndRotation()}function Iq(e){e.removeLeadSnapshot()}function SA(e,t,r){e.translate=be(t.translate,0,r),e.scale=be(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function bA(e,t,r,o){e.min=be(t.min,r.min,o),e.max=be(t.max,r.max,o)}function Pq(e,t,r,o){bA(e.x,t.x,r.x,o),bA(e.y,t.y,r.y,o)}function Tq(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var kq={duration:.45,ease:[.4,0,.1,1]},RA=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),LA=RA("applewebkit/")&&!RA("chrome/")?Math.round:mt;function IA(e){e.min=LA(e.min),e.max=LA(e.max)}function Mq(e){IA(e.x),IA(e.y)}function TA(e,t,r){return e==="position"||e==="preserve-aspect"&&!FE(IC(t),IC(r),.2)}function Eq(e){return e!==e.root&&e.scroll?.wasRoot}var kA=Eh({attachResizeListener:(e,t)=>Ia(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var MC={current:void 0},Ah=Eh({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!MC.current){let e=new kA({});e.mount(window),e.setOptions({layoutScroll:!0}),MC.current=e}return MC.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var MA={pan:{Feature:Ih},drag:{Feature:Lh,ProjectionNode:Ah,MeasureLayout:Ph}};function EA(e,t,r){let{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",r==="Start");let n="onHover"+r,a=o[n];a&&we.postRender(()=>a(t,Pa(t)))}var Dh=class extends zt{mount(){let{current:t}=this.node;t&&(this.unmount=eC(t,(r,o)=>(EA(this.node,o,"Start"),n=>EA(this.node,n,"End"))))}unmount(){}};var Nh=class extends zt{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=ln(Ia(this.node.current,"focus",()=>this.onFocus()),Ia(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function AA(e,t,r){let{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",r==="Start");let n="onTap"+(r==="End"?"":r),a=o[n];a&&we.postRender(()=>a(t,Pa(t)))}var _h=class extends zt{mount(){let{current:t}=this.node;t&&(this.unmount=oC(t,(r,o)=>(AA(this.node,o,"Start"),(n,{success:a})=>AA(this.node,n,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var AC=new WeakMap,EC=new WeakMap,Aq=e=>{let t=AC.get(e.target);t&&t(e)},Dq=e=>{e.forEach(Aq)};function Nq({root:e,...t}){let r=e||document;EC.has(r)||EC.set(r,{});let o=EC.get(r),n=JSON.stringify(t);return o[n]||(o[n]=new IntersectionObserver(Dq,{root:e,...t})),o[n]}function DA(e,t,r){let o=Nq(t);return AC.set(e,r),o.observe(e),()=>{AC.delete(e),o.unobserve(e)}}var _q={some:0,all:1},Oh=class extends zt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:r,margin:o,amount:n="some",once:a}=t,i={root:r?r.current:void 0,rootMargin:o,threshold:typeof n=="number"?n:_q[n]},s=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return DA(this.node.current,i,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Oq(t,r))&&this.startObserver()}unmount(){}};function Oq({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var NA={inView:{Feature:Oh},tap:{Feature:_h},focus:{Feature:Nh},hover:{Feature:Dh}};var _A={layout:{ProjectionNode:Ah,MeasureLayout:Ph}};var OA={...ME,...NA,...MA,..._A};var Ve=nE(OA,CE);var Xu=R(A(),1);function Yu(e){let t=Un(()=>Xr(e)),{isStatic:r}=(0,Xu.useContext)(Ii);if(r){let[,o]=(0,Xu.useState)(e);(0,Xu.useEffect)(()=>t.on("change",o),[])}return t}function Fh(e,t){let r=Yu(t()),o=()=>r.set(t());return o(),wu(()=>{let n=()=>we.preRender(o,!1,!0),a=e.map(i=>i.on("change",n));return()=>{a.forEach(i=>i()),dr(o)}}),r}function FA(e){Us.current=[],e();let t=Fh(Us.current,e);return Us.current=void 0,t}function DC(e,t,r,o){if(typeof e=="function")return FA(e);let n=typeof t=="function"?t:nC(t,r,o);return Array.isArray(e)?VA(e,n):VA([e],([a])=>n(a))}function VA(e,t){let r=Un(()=>[]);return Fh(e,()=>{r.length=0;let o=e.length;for(let n=0;n<o;n++)r[n]=e[n].get();return t(r)})}function Zf(e){return typeof e=="object"&&!Array.isArray(e)}function Vh(e,t,r,o){return typeof e=="string"&&Zf(t)?Vf(e,r,o):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function BA(e,t,r){return e*(t+1)}function NC(e,t,r,o){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?r:t.startsWith("<")?Math.max(0,r+parseFloat(t.slice(1))):o.get(t)??e}function Fq(e,t,r){for(let o=0;o<e.length;o++){let n=e[o];n.at>t&&n.at<r&&(sn(e,n),o--)}}function HA(e,t,r,o,n,a){Fq(e,n,a);for(let i=0;i<t.length;i++)e.push({value:t[i],at:be(n,a,o[i]),easing:yf(r,i)})}function UA(e,t){for(let r=0;r<e.length;r++)e[r]=e[r]/(t+1)}function zA(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Vq="easeInOut",Bq=20;function jA(e,{defaultTransition:t={},...r}={},o,n){let a=t.duration||.3,i=new Map,s=new Map,l={},u=new Map,c=0,d=0,f=0;for(let p=0;p<e.length;p++){let h=e[p];if(typeof h=="string"){u.set(h,d);continue}else if(!Array.isArray(h)){u.set(h.name,NC(d,h.at,c,u));continue}let[m,x,v={}]=h;v.at!==void 0&&(d=NC(d,v.at,c,u));let g=0,y=(w,C,b,S=0,L=0)=>{let T=Hq(w),{delay:P=0,times:_=Tf(T),type:F="keyframes",repeat:j,repeatType:D,repeatDelay:W=0,...N}=C,{ease:z=t.ease||"easeOut",duration:V}=C,k=typeof P=="function"?P(S,L):P,K=T.length,de=Vs(F)?F:n?.[F||"keyframes"];if(K<=2&&de){let J=100;if(K===2&&Wq(T)){let ge=T[1]-T[0];J=Math.abs(ge)}let fe={...N};V!==void 0&&(fe.duration=St(V));let q=Lf(fe,J,de);z=q.ease,V=q.duration}V??(V=a);let M=d+k;_.length===1&&_[0]===0&&(_[1]=1);let Y=_.length-T.length;if(Y>0&&Pf(_,Y),T.length===1&&T.unshift(null),j){Zt(j<Bq,"Repeat count too high, must be less than 20","repeat-count-high"),V=BA(V,j);let J=[...T],fe=[..._];z=Array.isArray(z)?[...z]:[z];let q=[...z];for(let ge=0;ge<j;ge++){T.push(...J);for(let Re=0;Re<J.length;Re++)_.push(fe[Re]+(ge+1)),z.push(Re===0?"linear":yf(q,Re-1))}UA(_,j)}let le=M+V;HA(b,T,z,_,M,le),g=Math.max(k+V,g),f=Math.max(le,f)};if(Ee(m)){let w=WA(m,s);y(x,v,GA("default",w))}else{let w=Vh(m,x,o,l),C=w.length;for(let b=0;b<C;b++){x=x,v=v;let S=w[b],L=WA(S,s);for(let T in x)y(x[T],Uq(v,T),GA(T,L),b,C)}}c=d,d+=g}return s.forEach((p,h)=>{for(let m in p){let x=p[m];x.sort(zA);let v=[],g=[],y=[];for(let C=0;C<x.length;C++){let{at:b,value:S,easing:L}=x[C];v.push(S),g.push(Eo(0,f,b)),y.push(L||"easeOut")}g[0]!==0&&(g.unshift(0),v.unshift(v[0]),y.unshift(Vq)),g[g.length-1]!==1&&(g.push(1),v.push(null)),i.has(h)||i.set(h,{keyframes:{},transition:{}});let w=i.get(h);w.keyframes[m]=v,w.transition[m]={...t,duration:f,ease:y,times:g,...r}}}),i}function WA(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function GA(e,t){return t[e]||(t[e]=[]),t[e]}function Hq(e){return Array.isArray(e)?e:[e]}function Uq(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var zq=e=>typeof e=="number",Wq=e=>e.every(zq);function Gq(e,t){return e in t}var Bh=class extends Vu{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,r){if(Gq(r,t)){let o=t[r];if(typeof o=="string"||typeof o=="number")return o}}getBaseTargetFromProps(){}removeValueFromRenderState(t,r){delete r.output[t]}measureInstanceViewportBox(){return We()}build(t,r){Object.assign(t.output,r)}renderInstance(t,{output:r}){Object.assign(t,r)}sortInstanceNodePosition(){return 0}};function qA(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},r=Gs(e)&&!Uf(e)?new Uu(t):new Hu(t);r.mount(e),Ei.set(e,r)}function $A(e){let t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},r=new Bh(t);r.mount(e),Ei.set(e,r)}function jq(e,t){return Ee(e)||typeof e=="number"||typeof e=="string"&&!Zf(t)}function Hh(e,t,r,o){let n=[];if(jq(e,t))n.push(Th(e,Zf(t)&&t.default||t,r&&(r.default||r)));else{let a=Vh(e,t,o),i=a.length;Zt(!!i,"No valid elements provided.","no-valid-elements");for(let s=0;s<i;s++){let l=a[s];Zt(l!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let u=l instanceof Element?qA:$A;Ei.has(l)||u(l);let c=Ei.get(l),d={...r};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(s,i)),n.push(...Wu(c,{...t,transition:d},{}))}}return n}function KA(e,t,r){let o=[];return jA(e,t,r,{spring:ya}).forEach(({keyframes:a,transition:i},s)=>{o.push(...Hh(s,a,i))}),o}function qq(e){return Array.isArray(e)&&e.some(Array.isArray)}function XA(e){function t(r,o,n){let a=[];qq(r)?a=KA(r,o,e):a=Hh(r,o,n,e);let i=new Af(a);return e&&(e.animations.push(i),i.finished.then(()=>{sn(e.animations,i)})),i}return t}var _C=XA();var d0e=te("",{variants:{hover:{lift:["transition-all duration-200 ease-out","hover:-translate-y-0.5","hover:shadow-md"],glow:["transition-all duration-300 ease-out","hover:shadow-lg","hover:shadow-primary/20"],scale:["transition-transform duration-200 ease-out","hover:scale-105","active:scale-95"],brightness:["transition-all duration-200 ease-out","hover:brightness-110","active:brightness-95"],border:["transition-all duration-200 ease-out","hover:border-primary/50"]},focus:{ring:["focus:outline-none","focus-visible:ring-2","focus-visible:ring-primary/50","focus-visible:ring-offset-2"],glow:["focus:outline-none","focus-visible:shadow-lg","focus-visible:shadow-primary/30"],border:["focus:outline-none","focus-visible:border-primary","focus-visible:border-2"]},active:{scale:["active:scale-95","transition-transform duration-100"],darken:["active:brightness-90","transition-all duration-100"],depress:["active:translate-y-0.5","active:shadow-sm","transition-all duration-100"]},cursor:{pointer:"cursor-pointer",grab:"cursor-grab active:cursor-grabbing",text:"cursor-text",wait:"cursor-wait",help:"cursor-help",notAllowed:"cursor-not-allowed"}},defaultVariants:{hover:"lift",focus:"ring",active:"scale",cursor:"pointer"}}),pn={smooth:{type:"spring",stiffness:260,damping:20},bouncy:{type:"spring",stiffness:300,damping:15},stiff:{type:"spring",stiffness:400,damping:25},gentle:{type:"spring",stiffness:150,damping:15}},Uh={lift:{y:-2,transition:pn.smooth},scale:{scale:1.05,transition:pn.smooth},glow:{boxShadow:"0 0 20px rgba(var(--primary), 0.3)",transition:pn.smooth},rotate:{rotate:2,transition:pn.bouncy}},YA={scale:{scale:.95,transition:{duration:.1}},depress:{y:1,transition:{duration:.1}}},f0e={ring:{boxShadow:"0 0 0 2px var(--background), 0 0 0 4px var(--primary)",transition:pn.smooth},glow:{boxShadow:"0 0 0 3px rgba(var(--primary), 0.3)",transition:pn.smooth}},p0e={container:{hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}},item:{hidden:{opacity:0,y:20},show:{opacity:1,y:0,transition:pn.smooth}}},m0e={fadeIn:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},slideUp:{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:pn.smooth},slideRight:{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:pn.smooth},scale:{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.05},transition:pn.smooth}},QA={initial:{opacity:.5},animate:{opacity:[.5,.8,.5],transition:{duration:1.5,repeat:1/0,ease:"easeInOut"}}};var g0e={initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.95,transition:{duration:.15}},transition:pn.bouncy};var Di=R(E()),ZA=te("rounded-lg border bg-card text-card-foreground shadow-sm dark:shadow-gray-900/20 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-100 transition-all duration-200",{variants:{variant:{default:"",outline:"border border-border shadow-none bg-transparent dark:border-gray-700 dark:bg-transparent dark:text-gray-200",filled:"border-none bg-secondary dark:bg-gray-800 dark:text-gray-100 dark:shadow-inner dark:shadow-gray-950/10",elevated:"border-none shadow-md dark:shadow-lg dark:shadow-gray-900/30 dark:bg-gray-850 dark:text-gray-100",gradient:"border-none bg-gradient-to-br from-primary/5 to-primary/10 dark:from-primary/10 dark:to-primary/20",glass:"border border-white/20 bg-white/10 backdrop-blur-md dark:border-gray-700/30 dark:bg-gray-800/10"},size:{default:"",sm:"",lg:"",xl:""},radius:{default:"rounded-lg",sm:"rounded-md",lg:"rounded-xl",full:"rounded-3xl",none:"rounded-none"},interactive:{true:"cursor-pointer hover:shadow-lg hover:border-primary/20 dark:hover:border-primary/30 hover:-translate-y-0.5 active:translate-y-0 active:shadow-sm",false:""}},defaultVariants:{variant:"default",size:"default",radius:"default"}}),JA=Qs.forwardRef(({className:e,variant:t,size:r,radius:o,interactive:n,microInteraction:a="lift",...i},s)=>{if(n&&a!=="none"){let l={whileHover:a==="scale"?Uh.scale:a==="glow"?Uh.glow:Uh.lift,whileTap:YA.scale};return(0,Di.jsx)(Ve.div,{ref:s,className:I("moonui-theme",ZA({variant:t,size:r,radius:o,interactive:n,className:e})),...l,...i})}return(0,Di.jsx)("div",{ref:s,className:I("moonui-theme",ZA({variant:t,size:r,radius:o,interactive:n,className:e})),...i})});JA.displayName="Card";var eD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("div",{ref:r,className:I("moonui-theme","flex flex-col space-y-1.5 p-6",e),...t}));eD.displayName="CardHeader";var tD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("h3",{ref:r,className:I("moonui-theme","text-lg font-semibold leading-none tracking-tight",e),...t}));tD.displayName="CardTitle";var rD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("p",{ref:r,className:I("moonui-theme","text-sm text-muted-foreground",e),...t}));rD.displayName="CardDescription";var oD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("div",{ref:r,className:I("moonui-theme","p-6 pt-0",e),...t}));oD.displayName="CardContent";var nD=Qs.forwardRef(({className:e,...t},r)=>(0,Di.jsx)("div",{ref:r,className:I("moonui-theme","flex items-center p-6 pt-0",e),...t}));nD.displayName="CardFooter";var Zs=R(A());var Ni=R(E()),$q=e=>{let t={visa:/^4/,mastercard:/^5[1-5]/,amex:/^3[47]/,discover:/^6(?:011|5)/,diners:/^3(?:0[0-5]|[68])/,jcb:/^35/};for(let[r,o]of Object.entries(t))if(o.test(e))return r;return"unknown"},aD=(e,t)=>{let r=e.replace(/\s+/g,""),o=t==="amex"?[4,6,5]:[4,4,4,4],n="",a=0;for(let i of o){if(a>=r.length)break;n&&(n+=" "),n+=r.slice(a,a+i),a+=i}return n},iD=Zs.forwardRef(({className:e,value:t="",onChange:r,showIcon:o=!0,size:n,...a},i)=>{let[s,l]=Zs.useState("unknown"),u=c=>{let d=c.target.value.replace(/\D/g,""),f=$q(d);l(f);let p=f==="amex"?15:16,h=d.slice(0,p),m=aD(h,f);r?.(h,f),c.target.value=m};return(0,Ni.jsxs)("div",{className:"relative",children:[(0,Ni.jsx)(mr,{ref:i,type:"text",inputMode:"numeric",autoComplete:"cc-number",placeholder:"1234 5678 9012 3456",value:aD(t,s),onChange:u,className:I(o&&"pl-10",e),...a}),o&&(0,Ni.jsx)(_d,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"})]})});iD.displayName="CardNumberInput";var sD=Zs.forwardRef(({className:e,value:t="",onChange:r,size:o,...n},a)=>{let i=l=>{let u=l.target.value.replace(/\D/g,"");if(u.length>=2){let d=parseInt(u.slice(0,2));d>12?u="12"+u.slice(2):d===0&&(u="01"+u.slice(2))}u=u.slice(0,4);let c=u;u.length>=2&&(c=u.slice(0,2)+"/"+u.slice(2)),r?.(u),l.target.value=c},s=t.length>=2?t.slice(0,2)+"/"+t.slice(2):t;return(0,Ni.jsx)(mr,{ref:a,type:"text",inputMode:"numeric",autoComplete:"cc-exp",placeholder:"MM/YY",value:s,onChange:i,className:e,...n})});sD.displayName="CardExpiryInput";var lD=Zs.forwardRef(({className:e,value:t="",onChange:r,cardType:o="unknown",size:n,...a},i)=>{let s=o==="amex"?4:3;return(0,Ni.jsx)(mr,{ref:i,type:"text",inputMode:"numeric",autoComplete:"cc-csc",placeholder:o==="amex"?"1234":"123",value:t,onChange:u=>{let c=u.target.value.replace(/\D/g,"").slice(0,s);r?.(c)},maxLength:s,className:e,...a})});lD.displayName="CardCVCInput";var uD=Zs.forwardRef(({className:e,value:t="",onChange:r,format:o="US",size:n,...a},i)=>{let s=u=>{let c=u.target.value;switch(o){case"US":c=c.replace(/\D/g,"").slice(0,5);break;case"CA":c=c.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6),c.length>=3&&(c=c.slice(0,3)+" "+c.slice(3));break;case"UK":c=c.toUpperCase().replace(/[^A-Z0-9\s]/g,"").slice(0,8);break;default:c=c.slice(0,10)}r?.(c.replace(/\s/g,"")),u.target.value=c};return(0,Ni.jsx)(mr,{ref:i,type:"text",autoComplete:"postal-code",placeholder:(()=>{switch(o){case"US":return"12345";case"CA":return"K1A 0B1";case"UK":return"SW1A 1AA";default:return"Postal Code"}})(),value:t,onChange:s,className:e,...a})});uD.displayName="CardZipInput";var mn=R(A());var Ar=R(A(),1);var zh=R(A(),1);function Qu(e){let t=zh.useRef({value:e,previous:e});return zh.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cD=R(A(),1);function Zu(e){let[t,r]=cD.useState(void 0);return Me(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let a=n[0],i,s;if("borderBoxSize"in a){let l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,s=u.blockSize}else i=e.offsetWidth,s=e.offsetHeight;r({width:i,height:s})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var go=R(E(),1),Wh="Checkbox",[Kq,V0e]=ke(Wh),[Xq,OC]=Kq(Wh);function Yq(e){let{__scopeCheckbox:t,checked:r,children:o,defaultChecked:n,disabled:a,form:i,name:s,onCheckedChange:l,required:u,value:c="on",internal_do_not_use_render:d}=e,[f,p]=ze({prop:r,defaultProp:n??!1,onChange:l,caller:Wh}),[h,m]=Ar.useState(null),[x,v]=Ar.useState(null),g=Ar.useRef(!1),y=h?!!i||!!h.closest("form"):!0,w={checked:f,disabled:a,setChecked:p,control:h,setControl:m,name:s,form:i,value:c,hasConsumerStoppedPropagationRef:g,required:u,defaultChecked:_i(n)?!1:n,isFormControl:y,bubbleInput:x,setBubbleInput:v};return(0,go.jsx)(Xq,{scope:t,...w,children:Qq(d)?d(w):o})}var dD="CheckboxTrigger",fD=Ar.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...o},n)=>{let{control:a,value:i,disabled:s,checked:l,required:u,setControl:c,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:h}=OC(dD,e),m=ae(n,c),x=Ar.useRef(l);return Ar.useEffect(()=>{let v=a?.form;if(v){let g=()=>d(x.current);return v.addEventListener("reset",g),()=>v.removeEventListener("reset",g)}},[a,d]),(0,go.jsx)(X.button,{type:"button",role:"checkbox","aria-checked":_i(l)?"mixed":l,"aria-required":u,"data-state":hD(l),"data-disabled":s?"":void 0,disabled:s,value:i,...o,ref:m,onKeyDown:H(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:H(r,v=>{d(g=>_i(g)?!0:!g),h&&p&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})})});fD.displayName=dD;var Gh=Ar.forwardRef((e,t)=>{let{__scopeCheckbox:r,name:o,checked:n,defaultChecked:a,required:i,disabled:s,value:l,onCheckedChange:u,form:c,...d}=e;return(0,go.jsx)(Yq,{__scopeCheckbox:r,checked:n,defaultChecked:a,disabled:s,required:i,onCheckedChange:u,name:o,form:c,value:l,internal_do_not_use_render:({isFormControl:f})=>(0,go.jsxs)(go.Fragment,{children:[(0,go.jsx)(fD,{...d,ref:t,__scopeCheckbox:r}),f&&(0,go.jsx)(gD,{__scopeCheckbox:r})]})})});Gh.displayName=Wh;var pD="CheckboxIndicator",FC=Ar.forwardRef((e,t)=>{let{__scopeCheckbox:r,forceMount:o,...n}=e,a=OC(pD,r);return(0,go.jsx)(it,{present:o||_i(a.checked)||a.checked===!0,children:(0,go.jsx)(X.span,{"data-state":hD(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t,style:{pointerEvents:"none",...e.style}})})});FC.displayName=pD;var mD="CheckboxBubbleInput",gD=Ar.forwardRef(({__scopeCheckbox:e,...t},r)=>{let{control:o,hasConsumerStoppedPropagationRef:n,checked:a,defaultChecked:i,required:s,disabled:l,name:u,value:c,form:d,bubbleInput:f,setBubbleInput:p}=OC(mD,e),h=ae(r,p),m=Qu(a),x=Zu(o);Ar.useEffect(()=>{let g=f;if(!g)return;let y=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(y,"checked").set,b=!n.current;if(m!==a&&C){let S=new Event("click",{bubbles:b});g.indeterminate=_i(a),C.call(g,_i(a)?!1:a),g.dispatchEvent(S)}},[f,m,a,n]);let v=Ar.useRef(_i(a)?!1:a);return(0,go.jsx)(X.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??v.current,required:s,disabled:l,name:u,value:c,form:d,...t,tabIndex:-1,ref:h,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});gD.displayName=mD;function Qq(e){return typeof e=="function"}function _i(e){return e==="indeterminate"}function hD(e){return _i(e)?"indeterminate":e?"checked":"unchecked"}var Do=R(E()),Jq=te("peer shrink-0 border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary-foreground",{variants:{variant:{default:"border-border bg-background data-[state=checked]:bg-primary data-[state=checked]:border-primary",outline:"border-border bg-transparent data-[state=checked]:bg-primary data-[state=checked]:border-primary",muted:"border-border bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary",ghost:"border-transparent bg-transparent hover:bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary"},size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-sm",md:"rounded-md",full:"rounded-full"},animation:{none:"",subtle:"transition-all duration-200",default:"transition-all duration-200",bounce:"transition-all duration-200"}},defaultVariants:{variant:"default",size:"default",radius:"default",animation:"default"}}),VC=mn.forwardRef(({className:e,variant:t,size:r,radius:o,animation:n,indeterminate:a=!1,icon:i,checked:s,...l},u)=>{let[c,d]=mn.useState(a);return mn.useEffect(()=>{d(a)},[a]),(0,Do.jsx)(Gh,{ref:u,checked:c?!1:s,className:I("moonui-theme",Jq({variant:t,size:r,radius:o,animation:n}),e),...l,children:(0,Do.jsx)(FC,{className:I("flex items-center justify-center text-current",n==="bounce"&&"data-[state=checked]:animate-bounce"),children:c?(0,Do.jsx)(jd,{className:"h-[65%] w-[65%]"}):i||(0,Do.jsx)(lr,{className:"h-[65%] w-[65%]"})})})});VC.displayName=Gh.displayName;var vD=mn.forwardRef(({className:e,orientation:t="vertical",spacing:r="1rem",children:o,...n},a)=>(0,Do.jsx)("div",{ref:a,className:I("flex",t==="vertical"?"flex-col":"flex-row flex-wrap",e),style:{gap:r},role:"group",...n,children:o}));vD.displayName="CheckboxGroup";var jh=mn.forwardRef(({className:e,htmlFor:t,children:r,position:o="end",disabled:n=!1,...a},i)=>(0,Do.jsx)("label",{ref:i,htmlFor:t,className:I("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",o==="start"?"mr-2":"ml-2",n&&"cursor-not-allowed opacity-70",e),...a,children:r}));jh.displayName="CheckboxLabel";var yD=mn.forwardRef(({id:e,label:t,labelPosition:r="end",labelClassName:o,...n},a)=>{let i=mn.useId(),s=e||i;return(0,Do.jsxs)("div",{className:"flex items-center",children:[r==="start"&&(0,Do.jsx)(jh,{htmlFor:s,position:"start",disabled:n.disabled,className:o,children:t}),(0,Do.jsx)(VC,{ref:a,id:s,...n}),r==="end"&&(0,Do.jsx)(jh,{htmlFor:s,position:"end",disabled:n.disabled,className:o,children:t})]})});yD.displayName="CheckboxWithLabel";var BC=R(A());var Js=R(E()),e6=dg,xD=te("flex w-full items-center justify-between transition-all",{variants:{variant:{default:"text-foreground hover:text-primary",ghost:"text-foreground hover:bg-accent/10 rounded",outline:"text-foreground border border-border rounded-t-md hover:bg-accent/5"},size:{sm:"text-xs py-2 px-3",default:"text-sm py-3 px-4",md:"text-base py-4 px-4",lg:"text-lg py-5 px-5"}},defaultVariants:{variant:"default",size:"default"}}),wD=BC.forwardRef(({className:e,children:t,variant:r,size:o,asChild:n,...a},i)=>n?(0,Js.jsx)(ou,{ref:i,className:I("moonui-theme",xD({variant:r,size:o}),e),asChild:n,...a,children:t}):(0,Js.jsxs)(ou,{ref:i,className:I("moonui-theme",xD({variant:r,size:o}),e),...a,children:[t,(0,Js.jsx)(Vn,{className:"h-4 w-4 shrink-0 ml-auto transition-transform duration-200 [&[data-state=open]]:rotate-180"})]}));wD.displayName=ou.displayName;var t6=te("overflow-hidden transition-all data-[state=closed]:animate-collapse-up data-[state=open]:animate-collapse-down",{variants:{variant:{default:"text-muted-foreground",ghost:"text-muted-foreground rounded-b",outline:"text-muted-foreground border border-t-0 border-border rounded-b-md"},size:{sm:"text-xs",default:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{variant:"default",size:"default"}}),CD=BC.forwardRef(({className:e,children:t,variant:r,size:o,...n},a)=>(0,Js.jsx)(Sd,{ref:a,className:I("moonui-theme",t6({variant:r,size:o}),e),...n,children:(0,Js.jsx)("div",{className:"p-4",children:t})}));CD.displayName=Sd.displayName;var Ho=R(A());var SD=R(A());var No=R(E()),r6=te("group relative flex items-center w-full transition-colors",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),o6=te(["w-full bg-background transition-all duration-200","text-foreground placeholder:text-muted-foreground dark:placeholder:text-gray-500","disabled:cursor-not-allowed disabled:opacity-50","file:border-0 file:bg-transparent file:font-medium","focus-visible:outline-none dark:text-gray-200"],{variants:{variant:{standard:"border border-gray-300 dark:border-gray-700 rounded-md px-3 py-2 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:bg-gray-900/60 dark:shadow-inner dark:shadow-gray-950/10",filled:"border border-transparent bg-gray-100 dark:bg-gray-800/90 rounded-md px-3 py-2 hover:bg-gray-200 dark:hover:bg-gray-700/90 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 dark:shadow-inner dark:shadow-gray-950/10",ghost:"border-none bg-transparent shadow-none px-1 dark:text-gray-300 dark:placeholder:text-gray-500 hover:bg-gray-100/50 dark:hover:bg-gray-800/30 focus-visible:bg-transparent",underline:"border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 py-2 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:text-gray-300"},size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},hasLeftIcon:{true:"pl-10",false:""},hasRightIcon:{true:"pr-10",false:""},hasRightButton:{true:"pr-10",false:""},isError:{true:"border-error focus-visible:ring-error/30 focus-visible:border-error hover:border-error/80 dark:hover:border-error/80",false:""},isSuccess:{true:"border-success focus-visible:ring-success/30 focus-visible:border-success hover:border-success/80 dark:hover:border-success/80",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800/50 pointer-events-none",false:""}},defaultVariants:{variant:"standard",size:"md",isError:!1,isSuccess:!1,isDisabled:!1,hasLeftIcon:!1,hasRightIcon:!1,hasRightButton:!1}}),mr=SD.forwardRef(({className:e,wrapperClassName:t,messageClassName:r,variant:o,size:n,isError:a,disabled:i,error:s,success:l,loading:u,leftIcon:c,rightIcon:d,rightButton:f,alwaysShowMessage:p=!1,...h},m)=>{let x=p||s||l,v=s?"error":l?"success":"normal";return(0,No.jsxs)("div",{className:"space-y-1.5 w-full",children:[(0,No.jsxs)("div",{className:I("moonui-theme",r6({size:n}),t),children:[c&&(0,No.jsx)("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:u?(0,No.jsx)(Qt,{className:"h-4 w-4 animate-spin"}):c}),(0,No.jsx)("input",{className:I(o6({variant:o,size:n,isError:!!s||a,isSuccess:!!l,isDisabled:i||u,hasLeftIcon:!!c||u,hasRightIcon:!!d,hasRightButton:!!f}),e),ref:m,disabled:i||u,"data-loading":u?"":void 0,"data-error":s?"":void 0,"data-success":l?"":void 0,"aria-invalid":!!s||!!a||void 0,"aria-describedby":s?`${h.id||""}-error`:l?`${h.id||""}-success`:void 0,...h}),d&&!u&&(0,No.jsx)("div",{className:"absolute right-3 text-gray-500 flex items-center justify-center pointer-events-none",children:d}),f&&(0,No.jsx)("div",{className:"absolute right-3",children:f}),u&&!c&&(0,No.jsx)("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:(0,No.jsx)(Qt,{className:"h-4 w-4 animate-spin","aria-hidden":"true"})})]}),x&&(0,No.jsx)("p",{className:I("text-xs transition-all",v==="error"&&"text-error",v==="success"&&"text-success",v==="normal"&&"text-muted-foreground",r),id:s?`${h.id||""}-error`:l?`${h.id||""}-success`:void 0,children:s||l||""})]})});mr.displayName="Input";var ID=R(A());var bD=R(A(),1);var RD=R(E(),1),n6="Label",LD=bD.forwardRef((e,t)=>(0,RD.jsx)(X.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));LD.displayName=n6;var HC=LD;var PD=R(E()),i6=te("text-sm font-medium leading-none text-gray-900 dark:text-gray-200 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:peer-disabled:opacity-60 transition-colors duration-200"),Zr=ID.forwardRef(({className:e,...t},r)=>(0,PD.jsx)(HC,{ref:r,className:I(i6(),e),...t}));Zr.displayName=HC.displayName;var O2=R(A());var lt=R(A(),1);var gt=R(A(),1);var TD=R(A(),1);function kD(e,t=globalThis?.document){let r=et(e);TD.useEffect(()=>{let o=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var zC=R(E(),1),s6="DismissableLayer",UC="dismissableLayer.update",l6="dismissableLayer.pointerDownOutside",u6="dismissableLayer.focusOutside",MD,AD=gt.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_o=gt.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:n,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...l}=e,u=gt.useContext(AD),[c,d]=gt.useState(null),f=c?.ownerDocument??globalThis?.document,[,p]=gt.useState({}),h=ae(t,S=>d(S)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(x),g=c?m.indexOf(c):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,w=g>=v,C=d6(S=>{let L=S.target,T=[...u.branches].some(P=>P.contains(L));!w||T||(n?.(S),i?.(S),S.defaultPrevented||s?.())},f),b=f6(S=>{let L=S.target;[...u.branches].some(P=>P.contains(L))||(a?.(S),i?.(S),S.defaultPrevented||s?.())},f);return kD(S=>{g===u.layers.size-1&&(o?.(S),!S.defaultPrevented&&s&&(S.preventDefault(),s()))},f),gt.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(MD=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),ED(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=MD)}},[c,f,r,u]),gt.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),ED())},[c,u]),gt.useEffect(()=>{let S=()=>p({});return document.addEventListener(UC,S),()=>document.removeEventListener(UC,S)},[]),(0,zC.jsx)(X.div,{...l,ref:h,style:{pointerEvents:y?w?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,b.onFocusCapture),onBlurCapture:H(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});_o.displayName=s6;var c6="DismissableLayerBranch",DD=gt.forwardRef((e,t)=>{let r=gt.useContext(AD),o=gt.useRef(null),n=ae(t,o);return gt.useEffect(()=>{let a=o.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),(0,zC.jsx)(X.div,{...e,ref:n})});DD.displayName=c6;function d6(e,t=globalThis?.document){let r=et(e),o=gt.useRef(!1),n=gt.useRef(()=>{});return gt.useEffect(()=>{let a=s=>{if(s.target&&!o.current){let u=function(){ND(l6,r,c,{discrete:!0})};var l=u;let c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=u,t.addEventListener("click",n.current,{once:!0})):u()}else t.removeEventListener("click",n.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function f6(e,t=globalThis?.document){let r=et(e),o=gt.useRef(!1);return gt.useEffect(()=>{let n=a=>{a.target&&!o.current&&ND(u6,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function ED(){let e=new CustomEvent(UC);document.dispatchEvent(e)}function ND(e,t,r,{discrete:o}){let n=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?ru(n,a):n.dispatchEvent(a)}var _D=_o,OD=DD;var VD=R(A(),1),WC=0;function Oi(){VD.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??FD()),document.body.insertAdjacentElement("beforeend",e[1]??FD()),WC++,()=>{WC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),WC--}},[])}function FD(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Oo=R(A(),1);var WD=R(E(),1),GC="focusScope.autoFocusOnMount",jC="focusScope.autoFocusOnUnmount",BD={bubbles:!1,cancelable:!0},m6="FocusScope",Ta=Oo.forwardRef((e,t)=>{let{loop:r=!1,trapped:o=!1,onMountAutoFocus:n,onUnmountAutoFocus:a,...i}=e,[s,l]=Oo.useState(null),u=et(n),c=et(a),d=Oo.useRef(null),f=ae(t,m=>l(m)),p=Oo.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Oo.useEffect(()=>{if(o){let g=function(b){if(p.paused||!s)return;let S=b.target;s.contains(S)?d.current=S:Fi(d.current,{select:!0})},y=function(b){if(p.paused||!s)return;let S=b.relatedTarget;S!==null&&(s.contains(S)||Fi(d.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(let L of b)L.removedNodes.length>0&&Fi(s)};var m=g,x=y,v=w;document.addEventListener("focusin",g),document.addEventListener("focusout",y);let C=new MutationObserver(w);return s&&C.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),C.disconnect()}}},[o,s,p.paused]),Oo.useEffect(()=>{if(s){UD.add(p);let m=document.activeElement;if(!s.contains(m)){let v=new CustomEvent(GC,BD);s.addEventListener(GC,u),s.dispatchEvent(v),v.defaultPrevented||(g6(w6(GD(s)),{select:!0}),document.activeElement===m&&Fi(s))}return()=>{s.removeEventListener(GC,u),setTimeout(()=>{let v=new CustomEvent(jC,BD);s.addEventListener(jC,c),s.dispatchEvent(v),v.defaultPrevented||Fi(m??document.body,{select:!0}),s.removeEventListener(jC,c),UD.remove(p)},0)}}},[s,u,c,p]);let h=Oo.useCallback(m=>{if(!r&&!o||p.paused)return;let x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(x&&v){let g=m.currentTarget,[y,w]=h6(g);y&&w?!m.shiftKey&&v===w?(m.preventDefault(),r&&Fi(y,{select:!0})):m.shiftKey&&v===y&&(m.preventDefault(),r&&Fi(w,{select:!0})):v===g&&m.preventDefault()}},[r,o,p.paused]);return(0,WD.jsx)(X.div,{tabIndex:-1,...i,ref:f,onKeyDown:h})});Ta.displayName=m6;function g6(e,{select:t=!1}={}){let r=document.activeElement;for(let o of e)if(Fi(o,{select:t}),document.activeElement!==r)return}function h6(e){let t=GD(e),r=HD(t,e),o=HD(t.reverse(),e);return[r,o]}function GD(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let n=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||n?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function HD(e,t){for(let r of e)if(!v6(r,{upTo:t}))return r}function v6(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function y6(e){return e instanceof HTMLInputElement&&"select"in e}function Fi(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&y6(e)&&t&&e.select()}}var UD=x6();function x6(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),e=zD(e,t),e.unshift(t)},remove(t){e=zD(e,t),e[0]?.resume()}}}function zD(e,t){let r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function w6(e){return e.filter(t=>t.tagName!=="A")}var eo=R(A(),1);var $D=["top","right","bottom","left"];var qn=Math.min,Dr=Math.max,ep=Math.round,tp=Math.floor,gn=e=>({x:e,y:e}),C6={left:"right",right:"left",bottom:"top",top:"bottom"},S6={start:"end",end:"start"};function $h(e,t,r){return Dr(e,qn(t,r))}function $n(e,t){return typeof e=="function"?e(t):e}function Kn(e){return e.split("-")[0]}function el(e){return e.split("-")[1]}function Kh(e){return e==="x"?"y":"x"}function Xh(e){return e==="y"?"height":"width"}var b6=new Set(["top","bottom"]);function hn(e){return b6.has(Kn(e))?"y":"x"}function Yh(e){return Kh(hn(e))}function KD(e,t,r){r===void 0&&(r=!1);let o=el(e),n=Yh(e),a=Xh(n),i=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Jf(i)),[i,Jf(i)]}function XD(e){let t=Jf(e);return[qh(e),t,qh(t)]}function qh(e){return e.replace(/start|end/g,t=>S6[t])}var jD=["left","right"],qD=["right","left"],R6=["top","bottom"],L6=["bottom","top"];function I6(e,t,r){switch(e){case"top":case"bottom":return r?t?qD:jD:t?jD:qD;case"left":case"right":return t?R6:L6;default:return[]}}function YD(e,t,r,o){let n=el(e),a=I6(Kn(e),r==="start",o);return n&&(a=a.map(i=>i+"-"+n),t&&(a=a.concat(a.map(qh)))),a}function Jf(e){return e.replace(/left|right|bottom|top/g,t=>C6[t])}function P6(e){return{top:0,right:0,bottom:0,left:0,...e}}function qC(e){return typeof e!="number"?P6(e):{top:e,right:e,bottom:e,left:e}}function tl(e){let{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function QD(e,t,r){let{reference:o,floating:n}=e,a=hn(t),i=Yh(t),s=Xh(i),l=Kn(t),u=a==="y",c=o.x+o.width/2-n.width/2,d=o.y+o.height/2-n.height/2,f=o[s]/2-n[s]/2,p;switch(l){case"top":p={x:c,y:o.y-n.height};break;case"bottom":p={x:c,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-n.width,y:d};break;default:p={x:o.x,y:o.y}}switch(el(t)){case"start":p[i]-=f*(r&&u?-1:1);break;case"end":p[i]+=f*(r&&u?-1:1);break}return p}var eN=async(e,t,r)=>{let{placement:o="bottom",strategy:n="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t)),u=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:c,y:d}=QD(u,o,l),f=o,p={},h=0;for(let m=0;m<s.length;m++){let{name:x,fn:v}=s[m],{x:g,y,data:w,reset:C}=await v({x:c,y:d,initialPlacement:o,placement:f,strategy:n,middlewareData:p,rects:u,platform:i,elements:{reference:e,floating:t}});c=g??c,d=y??d,p={...p,[x]:{...p[x],...w}},C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:n}):C.rects),{x:c,y:d}=QD(u,f,l)),m=-1)}return{x:c,y:d,placement:f,strategy:n,middlewareData:p}};async function Ju(e,t){var r;t===void 0&&(t={});let{x:o,y:n,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=$n(t,e),h=qC(p),x=s[f?d==="floating"?"reference":"floating":d],v=tl(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),g=d==="floating"?{x:o,y:n,width:i.floating.width,height:i.floating.height}:i.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),w=await(a.isElement==null?void 0:a.isElement(y))?await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1}:{x:1,y:1},C=tl(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:y,strategy:l}):g);return{top:(v.top-C.top+h.top)/w.y,bottom:(C.bottom-v.bottom+h.bottom)/w.y,left:(v.left-C.left+h.left)/w.x,right:(C.right-v.right+h.right)/w.x}}var tN=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:o,placement:n,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=$n(e,t)||{};if(u==null)return{};let d=qC(c),f={x:r,y:o},p=Yh(n),h=Xh(p),m=await i.getDimensions(u),x=p==="y",v=x?"top":"left",g=x?"bottom":"right",y=x?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],C=f[p]-a.reference[p],b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u)),S=b?b[y]:0;(!S||!await(i.isElement==null?void 0:i.isElement(b)))&&(S=s.floating[y]||a.floating[h]);let L=w/2-C/2,T=S/2-m[h]/2-1,P=qn(d[v],T),_=qn(d[g],T),F=P,j=S-m[h]-_,D=S/2-m[h]/2+L,W=$h(F,D,j),N=!l.arrow&&el(n)!=null&&D!==W&&a.reference[h]/2-(D<F?P:_)-m[h]/2<0,z=N?D<F?D-F:D-j:0;return{[p]:f[p]+z,data:{[p]:W,centerOffset:D-W-z,...N&&{alignmentOffset:z}},reset:N}}});var rN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;let{placement:n,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...x}=$n(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};let v=Kn(n),g=hn(s),y=Kn(s)===s,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=f||(y||!m?[Jf(s)]:XD(s)),b=h!=="none";!f&&b&&C.push(...YD(s,m,h,w));let S=[s,...C],L=await Ju(t,x),T=[],P=((o=a.flip)==null?void 0:o.overflows)||[];if(c&&T.push(L[v]),d){let D=KD(n,i,w);T.push(L[D[0]],L[D[1]])}if(P=[...P,{placement:n,overflows:T}],!T.every(D=>D<=0)){var _,F;let D=(((_=a.flip)==null?void 0:_.index)||0)+1,W=S[D];if(W&&(!(d==="alignment"?g!==hn(W):!1)||P.every(V=>hn(V.placement)===g?V.overflows[0]>0:!0)))return{data:{index:D,overflows:P},reset:{placement:W}};let N=(F=P.filter(z=>z.overflows[0]<=0).sort((z,V)=>z.overflows[1]-V.overflows[1])[0])==null?void 0:F.placement;if(!N)switch(p){case"bestFit":{var j;let z=(j=P.filter(V=>{if(b){let k=hn(V.placement);return k===g||k==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(k=>k>0).reduce((k,K)=>k+K,0)]).sort((V,k)=>V[1]-k[1])[0])==null?void 0:j[0];z&&(N=z);break}case"initialPlacement":N=s;break}if(n!==N)return{reset:{placement:N}}}return{}}}};function ZD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JD(e){return $D.some(t=>e[t]>=0)}var oN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:o="referenceHidden",...n}=$n(e,t);switch(o){case"referenceHidden":{let a=await Ju(t,{...n,elementContext:"reference"}),i=ZD(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:JD(i)}}}case"escaped":{let a=await Ju(t,{...n,altBoundary:!0}),i=ZD(a,r.floating);return{data:{escapedOffsets:i,escaped:JD(i)}}}default:return{}}}}};var nN=new Set(["left","top"]);async function T6(e,t){let{placement:r,platform:o,elements:n}=e,a=await(o.isRTL==null?void 0:o.isRTL(n.floating)),i=Kn(r),s=el(r),l=hn(r)==="y",u=nN.has(i)?-1:1,c=a&&l?-1:1,d=$n(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),l?{x:p*c,y:f*u}:{x:f*u,y:p*c}}var aN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;let{x:n,y:a,placement:i,middlewareData:s}=t,l=await T6(t,e);return i===((r=s.offset)==null?void 0:r.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:n+l.x,y:a+l.y,data:{...l,placement:i}}}}},iN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:o,placement:n}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:x=>{let{x:v,y:g}=x;return{x:v,y:g}}},...l}=$n(e,t),u={x:r,y:o},c=await Ju(t,l),d=hn(Kn(n)),f=Kh(d),p=u[f],h=u[d];if(a){let x=f==="y"?"top":"left",v=f==="y"?"bottom":"right",g=p+c[x],y=p-c[v];p=$h(g,p,y)}if(i){let x=d==="y"?"top":"left",v=d==="y"?"bottom":"right",g=h+c[x],y=h-c[v];h=$h(g,h,y)}let m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-r,y:m.y-o,enabled:{[f]:a,[d]:i}}}}}},sN=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:o,placement:n,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=$n(e,t),c={x:r,y:o},d=hn(n),f=Kh(d),p=c[f],h=c[d],m=$n(s,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let y=f==="y"?"height":"width",w=a.reference[f]-a.floating[y]+x.mainAxis,C=a.reference[f]+a.reference[y]-x.mainAxis;p<w?p=w:p>C&&(p=C)}if(u){var v,g;let y=f==="y"?"width":"height",w=nN.has(Kn(n)),C=a.reference[d]-a.floating[y]+(w&&((v=i.offset)==null?void 0:v[d])||0)+(w?0:x.crossAxis),b=a.reference[d]+a.reference[y]+(w?0:((g=i.offset)==null?void 0:g[d])||0)-(w?x.crossAxis:0);h<C?h=C:h>b&&(h=b)}return{[f]:p,[d]:h}}}},lN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;let{placement:n,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...u}=$n(e,t),c=await Ju(t,u),d=Kn(n),f=el(n),p=hn(n)==="y",{width:h,height:m}=a.floating,x,v;d==="top"||d==="bottom"?(x=d,v=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,x=f==="end"?"top":"bottom");let g=m-c.top-c.bottom,y=h-c.left-c.right,w=qn(m-c[x],g),C=qn(h-c[v],y),b=!t.middlewareData.shift,S=w,L=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(L=y),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(S=g),b&&!f){let P=Dr(c.left,0),_=Dr(c.right,0),F=Dr(c.top,0),j=Dr(c.bottom,0);p?L=h-2*(P!==0||_!==0?P+_:Dr(c.left,c.right)):S=m-2*(F!==0||j!==0?F+j:Dr(c.top,c.bottom))}await l({...t,availableWidth:L,availableHeight:S});let T=await i.getDimensions(s.floating);return h!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function Qh(){return typeof window<"u"}function ol(e){return cN(e)?(e.nodeName||"").toLowerCase():"#document"}function Jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vn(e){var t;return(t=(cN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function cN(e){return Qh()?e instanceof Node||e instanceof Jr(e).Node:!1}function Fo(e){return Qh()?e instanceof Element||e instanceof Jr(e).Element:!1}function yn(e){return Qh()?e instanceof HTMLElement||e instanceof Jr(e).HTMLElement:!1}function uN(e){return!Qh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jr(e).ShadowRoot}var k6=new Set(["inline","contents"]);function ec(e){let{overflow:t,overflowX:r,overflowY:o,display:n}=Vo(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!k6.has(n)}var M6=new Set(["table","td","th"]);function dN(e){return M6.has(ol(e))}var E6=[":popover-open",":modal"];function rp(e){return E6.some(t=>{try{return e.matches(t)}catch{return!1}})}var A6=["transform","translate","scale","rotate","perspective"],D6=["transform","translate","scale","rotate","perspective","filter"],N6=["paint","layout","strict","content"];function Zh(e){let t=Jh(),r=Fo(e)?Vo(e):e;return A6.some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||D6.some(o=>(r.willChange||"").includes(o))||N6.some(o=>(r.contain||"").includes(o))}function fN(e){let t=ka(e);for(;yn(t)&&!nl(t);){if(Zh(t))return t;if(rp(t))return null;t=ka(t)}return null}function Jh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var _6=new Set(["html","body","#document"]);function nl(e){return _6.has(ol(e))}function Vo(e){return Jr(e).getComputedStyle(e)}function op(e){return Fo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ka(e){if(ol(e)==="html")return e;let t=e.assignedSlot||e.parentNode||uN(e)&&e.host||vn(e);return uN(t)?t.host:t}function pN(e){let t=ka(e);return nl(t)?e.ownerDocument?e.ownerDocument.body:e.body:yn(t)&&ec(t)?t:pN(t)}function rl(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let n=pN(e),a=n===((o=e.ownerDocument)==null?void 0:o.body),i=Jr(n);if(a){let s=ev(i);return t.concat(i,i.visualViewport||[],ec(n)?n:[],s&&r?rl(s):[])}return t.concat(n,rl(n,[],r))}function ev(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hN(e){let t=Vo(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=yn(e),a=n?e.offsetWidth:r,i=n?e.offsetHeight:o,s=ep(r)!==a||ep(o)!==i;return s&&(r=a,o=i),{width:r,height:o,$:s}}function KC(e){return Fo(e)?e:e.contextElement}function tc(e){let t=KC(e);if(!yn(t))return gn(1);let r=t.getBoundingClientRect(),{width:o,height:n,$:a}=hN(t),i=(a?ep(r.width):r.width)/o,s=(a?ep(r.height):r.height)/n;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}var O6=gn(0);function vN(e){let t=Jr(e);return!Jh()||!t.visualViewport?O6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function F6(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Jr(e)?!1:t}function al(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let n=e.getBoundingClientRect(),a=KC(e),i=gn(1);t&&(o?Fo(o)&&(i=tc(o)):i=tc(e));let s=F6(a,r,o)?vN(a):gn(0),l=(n.left+s.x)/i.x,u=(n.top+s.y)/i.y,c=n.width/i.x,d=n.height/i.y;if(a){let f=Jr(a),p=o&&Fo(o)?Jr(o):o,h=f,m=ev(h);for(;m&&o&&p!==h;){let x=tc(m),v=m.getBoundingClientRect(),g=Vo(m),y=v.left+(m.clientLeft+parseFloat(g.paddingLeft))*x.x,w=v.top+(m.clientTop+parseFloat(g.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,d*=x.y,l+=y,u+=w,h=Jr(m),m=ev(h)}}return tl({width:c,height:d,x:l,y:u})}function XC(e,t){let r=op(e).scrollLeft;return t?t.left+r:al(vn(e)).left+r}function yN(e,t,r){r===void 0&&(r=!1);let o=e.getBoundingClientRect(),n=o.left+t.scrollLeft-(r?0:XC(e,o)),a=o.top+t.scrollTop;return{x:n,y:a}}function V6(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e,a=n==="fixed",i=vn(o),s=t?rp(t.floating):!1;if(o===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=gn(1),c=gn(0),d=yn(o);if((d||!d&&!a)&&((ol(o)!=="body"||ec(i))&&(l=op(o)),yn(o))){let p=al(o);u=tc(o),c.x=p.x+o.clientLeft,c.y=p.y+o.clientTop}let f=i&&!d&&!a?yN(i,l,!0):gn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}}function B6(e){return Array.from(e.getClientRects())}function H6(e){let t=vn(e),r=op(e),o=e.ownerDocument.body,n=Dr(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Dr(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),i=-r.scrollLeft+XC(e),s=-r.scrollTop;return Vo(o).direction==="rtl"&&(i+=Dr(t.clientWidth,o.clientWidth)-n),{width:n,height:a,x:i,y:s}}function U6(e,t){let r=Jr(e),o=vn(e),n=r.visualViewport,a=o.clientWidth,i=o.clientHeight,s=0,l=0;if(n){a=n.width,i=n.height;let u=Jh();(!u||u&&t==="fixed")&&(s=n.offsetLeft,l=n.offsetTop)}return{width:a,height:i,x:s,y:l}}var z6=new Set(["absolute","fixed"]);function W6(e,t){let r=al(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,a=yn(e)?tc(e):gn(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=n*a.x,u=o*a.y;return{width:i,height:s,x:l,y:u}}function mN(e,t,r){let o;if(t==="viewport")o=U6(e,r);else if(t==="document")o=H6(vn(e));else if(Fo(t))o=W6(t,r);else{let n=vN(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return tl(o)}function xN(e,t){let r=ka(e);return r===t||!Fo(r)||nl(r)?!1:Vo(r).position==="fixed"||xN(r,t)}function G6(e,t){let r=t.get(e);if(r)return r;let o=rl(e,[],!1).filter(s=>Fo(s)&&ol(s)!=="body"),n=null,a=Vo(e).position==="fixed",i=a?ka(e):e;for(;Fo(i)&&!nl(i);){let s=Vo(i),l=Zh(i);!l&&s.position==="fixed"&&(n=null),(a?!l&&!n:!l&&s.position==="static"&&!!n&&z6.has(n.position)||ec(i)&&!l&&xN(e,i))?o=o.filter(c=>c!==i):n=s,i=ka(i)}return t.set(e,o),o}function j6(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e,i=[...r==="clippingAncestors"?rp(t)?[]:G6(t,this._c):[].concat(r),o],s=i[0],l=i.reduce((u,c)=>{let d=mN(t,c,n);return u.top=Dr(d.top,u.top),u.right=qn(d.right,u.right),u.bottom=qn(d.bottom,u.bottom),u.left=Dr(d.left,u.left),u},mN(t,s,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function q6(e){let{width:t,height:r}=hN(e);return{width:t,height:r}}function $6(e,t,r){let o=yn(t),n=vn(t),a=r==="fixed",i=al(e,!0,a,t),s={scrollLeft:0,scrollTop:0},l=gn(0);function u(){l.x=XC(n)}if(o||!o&&!a)if((ol(t)!=="body"||ec(n))&&(s=op(t)),o){let p=al(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else n&&u();a&&!o&&n&&u();let c=n&&!o&&!a?yN(n,s):gn(0),d=i.left+s.scrollLeft-l.x-c.x,f=i.top+s.scrollTop-l.y-c.y;return{x:d,y:f,width:i.width,height:i.height}}function $C(e){return Vo(e).position==="static"}function gN(e,t){if(!yn(e)||Vo(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return vn(e)===r&&(r=r.ownerDocument.body),r}function wN(e,t){let r=Jr(e);if(rp(e))return r;if(!yn(e)){let n=ka(e);for(;n&&!nl(n);){if(Fo(n)&&!$C(n))return n;n=ka(n)}return r}let o=gN(e,t);for(;o&&dN(o)&&$C(o);)o=gN(o,t);return o&&nl(o)&&$C(o)&&!Zh(o)?r:o||fN(e)||r}var K6=async function(e){let t=this.getOffsetParent||wN,r=this.getDimensions,o=await r(e.floating);return{reference:$6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function X6(e){return Vo(e).direction==="rtl"}var CN={convertOffsetParentRelativeRectToViewportRelativeRect:V6,getDocumentElement:vn,getClippingRect:j6,getOffsetParent:wN,getElementRects:K6,getClientRects:B6,getDimensions:q6,getScale:tc,isElement:Fo,isRTL:X6};function SN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Y6(e,t){let r=null,o,n=vn(e);function a(){var s;clearTimeout(o),(s=r)==null||s.disconnect(),r=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();let u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:p}=u;if(s||t(),!f||!p)return;let h=tp(d),m=tp(n.clientWidth-(c+f)),x=tp(n.clientHeight-(d+p)),v=tp(c),y={rootMargin:-h+"px "+-m+"px "+-x+"px "+-v+"px",threshold:Dr(0,qn(1,l))||1},w=!0;function C(b){let S=b[0].intersectionRatio;if(S!==l){if(!w)return i();S?i(!1,S):o=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!SN(u,e.getBoundingClientRect())&&i(),w=!1}try{r=new IntersectionObserver(C,{...y,root:n.ownerDocument})}catch{r=new IntersectionObserver(C,y)}r.observe(e)}return i(!0),a}function YC(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=KC(e),c=n||a?[...u?rl(u):[],...rl(t)]:[];c.forEach(v=>{n&&v.addEventListener("scroll",r,{passive:!0}),a&&v.addEventListener("resize",r)});let d=u&&s?Y6(u,r):null,f=-1,p=null;i&&(p=new ResizeObserver(v=>{let[g]=v;g&&g.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),r()}),u&&!l&&p.observe(u),p.observe(t));let h,m=l?al(e):null;l&&x();function x(){let v=al(e);m&&!SN(m,v)&&r(),m=v,h=requestAnimationFrame(x)}return r(),()=>{var v;c.forEach(g=>{n&&g.removeEventListener("scroll",r),a&&g.removeEventListener("resize",r)}),d?.(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var bN=aN;var RN=iN,LN=rN,IN=lN,PN=oN,QC=tN;var TN=sN,ZC=(e,t,r)=>{let o=new Map,n={platform:CN,...r},a={...n.platform,_c:o};return eN(e,t,{...n,platform:a})};var Lt=R(A(),1),MN=R(A(),1),EN=R(tu(),1),Q6=typeof document<"u",Z6=function(){},tv=Q6?MN.useLayoutEffect:Z6;function rv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!rv(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){let a=n[o];if(!(a==="_owner"&&e.$$typeof)&&!rv(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function AN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kN(e,t){let r=AN(e);return Math.round(t*r)/r}function JC(e){let t=Lt.useRef(e);return tv(()=>{t.current=e}),t}function DN(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=Lt.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Lt.useState(o);rv(f,o)||p(o);let[h,m]=Lt.useState(null),[x,v]=Lt.useState(null),g=Lt.useCallback(V=>{V!==b.current&&(b.current=V,m(V))},[]),y=Lt.useCallback(V=>{V!==S.current&&(S.current=V,v(V))},[]),w=a||h,C=i||x,b=Lt.useRef(null),S=Lt.useRef(null),L=Lt.useRef(c),T=l!=null,P=JC(l),_=JC(n),F=JC(u),j=Lt.useCallback(()=>{if(!b.current||!S.current)return;let V={placement:t,strategy:r,middleware:f};_.current&&(V.platform=_.current),ZC(b.current,S.current,V).then(k=>{let K={...k,isPositioned:F.current!==!1};D.current&&!rv(L.current,K)&&(L.current=K,EN.flushSync(()=>{d(K)}))})},[f,t,r,_,F]);tv(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[u]);let D=Lt.useRef(!1);tv(()=>(D.current=!0,()=>{D.current=!1}),[]),tv(()=>{if(w&&(b.current=w),C&&(S.current=C),w&&C){if(P.current)return P.current(w,C,j);j()}},[w,C,j,P,T]);let W=Lt.useMemo(()=>({reference:b,floating:S,setReference:g,setFloating:y}),[g,y]),N=Lt.useMemo(()=>({reference:w,floating:C}),[w,C]),z=Lt.useMemo(()=>{let V={position:r,left:0,top:0};if(!N.floating)return V;let k=kN(N.floating,c.x),K=kN(N.floating,c.y);return s?{...V,transform:"translate("+k+"px, "+K+"px)",...AN(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:k,top:K}},[r,s,N.floating,c.x,c.y]);return Lt.useMemo(()=>({...c,update:j,refs:W,elements:N,floatingStyles:z}),[c,j,W,N,z])}var J6=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:o,padding:n}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?QC({element:o.current,padding:n}).fn(r):{}:o?QC({element:o,padding:n}).fn(r):{}}}},NN=(e,t)=>({...bN(e),options:[e,t]}),_N=(e,t)=>({...RN(e),options:[e,t]}),ON=(e,t)=>({...TN(e),options:[e,t]}),FN=(e,t)=>({...LN(e),options:[e,t]}),VN=(e,t)=>({...IN(e),options:[e,t]});var BN=(e,t)=>({...PN(e),options:[e,t]});var HN=(e,t)=>({...J6(e),options:[e,t]});var UN=R(A(),1);var eS=R(E(),1),e8="Arrow",zN=UN.forwardRef((e,t)=>{let{children:r,width:o=10,height:n=5,...a}=e;return(0,eS.jsx)(X.svg,{...a,ref:t,width:o,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,eS.jsx)("polygon",{points:"0,0 30,0 15,10"})})});zN.displayName=e8;var WN=zN;var Vi=R(E(),1);var tS="Popper",[GN,Bo]=ke(tS),[r8,jN]=GN(tS),qN=e=>{let{__scopePopper:t,children:r}=e,[o,n]=eo.useState(null);return(0,Vi.jsx)(r8,{scope:t,anchor:o,onAnchorChange:n,children:r})};qN.displayName=tS;var $N="PopperAnchor",KN=eo.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:o,...n}=e,a=jN($N,r),i=eo.useRef(null),s=ae(t,i),l=eo.useRef(null);return eo.useEffect(()=>{let u=l.current;l.current=o?.current||i.current,u!==l.current&&a.onAnchorChange(l.current)}),o?null:(0,Vi.jsx)(X.div,{...n,ref:s})});KN.displayName=$N;var rS="PopperContent",[o8,n8]=GN(rS),XN=eo.forwardRef((e,t)=>{let{__scopePopper:r,side:o="bottom",sideOffset:n=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:h,...m}=e,x=jN(rS,r),[v,g]=eo.useState(null),y=ae(t,q=>g(q)),[w,C]=eo.useState(null),b=Zu(w),S=b?.width??0,L=b?.height??0,T=o+(a!=="center"?"-"+a:""),P=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},_=Array.isArray(u)?u:[u],F=_.length>0,j={padding:P,boundary:_.filter(i8),altBoundary:F},{refs:D,floatingStyles:W,placement:N,isPositioned:z,middlewareData:V}=DN({strategy:"fixed",placement:T,whileElementsMounted:(...q)=>YC(...q,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[NN({mainAxis:n+L,alignmentAxis:i}),l&&_N({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?ON():void 0,...j}),l&&FN({...j}),VN({...j,apply:({elements:q,rects:ge,availableWidth:Re,availableHeight:_e})=>{let{width:nt,height:bt}=ge.reference,wo=q.floating.style;wo.setProperty("--radix-popper-available-width",`${Re}px`),wo.setProperty("--radix-popper-available-height",`${_e}px`),wo.setProperty("--radix-popper-anchor-width",`${nt}px`),wo.setProperty("--radix-popper-anchor-height",`${bt}px`)}}),w&&HN({element:w,padding:s}),s8({arrowWidth:S,arrowHeight:L}),f&&BN({strategy:"referenceHidden",...j})]}),[k,K]=ZN(N),de=et(h);Me(()=>{z&&de?.()},[z,de]);let M=V.arrow?.x,Y=V.arrow?.y,le=V.arrow?.centerOffset!==0,[J,fe]=eo.useState();return Me(()=>{v&&fe(window.getComputedStyle(v).zIndex)},[v]),(0,Vi.jsx)("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:z?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,Vi.jsx)(o8,{scope:r,placedSide:k,onArrowChange:C,arrowX:M,arrowY:Y,shouldHideArrow:le,children:(0,Vi.jsx)(X.div,{"data-side":k,"data-align":K,...m,ref:y,style:{...m.style,animation:z?void 0:"none"}})})})});XN.displayName=rS;var YN="PopperArrow",a8={top:"bottom",right:"left",bottom:"top",left:"right"},QN=eo.forwardRef(function(t,r){let{__scopePopper:o,...n}=t,a=n8(YN,o),i=a8[a.placedSide];return(0,Vi.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,Vi.jsx)(WN,{...n,ref:r,style:{...n.style,display:"block"}})})});QN.displayName=YN;function i8(e){return e!==null}var s8=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:o,middlewareData:n}=t,i=n.arrow?.centerOffset!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,c]=ZN(r),d={start:"0%",center:"50%",end:"100%"}[c],f=(n.arrow?.x??0)+s/2,p=(n.arrow?.y??0)+l/2,h="",m="";return u==="bottom"?(h=i?d:`${f}px`,m=`${-l}px`):u==="top"?(h=i?d:`${f}px`,m=`${o.floating.height+l}px`):u==="right"?(h=`${-l}px`,m=i?d:`${p}px`):u==="left"&&(h=`${o.floating.width+l}px`,m=i?d:`${p}px`),{data:{x:h,y:m}}}});function ZN(e){let[t,r="center"]=e.split("-");return[t,r]}var Ma=qN,Ea=KN,Bi=XN,Hi=QN;var nv=R(A(),1),JN=R(tu(),1);var e2=R(E(),1),l8="Portal",ho=nv.forwardRef((e,t)=>{let{container:r,...o}=e,[n,a]=nv.useState(!1);Me(()=>a(!0),[]);let i=r||n&&globalThis?.document?.body;return i?JN.default.createPortal((0,e2.jsx)(X.div,{...o,ref:t}),i):null});ho.displayName=l8;var u8=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rc=new WeakMap,av=new WeakMap,iv={},oS=0,t2=function(e){return e&&(e.host||t2(e.parentNode))},c8=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=t2(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},d8=function(e,t,r,o){var n=c8(t,Array.isArray(e)?e:[e]);iv[r]||(iv[r]=new WeakMap);var a=iv[r],i=[],s=new Set,l=new Set(n),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};n.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))c(f);else try{var p=f.getAttribute(o),h=p!==null&&p!=="false",m=(rc.get(f)||0)+1,x=(a.get(f)||0)+1;rc.set(f,m),a.set(f,x),i.push(f),m===1&&h&&av.set(f,!0),x===1&&f.setAttribute(r,"true"),h||f.setAttribute(o,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return c(t),s.clear(),oS++,function(){i.forEach(function(d){var f=rc.get(d)-1,p=a.get(d)-1;rc.set(d,f),a.set(d,p),f||(av.has(d)||d.removeAttribute(o),av.delete(d)),p||d.removeAttribute(r)}),oS--,oS||(rc=new WeakMap,rc=new WeakMap,av=new WeakMap,iv={})}},Ui=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),n=t||u8(e);return n?(o.push.apply(o,Array.from(n.querySelectorAll("[aria-live], script"))),d8(o,n,r,"aria-hidden")):function(){return null}};var to=function(){return to=Object.assign||function(t){for(var r,o=1,n=arguments.length;o<n;o++){r=arguments[o];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},to.apply(this,arguments)};function sv(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function r2(e,t,r){if(r||arguments.length===2)for(var o=0,n=t.length,a;o<n;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))}var fv=R(A());var gr=R(A());var il="right-scroll-bar-position",sl="width-before-scroll-bar",nS="with-scroll-bars-hidden",aS="--removed-body-scroll-bar-size";function lv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}var o2=R(A());function n2(e,t){var r=(0,o2.useState)(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var n=r.value;n!==o&&(r.value=o,r.callback(o,n))}}}})[0];return r.callback=t,r.facade}var uv=R(A());var f8=typeof window<"u"?uv.useLayoutEffect:uv.useEffect,a2=new WeakMap;function iS(e,t){var r=n2(t||null,function(o){return e.forEach(function(n){return lv(n,o)})});return f8(function(){var o=a2.get(r);if(o){var n=new Set(o),a=new Set(e),i=r.current;n.forEach(function(s){a.has(s)||lv(s,null)}),a.forEach(function(s){n.has(s)||lv(s,i)})}a2.set(r,e)},[e]),r}function p8(e){return e}function m8(e,t){t===void 0&&(t=p8);var r=[],o=!1,n={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,o);return r.push(i),function(){r=r.filter(function(s){return s!==i})}},assignSyncMedium:function(a){for(o=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(s){return a(s)},filter:function(){return r}}},assignMedium:function(a){o=!0;var i=[];if(r.length){var s=r;r=[],s.forEach(a),i=r}var l=function(){var c=i;i=[],c.forEach(a)},u=function(){return Promise.resolve().then(l)};u(),r={push:function(c){i.push(c),u()},filter:function(c){return i=i.filter(c),r}}}};return n}function sS(e){e===void 0&&(e={});var t=m8(null);return t.options=to({async:!0,ssr:!1},e),t}var i2=R(A()),s2=function(e){var t=e.sideCar,r=sv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return i2.createElement(o,to({},r))};s2.isSideCarExport=!0;function lS(e,t){return e.useMedium(t),s2}var cv=sS();var uS=function(){},np=gr.forwardRef(function(e,t){var r=gr.useRef(null),o=gr.useState({onScrollCapture:uS,onWheelCapture:uS,onTouchMoveCapture:uS}),n=o[0],a=o[1],i=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,m=e.inert,x=e.allowPinchZoom,v=e.as,g=v===void 0?"div":v,y=e.gapMode,w=sv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=f,b=iS([r,t]),S=to(to({},w),n);return gr.createElement(gr.Fragment,null,c&&gr.createElement(C,{sideCar:cv,removeScrollBar:u,shards:d,noRelative:p,noIsolation:h,inert:m,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:y}),i?gr.cloneElement(gr.Children.only(s),to(to({},S),{ref:b})):gr.createElement(g,to({},S,{className:l,ref:b}),s))});np.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};np.classNames={fullWidth:sl,zeroRight:il};var rt=R(A());var nc=R(A());var c2=R(A());var l2;var u2=function(){if(l2)return l2;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function g8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=u2();return t&&e.setAttribute("nonce",t),e}function h8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function v8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var cS=function(){var e=0,t=null;return{add:function(r){e==0&&(t=g8())&&(h8(t,r),v8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}};var dS=function(){var e=cS();return function(t,r){c2.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}};var ap=function(){var e=dS(),t=function(r){var o=r.styles,n=r.dynamic;return e(o,n),null};return t};var y8={left:0,top:0,right:0,gap:0},fS=function(e){return parseInt(e||"",10)||0},x8=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],n=t[e==="padding"?"paddingRight":"marginRight"];return[fS(r),fS(o),fS(n)]},pS=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return y8;var t=x8(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}};var w8=ap(),oc="data-scroll-locked",C8=function(e,t,r,o){var n=e.left,a=e.top,i=e.right,s=e.gap;return r===void 0&&(r="margin"),`
18
18
  .`.concat(nS,` {
19
19
  overflow: hidden `).concat(o,`;
20
20
  padding-right: `).concat(s,"px ").concat(o,`;