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