import{j as Y}from"./vendor-ui-CUslpDkL.js";import{r as v}from"./vendor-react-Dg0Tra3e.js";const $e=v.createContext({});function Ke(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ns=typeof window<"u",Us=Ns?v.useLayoutEffect:v.useEffect,Zt=v.createContext(null);function Ge(t,e){t.indexOf(e)===-1&&t.push(e)}function He(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const X=(t,e,n)=>n>e?e:n<t?t:n;let Jt=()=>{},mt=()=>{};const q={},Ws=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function $s(t){return typeof t=="object"&&t!==null}const Ks=t=>/^0[^.\s]+$/u.test(t);function ze(t){let e;return()=>(e===void 0&&(e=t()),e)}const $=t=>t,Sr=(t,e)=>n=>e(t(n)),Lt=(...t)=>t.reduce(Sr),Ct=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class _e{constructor(){this.subscriptions=[]}add(e){return Ge(this.subscriptions,e),()=>He(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const z=t=>t*1e3,W=t=>t/1e3;function Gs(t,e){return e?t*(1e3/e):0}const Hs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,wr=1e-7,br=12;function Ar(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Hs(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>wr&&++a<br);return r}function kt(t,e,n,s){if(t===e&&n===s)return $;const i=o=>Ar(o,0,1,t,n);return o=>o===0||o===1?o:Hs(i(o),e,s)}const zs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,_s=t=>e=>1-t(1-e),Xs=kt(.33,1.53,.69,.99),Xe=_s(Xs),Ys=zs(Xe),qs=t=>(t*=2)<1?.5*Xe(t):.5*(2-Math.pow(2,-10*(t-1))),Ye=t=>1-Math.sin(Math.acos(t)),Zs=_s(Ye),Js=zs(Ye),Vr=kt(.42,0,1,1),Cr=kt(0,0,.58,1),Qs=kt(.42,0,.58,1),Mr=t=>Array.isArray(t)&&typeof t[0]!="number",ti=t=>Array.isArray(t)&&typeof t[0]=="number",Sn={linear:$,easeIn:Vr,easeInOut:Qs,easeOut:Cr,circIn:Ye,circInOut:Js,circOut:Zs,backIn:Xe,backInOut:Ys,backOut:Xs,anticipate:qs},Dr=t=>typeof t=="string",wn=t=>{if(ti(t)){mt(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,i]=t;return kt(e,n,s,i)}else if(Dr(t))return mt(Sn[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Sn[t];return t},Bt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],bn={value:null,addProjectionMetrics:null};function Er(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(h){r.has(h)&&(u.schedule(h),t()),l++,h(a)}const u={schedule:(h,f=!1,d=!1)=>{const p=d&&i?n:s;return f&&r.add(h),p.has(h)||p.add(h),h},cancel:h=>{s.delete(h),r.delete(h)},process:h=>{if(a=h,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),e&&bn.value&&bn.value.frameloop[e].push(l),l=0,n.clear(),i=!1,o&&(o=!1,u.process(h))}};return u}const Rr=40;function ei(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Bt.reduce((g,b)=>(g[b]=Er(o,e?b:void 0),g),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:f,render:d,postRender:m}=r,p=()=>{const g=q.useManualTiming?i.timestamp:performance.now();n=!1,q.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,Rr),1)),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),f.process(i),d.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))},x=()=>{n=!0,s=!0,i.isProcessing||t(p)};return{schedule:Bt.reduce((g,b)=>{const S=r[b];return g[b]=(V,E=!1,w=!1)=>(n||x(),S.schedule(V,E,w)),g},{}),cancel:g=>{for(let b=0;b<Bt.length;b++)r[Bt[b]].cancel(g)},state:i,steps:r}}const{schedule:C,cancel:Q,state:I,steps:se}=ei(typeof requestAnimationFrame<"u"?requestAnimationFrame:$,!0);let Ut;function Lr(){Ut=void 0}const j={now:()=>(Ut===void 0&&j.set(I.isProcessing||q.useManualTiming?I.timestamp:performance.now()),Ut),set:t=>{Ut=t,queueMicrotask(Lr)}},ni=t=>e=>typeof e=="string"&&e.startsWith(t),si=ni("--"),kr=ni("var(--"),qe=t=>kr(t)?Fr.test(t.split("/*")[0].trim()):!1,Fr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function An(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const gt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Mt={...gt,transform:t=>X(0,1,t)},jt={...gt,default:1},wt=t=>Math.round(t*1e5)/1e5,Ze=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ir(t){return t==null}const Br=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Je=(t,e)=>n=>!!(typeof n=="string"&&Br.test(n)&&n.startsWith(t)||e&&!Ir(n)&&Object.prototype.hasOwnProperty.call(n,e)),ii=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(Ze);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},jr=t=>X(0,255,t),ie={...gt,transform:t=>Math.round(jr(t))},rt={test:Je("rgb","red"),parse:ii("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ie.transform(t)+", "+ie.transform(e)+", "+ie.transform(n)+", "+wt(Mt.transform(s))+")"};function Or(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const xe={test:Je("#"),parse:Or,transform:rt.transform},Ft=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Z=Ft("deg"),_=Ft("%"),T=Ft("px"),Nr=Ft("vh"),Ur=Ft("vw"),Vn={..._,parse:t=>_.parse(t)/100,transform:t=>_.transform(t*100)},ut={test:Je("hsl","hue"),parse:ii("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+_.transform(wt(e))+", "+_.transform(wt(n))+", "+wt(Mt.transform(s))+")"},R={test:t=>rt.test(t)||xe.test(t)||ut.test(t),parse:t=>rt.test(t)?rt.parse(t):ut.test(t)?ut.parse(t):xe.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?rt.transform(t):ut.transform(t),getAnimatableNone:t=>{const e=R.parse(t);return e.alpha=0,R.transform(e)}},Wr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function $r(t){return isNaN(t)&&typeof t=="string"&&(t.match(Ze)?.length||0)+(t.match(Wr)?.length||0)>0}const ri="number",oi="color",Kr="var",Gr="var(",Cn="${}",Hr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Dt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(Hr,l=>(R.test(l)?(s.color.push(o),i.push(oi),n.push(R.parse(l))):l.startsWith(Gr)?(s.var.push(o),i.push(Kr),n.push(l)):(s.number.push(o),i.push(ri),n.push(parseFloat(l))),++o,Cn)).split(Cn);return{values:n,split:a,indexes:s,types:i}}function ai(t){return Dt(t).values}function li(t){const{split:e,types:n}=Dt(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===ri?o+=wt(i[r]):a===oi?o+=R.transform(i[r]):o+=i[r]}return o}}const zr=t=>typeof t=="number"?0:R.test(t)?R.getAnimatableNone(t):t;function _r(t){const e=ai(t);return li(t)(e.map(zr))}const tt={test:$r,parse:ai,createTransformer:li,getAnimatableNone:_r};function re(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Xr({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=re(l,a,t+1/3),o=re(l,a,t),r=re(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Gt(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,oe=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Yr=[xe,rt,ut],qr=t=>Yr.find(e=>e.test(t));function Mn(t){const e=qr(t);if(Jt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===ut&&(n=Xr(n)),n}const Dn=(t,e)=>{const n=Mn(t),s=Mn(e);if(!n||!s)return Gt(t,e);const i={...n};return o=>(i.red=oe(n.red,s.red,o),i.green=oe(n.green,s.green,o),i.blue=oe(n.blue,s.blue,o),i.alpha=D(n.alpha,s.alpha,o),rt.transform(i))},Te=new Set(["none","hidden"]);function Zr(t,e){return Te.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Jr(t,e){return n=>D(t,e,n)}function Qe(t){return typeof t=="number"?Jr:typeof t=="string"?qe(t)?Gt:R.test(t)?Dn:eo:Array.isArray(t)?ui:typeof t=="object"?R.test(t)?Dn:Qr:Gt}function ui(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>Qe(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function Qr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Qe(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function to(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const eo=(t,e)=>{const n=tt.createTransformer(e),s=Dt(t),i=Dt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Te.has(t)&&!i.values.length||Te.has(e)&&!s.values.length?Zr(t,e):Lt(ui(to(s,i),i.values),n):(Jt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Gt(t,e))};function ci(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):Qe(t)(t,e)}const no=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>C.update(e,n),stop:()=>Q(e),now:()=>I.isProcessing?I.timestamp:j.now()}},hi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=Math.round(t(o/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Ht=2e4;function tn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Ht;)e+=n,s=t.next(e);return e>=Ht?1/0:e}function so(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(tn(s),Ht);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:W(i)}}const io=5;function fi(t,e,n){const s=Math.max(e-io,0);return Gs(n-t(s),e-s)}const M={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ae=.001;function ro({duration:t=M.duration,bounce:e=M.bounce,velocity:n=M.velocity,mass:s=M.mass}){let i,o;Jt(t<=z(M.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=X(M.minDamping,M.maxDamping,r),t=X(M.minDuration,M.maxDuration,W(t)),r<1?(i=c=>{const u=c*r,h=u*t,f=u-n,d=Pe(c,r),m=Math.exp(-h);return ae-f/d*m},o=c=>{const h=c*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(c,2)*t,m=Math.exp(-h),p=Pe(Math.pow(c,2),r);return(-i(c)+ae>0?-1:1)*((f-d)*m)/p}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-ae+u*h},o=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=ao(i,o,a);if(t=z(t),isNaN(l))return{stiffness:M.stiffness,damping:M.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:r*2*Math.sqrt(s*c),duration:t}}}const oo=12;function ao(t,e,n){let s=n;for(let i=1;i<oo;i++)s=s-t(s)/e(s);return s}function Pe(t,e){return t*Math.sqrt(1-e*e)}const lo=["duration","bounce"],uo=["stiffness","damping","mass"];function En(t,e){return e.some(n=>t[n]!==void 0)}function co(t){let e={velocity:M.velocity,stiffness:M.stiffness,damping:M.damping,mass:M.mass,isResolvedFromDuration:!1,...t};if(!En(t,uo)&&En(t,lo))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*X(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:M.mass,stiffness:i,damping:o}}else{const n=ro(t);e={...e,...n,mass:M.mass},e.isResolvedFromDuration=!0}return e}function zt(t=M.visualDuration,e=M.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=co({...n,velocity:-W(n.velocity||0)}),m=f||0,p=c/(2*Math.sqrt(l*u)),x=r-o,y=W(Math.sqrt(l/u)),P=Math.abs(x)<5;s||(s=P?M.restSpeed.granular:M.restSpeed.default),i||(i=P?M.restDelta.granular:M.restDelta.default);let g;if(p<1){const S=Pe(y,p);g=V=>{const E=Math.exp(-p*y*V);return r-E*((m+p*y*x)/S*Math.sin(S*V)+x*Math.cos(S*V))}}else if(p===1)g=S=>r-Math.exp(-y*S)*(x+(m+y*x)*S);else{const S=y*Math.sqrt(p*p-1);g=V=>{const E=Math.exp(-p*y*V),w=Math.min(S*V,300);return r-E*((m+p*y*x)*Math.sinh(w)+S*x*Math.cosh(w))/S}}const b={calculatedDuration:d&&h||null,next:S=>{const V=g(S);if(d)a.done=S>=h;else{let E=S===0?m:0;p<1&&(E=S===0?z(m):fi(g,S,V));const w=Math.abs(E)<=s,A=Math.abs(r-V)<=i;a.done=w&&A}return a.value=a.done?r:V,a},toString:()=>{const S=Math.min(tn(b),Ht),V=hi(E=>b.next(S*E).value,S,30);return S+"ms "+V},toTransition:()=>{}};return b}zt.applyToOptions=t=>{const e=so(t,100,zt);return t.ease=e.ease,t.duration=z(e.duration),t.type="keyframes",t};function Se({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=w=>a!==void 0&&w<a||l!==void 0&&w>l,m=w=>a===void 0?l:l===void 0||Math.abs(a-w)<Math.abs(l-w)?a:l;let p=n*e;const x=h+p,y=r===void 0?x:r(x);y!==x&&(p=y-h);const P=w=>-p*Math.exp(-w/s),g=w=>y+P(w),b=w=>{const A=P(w),L=g(w);f.done=Math.abs(A)<=c,f.value=f.done?y:L};let S,V;const E=w=>{d(f.value)&&(S=w,V=zt({keyframes:[f.value,m(f.value)],velocity:fi(g,w,f.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:w=>{let A=!1;return!V&&S===void 0&&(A=!0,b(w),E(w)),S!==void 0&&w>=S?V.next(w-S):(!A&&b(w),f)}}}function ho(t,e,n){const s=[],i=n||q.mix||ci,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||$:e;a=Lt(l,a)}s.push(a)}return s}function fo(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(mt(o===e.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=ho(e,s,i),l=a.length,c=u=>{if(r&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Ct(t[h],t[h+1],u);return a[h](f)};return n?u=>c(X(t[0],t[o-1],u)):c}function mo(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ct(0,e,s);t.push(D(n,1,i))}}function po(t){const e=[0];return mo(e,t.length-1),e}function go(t,e){return t.map(n=>n*e)}function yo(t,e){return t.map(()=>e||Qs).splice(0,t.length-1)}function bt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Mr(s)?s.map(wn):wn(s),o={done:!1,value:e[0]},r=go(n&&n.length===e.length?n:po(e),t),a=fo(r,e,{ease:Array.isArray(i)?i:yo(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const vo=t=>t!==null;function en(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(vo),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const xo={decay:Se,inertia:Se,tween:bt,keyframes:bt,spring:zt};function di(t){typeof t.type=="string"&&(t.type=xo[t.type])}class nn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const To=t=>t/100;class sn extends nn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==j.now()&&this.tick(j.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;di(e);const{type:n=bt,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const l=n||bt;l!==bt&&typeof a[0]!="number"&&(this.mixKeyframes=Lt(To,ci(a[0],a[1])),a=[0,100]);const c=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-r})),c.calculatedDuration===null&&(c.calculatedDuration=tn(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,b=s;if(h){const w=Math.min(this.currentTime,i)/a;let A=Math.floor(w),L=w%1;!L&&w>=1&&(L=1),L===1&&A--,A=Math.min(A,h+1),!!(A%2)&&(f==="reverse"?(L=1-L,d&&(L-=d/a)):f==="mirror"&&(b=r)),g=X(0,1,L)*a}const S=P?{done:!1,value:u[0]}:b.next(g);o&&(S.value=o(S.value));let{done:V}=S;!P&&l!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return E&&m!==Se&&(S.value=en(u,this.options,x,this.speed)),p&&p(S.value),E&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return W(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(this.currentTime)}set time(e){e=z(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(j.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=W(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=no,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(j.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Po(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ot=t=>t*180/Math.PI,we=t=>{const e=ot(Math.atan2(t[1],t[0]));return be(e)},So={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:we,rotateZ:we,skewX:t=>ot(Math.atan(t[1])),skewY:t=>ot(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},be=t=>(t=t%360,t<0&&(t+=360),t),Rn=we,Ln=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),kn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),wo={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ln,scaleY:kn,scale:t=>(Ln(t)+kn(t))/2,rotateX:t=>be(ot(Math.atan2(t[6],t[5]))),rotateY:t=>be(ot(Math.atan2(-t[2],t[0]))),rotateZ:Rn,rotate:Rn,skewX:t=>ot(Math.atan(t[4])),skewY:t=>ot(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ae(t){return t.includes("scale")?1:0}function Ve(t,e){if(!t||t==="none")return Ae(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=wo,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=So,i=a}if(!i)return Ae(e);const o=s[e],r=i[1].split(",").map(Ao);return typeof o=="function"?o(r):r[o]}const bo=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ve(n,e)};function Ao(t){return parseFloat(t.trim())}const yt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vt=new Set(yt),Fn=t=>t===gt||t===T,Vo=new Set(["x","y","z"]),Co=yt.filter(t=>!Vo.has(t));function Mo(t){const e=[];return Co.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const J={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ve(e,"x"),y:(t,{transform:e})=>Ve(e,"y")};J.translateX=J.x;J.translateY=J.y;const at=new Set;let Ce=!1,Me=!1,De=!1;function mi(){if(Me){const t=Array.from(at).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Mo(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{s.getValue(o)?.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Me=!1,Ce=!1,at.forEach(t=>t.complete(De)),at.clear()}function pi(){at.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Me=!0)})}function Do(){De=!0,pi(),mi(),De=!1}class rn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(at.add(this),Ce||(Ce=!0,C.read(pi),C.resolveKeyframes(mi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i?.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}Po(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),at.delete(this)}cancel(){this.state==="scheduled"&&(at.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Eo=t=>t.startsWith("--");function Ro(t,e,n){Eo(e)?t.style.setProperty(e,n):t.style[e]=n}const Lo=ze(()=>window.ScrollTimeline!==void 0),ko={};function Fo(t,e){const n=ze(t);return()=>ko[e]??n()}const gi=Fo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,In={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pt([0,.65,.55,1]),circOut:Pt([.55,0,1,.45]),backIn:Pt([.31,.01,.66,-.59]),backOut:Pt([.33,1.53,.69,.99])};function yi(t,e){if(t)return typeof t=="function"?gi()?hi(t,e):"ease-out":ti(t)?Pt(t):Array.isArray(t)?t.map(n=>yi(n,e)||In.easeOut):In[t]}function Io(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=yi(a,i);Array.isArray(h)&&(u.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function vi(t){return typeof t=="function"&&"applyToOptions"in t}function Bo({type:t,...e}){return vi(t)&&gi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class jo extends nn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,mt(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=Bo(e);this.animation=Io(n,s,i,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=en(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Ro(n,s,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return W(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=z(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Lo()?(this.animation.timeline=e,$):n(this)}}const xi={anticipate:qs,backInOut:Ys,circInOut:Js};function Oo(t){return t in xi}function No(t){typeof t.ease=="string"&&Oo(t.ease)&&(t.ease=xi[t.ease])}const le=10;class Uo extends jo{constructor(e){No(e),di(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new sn({...r,autoplay:!1}),l=Math.max(le,j.now()-this.startTime),c=X(0,le,l-le);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const Bn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(tt.test(t)||t==="0")&&!t.startsWith("url("));function Wo(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function $o(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=Bn(i,e),a=Bn(o,e);return Jt(r===a,`You are trying to animate ${e} from "${i}" to "${o}". "${r?o:i}" is not an animatable value.`,"value-not-animatable"),!r||!a?!1:Wo(t)||(n==="spring"||vi(n))&&s}function Ee(t){t.duration=0,t.type="keyframes"}const Ko=new Set(["opacity","clipPath","filter","transform"]),Go=ze(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ho(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Go()&&n&&Ko.has(n)&&(n!=="transform"||!c)&&!l&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const zo=40;class _o extends nn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:l,motionValue:c,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=j.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:l,motionValue:c,element:u,...h},d=u?.KeyframeResolver||rn;this.keyframeResolver=new d(a,(m,p,x)=>this.onKeyframesResolved(m,p,f,!x),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=j.now(),$o(e,o,r,a)||((q.instantAnimations||!l)&&u?.(en(e,s,n)),e[0]=e[e.length-1],Ee(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>zo?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!c&&Ho(f),m=f.motionValue?.owner?.current,p=d?new Uo({...f,element:m}):new sn(f);p.finished.then(()=>{this.notifyFinished()}).catch($),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Do()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ti(t,e,n,s=0,i=1){const o=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const Xo=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yo(t){const e=Xo.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}const qo=4;function Pi(t,e,n=1){mt(n<=qo,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,i]=Yo(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return Ws(r)?parseFloat(r):r}return qe(i)?Pi(i,e,n+1):i}const Zo={type:"spring",stiffness:500,damping:25,restSpeed:10},Jo=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Qo={type:"keyframes",duration:.8},ta={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ea=(t,{keyframes:e})=>e.length>2?Qo:vt.has(t)?t.startsWith("scale")?Jo(e[1]):Zo:ta,na=t=>t!==null;function sa(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(na),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}function on(t,e){return t?.[e]??t?.default??t}function ia({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const an=(t,e,n,s={},i,o)=>r=>{const a=on(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-z(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};ia(a)||Object.assign(u,ea(t,u)),u.duration&&(u.duration=z(u.duration)),u.repeatDelay&&(u.repeatDelay=z(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Ee(u),u.delay===0&&(h=!0)),(q.instantAnimations||q.skipAnimations)&&(h=!0,Ee(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=sa(u.keyframes,a);if(f!==void 0){C.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new sn(u):new _o(u)};function jn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function ln(t,e,n,s){if(typeof e=="function"){const[i,o]=jn(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=jn(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function dt(t,e,n){const s=t.getProps();return ln(s,e,n!==void 0?n:s.custom,t)}const Si=new Set(["width","height","top","left","right","bottom",...yt]),On=30,ra=t=>!isNaN(parseFloat(t));class oa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=j.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=j.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ra(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new _e);const s=this.events[e].add(n);return e==="change"?()=>{s(),C.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=j.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>On)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,On);return Gs(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function pt(t,e){return new oa(t,e)}const Re=t=>Array.isArray(t);function aa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,pt(n))}function la(t){return Re(t)?t[t.length-1]||0:t}function ua(t,e){const n=dt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=la(o[r]);aa(t,r,a)}}const B=t=>!!(t&&t.getVelocity);function ca(t){return!!(B(t)&&t.add)}function Le(t,e){const n=t.getValue("willChange");if(ca(n))return n.add(e);if(!n&&q.WillChange){const s=new q.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function un(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ha="framerAppearId",wi="data-"+un(ha);function bi(t){return t.props[wi]}function fa({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ai(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;s&&(o=s);const l=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const u in a){const h=t.getValue(u,t.latestValues[u]??null),f=a[u];if(f===void 0||c&&fa(c,u))continue;const d={delay:n,...on(o||{},u)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===m&&!d.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const y=bi(t);if(y){const P=window.MotionHandoffAnimation(y,u,C);P!==null&&(d.startTime=P,p=!0)}}Le(t,u),h.start(an(u,h,f,t.shouldReduceMotion&&Si.has(u)?{type:!1}:d,t,p));const x=h.animation;x&&l.push(x)}return r&&Promise.all(l).then(()=>{C.update(()=>{r&&ua(t,r)})}),l}function ke(t,e,n={}){const s=dt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Ai(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:h}=i;return da(t,e,l,c,u,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,c]=a==="beforeChildren"?[o,r]:[r,o];return l().then(()=>c())}else return Promise.all([o(),r(n.delay)])}function da(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ke(l,e,{...r,delay:n+(typeof s=="function"?0:s)+Ti(t.variantChildren,l,s,i,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function ma(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>ke(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=ke(t,e,n);else{const i=typeof e=="function"?dt(t,e,n.custom):e;s=Promise.all(Ai(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const pa={test:t=>t==="auto",parse:t=>t},Vi=t=>e=>e.test(t),Ci=[gt,T,_,Z,Ur,Nr,pa],Nn=t=>Ci.find(Vi(t));function ga(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ks(t):!0}const ya=new Set(["brightness","contrast","saturate","opacity"]);function va(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ze)||[];if(!s)return t;const i=n.replace(s,"");let o=ya.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const xa=/\b([a-z-]*)\(.*?\)/gu,Fe={...tt,getAnimatableNone:t=>{const e=t.match(xa);return e?e.map(va).join(" "):t}},Un={...gt,transform:Math.round},Ta={rotate:Z,rotateX:Z,rotateY:Z,rotateZ:Z,scale:jt,scaleX:jt,scaleY:jt,scaleZ:jt,skew:Z,skewX:Z,skewY:Z,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:Mt,originX:Vn,originY:Vn,originZ:T},cn={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,inset:T,insetBlock:T,insetBlockStart:T,insetBlockEnd:T,insetInline:T,insetInlineStart:T,insetInlineEnd:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,paddingBlock:T,paddingBlockStart:T,paddingBlockEnd:T,paddingInline:T,paddingInlineStart:T,paddingInlineEnd:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,marginBlock:T,marginBlockStart:T,marginBlockEnd:T,marginInline:T,marginInlineStart:T,marginInlineEnd:T,backgroundPositionX:T,backgroundPositionY:T,...Ta,zIndex:Un,fillOpacity:Mt,strokeOpacity:Mt,numOctaves:Un},Pa={...cn,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:Fe,WebkitFilter:Fe},Mi=t=>Pa[t];function Di(t,e){let n=Mi(t);return n!==Fe&&(n=tt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Sa=new Set(["auto","none","0"]);function wa(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!Sa.has(o)&&Dt(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=Di(n,i)}class ba extends rn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),qe(h))){const f=Pi(h,n.current);f!==void 0&&(e[u]=f),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Si.has(s)||e.length!==2)return;const[i,o]=e,r=Nn(i),a=Nn(o),l=An(i),c=An(o);if(l!==c&&J[s]){this.needsMeasurement=!0;return}if(r!==a)if(Fn(r)&&Fn(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else J[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||ga(e[i]))&&s.push(i);s.length&&wa(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=J[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=J[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function Aa(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Ei=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ie(t){return $s(t)&&"offsetHeight"in t}const{schedule:hn,cancel:ac}=ei(queueMicrotask,!1),G={x:!1,y:!1};function Ri(){return G.x||G.y}function Va(t){return t==="x"||t==="y"?G[t]?null:(G[t]=!0,()=>{G[t]=!1}):G.x||G.y?null:(G.x=G.y=!0,()=>{G.x=G.y=!1})}function Li(t,e){const n=Aa(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Wn(t){return!(t.pointerType==="touch"||Ri())}function Ca(t,e,n={}){const[s,i,o]=Li(t,n),r=a=>{if(!Wn(a))return;const{target:l}=a,c=e(l,a);if(typeof c!="function"||!l)return;const u=h=>{Wn(h)&&(c(h),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const ki=(t,e)=>e?t===e?!0:ki(t,e.parentElement):!1,fn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ma=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Fi(t){return Ma.has(t.tagName)||t.isContentEditable===!0}const Wt=new WeakSet;function $n(t){return e=>{e.key==="Enter"&&t(e)}}function ue(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Da=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=$n(()=>{if(Wt.has(n))return;ue(n,"down");const i=$n(()=>{ue(n,"up")}),o=()=>ue(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Kn(t){return fn(t)&&!Ri()}function Ea(t,e,n={}){const[s,i,o]=Li(t,n),r=a=>{const l=a.currentTarget;if(!Kn(a))return;Wt.add(l);const c=e(l,a),u=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Wt.has(l)&&Wt.delete(l),Kn(d)&&typeof c=="function"&&c(d,{success:m})},h=d=>{u(d,l===window||l===document||n.useGlobalTarget||ki(l,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),Ie(a)&&(a.addEventListener("focus",c=>Da(c,i)),!Fi(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Ii(t){return $s(t)&&"ownerSVGElement"in t}function Ra(t){return Ii(t)&&t.tagName==="svg"}const La=[...Ci,R,tt],ka=t=>La.find(Vi(t)),Gn=()=>({translate:0,scale:1,origin:0,originPoint:0}),ct=()=>({x:Gn(),y:Gn()}),Hn=()=>({min:0,max:0}),k=()=>({x:Hn(),y:Hn()}),Be={current:null},Bi={current:!1},Fa=typeof window<"u";function Ia(){if(Bi.current=!0,!!Fa)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Be.current=t.matches;t.addEventListener("change",e),e()}else Be.current=!1}const Ba=new WeakMap;function Qt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Et(t){return typeof t=="string"||Array.isArray(t)}const dn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mn=["initial",...dn];function te(t){return Qt(t.animate)||mn.some(e=>Et(t[e]))}function ji(t){return!!(te(t)||t.variants)}function ja(t,e,n){for(const s in e){const i=e[s],o=n[s];if(B(i))t.addValue(s,i);else if(B(o))t.addValue(s,pt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,pt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const zn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let _t={};function Oi(t){_t=t}function Oa(){return _t}class Na{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=j.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,C.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=te(n),this.isVariantNode=ji(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&B(d)&&d.set(l[f])}}mount(e){this.current=e,Ba.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Bi.current||Ia(),this.shouldReduceMotion=Be.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Q(this.notifyUpdate),Q(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=vt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&C.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in _t){const n=_t[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):k()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<zn.length;s++){const i=zn[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=ja(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=pt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Ws(s)||Ks(s))?s=parseFloat(s):!ka(s)&&tt.test(n)&&(s=Di(e,n)),this.setBaseTarget(e,B(s)?s.get():s)),B(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=ln(this.props,n,this.presenceContext?.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!B(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new _e),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){hn.render(this.render)}}class Ni extends Na{constructor(){super(...arguments),this.KeyframeResolver=ba}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class et{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Ui({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Ua({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Wa(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ce(t){return t===void 0||t===1}function je({scale:t,scaleX:e,scaleY:n}){return!ce(t)||!ce(e)||!ce(n)}function it(t){return je(t)||Wi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Wi(t){return _n(t.x)||_n(t.y)}function _n(t){return t&&t!=="0%"}function Xt(t,e,n){const s=t-n,i=e*s;return n+i}function Xn(t,e,n,s,i){return i!==void 0&&(t=Xt(t,i,s)),Xt(t,n,s)+e}function Oe(t,e=0,n=1,s,i){t.min=Xn(t.min,e,n,s,i),t.max=Xn(t.max,e,n,s,i)}function $i(t,{x:e,y:n}){Oe(t.x,e.translate,e.scale,e.originPoint),Oe(t.y,n.translate,n.scale,n.originPoint)}const Yn=.999999999999,qn=1.0000000000001;function $a(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&ft(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,$i(t,r)),s&&it(o.latestValues)&&ft(t,o.latestValues))}e.x<qn&&e.x>Yn&&(e.x=1),e.y<qn&&e.y>Yn&&(e.y=1)}function ht(t,e){t.min=t.min+e,t.max=t.max+e}function Zn(t,e,n,s,i=.5){const o=D(t.min,t.max,i);Oe(t,e,n,o,s)}function ft(t,e){Zn(t.x,e.x,e.scaleX,e.scale,e.originX),Zn(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ki(t,e){return Ui(Wa(t.getBoundingClientRect(),e))}function Ka(t,e,n){const s=Ki(t,n),{scroll:i}=e;return i&&(ht(s.x,i.offset.x),ht(s.y,i.offset.y)),s}const Ga={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ha=yt.length;function za(t,e,n){let s="",i=!0;for(let o=0;o<Ha;o++){const r=yt[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Ei(a,cn[r]);if(!l){i=!1;const u=Ga[r]||r;s+=`${u}(${c}) `}n&&(e[r]=c)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function pn(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const c=e[l];if(vt.has(l)){r=!0;continue}else if(si(l)){i[l]=c;continue}else{const u=Ei(c,cn[l]);l.startsWith("origin")?(a=!0,o[l]=u):s[l]=u}}if(e.transform||(r||n?s.transform=za(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;s.transformOrigin=`${l} ${c} ${u}`}}function Gi(t,{style:e,vars:n},s,i){const o=t.style;let r;for(r in e)o[r]=e[r];i?.applyProjectionStyles(o,s);for(r in n)o.setProperty(r,n[r])}function Jn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Tt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Jn(t,e.target.x),s=Jn(t,e.target.y);return`${n}% ${s}%`}},_a={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=tt.parse(t);if(i.length>5)return s;const o=tt.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const c=D(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=c),typeof i[3+r]=="number"&&(i[3+r]/=c),o(i)}},Ne={borderRadius:{...Tt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Tt,borderTopRightRadius:Tt,borderBottomLeftRadius:Tt,borderBottomRightRadius:Tt,boxShadow:_a};function Hi(t,{layout:e,layoutId:n}){return vt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ne[t]||t==="opacity")}function gn(t,e,n){const s=t.style,i=e?.style,o={};if(!s)return o;for(const r in s)(B(s[r])||i&&B(i[r])||Hi(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=s[r]);return o}function Xa(t){return window.getComputedStyle(t)}class Ya extends Ni{constructor(){super(...arguments),this.type="html",this.renderInstance=Gi}readValueFromInstance(e,n){if(vt.has(n))return this.projection?.isProjecting?Ae(n):bo(e,n);{const s=Xa(e),i=(si(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Ki(e,n)}build(e,n,s){pn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return gn(e,n,s)}}const qa={offset:"stroke-dashoffset",array:"stroke-dasharray"},Za={offset:"strokeDashoffset",array:"strokeDasharray"};function Ja(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?qa:Za;t[o.offset]=`${-s}`,t[o.array]=`${e} ${n}`}const Qa=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function zi(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(pn(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const d of Qa)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Ja(h,i,o,r,!1)}const _i=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"]),Xi=t=>typeof t=="string"&&t.toLowerCase()==="svg";function tl(t,e,n,s){Gi(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(_i.has(i)?i:un(i),e.attrs[i])}function Yi(t,e,n){const s=gn(t,e,n);for(const i in t)if(B(t[i])||B(e[i])){const o=yt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}class el extends Ni{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(vt.has(n)){const s=Mi(n);return s&&s.default||0}return n=_i.has(n)?n:un(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Yi(e,n,s)}build(e,n,s){zi(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){tl(e,n,s,i)}mount(e){this.isSVGTag=Xi(e.tagName),super.mount(e)}}const nl=mn.length;function qi(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?qi(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<nl;n++){const s=mn[n],i=t.props[s];(Et(i)||i===!1)&&(e[s]=i)}return e}function Zi(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const sl=[...dn].reverse(),il=dn.length;function rl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>ma(t,n,s)))}function ol(t){let e=rl(t),n=Qn(),s=!0;const i=l=>(c,u)=>{const h=dt(t,u,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...m}=h;c={...c,...m,...d}}return c};function o(l){e=l(t)}function r(l){const{props:c}=t,u=qi(t.parent)||{},h=[],f=new Set;let d={},m=1/0;for(let x=0;x<il;x++){const y=sl[x],P=n[y],g=c[y]!==void 0?c[y]:u[y],b=Et(g),S=y===l?P.isActive:null;S===!1&&(m=x);let V=g===u[y]&&g!==c[y]&&b;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),P.protectedKeys={...d},!P.isActive&&S===null||!g&&!P.prevProp||Qt(g)||typeof g=="boolean")continue;const E=al(P.prevProp,g);let w=E||y===l&&P.isActive&&!V&&b||x>m&&b,A=!1;const L=Array.isArray(g)?g:[g];let H=L.reduce(i(y),{});S===!1&&(H={});const{prevResolvedValues:xt={}}=P,ne={...xt,...H},Tn=F=>{w=!0,f.has(F)&&(A=!0,f.delete(F)),P.needsAnimating[F]=!0;const N=t.getValue(F);N&&(N.liveStyle=!1)};for(const F in ne){const N=H[F],nt=xt[F];if(d.hasOwnProperty(F))continue;let lt=!1;Re(N)&&Re(nt)?lt=!Zi(N,nt):lt=N!==nt,lt?N!=null?Tn(F):f.add(F):N!==void 0&&f.has(F)?Tn(F):P.protectedKeys[F]=!0}P.prevProp=g,P.prevResolvedValues=H,P.isActive&&(d={...d,...H}),s&&t.blockInitialAnimation&&(w=!1);const Pn=V&&E;w&&(!Pn||A)&&h.push(...L.map(F=>{const N={type:y};if(typeof F=="string"&&s&&!Pn&&t.manuallyAnimateOnMount&&t.parent){const{parent:nt}=t,lt=dt(nt,F);if(nt.enteringChildren&<){const{delayChildren:Pr}=lt.transition||{};N.delay=Ti(nt.enteringChildren,t,Pr)}}return{animation:F,options:N}}))}if(f.size){const x={};if(typeof c.initial!="boolean"){const y=dt(t,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(x.transition=y.transition)}f.forEach(y=>{const P=t.getBaseTarget(y),g=t.getValue(y);g&&(g.liveStyle=!0),x[y]=P??null}),h.push({animation:x})}let p=!!h.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(h):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,c)),n[l].isActive=c;const u=r(l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Qn()}}}function al(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Zi(e,t):!1}function st(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Qn(){return{animate:st(!0),whileInView:st(),whileHover:st(),whileTap:st(),whileDrag:st(),whileFocus:st(),exit:st()}}function ts(t,e){t.min=e.min,t.max=e.max}function K(t,e){ts(t.x,e.x),ts(t.y,e.y)}function es(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Ji=1e-4,ll=1-Ji,ul=1+Ji,Qi=.01,cl=0-Qi,hl=0+Qi;function O(t){return t.max-t.min}function fl(t,e,n){return Math.abs(t-e)<=n}function ns(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=O(n)/O(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ll&&t.scale<=ul||isNaN(t.scale))&&(t.scale=1),(t.translate>=cl&&t.translate<=hl||isNaN(t.translate))&&(t.translate=0)}function At(t,e,n,s){ns(t.x,e.x,n.x,s?s.originX:void 0),ns(t.y,e.y,n.y,s?s.originY:void 0)}function ss(t,e,n){t.min=n.min+e.min,t.max=t.min+O(e)}function dl(t,e,n){ss(t.x,e.x,n.x),ss(t.y,e.y,n.y)}function is(t,e,n){t.min=e.min-n.min,t.max=t.min+O(e)}function Yt(t,e,n){is(t.x,e.x,n.x),is(t.y,e.y,n.y)}function rs(t,e,n,s,i){return t-=e,t=Xt(t,1/n,s),i!==void 0&&(t=Xt(t,1/i,s)),t}function ml(t,e=0,n=1,s=.5,i,o=t,r=t){if(_.test(e)&&(e=parseFloat(e),e=D(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=D(o.min,o.max,s);t===o&&(a-=e),t.min=rs(t.min,e,n,a,i),t.max=rs(t.max,e,n,a,i)}function os(t,e,[n,s,i],o,r){ml(t,e[n],e[s],e[i],e.scale,o,r)}const pl=["x","scaleX","originX"],gl=["y","scaleY","originY"];function as(t,e,n,s){os(t.x,e,pl,n?n.x:void 0,s?s.x:void 0),os(t.y,e,gl,n?n.y:void 0,s?s.y:void 0)}function ls(t){return t.translate===0&&t.scale===1}function tr(t){return ls(t.x)&&ls(t.y)}function us(t,e){return t.min===e.min&&t.max===e.max}function yl(t,e){return us(t.x,e.x)&&us(t.y,e.y)}function cs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function er(t,e){return cs(t.x,e.x)&&cs(t.y,e.y)}function hs(t){return O(t.x)/O(t.y)}function fs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function U(t){return[t("x"),t("y")]}function vl(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const nr=["TopLeft","TopRight","BottomLeft","BottomRight"],xl=nr.length,ds=t=>typeof t=="string"?parseFloat(t):t,ms=t=>typeof t=="number"||T.test(t);function Tl(t,e,n,s,i,o){i?(t.opacity=D(0,n.opacity??1,Pl(s)),t.opacityExit=D(e.opacity??1,0,Sl(s))):o&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let r=0;r<xl;r++){const a=`border${nr[r]}Radius`;let l=ps(e,a),c=ps(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||ms(l)===ms(c)?(t[a]=Math.max(D(ds(l),ds(c),s),0),(_.test(c)||_.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function ps(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Pl=sr(0,.5,Zs),Sl=sr(.5,.95,$);function sr(t,e,n){return s=>s<t?0:s>e?1:n(Ct(t,e,s))}function wl(t,e,n){const s=B(t)?t:pt(t);return s.start(an("",s,e,n)),s.animation}function Rt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const bl=(t,e)=>t.depth-e.depth;class Al{constructor(){this.children=[],this.isDirty=!1}add(e){Ge(this.children,e),this.isDirty=!0}remove(e){He(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(bl),this.isDirty=!1,this.children.forEach(e)}}function Vl(t,e){const n=j.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(Q(s),t(o-e))};return C.setup(s,!0),()=>Q(s)}function $t(t){return B(t)?t.get():t}class Cl{constructor(){this.members=[]}add(e){Ge(this.members,e),e.scheduleRender()}remove(e){if(He(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Kt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},he=["","X","Y","Z"],Ml=1e3;let Dl=0;function fe(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function ir(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=bi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",C,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&ir(s)}function rr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e?.()){this.id=Dl++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Ll),this.nodes.forEach(Bl),this.nodes.forEach(jl),this.nodes.forEach(kl)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Al)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new _e),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=Ii(r)&&!Ra(r),this.instance=r;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const f=()=>this.root.updateBlockedByResize=!1;C.read(()=>{h=window.innerWidth}),t(r,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=Vl(f,250),Kt.hasAnimatedSinceResize&&(Kt.hasAnimatedSinceResize=!1,this.nodes.forEach(vs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||$l,{onLayoutAnimationStart:p,onLayoutAnimationComplete:x}=c.getProps(),y=!this.targetLayout||!er(this.targetLayout,d),P=!h&&f;if(this.options.layoutRoot||this.resumeFrom||P||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...on(m,"layout"),onPlay:p,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(u,P)}else h||vs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Q(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(Ol),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ir(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(gs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ys);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Il),this.nodes.forEach(El),this.nodes.forEach(Rl)):this.nodes.forEach(ys),this.clearAllSnapshots();const a=j.now();I.delta=X(0,1e3/60,a-I.timestamp),I.timestamp=a,I.isProcessing=!0,se.update.process(I),se.preRender.process(I),se.render.process(I),I.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Fl),this.sharedNodes.forEach(Nl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,C.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){C.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!O(this.snapshot.measuredBox.x)&&!O(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();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=k(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!tr(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;r&&this.instance&&(a||it(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Kl(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return k();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Gl))){const{scroll:c}=this.root;c&&(ht(a.x,c.offset.x),ht(a.y,c.offset.y))}return a}removeElementScroll(r){const a=k();if(K(a,r),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:h}=c;c!==this.root&&u&&h.layoutScroll&&(u.wasRoot&&K(a,r),ht(a.x,u.offset.x),ht(a.y,u.offset.y))}return a}applyTransform(r,a=!1){const l=k();K(l,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ft(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),it(u.latestValues)&&ft(l,u.latestValues)}return it(this.latestValues)&&ft(l,this.latestValues),l}removeTransform(r){const a=k();K(a,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!it(c.latestValues))continue;je(c.latestValues)&&c.updateSnapshot();const u=k(),h=c.measurePageBox();K(u,h),as(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return it(this.latestValues)&&as(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.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!==I.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=I.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=k(),this.targetWithTransforms=k()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),dl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):K(this.target,this.layout.layoutBox),$i(this.target,this.targetDelta)):K(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||je(this.parent.latestValues)||Wi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,a,l){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=k(),this.relativeTargetOrigin=k(),Yt(this.relativeTargetOrigin,a,l),K(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===I.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;K(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;$a(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=k());const{target:d}=r;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(es(this.prevProjectionDelta.x,this.projectionDelta.x),es(this.prevProjectionDelta.y,this.projectionDelta.y)),At(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!fs(this.projectionDelta.x,this.prevProjectionDelta.x)||!fs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ct(),this.projectionDelta=ct(),this.projectionDeltaWithTransform=ct()}setAnimationOrigin(r,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},h=ct();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=k(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,p=d!==m,x=this.getStack(),y=!x||x.members.length<=1,P=!!(p&&!y&&this.options.crossfade===!0&&!this.path.some(Wl));this.animationProgress=0;let g;this.mixTargetDelta=b=>{const S=b/1e3;xs(h.x,r.x,S),xs(h.y,r.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ul(this.relativeTarget,this.relativeTargetOrigin,f,S),g&&yl(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=k()),K(g,this.relativeTarget)),p&&(this.animationValues=u,Tl(u,c,this.latestValues,S,P,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Q(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=C.update(()=>{Kt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=pt(0)),this.currentAnimation=wl(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ml),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=r;if(!(!a||!l||!c)){if(this!==r&&this.layout&&c&&or(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||k();const h=O(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=O(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}K(a,l),ft(a,u),At(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Cl),this.sharedNodes.get(r).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&fe("z",r,c,this.animationValues);for(let u=0;u<he.length;u++)fe(`rotate${he[u]}`,r,c,this.animationValues),fe(`skew${he[u]}`,r,c,this.animationValues);r.render();for(const u in c)r.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=$t(a?.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=$t(a?.pointerEvents)||""),this.hasProjected&&!it(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=vl(this.projectionDeltaWithTransform,this.treeScale,u);l&&(h=l(u,h)),r.transform=h;const{x:f,y:d}=this.projectionDelta;r.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,c.animationValues?r.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:r.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const m in Ne){if(u[m]===void 0)continue;const{correct:p,applyTo:x,isCSSVariable:y}=Ne[m],P=h==="none"?u[m]:p(u[m],c);if(x){const g=x.length;for(let b=0;b<g;b++)r[x[b]]=P}else y?this.options.visualElement.renderState.vars[m]=P:r[m]=P}this.options.layoutId&&(r.pointerEvents=c===this?$t(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(gs),this.root.sharedNodes.clear()}}}function El(t){t.updateLayout()}function Rl(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;i==="size"?U(u=>{const h=o?e.measuredBox[u]:e.layoutBox[u],f=O(h);h.min=n[u].min,h.max=h.min+f}):or(i,e.layoutBox,n)&&U(u=>{const h=o?e.measuredBox[u]:e.layoutBox[u],f=O(n[u]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[u].max=t.relativeTarget[u].min+f)});const r=ct();At(r,n,e.layoutBox);const a=ct();o?At(a,t.applyTransform(s,!0),e.measuredBox):At(a,n,e.layoutBox);const l=!tr(r);let c=!1;if(!t.resumeFrom){const u=t.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:h,layout:f}=u;if(h&&f){const d=k();Yt(d,e.layoutBox,h.layoutBox);const m=k();Yt(m,n,f.layoutBox),er(d,m)||(c=!0),u.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=d,t.relativeParent=u)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Ll(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function kl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Fl(t){t.clearSnapshot()}function gs(t){t.clearMeasurements()}function ys(t){t.isLayoutDirty=!1}function Il(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function vs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Bl(t){t.resolveTargetDelta()}function jl(t){t.calcProjection()}function Ol(t){t.resetSkewAndRotation()}function Nl(t){t.removeLeadSnapshot()}function xs(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ts(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function Ul(t,e,n,s){Ts(t.x,e.x,n.x,s),Ts(t.y,e.y,n.y,s)}function Wl(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const $l={duration:.45,ease:[.4,0,.1,1]},Ps=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ss=Ps("applewebkit/")&&!Ps("chrome/")?Math.round:$;function ws(t){t.min=Ss(t.min),t.max=Ss(t.max)}function Kl(t){ws(t.x),ws(t.y)}function or(t,e,n){return t==="position"||t==="preserve-aspect"&&!fl(hs(e),hs(n),.2)}function Gl(t){return t!==t.root&&t.scroll?.wasRoot}const Hl=rr({attachResizeListener:(t,e)=>Rt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),de={current:void 0},ar=rr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!de.current){const t=new Hl({});t.mount(window),t.setOptions({layoutScroll:!0}),de.current=t}return de.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),yn=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function bs(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function zl(...t){return e=>{let n=!1;const s=t.map(i=>{const o=bs(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<s.length;i++){const o=s[i];typeof o=="function"?o():bs(t[i],null)}}}}function _l(...t){return v.useCallback(zl(...t),t)}class Xl extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=Ie(s)&&s.offsetWidth||0,o=Ie(s)&&s.offsetHeight||0,r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft,r.right=i-r.width-r.left,r.bottom=o-r.height-r.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Yl({children:t,isPresent:e,anchorX:n,anchorY:s,root:i}){const o=v.useId(),r=v.useRef(null),a=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=v.useContext(yn),c=t.props?.ref??t?.ref,u=_l(r,c);return v.useInsertionEffect(()=>{const{width:h,height:f,top:d,left:m,right:p,bottom:x}=a.current;if(e||!r.current||!h||!f)return;const y=n==="left"?`left: ${m}`:`right: ${p}`,P=s==="bottom"?`bottom: ${x}`:`top: ${d}`;r.current.dataset.motionPopId=o;const g=document.createElement("style");l&&(g.nonce=l);const b=i??document.head;return b.appendChild(g),g.sheet&&g.sheet.insertRule(`
[data-motion-pop-id="${o}"] {
position: absolute !important;
width: ${h}px !important;
height: ${f}px !important;
${y}px !important;
${P}px !important;
}
`),()=>{b.contains(g)&&b.removeChild(g)}},[e]),Y.jsx(Xl,{isPresent:e,childRef:r,sizeRef:a,children:v.cloneElement(t,{ref:u})})}const ql=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r,anchorX:a,anchorY:l,root:c})=>{const u=Ke(Zl),h=v.useId();let f=!0,d=v.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:m=>{u.set(m,!0);for(const p of u.values())if(!p)return;s&&s()},register:m=>(u.set(m,!1),()=>u.delete(m))}),[n,u,s]);return o&&f&&(d={...d}),v.useMemo(()=>{u.forEach((m,p)=>u.set(p,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),r==="popLayout"&&(t=Y.jsx(Yl,{isPresent:n,anchorX:a,anchorY:l,root:c,children:t})),Y.jsx(Zt.Provider,{value:d,children:t})};function Zl(){return new Map}function lr(t=!0){const e=v.useContext(Zt);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=v.useId();v.useEffect(()=>{if(t)return i(o)},[t]);const r=v.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Ot=t=>t.key||"";function As(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const uc=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,h]=lr(r),f=v.useMemo(()=>As(t),[t]),d=r&&!u?[]:f.map(Ot),m=v.useRef(!0),p=v.useRef(f),x=Ke(()=>new Map),y=v.useRef(new Set),[P,g]=v.useState(f),[b,S]=v.useState(f);Us(()=>{m.current=!1,p.current=f;for(let w=0;w<b.length;w++){const A=Ot(b[w]);d.includes(A)?(x.delete(A),y.current.delete(A)):x.get(A)!==!0&&x.set(A,!1)}},[b,d.length,d.join("-")]);const V=[];if(f!==P){let w=[...f];for(let A=0;A<b.length;A++){const L=b[A],H=Ot(L);d.includes(H)||(w.splice(A,0,L),V.push(L))}return o==="wait"&&V.length&&(w=V),S(As(w)),g(f),null}const{forceRender:E}=v.useContext($e);return Y.jsx(Y.Fragment,{children:b.map(w=>{const A=Ot(w),L=r&&!u?!1:f===b||d.includes(A),H=()=>{if(y.current.has(A))return;if(y.current.add(A),x.has(A))x.set(A,!0);else return;let xt=!0;x.forEach(ne=>{ne||(xt=!1)}),xt&&(E?.(),S(p.current),r&&h?.(),s&&s())};return Y.jsx(ql,{isPresent:L,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:o,root:c,onExitComplete:L?void 0:H,anchorX:a,anchorY:l,children:w},A)})})},ur=v.createContext({strict:!1}),Vs={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"]};let Cs=!1;function Jl(){if(Cs)return;const t={};for(const e in Vs)t[e]={isEnabled:n=>Vs[e].some(s=>!!n[s])};Oi(t),Cs=!0}function cr(){return Jl(),Oa()}function Ql(t){const e=cr();for(const n in t)e[n]={...e[n],...t[n]};Oi(e)}const tu=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 qt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||tu.has(t)}let hr=t=>!qt(t);function eu(t){typeof t=="function"&&(hr=e=>e.startsWith("on")?!qt(e):t(e))}try{eu(require("@emotion/is-prop-valid").default)}catch{}function nu(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(hr(i)||n===!0&&qt(i)||!e&&!qt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const ee=v.createContext({});function su(t,e){if(te(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Et(n)?n:void 0,animate:Et(s)?s:void 0}}return t.inherit!==!1?e:{}}function iu(t){const{initial:e,animate:n}=su(t,v.useContext(ee));return v.useMemo(()=>({initial:e,animate:n}),[Ms(e),Ms(n)])}function Ms(t){return Array.isArray(t)?t.join(" "):t}const vn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fr(t,e,n){for(const s in e)!B(e[s])&&!Hi(s,n)&&(t[s]=e[s])}function ru({transformTemplate:t},e){return v.useMemo(()=>{const n=vn();return pn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function ou(t,e){const n=t.style||{},s={};return fr(s,n,t),Object.assign(s,ru(t,e)),s}function au(t,e){const n={},s=ou(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const dr=()=>({...vn(),attrs:{}});function lu(t,e,n,s){const i=v.useMemo(()=>{const o=dr();return zi(o,e,Xi(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};fr(o,t.style,t),i.style={...o,...i.style}}return i}const uu=["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 xn(t){return typeof t!="string"||t.includes("-")?!1:!!(uu.indexOf(t)>-1||/[A-Z]/u.test(t))}function cu(t,e,n,{latestValues:s},i,o=!1,r){const l=(r??xn(t)?lu:au)(e,s,i,t),c=nu(e,typeof t=="string",o),u=t!==v.Fragment?{...c,...l,ref:n}:{},{children:h}=e,f=v.useMemo(()=>B(h)?h.get():h,[h]);return v.createElement(t,{...u,children:f})}function hu({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:fu(n,s,i,t),renderState:e()}}function fu(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=$t(o[f]);let{initial:r,animate:a}=t;const l=te(t),c=ji(t);e&&c&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const h=u?a:r;if(h&&typeof h!="boolean"&&!Qt(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const m=ln(t,f[d]);if(m){const{transitionEnd:p,transition:x,...y}=m;for(const P in y){let g=y[P];if(Array.isArray(g)){const b=u?g.length-1:0;g=g[b]}g!==null&&(i[P]=g)}for(const P in p)i[P]=p[P]}}}return i}const mr=t=>(e,n)=>{const s=v.useContext(ee),i=v.useContext(Zt),o=()=>hu(t,e,s,i);return n?o():Ke(o)},du=mr({scrapeMotionValuesFromProps:gn,createRenderState:vn}),mu=mr({scrapeMotionValuesFromProps:Yi,createRenderState:dr}),pu=Symbol.for("motionComponentSymbol");function gu(t,e,n){const s=v.useRef(n);v.useInsertionEffect(()=>{s.current=n});const i=v.useRef(null);return v.useCallback(o=>{o&&t.onMount?.(o),e&&(o?e.mount(o):e.unmount());const r=s.current;if(typeof r=="function")if(o){const a=r(o);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):r(o);else r&&(r.current=o)},[e])}const pr=v.createContext({});function St(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function yu(t,e,n,s,i,o){const{visualElement:r}=v.useContext(ee),a=v.useContext(ur),l=v.useContext(Zt),c=v.useContext(yn).reducedMotion,u=v.useRef(null);s=s||a.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:r,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,isSVG:o}));const h=u.current,f=v.useContext(pr);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&vu(u.current,n,i,f);const d=v.useRef(!1);v.useInsertionEffect(()=>{h&&d.current&&h.update(n,l)});const m=n[wi],p=v.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return Us(()=>{h&&(d.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),p.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!p.current&&h.animationState&&h.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),p.current=!1),h.enteringChildren=void 0)}),h}function vu(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:gr(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&St(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:l,layoutRoot:c})}function gr(t){if(t)return t.options.allowProjection!==!1?t.projection:gr(t.parent)}function me(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Ql(s);const o=n?n==="svg":xn(t),r=o?mu:du;function a(c,u){let h;const f={...v.useContext(yn),...c,layoutId:xu(c)},{isStatic:d}=f,m=iu(c),p=r(c,d);if(!d&&Ns){Tu();const x=Pu(f);h=x.MeasureLayout,m.visualElement=yu(t,p,f,i,x.ProjectionNode,o)}return Y.jsxs(ee.Provider,{value:m,children:[h&&m.visualElement?Y.jsx(h,{visualElement:m.visualElement,...f}):null,cu(t,c,gu(p,m.visualElement,u),p,d,e,o)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=v.forwardRef(a);return l[pu]=t,l}function xu({layoutId:t}){const e=v.useContext($e).id;return e&&t!==void 0?e+"-"+t:t}function Tu(t,e){v.useContext(ur).strict}function Pu(t){const e=cr(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Su(t,e){if(typeof Proxy>"u")return me;const n=new Map,s=(o,r)=>me(o,r,t,e),i=(o,r)=>s(o,r);return new Proxy(i,{get:(o,r)=>r==="create"?s:(n.has(r)||n.set(r,me(r,void 0,t,e)),n.get(r))})}const wu=(t,e)=>e.isSVG??xn(t)?new el(e):new Ya(e,{allowProjection:t!==v.Fragment});class bu extends et{constructor(e){super(e),e.animationState||(e.animationState=ol(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Qt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Au=0;class Vu extends et{constructor(){super(...arguments),this.id=Au++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Cu={animation:{Feature:bu},exit:{Feature:Vu}};function It(t){return{point:{x:t.pageX,y:t.pageY}}}const Mu=t=>e=>fn(e)&&t(e,It(e));function Vt(t,e,n,s){return Rt(t,e,Mu(n),s)}const yr=({current:t})=>t?t.ownerDocument.defaultView:null,Ds=(t,e)=>Math.abs(t-e);function Du(t,e){const n=Ds(t.x,e.x),s=Ds(t.y,e.y);return Math.sqrt(n**2+s**2)}const Es=new Set(["auto","scroll"]);class vr{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=ge(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,p=Du(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!p)return;const{point:x}=d,{timestamp:y}=I;this.history.push({...x,timestamp:y});const{onStart:P,onMove:g}=this.handlers;m||(P&&P(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=pe(m,this.transformPagePoint),C.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:p,onSessionEnd:x,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=ge(d.type==="pointercancel"?this.lastMoveEventInfo:pe(m,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,P),x&&x(d,P)},!fn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const l=It(e),c=pe(l,this.transformPagePoint),{point:u}=c,{timestamp:h}=I;this.history=[{...u,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,ge(c,this.history)),this.removeListeners=Lt(Vt(this.contextWindow,"pointermove",this.handlePointerMove),Vt(this.contextWindow,"pointerup",this.handlePointerUp),Vt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Es.has(s.overflowX)||Es.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:i.x-n.x,y:i.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,i),C.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Q(this.updatePoint)}}function pe(t,e){return e?{point:e(t.point)}:t}function Rs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ge({point:t},e){return{point:t,delta:Rs(t,xr(e)),offset:Rs(t,Eu(e)),velocity:Ru(e,.1)}}function Eu(t){return t[0]}function xr(t){return t[t.length-1]}function Ru(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=xr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>z(e)));)n--;if(!s)return{x:0,y:0};const o=W(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Lu(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function Ls(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function ku(t,{top:e,left:n,bottom:s,right:i}){return{x:Ls(t.x,n,i),y:Ls(t.y,e,s)}}function ks(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Fu(t,e){return{x:ks(t.x,e.x),y:ks(t.y,e.y)}}function Iu(t,e){let n=.5;const s=O(t),i=O(e);return i>s?n=Ct(e.min,e.max-s,t.min):s>i&&(n=Ct(t.min,t.max-i,e.min)),X(0,1,n)}function Bu(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Ue=.35;function ju(t=Ue){return t===!1?t=0:t===!0&&(t=Ue),{x:Fs(t,"left","right"),y:Fs(t,"top","bottom")}}function Fs(t,e,n){return{min:Is(t,e),max:Is(t,n)}}function Is(t,e){return typeof t=="number"?t:t[e]||0}const Ou=new WeakMap;class Nu{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=k(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=h=>{n?(this.stopAnimation(),this.snapToCursor(It(h).point)):this.pauseAnimation()},r=(h,f)=>{this.stopAnimation();const{drag:d,dragPropagation:m,onDragStart:p}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Va(d),!this.openDragLock))return;this.latestPointerEvent=h,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),U(y=>{let P=this.getAxisMotionValue(y).get()||0;if(_.test(P)){const{projection:g}=this.visualElement;if(g&&g.layout){const b=g.layout.layoutBox[y];b&&(P=O(b)*(parseFloat(P)/100))}}this.originPoint[y]=P}),p&&C.postRender(()=>p(h,f)),Le(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:p,onDrag:x}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(m&&this.currentDirection===null){this.currentDirection=Uu(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),x&&x(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>U(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new vr(e,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:yr(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!s)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&C.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Nt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=Lu(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&St(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=ku(s.layoutBox,e):this.constraints=!1,this.elastic=ju(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&U(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Bu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!St(e))return!1;const s=e.current;mt(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Ka(s,i.root,this.visualElement.getTransformPagePoint());let r=Fu(i.layout.layoutBox,o);if(n){const a=n(Ua(r));this.hasMutatedConstraints=!!a,a&&(r=Ui(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=U(u=>{if(!Nt(u,n,this.currentDirection))return;let h=l&&l[u]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(u,m)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Le(this.visualElement,e),s.start(an(e,s,0,n,this.visualElement,!1))}stopAnimation(){U(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){U(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){U(n=>{const{drag:s}=this.getProps();if(!Nt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n],l=o.get()||0;o.set(e[n]-D(r,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!St(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};U(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=Iu({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),U(r=>{if(!Nt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:c}=this.constraints[r];a.set(D(l,c,i[r]))})}addListeners(){if(!this.visualElement.current)return;Ou.set(this.visualElement,this);const e=this.visualElement.current,n=Vt(e,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps(),h=l.target,f=h!==e&&Fi(h);c&&u&&!f&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();St(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),C.read(s);const r=Rt(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(U(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=l[u].translate,h.set(h.get()+l[u].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=Ue,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Nt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Uu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Wu extends et{constructor(e){super(e),this.removeGroupControls=$,this.removeListeners=$,this.controls=new Nu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||$}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.endPanSession()}}const Bs=t=>(e,n)=>{t&&C.postRender(()=>t(e,n))};class $u extends et{constructor(){super(...arguments),this.removePointerDownListener=$}onPointerDown(e){this.session=new vr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yr(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Bs(e),onStart:Bs(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&C.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Vt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ye=!1;class Ku extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),ye&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Kt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,ye=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||C.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),hn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;ye=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Tr(t){const[e,n]=lr(),s=v.useContext($e);return Y.jsx(Ku,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(pr),isPresent:e,safeToRemove:n})}const Gu={pan:{Feature:$u},drag:{Feature:Wu,ProjectionNode:ar,MeasureLayout:Tr}};function js(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&C.postRender(()=>o(e,It(e)))}class Hu extends et{mount(){const{current:e}=this.node;e&&(this.unmount=Ca(e,(n,s)=>(js(this.node,s,"Start"),i=>js(this.node,i,"End"))))}unmount(){}}class zu extends et{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Lt(Rt(this.node.current,"focus",()=>this.onFocus()),Rt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Os(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&C.postRender(()=>o(e,It(e)))}class _u extends et{mount(){const{current:e}=this.node;e&&(this.unmount=Ea(e,(n,s)=>(Os(this.node,s,"Start"),(i,{success:o})=>Os(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const We=new WeakMap,ve=new WeakMap,Xu=t=>{const e=We.get(t.target);e&&e(t)},Yu=t=>{t.forEach(Xu)};function qu({root:t,...e}){const n=t||document;ve.has(n)||ve.set(n,{});const s=ve.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Yu,{root:t,...e})),s[i]}function Zu(t,e,n){const s=qu(e);return We.set(t,n),s.observe(t),()=>{We.delete(t),s.unobserve(t)}}const Ju={some:0,all:1};class Qu extends et{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Ju[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),f=c?u:h;f&&f(l)};return Zu(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(tc(e,n))&&this.startObserver()}unmount(){}}function tc({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ec={inView:{Feature:Qu},tap:{Feature:_u},focus:{Feature:zu},hover:{Feature:Hu}},nc={layout:{ProjectionNode:ar,MeasureLayout:Tr}},sc={...Cu,...ec,...Gu,...nc},cc=Su(sc,wu);export{uc as A,cc as m};