geekin-devtoys 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";const B=require("vue"),un=require("@vueuse/core");function kt(t,e){const n=typeof t=="string"&&!e?`${t}Context`:e,i=Symbol(n);return[o=>{const a=B.inject(i,o);if(a===void 0)throw new Error(`Injection \`${i.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`);return a},o=>(B.provide(i,o),o),i]}function go(t,e){const{layoutGroup:n,presenceContext:i,config:s}=e,r=n.id&&t.layoutId?`${n.id}-${t.layoutId}`:t.layoutId||void 0;return{...t,layoutId:r,transition:t.transition??s.transition,layoutGroup:n,motionConfig:s,inViewOptions:t.inViewOptions??s.inViewOptions,presenceContext:i,initial:i.initial===!1?i.initial:t.initial===!0?void 0:t.initial}}function Ge(t,e){t.indexOf(e)===-1&&t.push(e)}function _t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const J=(t,e,n)=>n>e?e:n<t?t:n;function ge(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let Bt=()=>{},ht=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(Bt=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(ge(e,n))},ht=(t,e,n)=>{if(!t)throw new Error(ge(e,n))});const st={},Mi=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ci=t=>typeof t=="object"&&t!==null,Ei=t=>/^0[^.\s]+$/u.test(t);function Di(t){let e;return()=>(e===void 0&&(e=t()),e)}const G=t=>t,Ft=(...t)=>t.reduce((e,n)=>i=>n(e(i))),Et=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class _e{constructor(){this.subscriptions=[]}add(e){return Ge(this.subscriptions,e),()=>_t(this.subscriptions,e)}notify(e,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,i);else for(let r=0;r<s;r++){const o=this.subscriptions[r];o&&o(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const U=t=>t*1e3,W=t=>t/1e3,Ri=(t,e)=>e?t*(1e3/e):0,hn=new Set;function Li(t,e,n){t||hn.has(e)||(console.warn(ge(e,n)),hn.add(e))}const ki=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,vo=1e-7,xo=12;function To(t,e,n,i,s){let r,o,a=0;do o=e+(n-e)/2,r=ki(o,i,s)-t,r>0?n=o:e=o;while(Math.abs(r)>vo&&++a<xo);return o}function Ot(t,e,n,i){if(t===e&&n===i)return G;const s=r=>To(r,0,1,t,n);return r=>r===0||r===1?r:ki(s(r),e,i)}const Bi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Fi=t=>e=>1-t(1-e),Oi=Ot(.33,1.53,.69,.99),He=Fi(Oi),ji=Bi(He),Ii=t=>t>=1?1:(t*=2)<1?.5*He(t):.5*(2-Math.pow(2,-10*(t-1))),ze=t=>1-Math.sin(Math.acos(t)),Ni=Fi(ze),Ui=Bi(ze),bo=Ot(.42,0,1,1),wo=Ot(0,0,.58,1),$i=Ot(.42,0,.58,1),So=t=>Array.isArray(t)&&typeof t[0]!="number",Ki=t=>Array.isArray(t)&&typeof t[0]=="number",fn={linear:G,easeIn:bo,easeInOut:$i,easeOut:wo,circIn:ze,circInOut:Ui,circOut:Ni,backIn:He,backInOut:ji,backOut:Oi,anticipate:Ii},Po=t=>typeof t=="string",dn=t=>{if(Ki(t)){ht(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return Ot(e,n,i,s)}else if(Po(t))return ht(fn[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),fn[t];return t},It=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ao(t){let e=new Set,n=new Set,i=!1,s=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){r.has(u)&&(l.schedule(u),t()),u(o)}const l={schedule:(u,c=!1,h=!1)=>{const d=h&&i?e:n;return c&&r.add(u),d.add(u),u},cancel:u=>{n.delete(u),r.delete(u)},process:u=>{if(o=u,i){s=!0;return}i=!0;const c=e;e=n,n=c,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(u))}};return l}const Vo=40;function Wi(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=It.reduce((x,S)=>(x[S]=Ao(r),x),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:d,postRender:p}=o,y=()=>{const x=st.useManualTiming,S=x?s.timestamp:performance.now();n=!1,x||(s.delta=i?1e3/60:Math.max(Math.min(S-s.timestamp,Vo),1)),s.timestamp=S,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),h.process(s),f.process(s),d.process(s),p.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(y))},m=()=>{n=!0,i=!0,s.isProcessing||t(y)};return{schedule:It.reduce((x,S)=>{const P=o[S];return x[S]=(E,M=!1,w=!1)=>(n||m(),P.schedule(E,M,w)),x},{}),cancel:x=>{for(let S=0;S<It.length;S++)o[It[S]].cancel(x)},state:s,steps:o}}const{schedule:A,cancel:et,state:F,steps:ie}=Wi(typeof requestAnimationFrame<"u"?requestAnimationFrame:G,!0);let $t;function Mo(){$t=void 0}const I={now:()=>($t===void 0&&I.set(F.isProcessing||st.useManualTiming?F.timestamp:performance.now()),$t),set:t=>{$t=t,queueMicrotask(Mo)}},Gi=t=>e=>typeof e=="string"&&e.startsWith(t),Ye=Gi("--"),Co=Gi("var(--"),Xe=t=>Co(t)?Eo.test(t.split("/*")[0].trim()):!1,Eo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function pn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Tt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Dt={...Tt,transform:t=>J(0,1,t)},Nt={...Tt,default:1},Vt=t=>Math.round(t*1e5)/1e5,qe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Do(t){return t==null}const Ro=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ze=(t,e)=>n=>!!(typeof n=="string"&&Ro.test(n)&&n.startsWith(t)||e&&!Do(n)&&Object.prototype.hasOwnProperty.call(n,e)),_i=(t,e,n)=>i=>{if(typeof i!="string")return i;const[s,r,o,a]=i.match(qe);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Lo=t=>J(0,255,t),se={...Tt,transform:t=>Math.round(Lo(t))},lt={test:Ze("rgb","red"),parse:_i("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+se.transform(t)+", "+se.transform(e)+", "+se.transform(n)+", "+Vt(Dt.transform(i))+")"};function ko(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const ve={test:Ze("#"),parse:ko,transform:lt.transform},jt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),tt=jt("deg"),Z=jt("%"),v=jt("px"),Bo=jt("vh"),Fo=jt("vw"),mn={...Z,parse:t=>Z.parse(t)/100,transform:t=>Z.transform(t*100)},mt={test:Ze("hsl","hue"),parse:_i("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Z.transform(Vt(e))+", "+Z.transform(Vt(n))+", "+Vt(Dt.transform(i))+")"},L={test:t=>lt.test(t)||ve.test(t)||mt.test(t),parse:t=>lt.test(t)?lt.parse(t):mt.test(t)?mt.parse(t):ve.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?lt.transform(t):mt.transform(t),getAnimatableNone:t=>{const e=L.parse(t);return e.alpha=0,L.transform(e)}},Oo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jo(t){return isNaN(t)&&typeof t=="string"&&(t.match(qe)?.length||0)+(t.match(Oo)?.length||0)>0}const Hi="number",zi="color",Io="var",No="var(",yn="${}",Uo=/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=[],i={color:[],number:[],var:[]},s=[];let r=0;const a=e.replace(Uo,l=>(L.test(l)?(i.color.push(r),s.push(zi),n.push(L.parse(l))):l.startsWith(No)?(i.var.push(r),s.push(Io),n.push(l)):(i.number.push(r),s.push(Hi),n.push(parseFloat(l))),++r,yn)).split(yn);return{values:n,split:a,indexes:i,types:s}}function $o(t){return xt(t).values}function Yi({split:t,types:e}){const n=t.length;return i=>{let s="";for(let r=0;r<n;r++)if(s+=t[r],i[r]!==void 0){const o=e[r];o===Hi?s+=Vt(i[r]):o===zi?s+=L.transform(i[r]):s+=i[r]}return s}}function Ko(t){return Yi(xt(t))}const Wo=t=>typeof t=="number"?0:L.test(t)?L.getAnimatableNone(t):t,Go=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:Wo(t);function _o(t){const e=xt(t);return Yi(e)(e.values.map((i,s)=>Go(i,e.split[s])))}const Y={test:jo,parse:$o,createTransformer:Ko,getAnimatableNone:_o};function oe(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 Ho({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let s=0,r=0,o=0;if(!e)s=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=oe(l,a,t+1/3),r=oe(l,a,t),o=oe(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}function Ht(t,e){return n=>n>0?e:t}const V=(t,e,n)=>t+(e-t)*n,re=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},zo=[ve,lt,mt],Yo=t=>zo.find(e=>e.test(t));function gn(t){const e=Yo(t);if(Bt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===mt&&(n=Ho(n)),n}const vn=(t,e)=>{const n=gn(t),i=gn(e);if(!n||!i)return Ht(t,e);const s={...n};return r=>(s.red=re(n.red,i.red,r),s.green=re(n.green,i.green,r),s.blue=re(n.blue,i.blue,r),s.alpha=V(n.alpha,i.alpha,r),lt.transform(s))},xe=new Set(["none","hidden"]);function Xo(t,e){return xe.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function qo(t,e){return n=>V(t,e,n)}function Je(t){return typeof t=="number"?qo:typeof t=="string"?Xe(t)?Ht:L.test(t)?vn:Qo:Array.isArray(t)?Xi:typeof t=="object"?L.test(t)?vn:Zo:Ht}function Xi(t,e){const n=[...t],i=n.length,s=t.map((r,o)=>Je(r)(r,e[o]));return r=>{for(let o=0;o<i;o++)n[o]=s[o](r);return n}}function Zo(t,e){const n={...t,...e},i={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(i[s]=Je(t[s])(t[s],e[s]));return s=>{for(const r in i)n[r]=i[r](s);return n}}function Jo(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}const Qo=(t,e)=>{const n=Y.createTransformer(e),i=xt(t),s=xt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?xe.has(t)&&!s.values.length||xe.has(e)&&!i.values.length?Xo(t,e):Ft(Xi(Jo(i,s),s.values),n):(Bt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ht(t,e))};function qi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?V(t,e,n):Je(t)(t,e)}const tr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>A.update(e,n),stop:()=>et(e),now:()=>F.isProcessing?F.timestamp:I.now()}},Zi=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let r=0;r<s;r++)i+=Math.round(t(r/(s-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},zt=2e4;function Qe(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<zt;)e+=n,i=t.next(e);return e>=zt?1/0:e}function er(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Qe(i),zt);return{type:"keyframes",ease:r=>i.next(s*r).value/e,duration:W(s)}}const R={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 Te(t,e){return t*Math.sqrt(1-e*e)}const nr=12;function ir(t,e,n){let i=n;for(let s=1;s<nr;s++)i=i-t(i)/e(i);return i}const ae=.001;function sr({duration:t=R.duration,bounce:e=R.bounce,velocity:n=R.velocity,mass:i=R.mass}){let s,r;Bt(t<=U(R.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=J(R.minDamping,R.maxDamping,o),t=J(R.minDuration,R.maxDuration,W(t)),o<1?(s=u=>{const c=u*o,h=c*t,f=c-n,d=Te(u,o),p=Math.exp(-h);return ae-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),y=Te(Math.pow(u,2),o);return(-s(u)+ae>0?-1:1)*((f-d)*p)/y}):(s=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-ae+c*h},r=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=ir(s,r,a);if(t=U(t),isNaN(l))return{stiffness:R.stiffness,damping:R.damping,duration:t};{const u=Math.pow(l,2)*i;return{stiffness:u,damping:o*2*Math.sqrt(i*u),duration:t}}}const or=["duration","bounce"],rr=["stiffness","damping","mass"];function xn(t,e){return e.some(n=>t[n]!==void 0)}function ar(t){let e={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...t};if(!xn(t,rr)&&xn(t,or))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),s=i*i,r=2*J(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:R.mass,stiffness:s,damping:r}}else{const n=sr({...t,velocity:0});e={...e,...n,mass:R.mass},e.isResolvedFromDuration=!0}return e}function Yt(t=R.visualDuration,e=R.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=ar({...n,velocity:-W(n.velocity||0)}),p=f||0,y=u/(2*Math.sqrt(l*c)),m=o-r,g=W(Math.sqrt(l/c)),T=Math.abs(m)<5;i||(i=T?R.restSpeed.granular:R.restSpeed.default),s||(s=T?R.restDelta.granular:R.restDelta.default);let x,S,P,E,M,w;if(y<1)P=Te(g,y),E=(p+y*g*m)/P,x=b=>{const D=Math.exp(-y*g*b);return o-D*(E*Math.sin(P*b)+m*Math.cos(P*b))},M=y*g*E+m*P,w=y*g*m-E*P,S=b=>Math.exp(-y*g*b)*(M*Math.sin(P*b)+w*Math.cos(P*b));else if(y===1){x=D=>o-Math.exp(-g*D)*(m+(p+g*m)*D);const b=p+g*m;S=D=>Math.exp(-g*D)*(g*b*D-p)}else{const b=g*Math.sqrt(y*y-1);x=H=>{const Q=Math.exp(-y*g*H),C=Math.min(b*H,300);return o-Q*((p+y*g*m)*Math.sinh(C)+b*m*Math.cosh(C))/b};const D=(p+y*g*m)/b,_=y*g*D-m*b,dt=y*g*m-D*b;S=H=>{const Q=Math.exp(-y*g*H),C=Math.min(b*H,300);return Q*(_*Math.sinh(C)+dt*Math.cosh(C))}}const O={calculatedDuration:d&&h||null,velocity:b=>U(S(b)),next:b=>{if(!d&&y<1){const _=Math.exp(-y*g*b),dt=Math.sin(P*b),H=Math.cos(P*b),Q=o-_*(E*dt+m*H),C=U(_*(M*dt+w*H));return a.done=Math.abs(C)<=i&&Math.abs(o-Q)<=s,a.value=a.done?o:Q,a}const D=x(b);if(d)a.done=b>=h;else{const _=U(S(b));a.done=Math.abs(_)<=i&&Math.abs(o-D)<=s}return a.value=a.done?o:D,a},toString:()=>{const b=Math.min(Qe(O),zt),D=Zi(_=>O.next(b*_).value,b,30);return b+"ms "+D},toTransition:()=>{}};return O}Yt.applyToOptions=t=>{const e=er(t,100,Yt);return t.ease=e.ease,t.duration=U(e.duration),t.type="keyframes",t};const lr=5;function Ji(t,e,n){const i=Math.max(e-lr,0);return Ri(n-t(i),e-i)}function be({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=w=>a!==void 0&&w<a||l!==void 0&&w>l,p=w=>a===void 0?l:l===void 0||Math.abs(a-w)<Math.abs(l-w)?a:l;let y=n*e;const m=h+y,g=o===void 0?m:o(m);g!==m&&(y=g-h);const T=w=>-y*Math.exp(-w/i),x=w=>g+T(w),S=w=>{const O=T(w),b=x(w);f.done=Math.abs(O)<=u,f.value=f.done?g:b};let P,E;const M=w=>{d(f.value)&&(P=w,E=Yt({keyframes:[f.value,p(f.value)],velocity:Ji(x,w,f.value),damping:s,stiffness:r,restDelta:u,restSpeed:c}))};return M(0),{calculatedDuration:null,next:w=>{let O=!1;return!E&&P===void 0&&(O=!0,S(w),M(w)),P!==void 0&&w>=P?E.next(w-P):(!O&&S(w),f)}}}function cr(t,e,n){const i=[],s=n||st.mix||qi,r=t.length-1;for(let o=0;o<r;o++){let a=s(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||G:e;a=Ft(l,a)}i.push(a)}return i}function Qi(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const r=t.length;if(ht(r===e.length,"Both input and output ranges must be the same length","range-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=cr(e,i,s),l=a.length,u=c=>{if(o&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=Et(t[h],t[h+1],c);return a[h](f)};return n?c=>u(J(t[0],t[r-1],c)):u}function ur(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=Et(0,e,i);t.push(V(n,1,s))}}function hr(t){const e=[0];return ur(e,t.length-1),e}function fr(t,e){return t.map(n=>n*e)}function dr(t,e){return t.map(()=>e||$i).splice(0,t.length-1)}function yt({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=So(i)?i.map(dn):dn(i),r={done:!1,value:e[0]},o=fr(n&&n.length===e.length?n:hr(e),t),a=Qi(o,e,{ease:Array.isArray(s)?s:dr(e,s)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const pr=t=>t!==null;function te(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(pr),a=s<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||i===void 0?r[a]:i}const mr={decay:be,inertia:be,tween:yt,keyframes:yt,spring:Yt};function ts(t){typeof t.type=="string"&&(t.type=mr[t.type])}class tn{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 yr=t=>t/100;class Xt extends tn{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=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==I.now()&&this.tick(I.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;ts(e);const{type:n=yt,repeat:i=0,repeatDelay:s=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||yt;process.env.NODE_ENV!=="production"&&l!==yt&&ht(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==yt&&typeof a[0]!="number"&&(this.mixKeyframes=Ft(yr,qi(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Qe(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=u}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:i,totalDuration:s,mixKeyframes:r,mirroredGenerator:o,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:p,onUpdate:y,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let x=this.currentTime,S=i;if(h){const w=Math.min(this.currentTime,s)/a;let O=Math.floor(w),b=w%1;!b&&w>=1&&(b=1),b===1&&O--,O=Math.min(O,h+1),O%2&&(f==="reverse"?(b=1-b,d&&(b-=d/a)):f==="mirror"&&(S=o)),x=J(0,1,b)*a}let P;T?(this.delayState.value=c[0],P=this.delayState):P=S.next(x),r&&!T&&(P.value=r(P.value));let{done:E}=P;!T&&l!==null&&(E=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return M&&p!==be&&(P.value=te(c,this.options,m,this.speed)),y&&y(P.value),M&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return W(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(this.currentTime)}set time(e){e=U(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 Ji(i=>this.generator.next(i).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(I.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=W(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=tr,startTime:n}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),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=n??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(I.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 gr(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ct=t=>t*180/Math.PI,we=t=>{const e=ct(Math.atan2(t[1],t[0]));return Se(e)},vr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:we,rotateZ:we,skewX:t=>ct(Math.atan(t[1])),skewY:t=>ct(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Se=t=>(t=t%360,t<0&&(t+=360),t),Tn=we,bn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),wn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),xr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bn,scaleY:wn,scale:t=>(bn(t)+wn(t))/2,rotateX:t=>Se(ct(Math.atan2(t[6],t[5]))),rotateY:t=>Se(ct(Math.atan2(-t[2],t[0]))),rotateZ:Tn,rotate:Tn,skewX:t=>ct(Math.atan(t[4])),skewY:t=>ct(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Pe(t){return t.includes("scale")?1:0}function Ae(t,e){if(!t||t==="none")return Pe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=xr,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=vr,s=a}if(!s)return Pe(e);const r=i[e],o=s[1].split(",").map(br);return typeof r=="function"?r(o):o[r]}const Tr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ae(n,e)};function br(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wt=new Set([...bt,"pathRotation"]),Sn=t=>t===Tt||t===v,wr=new Set(["x","y","z"]),Sr=bt.filter(t=>!wr.has(t));function Pr(t){const e=[];return Sr.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const it={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return i==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return i==="border-box"?s:s-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})=>Ae(e,"x"),y:(t,{transform:e})=>Ae(e,"y")};it.translateX=it.x;it.translateY=it.y;const ut=new Set;let Ve=!1,Me=!1,Ce=!1;function es(){if(Me){const t=Array.from(ut).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const s=Pr(i);s.length&&(n.set(i,s),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([r,o])=>{i.getValue(r)?.set(o)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Me=!1,Ve=!1,ut.forEach(t=>t.complete(Ce)),ut.clear()}function ns(){ut.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Me=!0)})}function Ar(){Ce=!0,ns(),es(),Ce=!1}class en{constructor(e,n,i,s,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=s,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ut.add(this),Ve||(Ve=!0,A.read(ns),A.resolveKeyframes(es))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:s}=this;if(e[0]===null){const r=s?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(i&&n){const a=i.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),s&&r===void 0&&s.set(e[0])}gr(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ut.delete(this)}cancel(){this.state==="scheduled"&&(ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Vr=t=>t.startsWith("--");function is(t,e,n){Vr(e)?t.style.setProperty(e,n):t.style[e]=n}const Mr={};function ss(t,e){const n=Di(t);return()=>Mr[e]??n()}const Cr=ss(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),os=ss(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Pt=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Pn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Pt([0,.65,.55,1]),circOut:Pt([.55,0,1,.45]),backIn:Pt([.31,.01,.66,-.59]),backOut:Pt([.33,1.53,.69,.99])};function rs(t,e){if(t)return typeof t=="function"?os()?Zi(t,e):"ease-out":Ki(t)?Pt(t):Array.isArray(t)?t.map(n=>rs(n,e)||Pn.easeOut):Pn[t]}function Er(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=rs(a,s);Array.isArray(h)&&(c.easing=h);const f={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(c,f)}function as(t){return typeof t=="function"&&"applyToOptions"in t}function Dr({type:t,...e}){return as(t)&&os()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class ls extends tn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,ht(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Dr(e);this.animation=Er(n,i,s,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const c=te(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),is(n,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(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return W(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+W(e)}get time(){return W(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=U(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:i,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Cr()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),G):s(this)}}const cs={anticipate:Ii,backInOut:ji,circInOut:Ui};function Rr(t){return t in cs}function Lr(t){typeof t.ease=="string"&&Rr(t.ease)&&(t.ease=cs[t.ease])}const le=10;class kr extends ls{constructor(e){Lr(e),ts(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:s,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new Xt({...o,autoplay:!1}),l=Math.max(le,I.now()-this.startTime),u=J(0,le,l-le),c=a.sample(l).value,{name:h}=this.options;r&&h&&is(r,h,c),n.setWithVelocity(a.sample(Math.max(0,l-u)).value,c,u),a.stop()}}const An=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Y.test(t)||t==="0")&&!t.startsWith("url("));function Br(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 Fr(t,e,n,i){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=An(s,e),a=An(r,e);return Bt(o===a,`You are trying to animate ${e} from "${s}" to "${r}". "${o?r:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Br(t)||(n==="spring"||as(n))&&i}function Ee(t){t.duration=0,t.type="keyframes"}const us=new Set(["opacity","clipPath","filter","transform"]),Or=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function jr(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Or.test(t[e]))return!0;return!1}const Ir=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Nr=Di(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ur(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=e.owner.getProps();return Nr()&&n&&(us.has(n)||Ir.has(n)&&jr(a))&&(n!=="transform"||!c)&&!u&&!i&&s!=="mirror"&&r!==0&&o!=="inertia"}const $r=40;class Kr extends tn{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:o="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=I.now();const f={autoplay:e,delay:n,type:i,repeat:s,repeatDelay:r,repeatType:o,name:l,motionValue:u,element:c,...h},d=c?.KeyframeResolver||en;this.keyframeResolver=new d(a,(p,y,m)=>this.onKeyframesResolved(p,y,f,!m),l,u,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=i;this.resolvedAt=I.now();let h=!0;Fr(e,r,o,a)||(h=!1,(st.instantAnimations||!l)&&c?.(te(e,i,n)),e[0]=e[e.length-1],Ee(i),i.repeat=0);const d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>$r?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},p=h&&!u&&Ur(d),y=d.motionValue?.owner?.current;let m;if(p)try{m=new kr({...d,element:y})}catch{m=new Xt(d)}else m=new Xt(d);m.finished.then(()=>{this.notifyFinished()}).catch(G),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ar()),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 hs(t,e,n,i=0,s=1){const r=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),o=t.size,a=(o-1)*i;return typeof n=="function"?n(r,o):s===1?r*i:a-r*i}const Vn=30,Wr=t=>!isNaN(parseFloat(t)),De={current:void 0};class Gr{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const s=I.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=I.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Wr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Li(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new _e);const i=this.events[e].add(n);return e==="change"?()=>{i(),A.read(()=>{this.events.change.getSize()||this.stop()})}:i}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,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return De.current&&De.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=I.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Vn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Vn);return Ri(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ft(t,e){return new Gr(t,e)}function fs(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function nn(t,e){const n=t?.[e]??t?.default??t;return n!==t?fs(n,t):n}const _r={type:"spring",stiffness:500,damping:25,restSpeed:10},Hr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),zr={type:"keyframes",duration:.8},Yr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Xr=(t,{keyframes:e})=>e.length>2?zr:wt.has(t)?t.startsWith("scale")?Hr(e[1]):_r:Yr,qr=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Zr(t){for(const e in t)if(!qr.has(e))return!0;return!1}const sn=(t,e,n,i={},s,r)=>o=>{const a=nn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u=u-U(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s};Zr(a)||Object.assign(c,Xr(t,c)),c.duration&&(c.duration=U(c.duration)),c.repeatDelay&&(c.repeatDelay=U(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Ee(c),c.delay===0&&(h=!0)),(st.instantAnimations||st.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,Ee(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=te(c.keyframes,a);if(f!==void 0){A.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new Xt(c):new Kr(c)},Jr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Qr(t){const e=Jr.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}const ta=4;function ds(t,e,n=1){ht(n<=ta,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=Qr(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const o=r.trim();return Mi(o)?parseFloat(o):o}return Xe(s)?ds(s,e,n+1):s}function Mn(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function ps(t,e,n,i){if(typeof e=="function"){const[s,r]=Mn(i);e=e(n!==void 0?n:t.custom,s,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,r]=Mn(i);e=e(n!==void 0?n:t.custom,s,r)}return e}function vt(t,e,n){const i=t.getProps();return ps(i,e,n!==void 0?n:i.custom,t)}const ms=new Set(["width","height","top","left","right","bottom",...bt]),ea=t=>Array.isArray(t);function na(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ft(n))}function ia(t){return ea(t)?t[t.length-1]||0:t}function sa(t,e){const n=vt(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const o in r){const a=ia(r[o]);na(t,o,a)}}const j=t=>!!(t&&t.getVelocity);function oa(t){return!!(j(t)&&t.add)}function Re(t,e){const n=t.getValue("willChange");if(oa(n))return n.add(e);if(!n&&st.WillChange){const i=new st.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function on(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ra="framerAppearId",aa="data-"+on(ra);function ys(t){return t.props[aa]}function la({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function gs(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();r=r?fs(r,l):l;const u=r?.reduceMotion,c=r?.skipAnimations;i&&(r=i);const h=[],f=s&&t.animationState&&t.animationState.getState()[s],d=r?.path;d&&d.animateVisualElement(t,a,r,n,h);for(const p in a){const y=t.getValue(p,t.latestValues[p]??null),m=a[p];if(m===void 0||f&&la(f,p))continue;const g={delay:n,...nn(r||{},p)};c&&(g.skipAnimations=!0);const T=y.get();if(T!==void 0&&!y.isAnimating()&&!Array.isArray(m)&&m===T&&!g.velocity){A.update(()=>y.set(m));continue}let x=!1;if(window.MotionHandoffAnimation){const E=ys(t);if(E){const M=window.MotionHandoffAnimation(E,p,A);M!==null&&(g.startTime=M,x=!0)}}Re(t,p);const S=u??t.shouldReduceMotion;y.start(sn(p,y,m,S&&ms.has(p)?{type:!1}:g,t,x));const P=y.animation;P&&h.push(P)}if(o){const p=()=>A.update(()=>{o&&sa(t,o)});h.length?Promise.all(h).then(p):p()}return h}function Le(t,e,n={}){const i=vt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const r=i?()=>Promise.all(gs(t,i,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:h}=s;return ca(t,e,l,u,c,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[l,u]=a==="beforeChildren"?[r,o]:[o,r];return l().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function ca(t,e,n=0,i=0,s=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Le(l,e,{...o,delay:n+(typeof i=="function"?0:i)+hs(t.variantChildren,l,i,s,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function ua(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const s=e.map(r=>Le(t,r,n));i=Promise.all(s)}else if(typeof e=="string")i=Le(t,e,n);else{const s=typeof e=="function"?vt(t,e,n.custom):e;i=Promise.all(gs(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const ha={test:t=>t==="auto",parse:t=>t},vs=t=>e=>e.test(t),xs=[Tt,v,Z,tt,Fo,Bo,ha],Cn=t=>xs.find(vs(t));function fa(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ei(t):!0}const da=new Set(["brightness","contrast","saturate","opacity"]);function pa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(qe)||[];if(!i)return t;const s=n.replace(i,"");let r=da.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const ma=/\b([a-z-]*)\(.*?\)/gu,ke={...Y,getAnimatableNone:t=>{const e=t.match(ma);return e?e.map(pa).join(" "):t}},Be={...Y,getAnimatableNone:t=>{const e=Y.parse(t);return Y.createTransformer(t)(e.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},En={...Tt,transform:Math.round},ya={rotate:tt,pathRotation:tt,rotateX:tt,rotateY:tt,rotateZ:tt,scale:Nt,scaleX:Nt,scaleY:Nt,scaleZ:Nt,skew:tt,skewX:tt,skewY:tt,distance:v,translateX:v,translateY:v,translateZ:v,x:v,y:v,z:v,perspective:v,transformPerspective:v,opacity:Dt,originX:mn,originY:mn,originZ:v},qt={borderWidth:v,borderTopWidth:v,borderRightWidth:v,borderBottomWidth:v,borderLeftWidth:v,borderRadius:v,borderTopLeftRadius:v,borderTopRightRadius:v,borderBottomRightRadius:v,borderBottomLeftRadius:v,width:v,maxWidth:v,height:v,maxHeight:v,top:v,right:v,bottom:v,left:v,inset:v,insetBlock:v,insetBlockStart:v,insetBlockEnd:v,insetInline:v,insetInlineStart:v,insetInlineEnd:v,padding:v,paddingTop:v,paddingRight:v,paddingBottom:v,paddingLeft:v,paddingBlock:v,paddingBlockStart:v,paddingBlockEnd:v,paddingInline:v,paddingInlineStart:v,paddingInlineEnd:v,margin:v,marginTop:v,marginRight:v,marginBottom:v,marginLeft:v,marginBlock:v,marginBlockStart:v,marginBlockEnd:v,marginInline:v,marginInlineStart:v,marginInlineEnd:v,fontSize:v,backgroundPositionX:v,backgroundPositionY:v,...ya,zIndex:En,fillOpacity:Dt,strokeOpacity:Dt,numOctaves:En},ga={...qt,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:ke,WebkitFilter:ke,mask:Be,WebkitMask:Be},Ts=t=>ga[t],va=new Set([ke,Be]);function bs(t,e){let n=Ts(t);return va.has(n)||(n=Y),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const xa=new Set(["auto","none","0"]);function Ta(t,e,n){let i=0,s;for(;i<t.length&&!s;){const r=t[i];typeof r=="string"&&!xa.has(r)&&xt(r).values.length&&(s=t[i]),i++}if(s&&n)for(const r of e)t[r]=bs(n,s)}class ba extends en{constructor(e,n,i,s,r){super(e,n,i,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.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=ds(h,n.current);f!==void 0&&(e[c]=f),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!ms.has(i)||e.length!==2)return;const[s,r]=e,o=Cn(s),a=Cn(r),l=pn(s),u=pn(r);if(l!==u&&it[i]){this.needsMeasurement=!0;return}if(o!==a)if(Sn(o)&&Sn(a))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else it[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||fa(e[s]))&&i.push(s);i.length&&Ta(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=it[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&e.getValue(i,s).jump(s,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const r=i.length-1,o=i[r];i[r]=it[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}const rn=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function ws(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const s=document.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(i=>i!=null)}const Fe=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function wa(t){return Ci(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Ss}=Wi(queueMicrotask,!1),Sa={y:!1};function Pa(){return Sa.y}function Ps(t,e){const n=ws(t),i=new AbortController,s={passive:!0,...e,signal:i.signal};return[n,s,()=>i.abort()]}function Aa(t){return!(t.pointerType==="touch"||Pa())}function Va(t,e,n={}){const[i,s,r]=Ps(t,n);return i.forEach(o=>{let a=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",p)},h=m=>{u&&(u(m),u=void 0),c()},f=m=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(m))},d=()=>{a=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},p=m=>{if(m.pointerType!=="touch"){if(a){l=!0;return}h(m)}},y=m=>{if(!Aa(m))return;l=!1;const g=e(o,m);typeof g=="function"&&(u=g,o.addEventListener("pointerleave",p,s))};o.addEventListener("pointerenter",y,s),o.addEventListener("pointerdown",d,s)}),r}const As=(t,e)=>e?t===e?!0:As(t,e.parentElement):!1,Ma=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ca=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ea(t){return Ca.has(t.tagName)||t.isContentEditable===!0}const Kt=new WeakSet;function Dn(t){return e=>{e.key==="Enter"&&t(e)}}function ce(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Da=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=Dn(()=>{if(Kt.has(n))return;ce(n,"down");const s=Dn(()=>{ce(n,"up")}),r=()=>ce(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function Rn(t){return Ma(t)&&!0}const Ln=new WeakSet;function Ra(t,e,n={}){const[i,s,r]=Ps(t,n),o=a=>{const l=a.currentTarget;if(!Rn(a)||Ln.has(a))return;Kt.add(l),n.stopPropagation&&Ln.add(a);const u=e(l,a),c={...s,capture:!0},h=(p,y)=>{window.removeEventListener("pointerup",f,c),window.removeEventListener("pointercancel",d,c),Kt.has(l)&&Kt.delete(l),Rn(p)&&typeof u=="function"&&u(p,{success:y})},f=p=>{h(p,l===window||l===document||n.useGlobalTarget||As(l,p.target))},d=p=>{h(p,!1)};window.addEventListener("pointerup",f,c),window.addEventListener("pointercancel",d,c)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),wa(a)&&(a.addEventListener("focus",u=>Da(u,s)),!Ea(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Vs(t){return Ci(t)&&"ownerSVGElement"in t}function La(t){return Vs(t)&&t.tagName==="svg"}const ka=[...xs,L,Y],Ba=t=>ka.find(vs(t)),kn=()=>({translate:0,scale:1,origin:0,originPoint:0}),gt=()=>({x:kn(),y:kn()}),Bn=()=>({min:0,max:0}),k=()=>({x:Bn(),y:Bn()}),Fa=new WeakMap;function an(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ee(t){return typeof t=="string"||Array.isArray(t)}const Oa=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ja=["initial",...Oa];function Ms(t){return an(t.animate)||ja.some(e=>ee(t[e]))}function Ia(t){return!!(Ms(t)||t.variants)}function Na(t,e,n){for(const i in e){const s=e[i],r=n[i];if(j(s))t.addValue(i,s);else if(j(r))t.addValue(i,ft(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const o=t.getValue(i);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(i);t.addValue(i,ft(o!==void 0?o:s,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const Oe={current:null},Cs={current:!1},Ua=typeof window<"u";function $a(){if(Cs.current=!0,!!Ua)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Oe.current=t.matches;t.addEventListener("change",e),e()}else Oe.current=!1}const Fn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let On={};class Ka{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:s,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=en,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=I.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,A.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Ms(n),this.isVariantNode=Ia(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 p=f[d];u[d]!==void 0&&j(p)&&p.set(u[d])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,Fa.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Cs.current||$a(),this.shouldReduceMotion=Oe.current),process.env.NODE_ENV!=="production"&&Li(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),et(this.notifyUpdate),et(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&us.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:c}=n.accelerate,h=new ls({element:this.current,name:e,keyframes:a,times:l,ease:u,duration:U(c)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const i=wt.has(e);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&A.preRender(this.notifyUpdate),i&&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,()=>{s(),r&&r()})}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 On){const n=On[e];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(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):k()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<Fn.length;i++){const s=Fn[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const r="on"+s,o=e[r];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Na(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 i=this.values.get(e);n!==i&&(i&&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 i=this.values.get(e);return i===void 0&&n!==void 0&&(i=ft(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){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"&&(Mi(i)||Ei(i))?i=parseFloat(i):!Ba(i)&&Y.test(n)&&(i=bs(e,n)),this.setBaseTarget(e,j(i)?i.get():i)),j(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const r=ps(this.props,n,this.presenceContext?.custom);r&&(i=r[e])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!j(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new _e),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Ss.render(this.render)}}class Es extends Ka{constructor(){super(...arguments),this.KeyframeResolver=ba}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const i=e.style;return i?i[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;j(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Ds({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Wa({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Ga(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function ue(t){return t===void 0||t===1}function je({scale:t,scaleX:e,scaleY:n}){return!ue(t)||!ue(e)||!ue(n)}function at(t){return je(t)||Rs(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Rs(t){return jn(t.x)||jn(t.y)}function jn(t){return t&&t!=="0%"}function Zt(t,e,n){const i=t-n,s=e*i;return n+s}function In(t,e,n,i,s){return s!==void 0&&(t=Zt(t,s,i)),Zt(t,n,i)+e}function Ie(t,e=0,n=1,i,s){t.min=In(t.min,e,n,i,s),t.max=In(t.max,e,n,i,s)}function Ls(t,{x:e,y:n}){Ie(t.x,e.translate,e.scale,e.originPoint),Ie(t.y,n.translate,n.scale,n.originPoint)}const Nn=.999999999999,Un=1.0000000000001;function _a(t,e,n,i=!1){const s=n.length;if(!s)return;e.x=e.y=1;let r,o;for(let a=0;a<s;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(i&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(X(t.x,-r.scroll.offset.x),X(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Ls(t,o)),i&&at(r.latestValues)&&Wt(t,r.latestValues,r.layout?.layoutBox))}e.x<Un&&e.x>Nn&&(e.x=1),e.y<Un&&e.y>Nn&&(e.y=1)}function X(t,e){t.min+=e,t.max+=e}function $n(t,e,n,i,s=.5){const r=V(t.min,t.max,s);Ie(t,e,n,r,i)}function Kn(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Wt(t,e,n){const i=n??t;$n(t.x,Kn(e.x,i.x),e.scaleX,e.scale,e.originX),$n(t.y,Kn(e.y,i.y),e.scaleY,e.scale,e.originY)}function ks(t,e){return Ds(Ga(t.getBoundingClientRect(),e))}function Ha(t,e,n){const i=ks(t,n),{scroll:s}=e;return s&&(X(i.x,s.offset.x),X(i.y,s.offset.y)),i}const za={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ya=bt.length;function Xa(t,e,n){let i="",s=!0;for(let o=0;o<Ya;o++){const a=bt[o],l=t[a];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(a.startsWith("scale")?1:0);else{const c=parseFloat(l);u=a.startsWith("scale")?c===1:c===0}if(!u||n){const c=Fe(l,qt[a]);if(!u){s=!1;const h=za[a]||a;i+=`${h}(${c}) `}n&&(e[a]=c)}}const r=t.pathRotation;return r&&(s=!1,i+=`rotate(${Fe(r,qt.pathRotation)}) `),i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function ln(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(wt.has(l)){o=!0;continue}else if(Ye(l)){s[l]=u;continue}else{const c=Fe(u,qt[l]);l.startsWith("origin")?(a=!0,r[l]=c):i[l]=c}}if(e.transform||(o||n?i.transform=Xa(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;i.transformOrigin=`${l} ${u} ${c}`}}function Bs(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];s?.applyProjectionStyles(r,i);for(o in n)r.setProperty(o,n[o])}function Wn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const q={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(v.test(t))t=parseFloat(t);else return t;const n=Wn(t,e.target.x),i=Wn(t,e.target.y);return`${n}% ${i}%`}},Fs={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Y.parse(t);if(s.length>5)return i;const r=Y.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=V(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),r(s)}},Rt={borderRadius:{...q,applyTo:[...rn]},borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomLeftRadius:q,borderBottomRightRadius:q,boxShadow:Fs};function Os(t){for(const e in t)Rt[e]=t[e],Ye(e)&&(Rt[e].isCSSVariable=!0)}function qa(t,{layout:e,layoutId:n}){return wt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Rt[t]||t==="opacity")}function js(t,e,n){const i=t.style,s=e?.style,r={};if(!i)return r;for(const o in i)(j(i[o])||s&&j(s[o])||qa(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=i[o]);return r}function Za(t){return window.getComputedStyle(t)}class Ja extends Es{constructor(){super(...arguments),this.type="html",this.renderInstance=Bs}readValueFromInstance(e,n){if(wt.has(n))return this.projection?.isProjecting?Pe(n):Tr(e,n);{const i=Za(e),s=(Ye(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:n}){return ks(e,n)}build(e,n,i){ln(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return js(e,n,i)}}const Qa={offset:"stroke-dashoffset",array:"stroke-dasharray"},tl={offset:"strokeDashoffset",array:"strokeDasharray"};function el(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Qa:tl;t[r.offset]=`${-i}`,t[r.array]=`${e} ${n}`}const nl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Is(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(ln(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 nl)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),i!==void 0&&(h.scale=i),s!==void 0&&el(h,s,r,o,!1)}const cn=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"]),Ns=t=>typeof t=="string"&&t.toLowerCase()==="svg";function il(t,e,n,i){Bs(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(cn.has(s)?s:on(s),e.attrs[s])}function sl(t,e,n){const i=js(t,e,n);for(const s in t)if(j(t[s])||j(e[s])){const r=bt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[r]=t[s]}return i}class ol extends Es{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(wt.has(n)){const i=Ts(n);return i&&i.default||0}return n=cn.has(n)?n:on(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return sl(e,n,i)}build(e,n,i){Is(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,s){il(e,n,i,s)}mount(e){this.isSVGTag=Ns(e.tagName),super.mount(e)}}function Ne(t,e){t.min=e.min,t.max=e.max}function z(t,e){Ne(t.x,e.x),Ne(t.y,e.y)}function Gn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Us=1e-4,rl=1-Us,al=1+Us,$s=.01,ll=0-$s,cl=0+$s;function N(t){return t.max-t.min}function ul(t,e,n){return Math.abs(t-e)<=n}function _n(t,e,n,i=.5){t.origin=i,t.originPoint=V(e.min,e.max,t.origin),t.scale=N(n)/N(e),t.translate=V(n.min,n.max,t.origin)-t.originPoint,(t.scale>=rl&&t.scale<=al||isNaN(t.scale))&&(t.scale=1),(t.translate>=ll&&t.translate<=cl||isNaN(t.translate))&&(t.translate=0)}function Mt(t,e,n,i){_n(t.x,e.x,n.x,i?i.originX:void 0),_n(t.y,e.y,n.y,i?i.originY:void 0)}function Hn(t,e,n,i=0){const s=i?V(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+N(e)}function hl(t,e,n,i){Hn(t.x,e.x,n.x,i?.x),Hn(t.y,e.y,n.y,i?.y)}function zn(t,e,n,i=0){const s=i?V(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+N(e)}function Jt(t,e,n,i){zn(t.x,e.x,n.x,i?.x),zn(t.y,e.y,n.y,i?.y)}function Yn(t,e,n,i,s){return t-=e,t=Zt(t,1/n,i),s!==void 0&&(t=Zt(t,1/s,i)),t}function fl(t,e=0,n=1,i=.5,s,r=t,o=t){if(Z.test(e)&&(e=parseFloat(e),e=V(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=V(r.min,r.max,i);t===r&&(a-=e),t.min=Yn(t.min,e,n,a,s),t.max=Yn(t.max,e,n,a,s)}function Xn(t,e,[n,i,s],r,o){fl(t,e[n],e[i],e[s],e.scale,r,o)}const dl=["x","scaleX","originX"],pl=["y","scaleY","originY"];function qn(t,e,n,i){Xn(t.x,e,dl,n?n.x:void 0,i?i.x:void 0),Xn(t.y,e,pl,n?n.y:void 0,i?i.y:void 0)}function Zn(t){return t.translate===0&&t.scale===1}function Ks(t){return Zn(t.x)&&Zn(t.y)}function Jn(t,e){return t.min===e.min&&t.max===e.max}function ml(t,e){return Jn(t.x,e.x)&&Jn(t.y,e.y)}function Qn(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ws(t,e){return Qn(t.x,e.x)&&Qn(t.y,e.y)}function ti(t){return N(t.x)/N(t.y)}function ei(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function K(t){return[t("x"),t("y")]}function yl(t,e,n){let i="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((s||r||o)&&(i=`translate3d(${s}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,pathRotation:h,rotateX:f,rotateY:d,skewX:p,skewY:y}=n;u&&(i=`perspective(${u}px) ${i}`),c&&(i+=`rotate(${c}deg) `),h&&(i+=`rotate(${h}deg) `),f&&(i+=`rotateX(${f}deg) `),d&&(i+=`rotateY(${d}deg) `),p&&(i+=`skewX(${p}deg) `),y&&(i+=`skewY(${y}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 gl=rn.length,ni=t=>typeof t=="string"?parseFloat(t):t,ii=t=>typeof t=="number"||v.test(t);function vl(t,e,n,i,s,r){s?(t.opacity=V(0,n.opacity??1,xl(i)),t.opacityExit=V(e.opacity??1,0,Tl(i))):r&&(t.opacity=V(e.opacity??1,n.opacity??1,i));for(let o=0;o<gl;o++){const a=rn[o];let l=si(e,a),u=si(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||ii(l)===ii(u)?(t[a]=Math.max(V(ni(l),ni(u),i),0),(Z.test(u)||Z.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=V(e.rotate||0,n.rotate||0,i))}function si(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const xl=Gs(0,.5,Ni),Tl=Gs(.5,.95,G);function Gs(t,e,n){return i=>i<t?0:i>e?1:n(Et(t,e,i))}function bl(t,e,n){const i=j(t)?t:ft(t);return i.start(sn("",i,e,n)),i.animation}function wl(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Sl=(t,e)=>t.depth-e.depth;class Pl{constructor(){this.children=[],this.isDirty=!1}add(e){Ge(this.children,e),this.isDirty=!0}remove(e){_t(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Sl),this.isDirty=!1,this.children.forEach(e)}}function Al(t,e){const n=I.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(et(i),t(r-e))};return A.setup(i,!0),()=>et(i)}function he(t){return j(t)?t.get():t}class Vl{constructor(){this.members=[]}add(e){Ge(this.members,e);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===e||i===this.lead||i===this.prevLead)continue;const s=i.instance;(!s||s.isConnected===!1)&&!i.snapshot&&(_t(this.members,i),i.unmount())}e.scheduleRender()}remove(e){if(_t(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){for(let n=this.members.indexOf(e)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.updateSnapshot(),e.scheduleRender();const{layoutDependency:s}=i.options,{layoutDependency:r}=e.options;(s===void 0||s!==r)&&(e.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Gt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},fe=["","X","Y","Z"],Ml=1e3;let Cl=0;function de(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function _s(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ys(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",A,!(s||r))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&_s(i)}function Hs({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(o={},a=e?.()){this.id=Cl++,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(Rl),this.nodes.forEach(jl),this.nodes.forEach(Il),this.nodes.forEach(Ll)},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 Pl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new _e),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=Vs(o)&&!La(o),this.instance=o;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),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;A.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=Al(f,250),Gt.hasAnimatedSinceResize&&(Gt.hasAnimatedSinceResize=!1,this.nodes.forEach(ai)))})}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 p=this.options.transition||u.getDefaultTransition()||Wl,{onLayoutAnimationStart:y,onLayoutAnimationComplete:m}=u.getProps(),g=!this.targetLayout||!Ws(this.targetLayout,d),T=!h&&f;if(this.options.layoutRoot||this.resumeFrom||T||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...nn(p,"layout"),onPlay:y,onComplete:m};(u.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(c,T,x.path)}else h||ai(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(),et(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(Nl),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&&_s(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,(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 u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(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(Bl),this.nodes.forEach(oi);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ri);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Fl),this.nodes.forEach(Ol),this.nodes.forEach(El),this.nodes.forEach(Dl)):this.nodes.forEach(ri),this.clearAllSnapshots();const a=I.now();F.delta=J(0,1e3/60,a-F.timestamp),F.timestamp=a,F.isProcessing=!0,ie.update.process(F),ie.preRender.process(F),ie.render.process(F),F.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ss.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(kl),this.sharedNodes.forEach(Ul)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,A.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){A.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=k()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,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=i(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(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Ks(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||at(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Gl(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return k();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(_l))){const{scroll:u}=this.root;u&&(X(a.x,u.offset.x),X(a.y,u.offset.y))}return a}removeElementScroll(o){const a=k();if(z(a,o),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&&z(a,o),X(a.x,c.offset.x),X(a.y,c.offset.y))}return a}applyTransform(o,a=!1,l){const u=l||k();z(u,o);for(let c=0;c<this.path.length;c++){const h=this.path[c];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(X(u.x,-h.scroll.offset.x),X(u.y,-h.scroll.offset.y)),at(h.latestValues)&&Wt(u,h.latestValues,h.layout?.layoutBox)}return at(this.latestValues)&&Wt(u,this.latestValues,this.layout?.layoutBox),u}removeTransform(o){const a=k();z(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!at(u.latestValues))continue;let c;u.instance&&(je(u.latestValues)&&u.updateSnapshot(),c=k(),z(c,u.measurePageBox())),qn(a,u.latestValues,u.snapshot?.layoutBox,c)}return at(this.latestValues)&&qn(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){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||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||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=k(),this.targetWithTransforms=k()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hl(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):z(this.target,this.layout.layoutBox),Ls(this.target,this.targetDelta)):z(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||je(this.parent.latestValues)||Rs(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=k(),this.relativeTargetOrigin=k(),Jt(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),z(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===F.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;z(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;_a(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=k());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gn(this.prevProjectionDelta.x,this.projectionDelta.x),Gn(this.prevProjectionDelta.y,this.projectionDelta.y)),Mt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!ei(this.projectionDelta.x,this.prevProjectionDelta.x)||!ei(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){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=gt(),this.projectionDelta=gt(),this.projectionDeltaWithTransform=gt()}setAnimationOrigin(o,a=!1,l){const u=this.snapshot,c=u?u.latestValues:{},h={...this.latestValues},f=gt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=k(),p=u?u.source:void 0,y=this.layout?this.layout.source:void 0,m=p!==y,g=this.getStack(),T=!g||g.members.length<=1,x=!!(m&&!T&&this.options.crossfade===!0&&!this.path.some(Kl));this.animationProgress=0;let S;const P=l?.interpolateProjection(o);this.mixTargetDelta=E=>{const M=E/1e3,w=P?.(M);w?(f.x.translate=w.x,f.x.scale=V(o.x.scale,1,M),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=w.y,f.y.scale=V(o.y.scale,1,M),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(li(f.x,o.x,M),li(f.y,o.y,M)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Jt(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),$l(this.relativeTarget,this.relativeTargetOrigin,d,M),S&&ml(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=k()),z(S,this.relativeTarget)),m&&(this.animationValues=h,vl(h,c,this.latestValues,M,x,T)),w&&w.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=w.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=A.update(()=>{Gt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ft(0)),this.motionValue.jump(0,!1),this.currentAnimation=bl(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},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(Ml),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&zs(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||k();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}z(a,l),Wt(a,c),Mt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Vl),this.sharedNodes.get(o).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 o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.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 u=this.getStack();u&&u.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 u={};l.z&&de("z",o,u,this.animationValues);for(let c=0;c<fe.length;c++)de(`rotate${fe[c]}`,o,u,this.animationValues),de(`skew${fe[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);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=he(a?.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=he(a?.pointerEvents)||""),this.hasProjected&&!at(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=yl(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in Rt){if(c[p]===void 0)continue;const{correct:y,applyTo:m,isCSSVariable:g}=Rt[p],T=h==="none"?c[p]:y(c[p],u);if(m){const x=m.length;for(let S=0;S<x;S++)o[m[S]]=T}else g?this.options.visualElement.renderState.vars[p]=T:o[p]=T}this.options.layoutId&&(o.pointerEvents=u===this?he(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(oi),this.root.sharedNodes.clear()}}}function El(t){t.updateLayout()}function Dl(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,r=e.source!==t.layout.source;if(s==="size")K(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],f=N(h);h.min=n[c].min,h.max=h.min+f});else if(s==="x"||s==="y"){const c=s==="x"?"y":"x";Ne(r?e.measuredBox[c]:e.layoutBox[c],n[c])}else zs(s,e.layoutBox,n)&&K(c=>{const h=r?e.measuredBox[c]:e.layoutBox[c],f=N(n[c]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+f)});const o=gt();Mt(o,n,e.layoutBox);const a=gt();r?Mt(a,t.applyTransform(i,!0),e.measuredBox):Mt(a,n,e.layoutBox);const l=!Ks(o);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=t.options.layoutAnchor||void 0,p=k();Jt(p,e.layoutBox,h.layoutBox,d);const y=k();Jt(y,n,f.layoutBox,d),Ws(p,y)||(u=!0),c.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=p,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Rl(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 Ll(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function kl(t){t.clearSnapshot()}function oi(t){t.clearMeasurements()}function Bl(t){t.isLayoutDirty=!0,t.updateLayout()}function ri(t){t.isLayoutDirty=!1}function Fl(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function Ol(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ai(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function jl(t){t.resolveTargetDelta()}function Il(t){t.calcProjection()}function Nl(t){t.resetSkewAndRotation()}function Ul(t){t.removeLeadSnapshot()}function li(t,e,n){t.translate=V(e.translate,0,n),t.scale=V(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ci(t,e,n,i){t.min=V(e.min,n.min,i),t.max=V(e.max,n.max,i)}function $l(t,e,n,i){ci(t.x,e.x,n.x,i),ci(t.y,e.y,n.y,i)}function Kl(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Wl={duration:.45,ease:[.4,0,.1,1]},ui=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),hi=ui("applewebkit/")&&!ui("chrome/")?Math.round:G;function fi(t){t.min=hi(t.min),t.max=hi(t.max)}function Gl(t){fi(t.x),fi(t.y)}function zs(t,e,n){return t==="position"||t==="preserve-aspect"&&!ul(ti(e),ti(n),.2)}function _l(t){return t!==t.root&&t.scroll?.wasRoot}const Hl=Hs({attachResizeListener:(t,e)=>wl(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),pe={current:void 0},zl=Hs({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pe.current){const t=new Hl({});t.mount(window),t.setOptions({layoutScroll:!0}),pe.current=t}return pe.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Yl={some:0,all:1};function Ys(t,e,{root:n,margin:i,amount:s="some"}={}){const r=ws(t),o=new WeakMap,a=u=>{u.forEach(c=>{const h=o.get(c.target);if(c.isIntersecting!==!!h)if(c.isIntersecting){const f=e(c.target,c);typeof f=="function"?o.set(c.target,f):l.unobserve(c.target)}else typeof h=="function"&&(h(c),o.delete(c.target))})},l=new IntersectionObserver(a,{root:n,rootMargin:i,threshold:typeof s=="number"?s:Yl[s]});return r.forEach(u=>l.observe(u)),()=>l.disconnect()}const di=(t,e)=>Math.abs(t-e);function Xl(t,e){const n=di(t.x,e.x),i=di(t.y,e.y);return Math.sqrt(n**2+i**2)}function Xs({current:t}){return t?t.ownerDocument.defaultView:null}function Ue(t){if(t)return t.nodeType===3||t.nodeType===8?Ue(t.nextSibling):t}const[ql,Zl]=kt("Motion"),[Jl]=kt("LayoutGroup"),Ql={reducedMotion:"never",transition:void 0,nonce:void 0},[tc]=kt("MotionConfig");function qs(){return tc(B.computed(()=>Ql))}var Zs=function(){},ne=function(){};process.env.NODE_ENV!=="production"&&(Zs=function(t,e){!t&&typeof console<"u"&&console.warn(e)},ne=function(t,e){if(!t)throw new Error(e)});const Js={motionAttribute:"data-ap"},$e=[];function Qs(t){for(const e of t)e&&!$e.includes(e)&&$e.push(e)}function to(t,e,n){if(Array.isArray(t))return t.reduce((i,s)=>{const r=to(s,e,n);return r?{...i,...r}:i},{});if(typeof t=="object")return t;if(t&&e){const i=e[t];return typeof i=="function"?i(n):i}}function ec(t,e,n){const i=to(t,e,n);if(!i)return;const{transition:s,transitionEnd:r,...o}=i;return{...o,...r}}function nc(t,e){const n=(t.initial===void 0&&t.variants?e?.initial:t.initial)===!1?["initial","animate"]:["initial"],i=t.custom??t.presenceContext?.custom;return n.reduce((s,r)=>({...s,...ec(t[r]||e?.[r],t.variants,i)}),{})}function eo(t,e){const n=e?.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}var ic=new Set(["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]);function no(t){return ic.has(t)}const Ke=new WeakMap;var sc=class{constructor(t,e){this.element=null,this.isExiting=!1,this.presenceContainer=null,this.children=new Set,this.features=new Map,this._context=null,this.options=t,this.parent=e,e?.children?.add(this),this.latestValues=nc(t,this.context),this.type=no(this.options.as)?"svg":"html"}get context(){return this._context||(this._context=new Proxy({},{get:(t,e)=>{const n=this.options[e];return ee(n)||e==="initial"&&n===!1?n:this.parent?.context[e]}})),this._context}updateFeatures(){if(this.visualElement)for(const t of $e){this.features.has(t.key)||this.features.set(t.key,new t(this));const e=this.features.get(t.key);this.isMounted()&&(e.isMount?e.update():(e.mount(),e.isMount=!0))}}updateOptions(t){this.options=t,this.visualElement?.update({...this.options,whileTap:this.options.whilePress},this.options.presenceContext??null)}mount(t){ne(!!t,"Animation state must be mounted with valid Element"),Ke.set(t,this),this.element=t;const e=this.options.presenceContext?.presenceId;e!==void 0&&t.setAttribute(Js.motionAttribute,e),this.visualElement?.mount(t),this.updateFeatures()}beforeUnmount(){this.getSnapshot(this.options,!1)}unmount(){this.parent?.children?.delete(this),Ke.delete(this.element),this.features.forEach(t=>t.unmount?.()),this.visualElement?.unmount()}beforeUpdate(){this.getSnapshot(this.options,void 0)}update(){this.updateFeatures(),this.didUpdate()}tryExitComplete(){this.isExiting||this.options?.layoutId&&this.visualElement.projection?.currentAnimation?.state==="running"||this.options.presenceContext?.onMotionExitComplete?.(this.presenceContainer,this)}setActive(t,e){t==="exit"&&e&&(this.isExiting=!0),this.visualElement?.animationState?.setActive(t,e).then(()=>{t==="exit"&&e&&(this.isExiting=!1,this.options?.layoutId?A.postRender(()=>this.tryExitComplete()):this.tryExitComplete())})}isMounted(){return!!this.element}initVisualElement(t){this.visualElement||(this.visualElement=t(this.options.as,{presenceContext:this.options.presenceContext??null,parent:this.parent?.visualElement,props:{...this.options,whileTap:this.options.whilePress},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{...this.latestValues}},reducedMotionConfig:this.options.motionConfig?.reducedMotion}),this.visualElement.parent?.addChild(this.visualElement),this.isMounted()&&this.visualElement.mount(this.element))}getSnapshot(t,e){}didUpdate(){}},nt=class{constructor(t){this.state=t}mount(){}unmount(){}update(){}};const io=["initial","animate","exit","whileHover","whileDrag","whileFocus","whilePress"];var oc=io.length;function so(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?so(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<oc;n++){const i=io[n],s=t.props[i];(ee(s)||s===!1)&&(e[i]=s)}return e}var oo=["animate","whileInView","whileFocus","whileHover","whilePress","whileDrag","exit"],rc=[...oo].reverse(),ac=oo.length;function rt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pi(){return{animate:rt(!0),whileInView:rt(),whileHover:rt(),whilePress:rt(),whileDrag:rt(),whileFocus:rt(),exit:rt()}}function lc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!eo(e,t):!1}function mi(t){return Array.isArray(t)}function cc(t){return e=>Promise.all(e.map(({animation:n,options:i})=>ua(t,n,i)))}function uc(t){let e=cc(t),n=pi(),i=!0;const s=l=>(u,c)=>{const h=vt(t,c,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...p}=h;u={...u,...p,...d}}return u};function r(l){e=l(t)}function o(l){const{props:u}=t,c=so(t.parent)||{},h=[],f=new Set;let d={},p=1/0;for(let m=0;m<ac;m++){const g=rc[m],T=n[g],x=u[g]!==void 0?u[g]:c[g],S=ee(x),P=g===l?T.isActive:null;P===!1&&(p=m);let E=x===c[g]&&x!==u[g]&&S;if(E&&i&&t.manuallyAnimateOnMount&&(E=!1),T.protectedKeys={...d},!T.isActive&&P===null||!x&&!T.prevProp||an(x)||typeof x=="boolean")continue;const M=lc(T.prevProp,x);let w=M||g===l&&T.isActive&&!E&&S||m>p&&S,O=!1;const b=Array.isArray(x)?x:[x];let D=b.reduce(s(g),{});P===!1&&(D={});const{prevResolvedValues:_={}}=T,dt={..._,...D},H=C=>{w=!0,f.has(C)&&(O=!0,f.delete(C)),T.needsAnimating[C]=!0;const $=t.getValue(C);$&&($.liveStyle=!1)};for(const C in dt){const $=D[C],ot=_[C];if(Object.hasOwnProperty.call(d,C))continue;let pt=!1;mi($)&&mi(ot)?pt=!eo($,ot):pt=$!==ot,pt?$!=null?H(C):f.add(C):$!==void 0&&f.has(C)?H(C):T.protectedKeys[C]=!0}T.prevProp=x,T.prevResolvedValues=D,T.isActive&&(d={...d,...D}),i&&t.blockInitialAnimation&&(w=!1);const Q=E&&M;w&&(!Q||O)&&h.push(...b.map(C=>{const $={type:g};if(typeof C=="string"&&i&&!Q&&t.manuallyAnimateOnMount&&t.parent){const{parent:ot}=t,pt=vt(ot,C);if(ot.enteringChildren&&pt){const{delayChildren:yo}=pt.transition||{};$.delay=hs(ot.enteringChildren,t,yo)}}return{animation:C,options:$}}))}if(f.size){const m={};if(typeof u.initial!="boolean"){const g=vt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(m.transition=g.transition)}f.forEach(g=>{const T=t.getBaseTarget(g),x=t.getValue(g);x&&(x.liveStyle=!0),m[g]=T??null}),h.push({animation:m})}let y=!!h.length;return i&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(y=!1),i=!1,y?e(h):Promise.resolve()}function a(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(h=>{h.animationState?.setActive(l,u)}),n[l].isActive=u;const c=o(l);for(const h in n)n[h].protectedKeys={};return c}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=pi(),i=!0}}}function ro(t){return t.style.display==="none"||t.offsetParent===null&&window.getComputedStyle(t).position!=="fixed"}var hc=class extends nt{static#t=this.key="animation";constructor(t){super(t);const e=t.visualElement;e.animationState||=uc(e)}updateAnimationControlsSubscription(){const{animate:t}=this.state.options;an(t)&&(this.unmountControls=t.subscribe(this.state.visualElement))}mount(){ro(this.state.element)?this.state.setActive("exit",!0):this.state.visualElement.animationState?.animateChanges(),this.updateAnimationControlsSubscription()}update(){this.state.visualElement.animationState?.animateChanges();const{animate:t}=this.state.visualElement.getProps(),{animate:e}=this.state.visualElement.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.state.visualElement.animationState.reset(),this.unmountControls?.()}};function fc(t,e){return no(t)?new ol(e):new Ja(e)}function yi(t){return{point:{x:t.pageX,y:t.pageY}}}var dc=class extends nt{static#t=this.key="press";constructor(t){super(t)}isActive(){const{whilePress:t,onPress:e,onPressCancel:n,onPressStart:i}=this.state.options;return!!(t||e||n||i)}register(){const t=this.state.element;!t||!this.isActive()||(this.removePress?.(),this.removePress=Ra(t,(e,n)=>{const i=this.state.options;return this.state.setActive("whilePress",!0),i.onPressStart&&A.postRender(()=>i.onPressStart(n,yi(n))),(s,{success:r})=>{this.state.setActive("whilePress",!1);const o=r?"onPress":"onPressCancel",a=this.state.options[o];a&&A.postRender(()=>a(s,yi(s)))}},{useGlobalTarget:this.state.options.globalPressTarget}))}mount(){this.register()}update(){const t=this.state.visualElement.prevProps;!(t?.whilePress||t?.whileTap||t?.onPress||t?.onPressCancel||t?.onPressStart)&&this.isActive()&&this.register()}unmount(){this.removePress?.(),this.removePress=void 0}};function ao(t){return t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1}function Lt(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}function pc(t){return e=>ao(e)&&t(e,Lt(e))}var mc=class extends nt{static#t=this.key="hover";constructor(t){super(t)}isActive(){const{whileHover:t,onHoverStart:e,onHoverEnd:n}=this.state.options;return!!(t||e||n)}register(){const t=this.state.element;!t||!this.isActive()||(this.removeHover?.(),this.removeHover=Va(t,(e,n)=>{const i=this.state.options;return this.state.setActive("whileHover",!0),i.onHoverStart&&A.postRender(()=>i.onHoverStart(n,Lt(n))),s=>{this.state.setActive("whileHover",!1);const r=this.state.options.onHoverEnd;r&&A.postRender(()=>r(s,Lt(s)))}}))}mount(){this.register()}update(){const t=this.state.visualElement.prevProps;!(t?.whileHover||t?.onHoverStart||t?.onHoverEnd)&&this.isActive()&&this.register()}unmount(){this.removeHover?.(),this.removeHover=void 0}},yc=class extends nt{static#t=this.key="inView";constructor(t){super(t)}isActive(){const{whileInView:t,onViewportEnter:e,onViewportLeave:n}=this.state.options;return!!(t||e||n)}startObserver(){const t=this.state.element;if(!t||!this.isActive())return;this.removeObserver?.();const{once:e,...n}=this.state.options.inViewOptions||{};this.removeObserver=Ys(t,(i,s)=>{const r=this.state.options;if(this.state.setActive("whileInView",!0),r.onViewportEnter&&A.postRender(()=>r.onViewportEnter(s)),!e)return()=>{this.state.setActive("whileInView",!1);const o=this.state.options.onViewportLeave;o&&A.postRender(()=>o(s))}},n)}mount(){this.startObserver()}update(){const{props:t,prevProps:e}=this.state.visualElement;["amount","margin","root"].some(n=>t.inViewOptions?.[n]!==e?.inViewOptions?.[n])&&this.startObserver()}unmount(){this.removeObserver?.(),this.removeObserver=void 0}};function Qt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}var gc=class extends nt{static#t=this.key="focus";constructor(t){super(t),this.isFocused=!1}onFocus(){let t=!1;try{t=this.state.element.matches(":focus-visible")}catch{t=!0}t&&(this.state.setActive("whileFocus",!0),this.isFocused=!0)}onBlur(){this.isFocused&&(this.state.setActive("whileFocus",!1),this.isFocused=!1)}mount(){const t=this.state.element;this.removeFocus=Ft(Qt(t,"focus",()=>this.onFocus()),Qt(t,"blur",()=>this.onBlur()))}unmount(){this.removeFocus?.(),this.removeFocus=void 0}};function lo(t){if(t)return t.options.allowProjection!==!1?t.projection:lo(t.parent)}const co={borderRadius:{...q,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomLeftRadius:q,borderBottomRightRadius:q,boxShadow:Fs};function At(t){return typeof t=="object"&&t!==null&&"nodeType"in t}const vc=typeof window>"u";var xc=class extends nt{static#t=this.key="projection";constructor(t){super(t),Os(co),vc||this.initProjection()}initProjection(){const t=this.state.options;this.state.visualElement.projection=new zl(this.state.visualElement.latestValues,t["data-framer-portal-id"]?void 0:lo(this.state.visualElement.parent)),this.projection=this.state.visualElement.projection,this.projection.isPresent=!0,this.setOptions()}setOptions(){const t=this.state.options,{layoutId:e,layout:n,drag:i=!1,dragConstraints:s=!1}=t;this.projection?.setOptions({layout:n,layoutId:e,alwaysMeasureLayout:!!e||!!i||s&&At(s),visualElement:this.state.visualElement,animationType:typeof t.layout=="string"?t.layout:"both",layoutRoot:t.layoutRoot,layoutScroll:t.layoutScroll,crossfade:t.crossfade,onExitComplete:()=>{!this.projection?.isPresent&&this.state.options.layoutId&&!this.state.isExiting&&queueMicrotask(()=>{this.state.options.presenceContext?.onMotionExitComplete?.(this.state.presenceContainer,this.state)})}})}update(){this.setOptions()}mount(){this.projection?.mount(this.state.element)}};function Ct(t,e,n,i){return Qt(t,e,pc(n),i)}var gi=new Set(["auto","scroll"]),uo=class{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=c=>{this.handleScroll(c.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=ye(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=Xl(c.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:d}=c,{timestamp:p}=F;this.history.push({...d,timestamp:p});const{onStart:y,onMove:m}=this.handlers;h||(y&&y(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,c)},this.handlePointerMove=(c,h)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=me(h,this.transformPagePoint),A.update(this.updatePoint,!0)},this.handlePointerUp=(c,h)=>{this.end();const{onEnd:f,onSessionEnd:d,resumeAnimation:p}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ye(c.type==="pointercancel"?this.lastMoveEventInfo:me(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(c,y),d&&d(c,y)},!ao(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=me(Lt(t),this.transformPagePoint),{point:a}=o,{timestamp:l}=F;this.history=[{...a,timestamp:l}];const{onSessionStart:u}=e;u&&u(t,ye(o,this.history)),this.removeListeners=Ft(Ct(this.contextWindow,"pointermove",this.handlePointerMove),Ct(this.contextWindow,"pointerup",this.handlePointerUp),Ct(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}isScrollable(t){const e=window.getComputedStyle(t);return e.overflow==="auto"||e.overflow==="scroll"||e.overflowX==="auto"||e.overflowX==="scroll"||e.overflowY==="auto"||e.overflowY==="scroll"}startScrollTracking(t){let e=t.parentElement;for(;e;){const n=getComputedStyle(e);(gi.has(n.overflowX)||gi.has(n.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-e.x,y:i.y-e.y};s.x===0&&s.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),A.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners?.(),this.scrollPositions.clear(),et(this.updatePoint)}};function me(t,e){return e?{point:e(t.point)}:t}function vi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ye({point:t},e){return{point:t,delta:vi(t,ho(e)),offset:vi(t,Tc(e)),velocity:bc(e,.1)}}function Tc(t){return t[0]}function ho(t){return t[t.length-1]}function bc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=ho(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>U(e)));)n--;if(!i)return{x:0,y:0};const r=W(s.timestamp-i.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-i.x)/r,y:(s.y-i.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function xi(t){return(e,n)=>{t&&A.postRender(()=>t(e,n))}}var wc=class extends nt{constructor(...t){super(...t),this.removePointerDownListener=G}static#t=this.key="pan";onPointerDown(t){this.session=new uo(t,this.createPanHandlers(),{transformPagePoint:this.state.visualElement.getTransformPagePoint(),contextWindow:Xs(this.state.visualElement)})}createPanHandlers(){return{onSessionStart:xi((t,e)=>{const{onPanSessionStart:n}=this.state.options;n&&n(t,e)}),onStart:xi((t,e)=>{const{onPanStart:n}=this.state.options;n&&n(t,e)}),onMove:(t,e)=>{const{onPan:n}=this.state.options;n&&n(t,e)},onEnd:(t,e)=>{const{onPanEnd:n}=this.state.options;delete this.session,n&&A.postRender(()=>n(t,e))}}}mount(){this.removePointerDownListener=Ct(this.state.element,"pointerdown",this.onPointerDown.bind(this))}update(){}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};function fo(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}var Ti=fo("dragHorizontal"),bi=fo("dragVertical");function Sc(t){let e=!1;if(t==="y")e=bi();else if(t==="x")e=Ti();else{const n=Ti(),i=bi();n&&i?e=()=>{n(),i()}:(n&&n(),i&&i())}return e}function Pc(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?V(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?V(n,t,i.max):Math.min(t,n)),t}const We=.35;function Ac(t,{top:e,left:n,bottom:i,right:s}){return{x:wi(t.x,n,s),y:wi(t.y,e,i)}}function wi(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 Vc(t=We){return t===!1?t=0:t===!0&&(t=We),{x:Si(t,"left","right"),y:Si(t,"top","bottom")}}function Si(t,e,n){return{min:Pi(t,e),max:Pi(t,n)}}function Pi(t,e){return typeof t=="number"?t:t[e]||0}function Mc(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}function Cc(t,e){return{x:Ai(t.x,e.x),y:Ai(t.y,e.y)}}function Ai(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function Ec(t,e){let n=.5;const i=N(t),s=N(e);return s>i?n=Et(e.min,e.max-i,t.min):i>s&&(n=Et(t.min,t.max-s,e.min)),J(0,1,n)}const Dc=new WeakMap;var Rc=class{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=k(),this.state=t}get visualElement(){return this.state.visualElement}start(t,{snapToCursor:e=!1}={}){const n=l=>{e?this.stopAnimation():this.pauseAnimation(),e&&this.snapToCursor(Lt(l,"page").point)},i=(l,u)=>{this.stopAnimation();const{drag:c,dragPropagation:h,onDragStart:f}=this.getProps();c&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Sc(c),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),K(d=>{let p=this.getAxisMotionValue(d).get()||0;if(Z.test(p)){const{projection:y}=this.visualElement;if(y&&y.layout){const m=y.layout.layoutBox[d];m&&(p=N(m)*(parseFloat(p)/100))}}this.originPoint[d]=p}),f&&A.postRender(()=>f(l,u)),Re(this.visualElement,"transform"),this.state.setActive("whileDrag",!0))},s=(l,u)=>{const{dragPropagation:c,dragDirectionLock:h,onDirectionLock:f,onDrag:d}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(h&&this.currentDirection===null){this.currentDirection=Lc(p),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),d&&d(l,u)},r=(l,u)=>this.stop(l,u),o=()=>K(l=>this.getAnimationState(l)==="paused"&&this.getAxisMotionValue(l).animation?.play()),{dragSnapToOrigin:a}=this.getProps();this.panSession=new uo(t,{onSessionStart:n,onStart:i,onMove:s,onSessionEnd:r,resumeAnimation:o},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:a,contextWindow:Xs(this.visualElement),element:this.state.element})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&A.postRender(()=>s(t,e))}cancel(){this.isDragging=!1;const{projection:t}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:e}=this.getProps();!e&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),this.state.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Ut(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=Pc(r,this.constraints[t],this.elastic[t])),s.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&At(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=Ac(n.layoutBox,t):this.constraints=!1,this.elastic=Vc(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&K(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=Mc(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!At(t))return!1;const n=t;ne(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Ha(n,i.root,this.visualElement.getTransformPagePoint());let r=Cc(i.layout.layoutBox,s);if(e){const o=e(Wa(r));this.hasMutatedConstraints=!!o,o&&(r=Ds(o))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{},l=K(u=>{if(!Ut(u,e,this.currentDirection))return;let c=a&&a[u]||{};r&&(c={min:0,max:0});const h=i?200:1e6,f=i?40:1e7,d={type:"inertia",velocity:n?t[u]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...c};return this.startAxisValueAnimation(u,d)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Re(this.visualElement,t),n.start(sn(t,n,0,e,this.visualElement,!1))}stopAnimation(){this.visualElement.projection?.isPresent&&K(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){K(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){K(e=>{const{drag:n}=this.getProps();if(!Ut(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:r,max:o}=i.layout.layoutBox[e];s.set(t[e]-V(r,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!At(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};K(r=>{const o=this.getAxisMotionValue(r);if(o&&this.constraints!==!1){const a=o.get();i[r]=Ec({min:a,max:a},this.constraints[r])}});const{transformTemplate:s}=this.visualElement.getProps();this.state.element.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),K(r=>{if(!Ut(r,t,null))return;const o=this.getAxisMotionValue(r),{min:a,max:l}=this.constraints[r];o.set(V(a,l,i[r]))})}addListeners(){if(!this.state.element)return;Dc.set(this.visualElement,this);const t=this.state.element,e=Ct(t,"pointerdown",a=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(a)}),n=()=>{const{dragConstraints:a}=this.getProps();At(a)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),A.read(n);const r=Qt(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",(({delta:a,hasLayoutChanged:l})=>{this.isDragging&&l&&(K(u=>{const c=this.getAxisMotionValue(u);c&&(this.originPoint[u]+=a[u].translate,c.set(c.get()+a[u].translate))}),this.visualElement.render())}));return()=>{r(),e(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:r=We,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:r,dragMomentum:o}}};function Ut(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Lc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}var kc=class extends nt{static#t=this.key="drag";constructor(t){super(t),this.removeGroupControls=G,this.removeListeners=G,this.controls=new Rc(t)}mount(){const{dragControls:t}=this.state.options;t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||G}unmount(){this.removeGroupControls(),this.removeListeners()}},St=!1,Bc=class extends nt{static#t=this.key="layout";constructor(t){super(t),this.hasMountSettled=!1,Os(co),t.getSnapshot=this.getSnapshot.bind(this),t.didUpdate=this.didUpdate.bind(this)}updatePrevLead(t){const e=t.getStack();e?.prevLead&&!e.prevLead.snapshot&&(e.prevLead.willUpdate(),St=!0)}didUpdate(){St&&(this.state.options.layout||this.state.options.layoutId||this.state.options.drag)&&(St=!1,this.state.visualElement.projection?.root?.didUpdate())}mount(){const t=this.state.options,e=this.state.options.layoutGroup;if(t.layout||t.layoutId){const n=this.state.visualElement.projection;if(t.layoutId){const i=!ro(this.state.element);n.isPresent=i,i?n.promote():n.relegate(),this.updatePrevLead(n)}e?.group?.add(n),Gt.hasEverUpdated=!0}this.didUpdate(),A.postRender(()=>{this.hasMountSettled=!0})}unmount(){const t=this.state.options.layoutGroup,e=this.state.visualElement.projection;e&&(t?.group&&(this.state.options.layout||this.state.options.layoutId)&&t.group.remove(e),this.state.options.layoutId&&(St=!0),this.didUpdate())}getSnapshot(t,e){const n=this.state.visualElement.projection,{drag:i,layoutDependency:s,layout:r,layoutId:o}=t;if(!n||!r&&!o&&!i||!this.hasMountSettled)return;St=!0;const a=this.state.options;(i||a.layoutDependency!==s||s===void 0||un.isDef(e)&&n.isPresent!==e)&&n.willUpdate(),un.isDef(e)&&e!==n.isPresent&&(n.isPresent=e,e?(n.promote(),this.updatePrevLead(n)):n.relegate())}};const Fc={renderer:fc,features:[hc,dc,mc,yc,gc,xc,wc,kc,Bc]},[Oc]=kt("LazyMotionContext"),[jc,Ic]=kt("AnimatePresenceContext");function Nc(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function po(){return{transform:{},transformOrigin:{},style:{},vars:{}}}function Uc(){return{...po(),attrs:{}}}function $c(t){const e=po();ln(e,t);const n={...e.style};for(const i in e.vars)n[i]=e.vars[i];return Object.keys(n).length===0?null:n}function Kc(t,e,n){const i=Uc();Is(i,t,Ns(e),void 0,n);const s={};for(const r in i.attrs){const o=cn.has(r)?r:Nc(r);s[o]=i.attrs[r]}return{attrs:s,style:{...i.style,...i.vars}}}function Wc(t,e){const n=ql(null),i=Jl({}),s=qs(),r=jc({}),o=Oc({features:B.ref({}),strict:!1});if(process.env.NODE_ENV!=="production"&&e&&o.strict){const d="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Zs(!1,d):ne(!1,d)}const a=B.useAttrs();function l(){return go(t,{layoutGroup:i,presenceContext:r,config:s.value})}function u(){return{...a,...l()}}const c=new sc(u(),n);Zl(c),e&&c.initVisualElement(e),B.watch(o.features,d=>{d.features?.length&&Qs(d.features),d.renderer&&c.initVisualElement(d.renderer),c.updateFeatures()},{immediate:!0,flush:"pre"});function h(){const d=c.type==="svg",p={...a};Object.keys(a).forEach(T=>{j(a[T])&&(p[T]=a[T].get())});const y=c.visualElement?.latestValues||c.latestValues;let m={...t.style,...d?{}:y};for(const T in m)j(m[T])&&(m[T]=m[T].get());if(d){const{attrs:T,style:x}=Kc({...y,...m},c.options.as,t.style);Object.assign(p,T),m=x}t.drag&&t.dragListener!==!1&&Object.assign(m,{userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",touchAction:t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`});const g=$c(m);return g&&(p.style=g),p}const f=B.getCurrentInstance().proxy;return B.onMounted(()=>{const d=Ue(f.$el);c.mount(d)}),B.onBeforeUnmount(()=>c.beforeUnmount()),B.onUnmounted(()=>{Ue(f.$el)?.isConnected||c.unmount()}),B.onBeforeUpdate(()=>{c.beforeUpdate(),c.updateOptions(u())}),B.onUpdated(()=>{c.update()}),{getProps:l,getAttrs:h,layoutGroup:i,state:c}}const Gc={ignoreStrict:{type:Boolean},forwardMotionProps:{type:Boolean,default:!1},asChild:{type:Boolean,default:!1},whileDrag:{type:[String,Array,Object]},whileHover:{type:[String,Array,Object]},whilePress:{type:[String,Array,Object]},whileInView:{type:[String,Array,Object]},whileFocus:{type:[String,Array,Object]},custom:{type:[String,Number,Object,Array]},initial:{type:[String,Array,Object,Boolean],default:void 0},animate:{type:[String,Array,Object],default:void 0},exit:{type:[String,Array,Object]},variants:{type:Object},inherit:{type:Boolean},style:{type:Object},transformTemplate:{type:Function},transition:{type:Object},onAnimationComplete:{type:Function},onUpdate:{type:Function},layout:{type:[Boolean,String],default:!1},layoutId:{type:String,default:void 0},layoutScroll:{type:Boolean,default:!1},layoutRoot:{type:Boolean,default:!1},"data-framer-portal-id":{type:String},crossfade:{type:Boolean,default:!0},layoutDependency:{type:null,default:void 0},onBeforeLayoutMeasure:{type:Function},onLayoutMeasure:{type:Function},onLayoutAnimationStart:{type:Function},onLayoutAnimationComplete:{type:Function},globalPressTarget:{type:Boolean},onPressStart:{type:Function},onPress:{type:Function},onPressCancel:{type:Function},onHoverStart:{type:Function},onHoverEnd:{type:Function},inViewOptions:{type:Object},onViewportEnter:{type:Function},onViewportLeave:{type:Function},drag:{type:[Boolean,String]},dragSnapToOrigin:{type:Boolean},dragDirectionLock:{type:Boolean},dragPropagation:{type:Boolean},dragConstraints:{type:[Boolean,Object]},dragElastic:{type:[Boolean,Number,Object],default:.5},dragMomentum:{type:Boolean,default:!0},dragTransition:{type:Object},dragListener:{type:Boolean,default:!0},dragControls:{type:Object},onDragStart:{type:Function},onDragEnd:{type:Function},onDrag:{type:Function},onDirectionLock:{type:Function},onDragTransitionEnd:{type:Function},onMeasureDragConstraints:{type:Function},onPanSessionStart:{type:Function},onPanStart:{type:Function},onPan:{type:Function},onPanEnd:{type:Function}};var _c=new Map,Hc=new Map;function zc(t){if(!Array.isArray(t))return[t];const e=[];for(const n of t)Array.isArray(n)?e.push(...n):e.push(n);return e}var Yc=["area","img","input"];function Xc(t,e,n){if(typeof t=="string"&&Yc.includes(t))return B.h(t,e);if(t==="template"){if(!n.default)return null;const i=zc(n.default()),s=i.findIndex(l=>l.type!==B.Comment);if(s===-1)return i;const r=i[s];delete r.props?.ref;const o=r.props?B.mergeProps(e,r.props):e;e.class&&r.props?.class&&delete r.props.class;const a=B.cloneVNode(r,o);for(const l in o)l.startsWith("on")&&(a.props||={},a.props[l]=o[l]);return i.length===1?a:(i[s]=a,i)}return null}function Vi(t,e={}){const n=typeof t=="string",i=n?t:t.name||"",s=e.renderer?_c:Hc;if(n&&s?.has(t))return s.get(t);const r=B.defineComponent({inheritAttrs:!1,props:{...Gc,as:{type:[String,Object],default:t||"div"}},name:i?`motion.${i}`:"Motion",setup(o,{slots:a}){const{getProps:l,getAttrs:u,state:c}=Wc(o,e.renderer);function h(){const f=c.element;if((typeof o.as!="object"||o.asChild)&&f){const{style:d}=u();if(d)for(const[p,y]of Object.entries(d))f.style[p]=y}}return()=>{const f=l(),d=u(),p=o.asChild?"template":o.as,y={...o.forwardMotionProps?f:{},...d,onVnodeUpdated:h},m=Xc(p,y,a);return m!==null?m:B.h(p,{...y},a)}}});return n&&s?.set(t,r),r}function qc(t){const e=t?.renderer;return Qs(t?.features||[]),new Proxy({},{get(n,i){return i==="create"?(s,r)=>Vi(s,{...r,renderer:e}):Vi(i,{renderer:e})}})}const mo=qc(Fc),Zc=mo.create("div");exports.Motion=Zc;exports.cancelFrame=et;exports.collectMotionValues=De;exports.frame=A;exports.inView=Ys;exports.interpolate=Qi;exports.motion=mo;exports.motionGlobalConfig=Js;exports.motionValue=ft;exports.mountedStates=Ke;exports.provideAnimatePresence=Ic;exports.useMotionConfig=qs;