Files
ragusaitweb/build/assets/motion-BIOHP8Ul.js
2026-01-21 22:38:10 +01:00

2 lines
87 KiB
JavaScript

function he(t,e){t.indexOf(e)===-1&&t.push(e)}function fe(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const $=(t,e,s)=>s>e?e:s<t?t:s;let de=()=>{};const _={},Ks=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 pe(t){let e;return()=>(e===void 0&&(e=t()),e)}const H=t=>t,an=(t,e)=>s=>e(t(s)),me=(...t)=>t.reduce(an),ye=(t,e,s)=>{const i=e-t;return i===0?1:(s-t)/i};class ge{constructor(){this.subscriptions=[]}add(e){return he(this.subscriptions,e),()=>fe(this.subscriptions,e)}notify(e,s,i){const n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](e,s,i);else for(let o=0;o<n;o++){const r=this.subscriptions[o];r&&r(e,s,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Y=t=>t*1e3,U=t=>t/1e3;function $s(t,e){return e?t*(1e3/e):0}const _s=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t,ln=1e-7,cn=12;function un(t,e,s,i,n){let o,r,a=0;do r=e+(s-e)/2,o=_s(r,i,n)-t,o>0?s=r:e=r;while(Math.abs(o)>ln&&++a<cn);return r}function bt(t,e,s,i){if(t===e&&s===i)return H;const n=o=>un(o,0,1,t,s);return o=>o===0||o===1?o:_s(n(o),e,i)}const zs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Xs=t=>e=>1-t(1-e),Ys=bt(.33,1.53,.69,.99),Te=Xs(Ys),Gs=zs(Te),Hs=t=>(t*=2)<1?.5*Te(t):.5*(2-Math.pow(2,-10*(t-1))),ve=t=>1-Math.sin(Math.acos(t)),qs=Xs(ve),Zs=zs(ve),hn=bt(.42,0,1,1),fn=bt(0,0,.58,1),Js=bt(.42,0,.58,1),dn=t=>Array.isArray(t)&&typeof t[0]!="number",Qs=t=>Array.isArray(t)&&typeof t[0]=="number",pn={linear:H,easeIn:hn,easeInOut:Js,easeOut:fn,circIn:ve,circInOut:Zs,circOut:qs,backIn:Te,backInOut:Gs,backOut:Ys,anticipate:Hs},mn=t=>typeof t=="string",je=t=>{if(Qs(t)){de(t.length===4);const[e,s,i,n]=t;return bt(e,s,i,n)}else if(mn(t))return pn[t];return t},Vt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function yn(t,e){let s=new Set,i=new Set,n=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){r.has(c)&&(u.schedule(c),t()),c(a)}const u={schedule:(c,h=!1,f=!1)=>{const m=f&&n?s:i;return h&&r.add(c),m.has(c)||m.add(c),c},cancel:c=>{i.delete(c),r.delete(c)},process:c=>{if(a=c,n){o=!0;return}n=!0,[s,i]=[i,s],s.forEach(l),s.clear(),n=!1,o&&(o=!1,u.process(c))}};return u}const gn=40;function ti(t,e){let s=!1,i=!0;const n={delta:0,timestamp:0,isProcessing:!1},o=()=>s=!0,r=Vt.reduce((y,V)=>(y[V]=yn(o),y),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:d,postRender:m}=r,v=()=>{const y=_.useManualTiming?n.timestamp:performance.now();s=!1,_.useManualTiming||(n.delta=i?1e3/60:Math.max(Math.min(y-n.timestamp,gn),1)),n.timestamp=y,n.isProcessing=!0,a.process(n),l.process(n),u.process(n),c.process(n),h.process(n),f.process(n),d.process(n),m.process(n),n.isProcessing=!1,s&&e&&(i=!1,t(v))},x=()=>{s=!0,i=!0,n.isProcessing||t(v)};return{schedule:Vt.reduce((y,V)=>{const T=r[V];return y[V]=(S,D=!1,A=!1)=>(s||x(),T.schedule(S,D,A)),y},{}),cancel:y=>{for(let V=0;V<Vt.length;V++)r[Vt[V]].cancel(y)},state:n,steps:r}}const{schedule:k,cancel:st,state:B,steps:Ft}=ti(typeof requestAnimationFrame<"u"?requestAnimationFrame:H,!0);let Pt;function Tn(){Pt=void 0}const F={now:()=>(Pt===void 0&&F.set(B.isProcessing||_.useManualTiming?B.timestamp:performance.now()),Pt),set:t=>{Pt=t,queueMicrotask(Tn)}},ei=t=>e=>typeof e=="string"&&e.startsWith(t),si=ei("--"),vn=ei("var(--"),xe=t=>vn(t)?xn.test(t.split("/*")[0].trim()):!1,xn=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ne(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const ht={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},vt={...ht,transform:t=>$(0,1,t)},St={...ht,default:1},yt=t=>Math.round(t*1e5)/1e5,be=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bn(t){return t==null}const An=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ae=(t,e)=>s=>!!(typeof s=="string"&&An.test(s)&&s.startsWith(t)||e&&!bn(s)&&Object.prototype.hasOwnProperty.call(s,e)),ii=(t,e,s)=>i=>{if(typeof i!="string")return i;const[n,o,r,a]=i.match(be);return{[t]:parseFloat(n),[e]:parseFloat(o),[s]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},Vn=t=>$(0,255,t),Et={...ht,transform:t=>Math.round(Vn(t))},Q={test:Ae("rgb","red"),parse:ii("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:i=1})=>"rgba("+Et.transform(t)+", "+Et.transform(e)+", "+Et.transform(s)+", "+yt(vt.transform(i))+")"};function Sn(t){let e="",s="",i="",n="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),i=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),i=t.substring(3,4),n=t.substring(4,5),e+=e,s+=s,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}}const Xt={test:Ae("#"),parse:Sn,transform:Q.transform},At=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),z=At("deg"),W=At("%"),p=At("px"),Pn=At("vh"),wn=At("vw"),Ke={...W,parse:t=>W.parse(t)/100,transform:t=>W.transform(t*100)},rt={test:Ae("hsl","hue"),parse:ii("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:i=1})=>"hsla("+Math.round(t)+", "+W.transform(yt(e))+", "+W.transform(yt(s))+", "+yt(vt.transform(i))+")"},w={test:t=>Q.test(t)||Xt.test(t)||rt.test(t),parse:t=>Q.test(t)?Q.parse(t):rt.test(t)?rt.parse(t):Xt.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Q.transform(t):rt.transform(t),getAnimatableNone:t=>{const e=w.parse(t);return e.alpha=0,w.transform(e)}},Dn=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Mn(t){return isNaN(t)&&typeof t=="string"&&(t.match(be)?.length||0)+(t.match(Dn)?.length||0)>0}const ni="number",ri="color",Rn="var",Cn="var(",Ue="${}",Bn=/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(),s=[],i={color:[],number:[],var:[]},n=[];let o=0;const a=e.replace(Bn,l=>(w.test(l)?(i.color.push(o),n.push(ri),s.push(w.parse(l))):l.startsWith(Cn)?(i.var.push(o),n.push(Rn),s.push(l)):(i.number.push(o),n.push(ni),s.push(parseFloat(l))),++o,Ue)).split(Ue);return{values:s,split:a,indexes:i,types:n}}function oi(t){return xt(t).values}function ai(t){const{split:e,types:s}=xt(t),i=e.length;return n=>{let o="";for(let r=0;r<i;r++)if(o+=e[r],n[r]!==void 0){const a=s[r];a===ni?o+=yt(n[r]):a===ri?o+=w.transform(n[r]):o+=n[r]}return o}}const kn=t=>typeof t=="number"?0:w.test(t)?w.getAnimatableNone(t):t;function Fn(t){const e=oi(t);return ai(t)(e.map(kn))}const G={test:Mn,parse:oi,createTransformer:ai,getAnimatableNone:Fn};function Lt(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(e-t)*6*s:s<1/2?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function En({hue:t,saturation:e,lightness:s,alpha:i}){t/=360,e/=100,s/=100;let n=0,o=0,r=0;if(!e)n=o=r=s;else{const a=s<.5?s*(1+e):s+e-s*e,l=2*s-a;n=Lt(l,a,t+1/3),o=Lt(l,a,t),r=Lt(l,a,t-1/3)}return{red:Math.round(n*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:i}}function Dt(t,e){return s=>s>0?e:t}const M=(t,e,s)=>t+(e-t)*s,It=(t,e,s)=>{const i=t*t,n=s*(e*e-i)+i;return n<0?0:Math.sqrt(n)},Ln=[Xt,Q,rt],In=t=>Ln.find(e=>e.test(t));function We(t){const e=In(t);if(!e)return!1;let s=e.parse(t);return e===rt&&(s=En(s)),s}const $e=(t,e)=>{const s=We(t),i=We(e);if(!s||!i)return Dt(t,e);const n={...s};return o=>(n.red=It(s.red,i.red,o),n.green=It(s.green,i.green,o),n.blue=It(s.blue,i.blue,o),n.alpha=M(s.alpha,i.alpha,o),Q.transform(n))},Yt=new Set(["none","hidden"]);function On(t,e){return Yt.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}function jn(t,e){return s=>M(t,e,s)}function Ve(t){return typeof t=="number"?jn:typeof t=="string"?xe(t)?Dt:w.test(t)?$e:Un:Array.isArray(t)?li:typeof t=="object"?w.test(t)?$e:Nn:Dt}function li(t,e){const s=[...t],i=s.length,n=t.map((o,r)=>Ve(o)(o,e[r]));return o=>{for(let r=0;r<i;r++)s[r]=n[r](o);return s}}function Nn(t,e){const s={...t,...e},i={};for(const n in s)t[n]!==void 0&&e[n]!==void 0&&(i[n]=Ve(t[n])(t[n],e[n]));return n=>{for(const o in i)s[o]=i[o](n);return s}}function Kn(t,e){const s=[],i={color:0,var:0,number:0};for(let n=0;n<e.values.length;n++){const o=e.types[n],r=t.indexes[o][i[o]],a=t.values[r]??0;s[n]=a,i[o]++}return s}const Un=(t,e)=>{const s=G.createTransformer(e),i=xt(t),n=xt(e);return i.indexes.var.length===n.indexes.var.length&&i.indexes.color.length===n.indexes.color.length&&i.indexes.number.length>=n.indexes.number.length?Yt.has(t)&&!n.values.length||Yt.has(e)&&!i.values.length?On(t,e):me(li(Kn(i,n),n.values),s):Dt(t,e)};function ci(t,e,s){return typeof t=="number"&&typeof e=="number"&&typeof s=="number"?M(t,e,s):Ve(t)(t,e)}const Wn=t=>{const e=({timestamp:s})=>t(s);return{start:(s=!0)=>k.update(e,s),stop:()=>st(e),now:()=>B.isProcessing?B.timestamp:F.now()}},ui=(t,e,s=10)=>{let i="";const n=Math.max(Math.round(e/s),2);for(let o=0;o<n;o++)i+=Math.round(t(o/(n-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Mt=2e4;function Se(t){let e=0;const s=50;let i=t.next(e);for(;!i.done&&e<Mt;)e+=s,i=t.next(e);return e>=Mt?1/0:e}function $n(t,e=100,s){const i=s({...t,keyframes:[0,e]}),n=Math.min(Se(i),Mt);return{type:"keyframes",ease:o=>i.next(n*o).value/e,duration:U(n)}}const _n=5;function hi(t,e,s){const i=Math.max(e-_n,0);return $s(s-t(i),e-i)}const P={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},Ot=.001;function zn({duration:t=P.duration,bounce:e=P.bounce,velocity:s=P.velocity,mass:i=P.mass}){let n,o,r=1-e;r=$(P.minDamping,P.maxDamping,r),t=$(P.minDuration,P.maxDuration,U(t)),r<1?(n=u=>{const c=u*r,h=c*t,f=c-s,d=Gt(u,r),m=Math.exp(-h);return Ot-f/d*m},o=u=>{const h=u*r*t,f=h*s+s,d=Math.pow(r,2)*Math.pow(u,2)*t,m=Math.exp(-h),v=Gt(Math.pow(u,2),r);return(-n(u)+Ot>0?-1:1)*((f-d)*m)/v}):(n=u=>{const c=Math.exp(-u*t),h=(u-s)*t+1;return-Ot+c*h},o=u=>{const c=Math.exp(-u*t),h=(s-u)*(t*t);return c*h});const a=5/t,l=Yn(n,o,a);if(t=Y(t),isNaN(l))return{stiffness:P.stiffness,damping:P.damping,duration:t};{const u=Math.pow(l,2)*i;return{stiffness:u,damping:r*2*Math.sqrt(i*u),duration:t}}}const Xn=12;function Yn(t,e,s){let i=s;for(let n=1;n<Xn;n++)i=i-t(i)/e(i);return i}function Gt(t,e){return t*Math.sqrt(1-e*e)}const Gn=["duration","bounce"],Hn=["stiffness","damping","mass"];function _e(t,e){return e.some(s=>t[s]!==void 0)}function qn(t){let e={velocity:P.velocity,stiffness:P.stiffness,damping:P.damping,mass:P.mass,isResolvedFromDuration:!1,...t};if(!_e(t,Hn)&&_e(t,Gn))if(t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(s*1.2),n=i*i,o=2*$(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:P.mass,stiffness:n,damping:o}}else{const s=zn(t);e={...e,...s,mass:P.mass},e.isResolvedFromDuration=!0}return e}function Rt(t=P.visualDuration,e=P.bounce){const s=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:n}=s;const o=s.keyframes[0],r=s.keyframes[s.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=qn({...s,velocity:-U(s.velocity||0)}),m=f||0,v=u/(2*Math.sqrt(l*c)),x=r-o,g=U(Math.sqrt(l/c)),b=Math.abs(x)<5;i||(i=b?P.restSpeed.granular:P.restSpeed.default),n||(n=b?P.restDelta.granular:P.restDelta.default);let y;if(v<1){const T=Gt(g,v);y=S=>{const D=Math.exp(-v*g*S);return r-D*((m+v*g*x)/T*Math.sin(T*S)+x*Math.cos(T*S))}}else if(v===1)y=T=>r-Math.exp(-g*T)*(x+(m+g*x)*T);else{const T=g*Math.sqrt(v*v-1);y=S=>{const D=Math.exp(-v*g*S),A=Math.min(T*S,300);return r-D*((m+v*g*x)*Math.sinh(A)+T*x*Math.cosh(A))/T}}const V={calculatedDuration:d&&h||null,next:T=>{const S=y(T);if(d)a.done=T>=h;else{let D=T===0?m:0;v<1&&(D=T===0?Y(m):hi(y,T,S));const A=Math.abs(D)<=i,E=Math.abs(r-S)<=n;a.done=A&&E}return a.value=a.done?r:S,a},toString:()=>{const T=Math.min(Se(V),Mt),S=ui(D=>V.next(T*D).value,T,30);return T+"ms "+S},toTransition:()=>{}};return V}Rt.applyToOptions=t=>{const e=$n(t,100,Rt);return t.ease=e.ease,t.duration=Y(e.duration),t.type="keyframes",t};function Ht({keyframes:t,velocity:e=0,power:s=.8,timeConstant:i=325,bounceDamping:n=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){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 v=s*e;const x=h+v,g=r===void 0?x:r(x);g!==x&&(v=g-h);const b=A=>-v*Math.exp(-A/i),y=A=>g+b(A),V=A=>{const E=b(A),I=y(A);f.done=Math.abs(E)<=u,f.value=f.done?g:I};let T,S;const D=A=>{d(f.value)&&(T=A,S=Rt({keyframes:[f.value,m(f.value)],velocity:hi(y,A,f.value),damping:n,stiffness:o,restDelta:u,restSpeed:c}))};return D(0),{calculatedDuration:null,next:A=>{let E=!1;return!S&&T===void 0&&(E=!0,V(A),D(A)),T!==void 0&&A>=T?S.next(A-T):(!E&&V(A),f)}}}function Zn(t,e,s){const i=[],n=s||_.mix||ci,o=t.length-1;for(let r=0;r<o;r++){let a=n(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||H:e;a=me(l,a)}i.push(a)}return i}function Jn(t,e,{clamp:s=!0,ease:i,mixer:n}={}){const o=t.length;if(de(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Zn(e,i,n),l=a.length,u=c=>{if(r&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=ye(t[h],t[h+1],c);return a[h](f)};return s?c=>u($(t[0],t[o-1],c)):u}function Qn(t,e){const s=t[t.length-1];for(let i=1;i<=e;i++){const n=ye(0,e,i);t.push(M(s,1,n))}}function tr(t){const e=[0];return Qn(e,t.length-1),e}function er(t,e){return t.map(s=>s*e)}function sr(t,e){return t.map(()=>e||Js).splice(0,t.length-1)}function gt({duration:t=300,keyframes:e,times:s,ease:i="easeInOut"}){const n=dn(i)?i.map(je):je(i),o={done:!1,value:e[0]},r=er(s&&s.length===e.length?s:tr(e),t),a=Jn(r,e,{ease:Array.isArray(n)?n:sr(e,n)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const ir=t=>t!==null;function Pe(t,{repeat:e,repeatType:s="loop"},i,n=1){const o=t.filter(ir),a=n<0||e&&s!=="loop"&&e%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const nr={decay:Ht,inertia:Ht,tween:gt,keyframes:gt,spring:Rt};function fi(t){typeof t.type=="string"&&(t.type=nr[t.type])}class we{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,s){return this.finished.then(e,s)}}const rr=t=>t/100;class De extends we{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==F.now()&&this.tick(F.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;fi(e);const{type:s=gt,repeat:i=0,repeatDelay:n=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const l=s||gt;l!==gt&&typeof a[0]!="number"&&(this.mixKeyframes=me(rr,ci(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=Se(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=u}updateTime(e){const s=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(e,s=!1){const{generator:i,totalDuration:n,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return i.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:d,type:m,onUpdate:v,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-n/this.speed,this.startTime)),s?this.currentTime=e:this.updateTime(e);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?g<0:g>n;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=n);let y=this.currentTime,V=i;if(h){const A=Math.min(this.currentTime,n)/a;let E=Math.floor(A),I=A%1;!I&&A>=1&&(I=1),I===1&&E--,E=Math.min(E,h+1),E%2&&(f==="reverse"?(I=1-I,d&&(I-=d/a)):f==="mirror"&&(V=r)),y=$(0,1,I)*a}const T=b?{done:!1,value:c[0]}:V.next(y);o&&(T.value=o(T.value));let{done:S}=T;!b&&l!==null&&(S=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return D&&m!==Ht&&(T.value=Pe(c,this.options,x,this.speed)),v&&v(T.value),D&&this.finish(),T}then(e,s){return this.finished.then(e,s)}get duration(){return U(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+U(e)}get time(){return U(this.currentTime)}set time(e){e=Y(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(F.now());const s=this.playbackSpeed!==e;this.playbackSpeed=e,s&&(this.time=U(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Wn,startTime:s}=this.options;this.driver||(this.driver=e(n=>this.tick(n))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=s??i),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(F.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function or(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const tt=t=>t*180/Math.PI,qt=t=>{const e=tt(Math.atan2(t[1],t[0]));return Zt(e)},ar={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:qt,rotateZ:qt,skewX:t=>tt(Math.atan(t[1])),skewY:t=>tt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Zt=t=>(t=t%360,t<0&&(t+=360),t),ze=qt,Xe=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ye=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),lr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Xe,scaleY:Ye,scale:t=>(Xe(t)+Ye(t))/2,rotateX:t=>Zt(tt(Math.atan2(t[6],t[5]))),rotateY:t=>Zt(tt(Math.atan2(-t[2],t[0]))),rotateZ:ze,rotate:ze,skewX:t=>tt(Math.atan(t[4])),skewY:t=>tt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Jt(t){return t.includes("scale")?1:0}function Qt(t,e){if(!t||t==="none")return Jt(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,n;if(s)i=lr,n=s;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=ar,n=a}if(!n)return Jt(e);const o=i[e],r=n[1].split(",").map(ur);return typeof o=="function"?o(r):r[o]}const cr=(t,e)=>{const{transform:s="none"}=getComputedStyle(t);return Qt(s,e)};function ur(t){return parseFloat(t.trim())}const ft=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dt=new Set(ft),Ge=t=>t===ht||t===p,hr=new Set(["x","y","z"]),fr=ft.filter(t=>!hr.has(t));function dr(t){const e=[];return fr.forEach(s=>{const i=t.getValue(s);i!==void 0&&(e.push([s,i.get()]),i.set(s.startsWith("scale")?1:0))}),e}const X={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),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})=>Qt(e,"x"),y:(t,{transform:e})=>Qt(e,"y")};X.translateX=X.x;X.translateY=X.y;const et=new Set;let te=!1,ee=!1,se=!1;function di(){if(ee){const t=Array.from(et).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),s=new Map;e.forEach(i=>{const n=dr(i);n.length&&(s.set(i,n),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const n=s.get(i);n&&n.forEach(([o,r])=>{i.getValue(o)?.set(r)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}ee=!1,te=!1,et.forEach(t=>t.complete(se)),et.clear()}function pi(){et.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ee=!0)})}function pr(){se=!0,pi(),di(),se=!1}class Me{constructor(e,s,i,n,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=s,this.name=i,this.motionValue=n,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(et.add(this),te||(te=!0,k.read(pi),k.resolveKeyframes(di))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:s,element:i,motionValue:n}=this;if(e[0]===null){const o=n?.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(i&&s){const a=i.readValue(s,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),n&&o===void 0&&n.set(e[0])}or(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),et.delete(this)}cancel(){this.state==="scheduled"&&(et.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const mr=t=>t.startsWith("--");function yr(t,e,s){mr(e)?t.style.setProperty(e,s):t.style[e]=s}const gr=pe(()=>window.ScrollTimeline!==void 0),Tr={};function vr(t,e){const s=pe(t);return()=>Tr[e]??s()}const mi=vr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),mt=([t,e,s,i])=>`cubic-bezier(${t}, ${e}, ${s}, ${i})`,He={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:mt([0,.65,.55,1]),circOut:mt([.55,0,1,.45]),backIn:mt([.31,.01,.66,-.59]),backOut:mt([.33,1.53,.69,.99])};function yi(t,e){if(t)return typeof t=="function"?mi()?ui(t,e):"ease-out":Qs(t)?mt(t):Array.isArray(t)?t.map(s=>yi(s,e)||He.easeOut):He[t]}function xr(t,e,s,{delay:i=0,duration:n=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:s};l&&(c.offset=l);const h=yi(a,n);Array.isArray(h)&&(c.easing=h);const f={delay:i,duration:n,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(c,f)}function gi(t){return typeof t=="function"&&"applyToOptions"in t}function br({type:t,...e}){return gi(t)&&mi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ar extends we{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:s,name:i,keyframes:n,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,de(typeof e.type!="string");const u=br(e);this.animation=xr(s,i,n,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=Pe(n,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):yr(s,i,c),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return U(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+U(e)}get time(){return U(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Y(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&gr()?(this.animation.timeline=e,H):s(this)}}const Ti={anticipate:Hs,backInOut:Gs,circInOut:Zs};function Vr(t){return t in Ti}function Sr(t){typeof t.ease=="string"&&Vr(t.ease)&&(t.ease=Ti[t.ease])}const jt=10;class Pr extends Ar{constructor(e){Sr(e),fi(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:s,onUpdate:i,onComplete:n,element:o,...r}=this.options;if(!s)return;if(e!==void 0){s.set(e);return}const a=new De({...r,autoplay:!1}),l=Math.max(jt,F.now()-this.startTime),u=$(0,jt,l-jt);s.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const qe=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(G.test(t)||t==="0")&&!t.startsWith("url("));function wr(t){const e=t[0];if(t.length===1)return!0;for(let s=0;s<t.length;s++)if(t[s]!==e)return!0}function Dr(t,e,s,i){const n=t[0];if(n===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=qe(n,e),a=qe(o,e);return!r||!a?!1:wr(t)||(s==="spring"||gi(s))&&i}function ie(t){t.duration=0,t.type="keyframes"}const Mr=new Set(["opacity","clipPath","filter","transform"]),Rr=pe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Cr(t){const{motionValue:e,name:s,repeatDelay:i,repeatType:n,damping:o,type:r}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return Rr()&&s&&Mr.has(s)&&(s!=="transform"||!u)&&!l&&!i&&n!=="mirror"&&o!==0&&r!=="inertia"}const Br=40;class kr extends we{constructor({autoplay:e=!0,delay:s=0,type:i="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:l,motionValue:u,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=F.now();const f={autoplay:e,delay:s,type:i,repeat:n,repeatDelay:o,repeatType:r,name:l,motionValue:u,element:c,...h},d=c?.KeyframeResolver||Me;this.keyframeResolver=new d(a,(m,v,x)=>this.onKeyframesResolved(m,v,f,!x),l,u,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,s,i,n){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=i;this.resolvedAt=F.now(),Dr(e,o,r,a)||((_.instantAnimations||!l)&&c?.(Pe(e,i,s)),e[0]=e[e.length-1],ie(i),i.repeat=0);const f={startTime:n?this.resolvedAt?this.resolvedAt-this.createdAt>Br?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...i,keyframes:e},d=!u&&Cr(f),m=f.motionValue?.owner?.current,v=d?new Pr({...f,element:m}):new De(f);v.finished.then(()=>{this.notifyFinished()}).catch(H),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,s){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),pr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function vi(t,e,s,i=0,n=1){const o=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),r=t.size,a=(r-1)*i;return typeof s=="function"?s(o,r):n===1?o*i:a-o*i}const Fr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Er(t){const e=Fr.exec(t);if(!e)return[,];const[,s,i,n]=e;return[`--${s??i}`,n]}function xi(t,e,s=1){const[i,n]=Er(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const r=o.trim();return Ks(r)?parseFloat(r):r}return xe(n)?xi(n,e,s+1):n}const Lr={type:"spring",stiffness:500,damping:25,restSpeed:10},Ir=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Or={type:"keyframes",duration:.8},jr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Nr=(t,{keyframes:e})=>e.length>2?Or:dt.has(t)?t.startsWith("scale")?Ir(e[1]):Lr:jr,Kr=t=>t!==null;function Ur(t,{repeat:e,repeatType:s="loop"},i){const n=t.filter(Kr),o=e&&s!=="loop"&&e%2===1?0:n.length-1;return n[o]}function Re(t,e){return t?.[e]??t?.default??t}function Wr({when:t,delay:e,delayChildren:s,staggerChildren:i,staggerDirection:n,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const bi=(t,e,s,i={},n,o)=>r=>{const a=Re(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Y(l);const c={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:n};Wr(a)||Object.assign(c,Nr(t,c)),c.duration&&(c.duration=Y(c.duration)),c.repeatDelay&&(c.repeatDelay=Y(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(ie(c),c.delay===0&&(h=!0)),(_.instantAnimations||_.skipAnimations)&&(h=!0,ie(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=Ur(c.keyframes,a);if(f!==void 0){k.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new De(c):new kr(c)};function Ze(t){const e=[{},{}];return t?.values.forEach((s,i)=>{e[0][i]=s.get(),e[1][i]=s.getVelocity()}),e}function Ai(t,e,s,i){if(typeof e=="function"){const[n,o]=Ze(i);e=e(s!==void 0?s:t.custom,n,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[n,o]=Ze(i);e=e(s!==void 0?s:t.custom,n,o)}return e}function ct(t,e,s){const i=t.getProps();return Ai(i,e,s!==void 0?s:i.custom,t)}const Vi=new Set(["width","height","top","left","right","bottom",...ft]),Je=30,$r=t=>!isNaN(parseFloat(t));class _r{constructor(e,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const n=F.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=s.owner}setCurrent(e){this.current=e,this.updatedAt=F.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=$r(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,s){this.events[e]||(this.events[e]=new ge);const i=this.events[e].add(s);return e==="change"?()=>{i(),k.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,s){this.passiveEffect=e,this.stopPassiveEffect=s}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,s,i){this.set(s),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,s=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=F.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Je)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,Je);return $s(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(e){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=e(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ut(t,e){return new _r(t,e)}const ne=t=>Array.isArray(t);function zr(t,e,s){t.hasValue(e)?t.getValue(e).set(s):t.addValue(e,ut(s))}function Xr(t){return ne(t)?t[t.length-1]||0:t}function Yr(t,e){const s=ct(t,e);let{transitionEnd:i={},transition:n={},...o}=s||{};o={...o,...i};for(const r in o){const a=Xr(o[r]);zr(t,r,a)}}const L=t=>!!(t&&t.getVelocity);function Gr(t){return!!(L(t)&&t.add)}function Hr(t,e){const s=t.getValue("willChange");if(Gr(s))return s.add(e);if(!s&&_.WillChange){const i=new _.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function Ce(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const qr="framerAppearId",Zr="data-"+Ce(qr);function Si(t){return t.props[Zr]}function Jr({protectedKeys:t,needsAnimating:e},s){const i=t.hasOwnProperty(s)&&e[s]!==!0;return e[s]=!1,i}function Pi(t,e,{delay:s=0,transitionOverride:i,type:n}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;i&&(o=i);const l=[],u=n&&t.animationState&&t.animationState.getState()[n];for(const c in a){const h=t.getValue(c,t.latestValues[c]??null),f=a[c];if(f===void 0||u&&Jr(u,c))continue;const d={delay:s,...Re(o||{},c)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===m&&!d.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const g=Si(t);if(g){const b=window.MotionHandoffAnimation(g,c,k);b!==null&&(d.startTime=b,v=!0)}}Hr(t,c),h.start(bi(c,h,f,t.shouldReduceMotion&&Vi.has(c)?{type:!1}:d,t,v));const x=h.animation;x&&l.push(x)}return r&&Promise.all(l).then(()=>{k.update(()=>{r&&Yr(t,r)})}),l}function re(t,e,s={}){const i=ct(t,e,s.type==="exit"?t.presenceContext?.custom:void 0);let{transition:n=t.getDefaultTransition()||{}}=i||{};s.transitionOverride&&(n=s.transitionOverride);const o=i?()=>Promise.all(Pi(t,i,s)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:h}=n;return Qr(t,e,l,u,c,h,s)}:()=>Promise.resolve(),{when:a}=n;if(a){const[l,u]=a==="beforeChildren"?[o,r]:[r,o];return l().then(()=>u())}else return Promise.all([o(),r(s.delay)])}function Qr(t,e,s=0,i=0,n=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(re(l,e,{...r,delay:s+(typeof i=="function"?0:i)+vi(t.variantChildren,l,i,n,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function to(t,e,s={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const n=e.map(o=>re(t,o,s));i=Promise.all(n)}else if(typeof e=="string")i=re(t,e,s);else{const n=typeof e=="function"?ct(t,e,s.custom):e;i=Promise.all(Pi(t,n,s))}return i.then(()=>{t.notify("AnimationComplete",e)})}const eo={test:t=>t==="auto",parse:t=>t},wi=t=>e=>e.test(t),Di=[ht,p,W,z,wn,Pn,eo],Qe=t=>Di.find(wi(t));function so(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ws(t):!0}const io=new Set(["brightness","contrast","saturate","opacity"]);function no(t){const[e,s]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=s.match(be)||[];if(!i)return t;const n=s.replace(i,"");let o=io.has(e)?1:0;return i!==s&&(o*=100),e+"("+o+n+")"}const ro=/\b([a-z-]*)\(.*?\)/gu,oe={...G,getAnimatableNone:t=>{const e=t.match(ro);return e?e.map(no).join(" "):t}},ts={...ht,transform:Math.round},oo={rotate:z,rotateX:z,rotateY:z,rotateZ:z,scale:St,scaleX:St,scaleY:St,scaleZ:St,skew:z,skewX:z,skewY:z,distance:p,translateX:p,translateY:p,translateZ:p,x:p,y:p,z:p,perspective:p,transformPerspective:p,opacity:vt,originX:Ke,originY:Ke,originZ:p},Be={borderWidth:p,borderTopWidth:p,borderRightWidth:p,borderBottomWidth:p,borderLeftWidth:p,borderRadius:p,radius:p,borderTopLeftRadius:p,borderTopRightRadius:p,borderBottomRightRadius:p,borderBottomLeftRadius:p,width:p,maxWidth:p,height:p,maxHeight:p,top:p,right:p,bottom:p,left:p,inset:p,insetBlock:p,insetBlockStart:p,insetBlockEnd:p,insetInline:p,insetInlineStart:p,insetInlineEnd:p,padding:p,paddingTop:p,paddingRight:p,paddingBottom:p,paddingLeft:p,paddingBlock:p,paddingBlockStart:p,paddingBlockEnd:p,paddingInline:p,paddingInlineStart:p,paddingInlineEnd:p,margin:p,marginTop:p,marginRight:p,marginBottom:p,marginLeft:p,marginBlock:p,marginBlockStart:p,marginBlockEnd:p,marginInline:p,marginInlineStart:p,marginInlineEnd:p,backgroundPositionX:p,backgroundPositionY:p,...oo,zIndex:ts,fillOpacity:vt,strokeOpacity:vt,numOctaves:ts},ao={...Be,color:w,backgroundColor:w,outlineColor:w,fill:w,stroke:w,borderColor:w,borderTopColor:w,borderRightColor:w,borderBottomColor:w,borderLeftColor:w,filter:oe,WebkitFilter:oe},Mi=t=>ao[t];function Ri(t,e){let s=Mi(t);return s!==oe&&(s=G),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const lo=new Set(["auto","none","0"]);function co(t,e,s){let i=0,n;for(;i<t.length&&!n;){const o=t[i];typeof o=="string"&&!lo.has(o)&&xt(o).values.length&&(n=t[i]),i++}if(n&&s)for(const o of e)t[o]=Ri(s,n)}class uo extends Me{constructor(e,s,i,n,o){super(e,s,i,n,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:s,name:i}=this;if(!s||!s.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),xe(h))){const f=xi(h,s.current);f!==void 0&&(e[c]=f),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Vi.has(i)||e.length!==2)return;const[n,o]=e,r=Qe(n),a=Qe(o),l=Ne(n),u=Ne(o);if(l!==u&&X[i]){this.needsMeasurement=!0;return}if(r!==a)if(Ge(r)&&Ge(a))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else X[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:s}=this,i=[];for(let n=0;n<e.length;n++)(e[n]===null||so(e[n]))&&i.push(n);i.length&&co(e,i,s)}measureInitialState(){const{element:e,unresolvedKeyframes:s,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=X[i](e.measureViewportBox(),window.getComputedStyle(e.current)),s[0]=this.measuredOrigin;const n=s[s.length-1];n!==void 0&&e.getValue(i,n).jump(n,!1)}measureEndState(){const{element:e,name:s,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const n=e.getValue(s);n&&n.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=X[s](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function ho(t,e,s){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;const n=s?.[t]??i.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t).filter(i=>i!=null)}const Ci=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function fo(t){return Us(t)&&"offsetHeight"in t}const{schedule:Bi}=ti(queueMicrotask,!1),K={x:!1,y:!1};function ki(){return K.x||K.y}function La(t){return t==="x"||t==="y"?K[t]?null:(K[t]=!0,()=>{K[t]=!1}):K.x||K.y?null:(K.x=K.y=!0,()=>{K.x=K.y=!1})}function Fi(t,e){const s=ho(t),i=new AbortController,n={passive:!0,...e,signal:i.signal};return[s,n,()=>i.abort()]}function es(t){return!(t.pointerType==="touch"||ki())}function Ia(t,e,s={}){const[i,n,o]=Fi(t,s),r=a=>{if(!es(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=h=>{es(h)&&(u(h),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,n)};return i.forEach(a=>{a.addEventListener("pointerenter",r,n)}),o}const Ei=(t,e)=>e?t===e?!0:Ei(t,e.parentElement):!1,po=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,mo=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function yo(t){return mo.has(t.tagName)||t.isContentEditable===!0}const wt=new WeakSet;function ss(t){return e=>{e.key==="Enter"&&t(e)}}function Nt(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const go=(t,e)=>{const s=t.currentTarget;if(!s)return;const i=ss(()=>{if(wt.has(s))return;Nt(s,"down");const n=ss(()=>{Nt(s,"up")}),o=()=>Nt(s,"cancel");s.addEventListener("keyup",n,e),s.addEventListener("blur",o,e)});s.addEventListener("keydown",i,e),s.addEventListener("blur",()=>s.removeEventListener("keydown",i),e)};function is(t){return po(t)&&!ki()}function Oa(t,e,s={}){const[i,n,o]=Fi(t,s),r=a=>{const l=a.currentTarget;if(!is(a))return;wt.add(l);const u=e(l,a),c=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),wt.has(l)&&wt.delete(l),is(d)&&typeof u=="function"&&u(d,{success:m})},h=d=>{c(d,l===window||l===document||s.useGlobalTarget||Ei(l,d.target))},f=d=>{c(d,!1)};window.addEventListener("pointerup",h,n),window.addEventListener("pointercancel",f,n)};return i.forEach(a=>{(s.useGlobalTarget?window:a).addEventListener("pointerdown",r,n),fo(a)&&(a.addEventListener("focus",u=>go(u,n)),!yo(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Li(t){return Us(t)&&"ownerSVGElement"in t}function To(t){return Li(t)&&t.tagName==="svg"}const vo=[...Di,w,G],xo=t=>vo.find(wi(t)),ns=()=>({translate:0,scale:1,origin:0,originPoint:0}),ot=()=>({x:ns(),y:ns()}),rs=()=>({min:0,max:0}),R=()=>({x:rs(),y:rs()}),ae={current:null},Ii={current:!1},bo=typeof window<"u";function Ao(){if(Ii.current=!0,!!bo)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ae.current=t.matches;t.addEventListener("change",e),e()}else ae.current=!1}const Vo=new WeakMap;function Oi(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ke(t){return typeof t=="string"||Array.isArray(t)}const Fe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ee=["initial",...Fe];function ji(t){return Oi(t.animate)||Ee.some(e=>ke(t[e]))}function So(t){return!!(ji(t)||t.variants)}function Po(t,e,s){for(const i in e){const n=e[i],o=s[i];if(L(n))t.addValue(i,n);else if(L(o))t.addValue(i,ut(n,{owner:t}));else if(o!==n)if(t.hasValue(i)){const r=t.getValue(i);r.liveStyle===!0?r.jump(n):r.hasAnimated||r.set(n)}else{const r=t.getStaticValue(i);t.addValue(i,ut(r!==void 0?r:n,{owner:t}))}}for(const i in s)e[i]===void 0&&t.removeValue(i);return e}const os=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ct={};function ja(t){Ct=t}function Na(){return Ct}class wo{scrapeMotionValuesFromProps(e,s,i){return{}}constructor({parent:e,props:s,presenceContext:i,reducedMotionConfig:n,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Me,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=F.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,k.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=s.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=s,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=ji(s),this.isVariantNode=So(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(s,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&L(d)&&d.set(l[f])}}mount(e){this.current=e,Vo.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((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Ii.current||Ao(),this.shouldReduceMotion=ae.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),st(this.notifyUpdate),st(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const s=this.features[e];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,s){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=dt.has(e);i&&this.onBindTransform&&this.onBindTransform();const n=s.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&k.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,s)),this.valueSubscriptions.set(e,()=>{n(),o&&o(),s.owner&&s.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 Ct){const s=Ct[e];if(!s)continue;const{isEnabled:i,Feature:n}=s;if(!this.features[e]&&n&&i(this.props)&&(this.features[e]=new n(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):R()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,s){this.latestValues[e]=s}update(e,s){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let i=0;i<os.length;i++){const n=os[i];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const o="on"+n,r=e[o];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Po(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 s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(e),()=>s.variantChildren.delete(e)}addValue(e,s){const i=this.values.get(e);s!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,s),this.values.set(e,s),this.latestValues[e]=s.get())}removeValue(e){this.values.delete(e);const s=this.valueSubscriptions.get(e);s&&(s(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,s){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&s!==void 0&&(i=ut(s===null?void 0:s,{owner:this}),this.addValue(e,i)),i}readValue(e,s){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Ks(i)||Ws(i))?i=parseFloat(i):!xo(i)&&G.test(s)&&(i=Ri(e,s)),this.setBaseTarget(e,L(i)?i.get():i)),L(i)?i.get():i}setBaseTarget(e,s){this.baseTarget[e]=s}getBaseTarget(e){const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Ai(this.props,s,this.presenceContext?.custom);o&&(i=o[e])}if(s&&i!==void 0)return i;const n=this.getBaseTargetFromProps(this.props,e);return n!==void 0&&!L(n)?n:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,s){return this.events[e]||(this.events[e]=new ge),this.events[e].add(s)}notify(e,...s){this.events[e]&&this.events[e].notify(...s)}scheduleRenderMicrotask(){Bi.render(this.render)}}class Ni extends wo{constructor(){super(...arguments),this.KeyframeResolver=uo}sortInstanceNodePosition(e,s){return e.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(e,s){const i=e.style;return i?i[s]:void 0}removeValueFromRenderState(e,{vars:s,style:i}){delete s[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;L(e)&&(this.childSubscription=e.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class Ka{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Do({top:t,left:e,right:s,bottom:i}){return{x:{min:e,max:s},y:{min:t,max:i}}}function Ua({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Mo(t,e){if(!e)return t;const s=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:s.y,left:s.x,bottom:i.y,right:i.x}}function Kt(t){return t===void 0||t===1}function le({scale:t,scaleX:e,scaleY:s}){return!Kt(t)||!Kt(e)||!Kt(s)}function J(t){return le(t)||Ki(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ki(t){return as(t.x)||as(t.y)}function as(t){return t&&t!=="0%"}function Bt(t,e,s){const i=t-s,n=e*i;return s+n}function ls(t,e,s,i,n){return n!==void 0&&(t=Bt(t,n,i)),Bt(t,s,i)+e}function ce(t,e=0,s=1,i,n){t.min=ls(t.min,e,s,i,n),t.max=ls(t.max,e,s,i,n)}function Ui(t,{x:e,y:s}){ce(t.x,e.translate,e.scale,e.originPoint),ce(t.y,s.translate,s.scale,s.originPoint)}const cs=.999999999999,us=1.0000000000001;function Ro(t,e,s,i=!1){const n=s.length;if(!n)return;e.x=e.y=1;let o,r;for(let a=0;a<n;a++){o=s[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&lt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ui(t,r)),i&&J(o.latestValues)&&lt(t,o.latestValues))}e.x<us&&e.x>cs&&(e.x=1),e.y<us&&e.y>cs&&(e.y=1)}function at(t,e){t.min=t.min+e,t.max=t.max+e}function hs(t,e,s,i,n=.5){const o=M(t.min,t.max,n);ce(t,e,s,o,i)}function lt(t,e){hs(t.x,e.x,e.scaleX,e.scale,e.originX),hs(t.y,e.y,e.scaleY,e.scale,e.originY)}function Wi(t,e){return Do(Mo(t.getBoundingClientRect(),e))}function Wa(t,e,s){const i=Wi(t,s),{scroll:n}=e;return n&&(at(i.x,n.offset.x),at(i.y,n.offset.y)),i}const Co={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bo=ft.length;function ko(t,e,s){let i="",n=!0;for(let o=0;o<Bo;o++){const r=ft[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(r.startsWith("scale")?1:0);else{const u=parseFloat(a);l=r.startsWith("scale")?u===1:u===0}if(!l||s){const u=Ci(a,Be[r]);if(!l){n=!1;const c=Co[r]||r;i+=`${c}(${u}) `}s&&(e[r]=u)}}return i=i.trim(),s?i=s(e,n?"":i):n&&(i="none"),i}function $i(t,e,s){const{style:i,vars:n,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const u=e[l];if(dt.has(l)){r=!0;continue}else if(si(l)){n[l]=u;continue}else{const c=Ci(u,Be[l]);l.startsWith("origin")?(a=!0,o[l]=c):i[l]=c}}if(e.transform||(r||s?i.transform=ko(e,t.transform,s):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=o;i.transformOrigin=`${l} ${u} ${c}`}}function _i(t,{style:e,vars:s},i,n){const o=t.style;let r;for(r in e)o[r]=e[r];n?.applyProjectionStyles(o,i);for(r in s)o.setProperty(r,s[r])}function fs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const pt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(p.test(t))t=parseFloat(t);else return t;const s=fs(t,e.target.x),i=fs(t,e.target.y);return`${s}% ${i}%`}},Fo={correct:(t,{treeScale:e,projectionDelta:s})=>{const i=t,n=G.parse(t);if(n.length>5)return i;const o=G.createTransformer(t),r=typeof n[0]!="number"?1:0,a=s.x.scale*e.x,l=s.y.scale*e.y;n[0+r]/=a,n[1+r]/=l;const u=M(a,l,.5);return typeof n[2+r]=="number"&&(n[2+r]/=u),typeof n[3+r]=="number"&&(n[3+r]/=u),o(n)}},ue={borderRadius:{...pt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:pt,borderTopRightRadius:pt,borderBottomLeftRadius:pt,borderBottomRightRadius:pt,boxShadow:Fo};function Eo(t,{layout:e,layoutId:s}){return dt.has(t)||t.startsWith("origin")||(e||s!==void 0)&&(!!ue[t]||t==="opacity")}function zi(t,e,s){const i=t.style,n=e?.style,o={};if(!i)return o;for(const r in i)(L(i[r])||n&&L(n[r])||Eo(r,t)||s?.getValue(r)?.liveStyle!==void 0)&&(o[r]=i[r]);return o}function Lo(t){return window.getComputedStyle(t)}class $a extends Ni{constructor(){super(...arguments),this.type="html",this.renderInstance=_i}readValueFromInstance(e,s){if(dt.has(s))return this.projection?.isProjecting?Jt(s):cr(e,s);{const i=Lo(e),n=(si(s)?i.getPropertyValue(s):i[s])||0;return typeof n=="string"?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:s}){return Wi(e,s)}build(e,s,i){$i(e,s,i.transformTemplate)}scrapeMotionValuesFromProps(e,s,i){return zi(e,s,i)}}const Io={offset:"stroke-dashoffset",array:"stroke-dasharray"},Oo={offset:"strokeDashoffset",array:"strokeDasharray"};function jo(t,e,s=1,i=0,n=!0){t.pathLength=1;const o=n?Io:Oo;t[o.offset]=`${-i}`,t[o.array]=`${e} ${s}`}const No=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ko(t,{attrX:e,attrY:s,attrScale:i,pathLength:n,pathSpacing:o=1,pathOffset:r=0,...a},l,u,c){if($i(t,a,u),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=c?.transformBox??"fill-box",delete h.transformBox);for(const d of No)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),s!==void 0&&(h.y=s),i!==void 0&&(h.scale=i),n!==void 0&&jo(h,n,o,r,!1)}const Xi=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"]),Uo=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Wo(t,e,s,i){_i(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Xi.has(n)?n:Ce(n),e.attrs[n])}function $o(t,e,s){const i=zi(t,e,s);for(const n in t)if(L(t[n])||L(e[n])){const o=ft.indexOf(n)!==-1?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n;i[o]=t[n]}return i}class _a extends Ni{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=R}getBaseTargetFromProps(e,s){return e[s]}readValueFromInstance(e,s){if(dt.has(s)){const i=Mi(s);return i&&i.default||0}return s=Xi.has(s)?s:Ce(s),e.getAttribute(s)}scrapeMotionValuesFromProps(e,s,i){return $o(e,s,i)}build(e,s,i){Ko(e,s,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,s,i,n){Wo(e,s,i,n)}mount(e){this.isSVGTag=Uo(e.tagName),super.mount(e)}}const _o=Ee.length;function Yi(t){if(!t)return;if(!t.isControllingVariants){const s=t.parent?Yi(t.parent)||{}:{};return t.props.initial!==void 0&&(s.initial=t.props.initial),s}const e={};for(let s=0;s<_o;s++){const i=Ee[s],n=t.props[i];(ke(n)||n===!1)&&(e[i]=n)}return e}function Gi(t,e){if(!Array.isArray(e))return!1;const s=e.length;if(s!==t.length)return!1;for(let i=0;i<s;i++)if(e[i]!==t[i])return!1;return!0}const zo=[...Fe].reverse(),Xo=Fe.length;function Yo(t){return e=>Promise.all(e.map(({animation:s,options:i})=>to(t,s,i)))}function za(t){let e=Yo(t),s=ds(),i=!0;const n=l=>(u,c)=>{const h=ct(t,c,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...m}=h;u={...u,...m,...d}}return u};function o(l){e=l(t)}function r(l){const{props:u}=t,c=Yi(t.parent)||{},h=[],f=new Set;let d={},m=1/0;for(let x=0;x<Xo;x++){const g=zo[x],b=s[g],y=u[g]!==void 0?u[g]:c[g],V=ke(y),T=g===l?b.isActive:null;T===!1&&(m=x);let S=y===c[g]&&y!==u[g]&&V;if(S&&i&&t.manuallyAnimateOnMount&&(S=!1),b.protectedKeys={...d},!b.isActive&&T===null||!y&&!b.prevProp||Oi(y)||typeof y=="boolean")continue;const D=Go(b.prevProp,y);let A=D||g===l&&b.isActive&&!S&&V||x>m&&V,E=!1;const I=Array.isArray(y)?y:[y];let it=I.reduce(n(g),{});T===!1&&(it={});const{prevResolvedValues:Le={}}=b,rn={...Le,...it},Ie=C=>{A=!0,f.has(C)&&(E=!0,f.delete(C)),b.needsAnimating[C]=!0;const O=t.getValue(C);O&&(O.liveStyle=!1)};for(const C in rn){const O=it[C],q=Le[C];if(d.hasOwnProperty(C))continue;let nt=!1;ne(O)&&ne(q)?nt=!Gi(O,q):nt=O!==q,nt?O!=null?Ie(C):f.add(C):O!==void 0&&f.has(C)?Ie(C):b.protectedKeys[C]=!0}b.prevProp=y,b.prevResolvedValues=it,b.isActive&&(d={...d,...it}),i&&t.blockInitialAnimation&&(A=!1);const Oe=S&&D;A&&(!Oe||E)&&h.push(...I.map(C=>{const O={type:g};if(typeof C=="string"&&i&&!Oe&&t.manuallyAnimateOnMount&&t.parent){const{parent:q}=t,nt=ct(q,C);if(q.enteringChildren&&nt){const{delayChildren:on}=nt.transition||{};O.delay=vi(q.enteringChildren,t,on)}}return{animation:C,options:O}}))}if(f.size){const x={};if(typeof u.initial!="boolean"){const g=ct(t,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(x.transition=g.transition)}f.forEach(g=>{const b=t.getBaseTarget(g),y=t.getValue(g);y&&(y.liveStyle=!0),x[g]=b??null}),h.push({animation:x})}let v=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(v=!1),i=!1,v?e(h):Promise.resolve()}function a(l,u){if(s[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,u)),s[l].isActive=u;const c=r(l);for(const h in s)s[h].protectedKeys={};return c}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>s,reset:()=>{s=ds()}}}function Go(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Gi(e,t):!1}function Z(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ds(){return{animate:Z(!0),whileInView:Z(),whileHover:Z(),whileTap:Z(),whileDrag:Z(),whileFocus:Z(),exit:Z()}}function ps(t,e){t.min=e.min,t.max=e.max}function N(t,e){ps(t.x,e.x),ps(t.y,e.y)}function ms(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Hi=1e-4,Ho=1-Hi,qo=1+Hi,qi=.01,Zo=0-qi,Jo=0+qi;function j(t){return t.max-t.min}function Qo(t,e,s){return Math.abs(t-e)<=s}function ys(t,e,s,i=.5){t.origin=i,t.originPoint=M(e.min,e.max,t.origin),t.scale=j(s)/j(e),t.translate=M(s.min,s.max,t.origin)-t.originPoint,(t.scale>=Ho&&t.scale<=qo||isNaN(t.scale))&&(t.scale=1),(t.translate>=Zo&&t.translate<=Jo||isNaN(t.translate))&&(t.translate=0)}function Tt(t,e,s,i){ys(t.x,e.x,s.x,i?i.originX:void 0),ys(t.y,e.y,s.y,i?i.originY:void 0)}function gs(t,e,s){t.min=s.min+e.min,t.max=t.min+j(e)}function ta(t,e,s){gs(t.x,e.x,s.x),gs(t.y,e.y,s.y)}function Ts(t,e,s){t.min=e.min-s.min,t.max=t.min+j(e)}function kt(t,e,s){Ts(t.x,e.x,s.x),Ts(t.y,e.y,s.y)}function vs(t,e,s,i,n){return t-=e,t=Bt(t,1/s,i),n!==void 0&&(t=Bt(t,1/n,i)),t}function ea(t,e=0,s=1,i=.5,n,o=t,r=t){if(W.test(e)&&(e=parseFloat(e),e=M(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=M(o.min,o.max,i);t===o&&(a-=e),t.min=vs(t.min,e,s,a,n),t.max=vs(t.max,e,s,a,n)}function xs(t,e,[s,i,n],o,r){ea(t,e[s],e[i],e[n],e.scale,o,r)}const sa=["x","scaleX","originX"],ia=["y","scaleY","originY"];function bs(t,e,s,i){xs(t.x,e,sa,s?s.x:void 0,i?i.x:void 0),xs(t.y,e,ia,s?s.y:void 0,i?i.y:void 0)}function As(t){return t.translate===0&&t.scale===1}function Zi(t){return As(t.x)&&As(t.y)}function Vs(t,e){return t.min===e.min&&t.max===e.max}function na(t,e){return Vs(t.x,e.x)&&Vs(t.y,e.y)}function Ss(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ji(t,e){return Ss(t.x,e.x)&&Ss(t.y,e.y)}function Ps(t){return j(t.x)/j(t.y)}function ws(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ds(t){return[t("x"),t("y")]}function ra(t,e,s){let i="";const n=t.x.translate/e.x,o=t.y.translate/e.y,r=s?.z||0;if((n||o||r)&&(i=`translate3d(${n}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),s){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:m}=s;u&&(i=`perspective(${u}px) ${i}`),c&&(i+=`rotate(${c}deg) `),h&&(i+=`rotateX(${h}deg) `),f&&(i+=`rotateY(${f}deg) `),d&&(i+=`skewX(${d}deg) `),m&&(i+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const Qi=["TopLeft","TopRight","BottomLeft","BottomRight"],oa=Qi.length,Ms=t=>typeof t=="string"?parseFloat(t):t,Rs=t=>typeof t=="number"||p.test(t);function aa(t,e,s,i,n,o){n?(t.opacity=M(0,s.opacity??1,la(i)),t.opacityExit=M(e.opacity??1,0,ca(i))):o&&(t.opacity=M(e.opacity??1,s.opacity??1,i));for(let r=0;r<oa;r++){const a=`border${Qi[r]}Radius`;let l=Cs(e,a),u=Cs(s,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Rs(l)===Rs(u)?(t[a]=Math.max(M(Ms(l),Ms(u),i),0),(W.test(u)||W.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||s.rotate)&&(t.rotate=M(e.rotate||0,s.rotate||0,i))}function Cs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const la=tn(0,.5,qs),ca=tn(.5,.95,H);function tn(t,e,s){return i=>i<t?0:i>e?1:s(ye(t,e,i))}function ua(t,e,s){const i=L(t)?t:ut(t);return i.start(bi("",i,e,s)),i.animation}function ha(t,e,s,i={passive:!0}){return t.addEventListener(e,s,i),()=>t.removeEventListener(e,s)}const fa=(t,e)=>t.depth-e.depth;class da{constructor(){this.children=[],this.isDirty=!1}add(e){he(this.children,e),this.isDirty=!0}remove(e){fe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(fa),this.isDirty=!1,this.children.forEach(e)}}function pa(t,e){const s=F.now(),i=({timestamp:n})=>{const o=n-s;o>=e&&(st(i),t(o-e))};return k.setup(i,!0),()=>st(i)}function Ut(t){return L(t)?t.get():t}class ma{constructor(){this.members=[]}add(e){he(this.members,e),e.scheduleRender()}remove(e){if(fe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(e){const s=this.members.findIndex(n=>e===n);if(s===0)return!1;let i;for(let n=s;n>=0;n--){const o=this.members[n];if(o.isPresent!==!1){i=o;break}}return i?(this.promote(i),!0):!1}promote(e,s){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,s&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:n}=e.options;n===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:s,resumingFrom:i}=e;s.onExitComplete&&s.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Wt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},$t=["","X","Y","Z"],ya=1e3;let ga=0;function _t(t,e,s,i){const{latestValues:n}=e;n[t]&&(s[t]=n[t],e.setStaticValue(t,0),i&&(i[t]=0))}function en(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const s=Si(e);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:n,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(s,"transform",k,!(n||o))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&en(i)}function sn({attachResizeListener:t,defaultParent:e,measureScroll:s,checkIsScrollRoot:i,resetTransform:n}){return class{constructor(r={},a=e?.()){this.id=ga++,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(xa),this.nodes.forEach(Sa),this.nodes.forEach(Pa),this.nodes.forEach(ba)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new da)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new ge),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=Li(r)&&!To(r),this.instance=r;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;k.read(()=>{h=window.innerWidth}),t(r,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=pa(f,250),Wt.hasAnimatedSinceResize&&(Wt.hasAnimatedSinceResize=!1,this.nodes.forEach(Fs)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||Ca,{onLayoutAnimationStart:v,onLayoutAnimationComplete:x}=u.getProps(),g=!this.targetLayout||!Ji(this.targetLayout,d),b=!h&&f;if(this.options.layoutRoot||this.resumeFrom||b||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...Re(m,"layout"),onPlay:v,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(c,b)}else h||Fs(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),st(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(wa),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&en(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Bs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ks);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Va),this.nodes.forEach(Ta),this.nodes.forEach(va)):this.nodes.forEach(ks),this.clearAllSnapshots();const a=F.now();B.delta=$(0,1e3/60,a-B.timestamp),B.timestamp=a,B.isProcessing=!0,Ft.update.process(B),Ft.preRender.process(B),Ft.render.process(B),B.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Aa),this.sharedNodes.forEach(Da)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,k.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){k.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!j(this.snapshot.measuredBox.x)&&!j(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=R(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=i(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!n)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Zi(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&this.instance&&(a||J(this.latestValues)||c)&&(n(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Ba(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return R();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ka))){const{scroll:u}=this.root;u&&(at(a.x,u.offset.x),at(a.y,u.offset.y))}return a}removeElementScroll(r){const a=R();if(N(a,r),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:h}=u;u!==this.root&&c&&h.layoutScroll&&(c.wasRoot&&N(a,r),at(a.x,c.offset.x),at(a.y,c.offset.y))}return a}applyTransform(r,a=!1){const l=R();N(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&lt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),J(c.latestValues)&&lt(l,c.latestValues)}return J(this.latestValues)&&lt(l,this.latestValues),l}removeTransform(r){const a=R();N(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!J(u.latestValues))continue;le(u.latestValues)&&u.updateSnapshot();const c=R(),h=u.measurePageBox();N(c,h),bs(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return J(this.latestValues)&&bs(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==B.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=B.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=R(),this.targetWithTransforms=R()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ta(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):N(this.target,this.layout.layoutBox),Ui(this.target,this.targetDelta)):N(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||le(this.parent.latestValues)||Ki(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,a,l){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=R(),this.relativeTargetOrigin=R(),kt(this.relativeTargetOrigin,a,l),N(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===B.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;N(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Ro(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=R());const{target:d}=r;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ms(this.prevProjectionDelta.x,this.projectionDelta.x),ms(this.prevProjectionDelta.y,this.projectionDelta.y)),Tt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!ws(this.projectionDelta.x,this.prevProjectionDelta.x)||!ws(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ot(),this.projectionDelta=ot(),this.projectionDeltaWithTransform=ot()}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=ot();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=R(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,v=d!==m,x=this.getStack(),g=!x||x.members.length<=1,b=!!(v&&!g&&this.options.crossfade===!0&&!this.path.some(Ra));this.animationProgress=0;let y;this.mixTargetDelta=V=>{const T=V/1e3;Es(h.x,r.x,T),Es(h.y,r.y,T),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Ma(this.relativeTarget,this.relativeTargetOrigin,f,T),y&&na(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=R()),N(y,this.relativeTarget)),v&&(this.animationValues=c,aa(c,u,this.latestValues,T,b,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(st(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=k.update(()=>{Wt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ut(0)),this.currentAnimation=ua(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ya),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&nn(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||R();const h=j(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=j(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}N(a,l),lt(a,c),Tt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new ma),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&_t("z",r,u,this.animationValues);for(let c=0;c<$t.length;c++)_t(`rotate${$t[c]}`,r,u,this.animationValues),_t(`skew${$t[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=Ut(a?.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=Ut(a?.pointerEvents)||""),this.hasProjected&&!J(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=ra(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),r.transform=h;const{x:f,y:d}=this.projectionDelta;r.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?r.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:r.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in ue){if(c[m]===void 0)continue;const{correct:v,applyTo:x,isCSSVariable:g}=ue[m],b=h==="none"?c[m]:v(c[m],u);if(x){const y=x.length;for(let V=0;V<y;V++)r[x[V]]=b}else g?this.options.visualElement.renderState.vars[m]=b:r[m]=b}this.options.layoutId&&(r.pointerEvents=u===this?Ut(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(Bs),this.root.sharedNodes.clear()}}}function Ta(t){t.updateLayout()}function va(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:n}=t.options,o=e.source!==t.layout.source;n==="size"?Ds(c=>{const h=o?e.measuredBox[c]:e.layoutBox[c],f=j(h);h.min=s[c].min,h.max=h.min+f}):nn(n,e.layoutBox,s)&&Ds(c=>{const h=o?e.measuredBox[c]:e.layoutBox[c],f=j(s[c]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+f)});const r=ot();Tt(r,s,e.layoutBox);const a=ot();o?Tt(a,t.applyTransform(i,!0),e.measuredBox):Tt(a,s,e.layoutBox);const l=!Zi(r);let u=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:h,layout:f}=c;if(h&&f){const d=R();kt(d,e.layoutBox,h.layoutBox);const m=R();kt(m,s,f.layoutBox),Ji(d,m)||(u=!0),c.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=d,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function xa(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 ba(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Aa(t){t.clearSnapshot()}function Bs(t){t.clearMeasurements()}function ks(t){t.isLayoutDirty=!1}function Va(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Fs(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Sa(t){t.resolveTargetDelta()}function Pa(t){t.calcProjection()}function wa(t){t.resetSkewAndRotation()}function Da(t){t.removeLeadSnapshot()}function Es(t,e,s){t.translate=M(e.translate,0,s),t.scale=M(e.scale,1,s),t.origin=e.origin,t.originPoint=e.originPoint}function Ls(t,e,s,i){t.min=M(e.min,s.min,i),t.max=M(e.max,s.max,i)}function Ma(t,e,s,i){Ls(t.x,e.x,s.x,i),Ls(t.y,e.y,s.y,i)}function Ra(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Ca={duration:.45,ease:[.4,0,.1,1]},Is=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Os=Is("applewebkit/")&&!Is("chrome/")?Math.round:H;function js(t){t.min=Os(t.min),t.max=Os(t.max)}function Ba(t){js(t.x),js(t.y)}function nn(t,e,s){return t==="position"||t==="preserve-aspect"&&!Qo(Ps(e),Ps(s),.2)}function ka(t){return t!==t.root&&t.scroll?.wasRoot}const Fa=sn({attachResizeListener:(t,e)=>ha(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),zt={current:void 0},Ya=sn({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!zt.current){const t=new Fa({});t.mount(window),t.setOptions({layoutScroll:!0}),zt.current=t}return zt.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Ns=(t,e)=>Math.abs(t-e);function Ga(t,e){const s=Ns(t.x,e.x),i=Ns(t.y,e.y);return Math.sqrt(s**2+i**2)}export{M as A,j as B,ye as C,$ as D,R as E,Ka as F,Ds as G,$a as H,Wa as I,Ua as J,Do as K,Hr as L,bi as M,La as N,W as O,yo as P,H as Q,Wt as R,_a as S,Bi as T,Ya as U,Ia as V,Oa as W,ke as a,L as b,Eo as c,$i as d,Ko as e,Uo as f,Na as g,So as h,ji as i,Oi as j,Ai as k,zi as l,$o as m,za as n,Zr as o,po as p,ha as q,Ut as r,ja as s,Ga as t,B as u,k as v,me as w,st as x,Y as y,U as z};