framer-motion 12.40.0 → 12.41.0

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.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var i=n(e),o=React,s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(t,e,n){var i,o={},r=null,u=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,i)&&!c.hasOwnProperty(i)&&(o[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===o[i]&&(o[i]=e[i]);return{$$typeof:s,type:t,key:r,ref:u,props:o,_owner:l.current}}const h=r,d=u,p=u,m=e.createContext({});function f(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null);function x(t,e){-1===t.indexOf(e)&&t.push(e)}function w(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function T([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[o]=t.splice(e,1);t.splice(i,0,o)}return t}const b=(t,e,n)=>n>e?e:n<t?t:n;function S(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}t.warning=()=>{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(S(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(S(e,n))});const P={},E=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),A=t=>"object"==typeof t&&null!==t,M=t=>/^0[^.\s]+$/u.test(t);function V(t){let e;return()=>(void 0===e&&(e=t()),e)}const C=t=>t,k=(...t)=>t.reduce((t,e)=>n=>e(t(n))),R=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class D{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>w(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const L=t=>1e3*t,B=t=>t/1e3,j=(t,e)=>e?t*(1e3/e):0,I=new Set;const O=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},F=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function W(t,e,n,i){if(t===e&&n===i)return C;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=F(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:F(o(t),e,i)}const U=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,N=t=>e=>1-t(1-e),$=W(.33,1.53,.69,.99),z=N($),Y=U(z),H=t=>t>=1?1:(t*=2)<1?.5*z(t):.5*(2-Math.pow(2,-10*(t-1))),X=t=>1-Math.sin(Math.acos(t)),G=N(X),K=U(X),_=W(.42,0,1,1),q=W(0,0,.58,1),Z=W(.42,0,.58,1);const J=t=>Array.isArray(t)&&"number"!=typeof t[0];function Q(t,e){return J(t)?t[O(0,t.length,e)]:t}const tt=t=>Array.isArray(t)&&"number"==typeof t[0],et={linear:C,easeIn:_,easeInOut:Z,easeOut:q,circIn:X,circInOut:K,circOut:G,backIn:z,backInOut:Y,backOut:$,anticipate:H},nt=e=>{if(tt(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,o,s]=e;return W(n,i,o,s)}return"string"==typeof e?(t.invariant(void 0!==et[e],`Invalid easing type '${e}'`,"invalid-easing-type"),et[e]):e},it=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],ot={value:null,addProjectionMetrics:null};function st(t,e){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,r=it.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,o=!1,s=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,s=!1)=>{const a=s&&o?n:i;return e&&r.add(t),a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(a=t,o)return void(s=!0);o=!0;const r=n;n=i,i=r,n.forEach(c),e&&ot.value&&ot.value.frameloop[e].push(l),l=0,n.clear(),o=!1,s&&(s=!1,u.process(t))}};return u}(s,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:p,postRender:m}=r,f=()=>{const s=P.useManualTiming,r=s?o.timestamp:performance.now();n=!1,s||(o.delta=i?1e3/60:Math.max(Math.min(r-o.timestamp,40),1)),o.timestamp=r,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),h.process(o),d.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:it.reduce((e,s)=>{const a=r[s];return e[s]=(e,s=!1,r=!1)=>(n||(n=!0,i=!0,o.isProcessing||t(f)),a.schedule(e,s,r)),e},{}),cancel:t=>{for(let e=0;e<it.length;e++)r[it[e]].cancel(t)},state:o,steps:r}}const{schedule:rt,cancel:at,state:lt,steps:ct}=st("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:C,!0);let ut;function ht(){ut=void 0}const dt={now:()=>(void 0===ut&&dt.set(lt.isProcessing||P.useManualTiming?lt.timestamp:performance.now()),ut),set:t=>{ut=t,queueMicrotask(ht)}},pt={layout:0,mainThread:0,waapi:0},mt=t=>e=>"string"==typeof e&&e.startsWith(t),ft=mt("--"),gt=mt("var(--"),yt=t=>!!gt(t)&&vt.test(t.split("/*")[0].trim()),vt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function xt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const wt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Tt={...wt,transform:t=>b(0,1,t)},bt={...wt,default:1},St=t=>Math.round(1e5*t)/1e5,Pt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Et=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,At=(t,e)=>n=>Boolean("string"==typeof n&&Et.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Mt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[o,s,r,a]=i.match(Pt);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Vt={...wt,transform:t=>Math.round((t=>b(0,255,t))(t))},Ct={test:At("rgb","red"),parse:Mt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Vt.transform(t)+", "+Vt.transform(e)+", "+Vt.transform(n)+", "+St(Tt.transform(i))+")"};const kt={test:At("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:Ct.transform},Rt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Dt=Rt("deg"),Lt=Rt("%"),Bt=Rt("px"),jt=Rt("vh"),It=Rt("vw"),Ot=(()=>({...Lt,parse:t=>Lt.parse(t)/100,transform:t=>Lt.transform(100*t)}))(),Ft={test:At("hsl","hue"),parse:Mt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Lt.transform(St(e))+", "+Lt.transform(St(n))+", "+St(Tt.transform(i))+")"},Wt={test:t=>Ct.test(t)||kt.test(t)||Ft.test(t),parse:t=>Ct.test(t)?Ct.parse(t):Ft.test(t)?Ft.parse(t):kt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ct.transform(t):Ft.transform(t),getAnimatableNone:t=>{const e=Wt.parse(t);return e.alpha=0,Wt.transform(e)}},Ut=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Nt="number",$t="color",zt=/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 Yt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},o=[];let s=0;const r=e.replace(zt,t=>(Wt.test(t)?(i.color.push(s),o.push($t),n.push(Wt.parse(t))):t.startsWith("var(")?(i.var.push(s),o.push("var"),n.push(t)):(i.number.push(s),o.push(Nt),n.push(parseFloat(t))),++s,"${}")).split("${}");return{values:n,split:r,indexes:i,types:o}}function Ht({split:t,types:e}){const n=t.length;return i=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],void 0!==i[s]){const t=e[s];o+=t===Nt?St(i[s]):t===$t?Wt.transform(i[s]):i[s]}return o}}const Xt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Wt.test(n)?Wt.getAnimatableNone(n):n;var n};const Gt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Pt)?.length||0)+(t.match(Ut)?.length||0)>0},parse:function(t){return Yt(t).values},createTransformer:function(t){return Ht(Yt(t))},getAnimatableNone:function(t){const e=Yt(t);return Ht(e)(e.values.map((t,n)=>Xt(t,e.split[n])))}};function Kt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function _t({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=Kt(a,i,t+1/3),s=Kt(a,i,t),r=Kt(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}function qt(t,e){return n=>n>0?e:t}const Zt=(t,e,n)=>t+(e-t)*n,Jt=(t,e,n)=>{const i=t*t,o=n*(e*e-i)+i;return o<0?0:Math.sqrt(o)},Qt=[kt,Ct,Ft];function te(e){const n=(i=e,Qt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let o=n.parse(e);return n===Ft&&(o=_t(o)),o}const ee=(t,e)=>{const n=te(t),i=te(e);if(!n||!i)return qt(t,e);const o={...n};return t=>(o.red=Jt(n.red,i.red,t),o.green=Jt(n.green,i.green,t),o.blue=Jt(n.blue,i.blue,t),o.alpha=Zt(n.alpha,i.alpha,t),Ct.transform(o))},ne=new Set(["none","hidden"]);function ie(t,e){return ne.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function oe(t,e){return n=>Zt(t,e,n)}function se(t){return"number"==typeof t?oe:"string"==typeof t?yt(t)?qt:Wt.test(t)?ee:le:Array.isArray(t)?re:"object"==typeof t?Wt.test(t)?ee:ae:qt}function re(t,e){const n=[...t],i=n.length,o=t.map((t,n)=>se(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}}function ae(t,e){const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=se(t[o])(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const le=(e,n)=>{const i=Gt.createTransformer(n),o=Yt(e),s=Yt(n);return o.indexes.var.length===s.indexes.var.length&&o.indexes.color.length===s.indexes.color.length&&o.indexes.number.length>=s.indexes.number.length?ne.has(e)&&!s.values.length||ne.has(n)&&!o.values.length?ie(e,n):k(re(function(t,e){const n=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const s=e.types[o],r=t.indexes[s][i[s]],a=t.values[r]??0;n[o]=a,i[s]++}return n}(o,s),s.values),i):(t.warning(!0,`Complex values '${e}' and '${n}' 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"),qt(e,n))};function ce(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Zt(t,e,n);return se(t)(t,e)}const ue=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>rt.update(e,t),stop:()=>at(e),now:()=>lt.isProcessing?lt.timestamp:dt.now()}},he=(t,e,n=10)=>{let i="";const o=Math.max(Math.round(e/n),2);for(let e=0;e<o;e++)i+=Math.round(1e4*t(e/(o-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},de=2e4;function pe(t){let e=0;let n=t.next(e);for(;!n.done&&e<de;)e+=50,n=t.next(e);return e>=de?1/0:e}function me(t,e=100,n){const i=n({...t,keyframes:[0,e]}),o=Math.min(pe(i),de);return{type:"keyframes",ease:t=>i.next(o*t).value/e,duration:B(o)}}const fe=100,ge=10,ye=1,ve=0,xe=800,we=.3,Te=.3,be={granular:.01,default:2},Se={granular:.005,default:.5},Pe=.01,Ee=10,Ae=.05,Me=1;function Ve(t,e){return t*Math.sqrt(1-e*e)}const Ce=.001;const ke=["duration","bounce"],Re=["stiffness","damping","mass"];function De(t,e){return e.some(e=>void 0!==t[e])}function Le(e){let n={velocity:ve,stiffness:fe,damping:ge,mass:ye,isResolvedFromDuration:!1,...e};if(!De(e,Re)&&De(e,ke))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,i=2*Math.PI/(1.2*t),o=i*i,s=2*b(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:ye,stiffness:o,damping:s}}else{const i=function({duration:e=xe,bounce:n=we,velocity:i=ve,mass:o=ye}){let s,r;t.warning(e<=L(Ee),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=b(Ae,Me,a),e=b(Pe,Ee,B(e)),a<1?(s=t=>{const n=t*a,o=n*e,s=n-i,r=Ve(t,a),l=Math.exp(-o);return Ce-s/r*l},r=t=>{const n=t*a*e,o=n*i+i,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=Ve(Math.pow(t,2),a);return(-s(t)+Ce>0?-1:1)*((o-r)*l)/c}):(s=t=>Math.exp(-t*e)*((t-i)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(i-t)));const l=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/e);if(e=L(e),isNaN(l))return{stiffness:fe,damping:ge,duration:e};{const t=Math.pow(l,2)*o;return{stiffness:t,damping:2*a*Math.sqrt(o*t),duration:e}}}({...e,velocity:0});n={...n,...i,mass:ye},n.isResolvedFromDuration=!0}return n}function Be(t=Te,e=we){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:o}=n;const s=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=Le({...n,velocity:-B(n.velocity||0)}),m=d||0,f=c/(2*Math.sqrt(l*u)),g=r-s,y=B(Math.sqrt(l/u)),v=Math.abs(g)<5;let x,w,T,b,S,P;if(i||(i=v?be.granular:be.default),o||(o=v?Se.granular:Se.default),f<1)T=Ve(y,f),b=(m+f*y*g)/T,x=t=>{const e=Math.exp(-f*y*t);return r-e*(b*Math.sin(T*t)+g*Math.cos(T*t))},S=f*y*b+g*T,P=f*y*g-b*T,w=t=>Math.exp(-f*y*t)*(S*Math.sin(T*t)+P*Math.cos(T*t));else if(1===f){x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);const t=m+y*g;w=e=>Math.exp(-y*e)*(y*t*e-m)}else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(m+f*y*g)/t,n=f*y*e-g*t,i=f*y*g-e*t;w=e=>{const o=Math.exp(-f*y*e),s=Math.min(t*e,300);return o*(n*Math.sinh(s)+i*Math.cosh(s))}}const E={calculatedDuration:p&&h||null,velocity:t=>L(w(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*y*t),n=Math.sin(T*t),s=Math.cos(T*t),l=r-e*(b*n+g*s),c=L(e*(S*n+P*s));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=o,a.value=a.done?r:l,a}const e=x(t);if(p)a.done=t>=h;else{const n=L(w(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=o}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(pe(E),de),e=he(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}Be.applyToOptions=t=>{const e=me(t,100,Be);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};function je(t,e,n){const i=Math.max(e-5,0);return j(n-t(i),e-i)}function Ie({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let w,T;const b=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,T=Be({keyframes:[d.value,p(d.value)],velocity:je(v,t,d.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),b(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function Oe(e,n,{clamp:i=!0,ease:o,mixer:s}={}){const r=e.length;if(t.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const l=function(t,e,n){const i=[],o=n||P.mix||ce,s=t.length-1;for(let n=0;n<s;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||C:e;s=k(t,s)}i.push(s)}return i}(n,o,s),c=l.length,u=t=>{if(a&&t<e[0])return n[0];let i=0;if(c>1)for(;i<e.length-2&&!(t<e[i+1]);i++);const o=R(e[i],e[i+1],t);return l[i](o)};return i?t=>u(b(e[0],e[r-1],t)):u}function Fe(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=R(0,e,i);t.push(Zt(n,1,o))}}function We(t){const e=[0];return Fe(e,t.length-1),e}function Ue(t,e){return t.map(t=>t*e)}function Ne(t,e){return t.map(()=>e||Z).splice(0,t.length-1)}function $e({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const o=J(i)?i.map(nt):nt(i),s={done:!1,value:e[0]},r=Oe(Ue(n&&n.length===e.length?n:We(e),t),e,{ease:Array.isArray(o)?o:Ne(e,o)});return{calculatedDuration:t,next:e=>(s.value=r(e),s.done=e>=t,s)}}const ze=t=>null!==t;function Ye(t,{repeat:e,repeatType:n="loop"},i,o=1){const s=t.filter(ze),r=o<0||e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}const He={decay:Ie,inertia:Ie,tween:$e,keyframes:$e,spring:Be};function Xe(t){"string"==typeof t.type&&(t.type=He[t.type])}class Ge{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ke=t=>t/100;class _e extends Ge{constructor(t){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:t}=this.options;t&&t.updatedAt!==dt.now()&&this.tick(dt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},pt.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Xe(t);const{type:e=$e,repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=t;let{keyframes:r}=t;const a=e||$e;a!==$e&&"number"!=typeof r[0]&&(this.mixKeyframes=k(Ke,ce(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===o&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-s})),null===l.calculatedDuration&&(l.calculatedDuration=pe(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,x=this.currentTime,w=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(w=s)),x=b(0,1,n)*r}y?(this.delayState.value=c[0],v=this.delayState):v=w.next(x),o&&!y&&(v.value=o(v.value));let{done:T}=v;y||null===a||(T=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return S&&p!==Ie&&(v.value=Ye(c,this.options,f,this.speed)),m&&m(v.value),S&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return B(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(this.currentTime)}set time(t){t=L(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return je(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(dt.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=B(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ue,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(dt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&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,pt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function qe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ze=t=>180*t/Math.PI,Je=t=>{const e=Ze(Math.atan2(t[1],t[0]));return tn(e)},Qe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Je,rotateZ:Je,skewX:t=>Ze(Math.atan(t[1])),skewY:t=>Ze(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},tn=t=>((t%=360)<0&&(t+=360),t),en=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),nn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),on={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:en,scaleY:nn,scale:t=>(en(t)+nn(t))/2,rotateX:t=>tn(Ze(Math.atan2(t[6],t[5]))),rotateY:t=>tn(Ze(Math.atan2(-t[2],t[0]))),rotateZ:Je,rotate:Je,skewX:t=>Ze(Math.atan(t[4])),skewY:t=>Ze(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function sn(t){return t.includes("scale")?1:0}function rn(t,e){if(!t||"none"===t)return sn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=on,o=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Qe,o=e}if(!o)return sn(e);const s=i[e],r=o[1].split(",").map(ln);return"function"==typeof s?s(r):r[s]}const an=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return rn(n,e)};function ln(t){return parseFloat(t.trim())}const cn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],un=(()=>new Set([...cn,"pathRotation"]))(),hn=t=>t===wt||t===Bt,dn=new Set(["x","y","z"]),pn=cn.filter(t=>!dn.has(t));const mn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-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})=>rn(e,"x"),y:(t,{transform:e})=>rn(e,"y")};mn.translateX=mn.x,mn.translateY=mn.y;const fn=new Set;let gn=!1,yn=!1,vn=!1;function xn(){if(yn){const t=Array.from(fn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return pn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}yn=!1,gn=!1,fn.forEach(t=>t.complete(vn)),fn.clear()}function wn(){fn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(yn=!0)})}function Tn(){vn=!0,wn(),xn(),vn=!1}class bn{constructor(t,e,n,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(fn.add(this),gn||(gn=!0,rt.read(wn),rt.resolveKeyframes(xn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const o=i?.get(),s=t[t.length-1];if(void 0!==o)t[0]=o;else if(n&&e){const i=n.readValue(e,s);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=s),i&&void 0===o&&i.set(t[0])}qe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),fn.delete(this)}cancel(){"scheduled"===this.state&&(fn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Sn=t=>t.startsWith("--");function Pn(t,e,n){Sn(e)?t.style.setProperty(e,n):t.style[e]=n}const En={};function An(t,e){const n=V(t);return()=>En[e]??n()}const Mn=An(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Vn=An(()=>void 0!==window.ViewTimeline,"viewTimeline"),Cn=An(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),kn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Rn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:kn([0,.65,.55,1]),circOut:kn([.55,0,1,.45]),backIn:kn([.31,.01,.66,-.59]),backOut:kn([.33,1.53,.69,.99])};function Dn(t,e){return t?"function"==typeof t?Cn()?he(t,e):"ease-out":tt(t)?kn(t):Array.isArray(t)?t.map(t=>Dn(t,e)||Rn.easeOut):Rn[t]:void 0}function Ln(t,e,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Dn(a,o);Array.isArray(h)&&(u.easing=h),ot.value&&pt.waapi++;const d={delay:i,duration:o,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:"reverse"===r?"alternate":"normal"};c&&(d.pseudoElement=c);const p=t.animate(u,d);return ot.value&&p.finished.finally(()=>{pt.waapi--}),p}function Bn(t){return"function"==typeof t&&"applyToOptions"in t}function jn({type:t,...e}){return Bn(t)&&Cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class In extends Ge{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:o,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=jn(e);this.animation=Ln(n,i,o,c,s),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Ye(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Pn(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return B(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=L(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Mn()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),C):i(this)}}const On={anticipate:H,backInOut:Y,circInOut:K};function Fn(t){"string"==typeof t.ease&&t.ease in On&&(t.ease=On[t.ease])}class Wn extends In{constructor(t){Fn(t),Xe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:o,...s}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new _e({...s,autoplay:!1}),a=Math.max(10,dt.now()-this.startTime),l=b(0,10,a-10),c=r.sample(a).value,{name:u}=this.options;o&&u&&Pn(o,u,c),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,c,l),r.stop()}}const Un=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Gt.test(t)&&"0"!==t||t.startsWith("url(")));function Nn(t){t.duration=0,t.type="keyframes"}const $n=new Set(["opacity","clipPath","filter","transform"]),zn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Yn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Hn=V(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Xn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:o,damping:s,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Hn()&&n&&($n.has(n)||Yn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&zn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==o&&0!==s&&"inertia"!==r}class Gn extends Ge{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=dt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:o,repeatType:s,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||bn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,o){this.keyframeResolver=void 0;const{name:s,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=dt.now();let h=!0;(function(e,n,i,o){const s=e[0];if(null===s)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=Un(s,n),l=Un(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${s}" to "${r}". "${a?r:s}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(e)||("spring"===i||Bn(i))&&o)})(e,s,r,a)||(h=!1,!P.instantAnimations&&l||u?.(Ye(e,i,n)),e[0]=e[e.length-1],Nn(i),i.repeat=0);const d={startTime:o?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},p=h&&!c&&Xn(d),m=d.motionValue?.owner?.current;let f;if(p)try{f=new Wn({...d,element:m})}catch{f=new _e(d)}else f=new _e(d);f.finished.then(()=>{this.notifyFinished()}).catch(C),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Tn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Kn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return _n(this.animations,"duration")}get iterationDuration(){return _n(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function _n(t,e){let n=0;for(let i=0;i<t.length;i++){const o=t[i][e];null!==o&&o>n&&(n=o)}return n}class qn extends Kn{then(t,e){return this.finished.finally(t).then(()=>{})}}class Zn extends In{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Jn=new WeakMap,Qn=(t,e="")=>`${t}:${e}`;function ti(t){let e=Jn.get(t);return e||(e=new Map,Jn.set(t,e)),e}function ei(t,e,n,i=0,o=1){const s=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(s,r):1===o?s*i:a-s*i}const ni={current:void 0};class ii{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=dt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=dt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new D);const n=this.events[t].add(e);return"change"===t?()=>{n(),rt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ni.current&&ni.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return j(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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 oi(t,e){return new ii(t,e)}function si(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function ri(t,e){const n=t?.[e]??t?.default??t;return n!==t?si(n,t):n}const ai={type:"spring",stiffness:500,damping:25,restSpeed:10},li={type:"keyframes",duration:.8},ci={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ui=(t,{keyframes:e})=>e.length>2?li:un.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ai:ci,hi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function di(t){for(const e in t)if(!hi.has(e))return!0;return!1}const pi=(t,e,n,i={},o,s)=>r=>{const a=ri(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=L(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};di(a)||Object.assign(u,ui(t,u)),u.duration&&(u.duration=L(u.duration)),u.repeatDelay&&(u.repeatDelay=L(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Nn(u),0===u.delay&&(h=!0)),(P.instantAnimations||P.skipAnimations||o?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,Nn(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!s&&void 0!==e.get()){const t=Ye(u.keyframes,a);if(void 0!==t)return void rt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new _e(u):new Gn(u)};function mi(t,e,n,i){const o=1-t;return o*o*e+2*o*t*n+t*t*i}function fi(t,e,n,i,o,s,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(s-o)+2*t*(r-s);return Math.atan2(l,a)*(180/Math.PI)}function gi(t,e,n,i,o,s){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=o*l;return{x:t+r*s+-a/l*n,y:e+a*s+r/l*n}}return{x:t,y:e}}const yi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function vi(t){const e=yi.exec(t);if(!e)return[,];const[,n,i,o]=e;return[`--${n??i}`,o]}function xi(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[o,s]=vi(e);if(!o)return;const r=window.getComputedStyle(n).getPropertyValue(o);if(r){const t=r.trim();return E(t)?parseFloat(t):t}return yt(s)?xi(s,n,i+1):s}function wi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Ti(t,e,n,i){if("function"==typeof e){const[o,s]=wi(i);e=e(void 0!==n?n:t.custom,o,s)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,s]=wi(i);e=e(void 0!==n?n:t.custom,o,s)}return e}function bi(t,e,n){const i=t.getProps();return Ti(i,e,void 0!==n?n:i.custom,t)}const Si=new Set(["width","height","top","left","right","bottom",...cn]),Pi=t=>Array.isArray(t);function Ei(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,oi(n))}function Ai(t){return Pi(t)?t[t.length-1]||0:t}function Mi(t,e){const n=bi(t,e);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const e in s){Ei(t,e,Ai(s[e]))}}const Vi=t=>Boolean(t&&t.getVelocity);function Ci(t){return Boolean(Vi(t)&&t.add)}function ki(t,e){const n=t.getValue("willChange");if(Ci(n))return n.add(e);if(!n&&P.WillChange){const n=new P.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function Ri(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Di="framerAppearId",Li="data-"+Ri(Di);function Bi(t){return t.props[Li]}function ji({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Ii(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();s=s?si(s,l):l;const c=s?.reduceMotion,u=s?.skipAnimations;i&&(s=i);const h=[],d=o&&t.animationState&&t.animationState.getState()[o],p=s?.path;p&&p.animateVisualElement(t,a,s,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),o=a[e];if(void 0===o||d&&ji(d,e))continue;const r={delay:n,...ri(s||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(o)&&o===l&&!r.velocity){rt.update(()=>i.set(o));continue}let p=!1;if(window.MotionHandoffAnimation){const n=Bi(t);if(n){const t=window.MotionHandoffAnimation(n,e,rt);null!==t&&(r.startTime=t,p=!0)}}ki(t,e);const m=c??t.shouldReduceMotion;i.start(pi(e,i,o,m&&Si.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>rt.update(()=>{r&&Mi(t,r)});h.length?Promise.all(h).then(e):e()}return h}function Oi(t,e,n={}){const i=bi(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(Ii(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,o=0,s=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Oi(l,e,{...r,delay:n+("function"==typeof i?0:i)+ei(t.variantChildren,l,i,o,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,s,r,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[s,r]:[r,s];return t().then(()=>e())}return Promise.all([s(),r(n.delay)])}function Fi(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>Oi(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Oi(t,e,n);else{const o="function"==typeof e?bi(t,e,n.custom):e;i=Promise.all(Ii(t,o,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Wi=t=>e=>e.test(t),Ui=[wt,Bt,Lt,Dt,It,jt,{test:t=>"auto"===t,parse:t=>t}],Ni=t=>Ui.find(Wi(t));function $i(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||M(t))}const zi=new Set(["brightness","contrast","saturate","opacity"]);function Yi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Pt)||[];if(!i)return t;const o=n.replace(i,"");let s=zi.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const Hi=/\b([a-z-]*)\(.*?\)/gu,Xi={...Gt,getAnimatableNone:t=>{const e=t.match(Hi);return e?e.map(Yi).join(" "):t}},Gi={...Gt,getAnimatableNone:t=>{const e=Gt.parse(t);return Gt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Ki={...wt,transform:Math.round},_i={rotate:Dt,pathRotation:Dt,rotateX:Dt,rotateY:Dt,rotateZ:Dt,scale:bt,scaleX:bt,scaleY:bt,scaleZ:bt,skew:Dt,skewX:Dt,skewY:Dt,distance:Bt,translateX:Bt,translateY:Bt,translateZ:Bt,x:Bt,y:Bt,z:Bt,perspective:Bt,transformPerspective:Bt,opacity:Tt,originX:Ot,originY:Ot,originZ:Bt},qi={borderWidth:Bt,borderTopWidth:Bt,borderRightWidth:Bt,borderBottomWidth:Bt,borderLeftWidth:Bt,borderRadius:Bt,borderTopLeftRadius:Bt,borderTopRightRadius:Bt,borderBottomRightRadius:Bt,borderBottomLeftRadius:Bt,width:Bt,maxWidth:Bt,height:Bt,maxHeight:Bt,top:Bt,right:Bt,bottom:Bt,left:Bt,inset:Bt,insetBlock:Bt,insetBlockStart:Bt,insetBlockEnd:Bt,insetInline:Bt,insetInlineStart:Bt,insetInlineEnd:Bt,padding:Bt,paddingTop:Bt,paddingRight:Bt,paddingBottom:Bt,paddingLeft:Bt,paddingBlock:Bt,paddingBlockStart:Bt,paddingBlockEnd:Bt,paddingInline:Bt,paddingInlineStart:Bt,paddingInlineEnd:Bt,margin:Bt,marginTop:Bt,marginRight:Bt,marginBottom:Bt,marginLeft:Bt,marginBlock:Bt,marginBlockStart:Bt,marginBlockEnd:Bt,marginInline:Bt,marginInlineStart:Bt,marginInlineEnd:Bt,fontSize:Bt,backgroundPositionX:Bt,backgroundPositionY:Bt,..._i,zIndex:Ki,fillOpacity:Tt,strokeOpacity:Tt,numOctaves:Ki},Zi={...qi,color:Wt,backgroundColor:Wt,outlineColor:Wt,fill:Wt,stroke:Wt,borderColor:Wt,borderTopColor:Wt,borderRightColor:Wt,borderBottomColor:Wt,borderLeftColor:Wt,filter:Xi,WebkitFilter:Xi,mask:Gi,WebkitMask:Gi},Ji=t=>Zi[t],Qi=new Set([Xi,Gi]);function to(t,e){let n=Ji(t);return Qi.has(n)||(n=Gt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const eo=new Set(["auto","none","0"]);class no extends bn{constructor(t,e,n,i,o){super(t,e,n,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),yt(i))){const o=xi(i,e.current);void 0!==o&&(t[n]=o),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Si.has(n)||2!==t.length)return;const[i,o]=t,s=Ni(i),r=Ni(o);if(xt(i)!==xt(o)&&mn[n])this.needsMeasurement=!0;else if(s!==r)if(hn(s)&&hn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else mn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||$i(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,o=0;for(;o<t.length&&!i;){const e=t[o];"string"==typeof e&&!eo.has(e)&&Yt(e).values.length&&(i=t[o]),o++}if(i&&n)for(const o of e)t[o]=to(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const o=n.length-1,s=n[o];n[o]=mn[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const io=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function oo(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&io.has(e)&&(t[n]=t[n]+"px")}const so=V(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function ro(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const o=n?.[t]??i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(t=>null!=t)}function ao(t){return(e,n)=>{const i=ro(e),o=[];for(const e of i){const i=t(e,n);o.push(i)}return()=>{for(const t of o)t()}}}const lo=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class co{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,o=!0){const s=this.values.get(t);s&&s.onRemove();const r=()=>{const i=e.get();this.latest[t]=o?lo(i,qi[t]):i,n&&rt.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&&at(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}}function uo(t){const e=new WeakMap;return(n,i)=>{const o=e.get(n)??new co;e.set(n,o);const s=[];for(const e in i){const r=i[e],a=t(n,o,e,r);s.push(a)}return()=>{for(const t of s)t()}}}const ho=(t,e,n,i)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),s=o?n:n.startsWith("data")||n.startsWith("aria")?Ri(n):n,r=o?()=>{t[s]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(s):t.setAttribute(s,String(i))};return e.set(n,i,r)},po=ao(uo(ho)),mo=uo((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function fo(t){return A(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const go={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const yo=new Set(["originX","originY","originZ"]),vo=(t,e,n,i)=>{let o,s;return un.has(n)?(e.get("transform")||(fo(t)||e.get("transformBox")||vo(t,e,"transformBox",new ii("fill-box")),e.set("transform",new ii("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i<cn.length;i++){const o=cn[i],s=t.latest[o];if(void 0===s)continue;let r=!0;if("number"==typeof s)r=s===(o.startsWith("scale")?1:0);else{const t=parseFloat(s);r=o.startsWith("scale")?1===t:0===t}r||(n=!1,e+=`${go[o]||o}(${s}) `)}const i=t.latest.pathRotation;return i&&(n=!1,e+=`rotate(${"number"==typeof i?`${i}deg`:i}) `),n?"none":e.trim()}(e)})),s=e.get("transform")):yo.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new ii(""),()=>{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",o=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${o}`}),s=e.get("transformOrigin")):o=Sn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,o,s)},xo=ao(uo(vo));const wo=ao(uo((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return rt.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new ii("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return ho(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?vo:ho)(t,e,n,i)}));const{schedule:To,cancel:bo}=st(queueMicrotask,!1),So={x:!1,y:!1};function Po(){return So.x||So.y}function Eo(t){return"x"===t||"y"===t?So[t]?null:(So[t]=!0,()=>{So[t]=!1}):So.x||So.y?null:(So.x=So.y=!0,()=>{So.x=So.y=!1})}function Ao(t,e){const n=ro(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Mo(t,e,n={}){const[i,o,s]=Ao(t,n);return i.forEach(t=>{let n,i=!1,s=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),s&&(s=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?s=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Po())return;s=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,o))},o),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",a,o)},o)}),s}const Vo=(t,e)=>!!e&&(t===e||Vo(t,e.parentElement)),Co=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,ko=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ro(t){return ko.has(t.tagName)||!0===t.isContentEditable}const Do=new Set(["INPUT","SELECT","TEXTAREA"]);function Lo(t){return Do.has(t.tagName)||!0===t.isContentEditable}const Bo=new WeakSet;function jo(t){return e=>{"Enter"===e.key&&t(e)}}function Io(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Oo(t){return Co(t)&&!Po()}const Fo=new WeakSet;function Wo(t,e,n={}){const[i,o,s]=Ao(t,n),r=t=>{const i=t.currentTarget;if(!Oo(t))return;if(Fo.has(t))return;Bo.add(i),n.stopPropagation&&Fo.add(t);const s=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Bo.has(i)&&Bo.delete(i),Oo(t)&&"function"==typeof s&&s(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||Vo(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",l,o)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,o),fo(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=jo(()=>{if(Bo.has(n))return;Io(n,"down");const t=jo(()=>{Io(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Io(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,o)),Ro(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),s}function Uo(t,e){const n=window.getComputedStyle(t);return Sn(e)?n.getPropertyValue(e):n[e]}function No(t){return A(t)&&"ownerSVGElement"in t}const $o=new WeakMap;let zo;const Yo=(t,e,n)=>(i,o)=>o&&o[0]?o[0][t+"Size"]:No(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ho=Yo("inline","width","offsetWidth"),Xo=Yo("block","height","offsetHeight");function Go({target:t,borderBoxSize:e}){$o.get(t)?.forEach(n=>{n(t,{get width(){return Ho(t,e)},get height(){return Xo(t,e)}})})}function Ko(t){t.forEach(Go)}function _o(t,e){zo||"undefined"!=typeof ResizeObserver&&(zo=new ResizeObserver(Ko));const n=ro(t);return n.forEach(t=>{let n=$o.get(t);n||(n=new Set,$o.set(t,n)),n.add(e),zo?.observe(t)}),()=>{n.forEach(t=>{const n=$o.get(t);n?.delete(e),n?.size||zo?.unobserve(t)})}}const qo=new Set;let Zo;function Jo(t){return qo.add(t),Zo||(Zo=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qo.forEach(e=>e(t))},window.addEventListener("resize",Zo)),()=>{qo.delete(t),qo.size||"function"!=typeof Zo||(window.removeEventListener("resize",Zo),Zo=void 0)}}function Qo(t,e){return"function"==typeof t?Jo(t):_o(t,e)}function ts(t,e){let n;const i=()=>{const{currentTime:i}=e,o=(null===i?0:i.value)/100;n!==o&&t(o),n=o};return rt.preUpdate(i,!0),()=>at(i)}function es(){const{value:t}=ot;null!==t?(t.frameloop.rate.push(lt.delta),t.animations.mainThread.push(pt.mainThread),t.animations.waapi.push(pt.waapi),t.animations.layout.push(pt.layout)):at(es)}function ns(t){return t.reduce((t,e)=>t+e,0)/t.length}function is(t,e=ns){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const os=t=>Math.round(1e3/t);function ss(){ot.value=null,ot.addProjectionMetrics=null}function rs(){const{value:t}=ot;if(!t)throw new Error("Stats are not being measured");ss(),at(es);const e={frameloop:{setup:is(t.frameloop.setup),rate:is(t.frameloop.rate),read:is(t.frameloop.read),resolveKeyframes:is(t.frameloop.resolveKeyframes),preUpdate:is(t.frameloop.preUpdate),update:is(t.frameloop.update),preRender:is(t.frameloop.preRender),render:is(t.frameloop.render),postRender:is(t.frameloop.postRender)},animations:{mainThread:is(t.animations.mainThread),waapi:is(t.animations.waapi),layout:is(t.animations.layout)},layoutProjection:{nodes:is(t.layoutProjection.nodes),calculatedTargetDeltas:is(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:is(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=os(n.min),n.max=os(n.max),n.avg=os(n.avg),[n.min,n.max]=[n.max,n.min],e}function as(t){return No(t)&&"svg"===t.tagName}function ls(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function cs(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],o=Oe(t[1+n],t[2+n],t[3+n]);return e?o(i):o}function us(t,e){const n=oi(Vi(t)?t.get():t);return hs(n,t,e),n}function hs(t,e,n={}){const i=t.get();let o,s=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{s&&(s.stop(),s=null),t.animation=void 0},c=()=>{(()=>{const e=ps(t.get()),i=ps(r);if(e===i)return void l();const a=s?s.getGeneratorVelocity():t.getVelocity();l(),s=new _e({keyframes:[e,i],velocity:a,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})})(),t.animation=s??void 0,t.events.animationStart?.notify(),s?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{r=t,o=t=>e(ds(t,a)),rt.postRender(c)},l),Vi(e)){let i=!0===n.skipInitialAnimation;const o=e.on("change",e=>{i?(i=!1,t.jump(ds(e,a),!1)):t.set(ds(e,a))}),s=t.on("destroy",o);return()=>{o(),s()}}return l}function ds(t,e){return e?t+e:t}function ps(t){return"number"==typeof t?t:parseFloat(t)}function ms(t){const e=[];ni.current=e;const n=t();ni.current=void 0;const i=oi(n);return function(t,e,n){const i=()=>e.set(n()),o=()=>rt.preRender(i,!1,!0),s=t.map(t=>t.on("change",o));e.on("destroy",()=>{s.forEach(t=>t()),at(i)})}(e,i,t),i}const fs=[...Ui,Wt,Gt],gs=t=>fs.find(Wi(t));function ys(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let vs={},xs=null;const ws=(t,e)=>{vs[t]=e},Ts=()=>{xs||(xs=document.createElement("style"),xs.id="motion-view");let t="";for(const e in vs){const n=vs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}xs.textContent=t,document.head.appendChild(xs),vs={}},bs=()=>{xs&&xs.parentElement&&xs.parentElement.removeChild(xs)};function Ss(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ps(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function Es(){return document.getAnimations().filter(Ps)}const As=["layout","enter","exit","new","old"];function Ms(t){const{update:e,targets:n,options:i}=t;if(!document.startViewTransition)return new Promise(async t=>{await e(),t(new Kn([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||ws(":root",{"view-transition-name":"none"}),ws("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),Ts();const o=document.startViewTransition(async()=>{await e()});return o.finished.finally(()=>{bs()}),new Promise(t=>{o.ready.then(()=>{const e=Es(),o=[];n.forEach((t,e)=>{for(const n of As){if(!t[n])continue;const{keyframes:s,options:r}=t[n];for(let[t,a]of Object.entries(s)){if(!a)continue;const s={...ri(i,t),...ri(r,t)},l=ys(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof s.delay&&(s.delay=s.delay(0,1)),s.duration&&(s.duration=L(s.duration)),s.delay&&(s.delay=L(s.delay));const c=new In({...s,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});o.push(c)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:s}=e;if(!s)continue;const r=Ss(s);if(!r)continue;const a=n.get(r.layer);if(a)Vs(a,"enter")&&Vs(a,"exit")&&e.getKeyframes().some(t=>t.mixBlendMode)?o.push(new Zn(t)):t.cancel();else{const n="group"===r.type?"layout":"";let s={...ri(i,n)};s.duration&&(s.duration=L(s.duration)),s=jn(s);const a=Dn(s.ease,s.duration);e.updateTiming({delay:L(s.delay??0),duration:s.duration,easing:a}),o.push(new Zn(t))}}t(new Kn(o))})})}function Vs(t,e){return t?.[e]?.keyframes.opacity}let Cs=[],ks=null;function Rs(){ks=null;const[t]=Cs;var e;t&&(w(Cs,e=t),ks=e,Ms(e).then(t=>{e.notifyReady(t),t.finished.finally(Rs)}))}function Ds(){for(let t=Cs.length-1;t>=0;t--){const e=Cs[t],{interrupt:n}=e.options;if("immediate"===n){const n=Cs.slice(0,t+1).map(t=>t.update),i=Cs.slice(t+1);e.update=()=>{n.forEach(t=>t())},Cs=[e,...i];break}}ks&&"immediate"!==Cs[0]?.options.interrupt||Rs()}class Ls{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.notifyReady=C,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...e},n=this,Cs.push(n),To.render(Ds)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:o}=this;o.has(i)||o.set(i,{});o.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Bs=()=>({translate:0,scale:1,origin:0,originPoint:0}),js=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Is=()=>({min:0,max:0}),Os=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Fs=new WeakMap;function Ws(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Us(t){return"string"==typeof t||Array.isArray(t)}const Ns=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$s=["initial",...Ns];function zs(t){return Ws(t.animate)||$s.some(e=>Us(t[e]))}function Ys(t){return Boolean(zs(t)||t.variants)}function Hs(t,e,n){for(const i in e){const o=e[i],s=n[i];if(Vi(o))t.addValue(i,o);else if(Vi(s))t.addValue(i,oi(o,{owner:t}));else if(s!==o)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(o):e.hasAnimated||e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,oi(void 0!==e?e:o,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Xs={current:null},Gs={current:!1},Ks="undefined"!=typeof window;function _s(){if(Gs.current=!0,Ks)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xs.current=t.matches;t.addEventListener("change",e),e()}else Xs.current=!1}const qs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zs={};function Js(t){Zs=t}function Qs(){return Zs}class tr{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:s,visualState:r},a={}){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=bn,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 t=dt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,rt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=o,this.options=a,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=zs(e),this.isVariantNode=Ys(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==l[t]&&Vi(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Fs.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Gs.current||_s(),this.shouldReduceMotion=Xs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),at(this.notifyUpdate),at(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&$n.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:o,ease:s,duration:r}=e.accelerate,a=new In({element:this.current,name:t,keyframes:i,times:o,ease:s,duration:L(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=un.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&rt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),o&&o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Zs){const e=Zs[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<qs.length;e++){const n=qs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=Hs(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=oi(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(E(n)||M(n))?n=parseFloat(n):!gs(n)&&Gt.test(e)&&(n=to(t,e)),this.setBaseTarget(t,Vi(n)?n.get():n)),Vi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Ti(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Vi(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new D),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){To.render(this.render)}}class er extends tr{constructor(){super(...arguments),this.KeyframeResolver=no}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Vi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class nr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function ir({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function or({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function sr(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 rr(t){return void 0===t||1===t}function ar({scale:t,scaleX:e,scaleY:n}){return!rr(t)||!rr(e)||!rr(n)}function lr(t){return ar(t)||cr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function cr(t){return ur(t.x)||ur(t.y)}function ur(t){return t&&"0%"!==t}function hr(t,e,n){return n+e*(t-n)}function dr(t,e,n,i,o){return void 0!==o&&(t=hr(t,o,i)),hr(t,n,i)+e}function pr(t,e=0,n=1,i,o){t.min=dr(t.min,e,n,i,o),t.max=dr(t.max,e,n,i,o)}function mr(t,{x:e,y:n}){pr(t.x,e.translate,e.scale,e.originPoint),pr(t.y,n.translate,n.scale,n.originPoint)}const fr=.999999999999,gr=1.0000000000001;function yr(t,e,n,i=!1){const o=n.length;if(!o)return;let s,r;e.x=e.y=1;for(let a=0;a<o;a++){s=n[a],r=s.projectionDelta;const{visualElement:o}=s.options;o&&o.props.style&&"contents"===o.props.style.display||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(vr(t.x,-s.scroll.offset.x),vr(t.y,-s.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,mr(t,r)),i&&lr(s.latestValues)&&Tr(t,s.latestValues,s.layout?.layoutBox))}e.x<gr&&e.x>fr&&(e.x=1),e.y<gr&&e.y>fr&&(e.y=1)}function vr(t,e){t.min+=e,t.max+=e}function xr(t,e,n,i,o=.5){pr(t,e,n,Zt(t.min,t.max,o),i)}function wr(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Tr(t,e,n){const i=n??t;xr(t.x,wr(e.x,i.x),e.scaleX,e.scale,e.originX),xr(t.y,wr(e.y,i.y),e.scaleY,e.scale,e.originY)}function br(t,e){return ir(sr(t.getBoundingClientRect(),e))}function Sr(t,e,n){const i=br(t,n),{scroll:o}=e;return o&&(vr(i.x,o.offset.x),vr(i.y,o.offset.y)),i}const Pr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Er=cn.length;function Ar(t,e,n){let i="",o=!0;for(let s=0;s<Er;s++){const r=cn[s],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=lo(a,qi[r]);if(!l){o=!1;i+=`${Pr[r]||r}(${t}) `}n&&(e[r]=t)}}const s=t.pathRotation;return s&&(o=!1,i+=`rotate(${lo(s,qi.pathRotation)}) `),i=i.trim(),n?i=n(e,o?"":i):o&&(i="none"),i}function Mr(t,e,n){const{style:i,vars:o,transformOrigin:s}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(un.has(t))r=!0;else if(ft(t))o[t]=n;else{const e=lo(n,qi[t]);t.startsWith("origin")?(a=!0,s[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=Ar(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=s;i.transformOrigin=`${t} ${e} ${n}`}}function Vr(t,{style:e,vars:n},i,o){const s=t.style;let r;for(r in e)s[r]=e[r];for(r in o?.applyProjectionStyles(s,i),n)s.setProperty(r,n[r])}function Cr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const kr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Bt.test(t))return t;t=parseFloat(t)}return`${Cr(t,e.target.x)}% ${Cr(t,e.target.y)}%`}},Rr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=Gt.parse(t);if(o.length>5)return i;const s=Gt.createTransformer(t),r="number"!=typeof o[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;o[0+r]/=a,o[1+r]/=l;const c=Zt(a,l,.5);return"number"==typeof o[2+r]&&(o[2+r]/=c),"number"==typeof o[3+r]&&(o[3+r]/=c),s(o)}},Dr={borderRadius:{...kr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:kr,borderTopRightRadius:kr,borderBottomLeftRadius:kr,borderBottomRightRadius:kr,boxShadow:Rr};function Lr(t,{layout:e,layoutId:n}){return un.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Dr[t]||"opacity"===t)}function Br(t,e,n){const i=t.style,o=e?.style,s={};if(!i)return s;for(const e in i)(Vi(i[e])||o&&Vi(o[e])||Lr(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(s[e]=i[e]);return s}class jr extends er{constructor(){super(...arguments),this.type="html",this.renderInstance=Vr}readValueFromInstance(t,e){if(un.has(e))return this.projection?.isProjecting?sn(e):an(t,e);{const i=(n=t,window.getComputedStyle(n)),o=(ft(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return br(t,e)}build(t,e,n){Mr(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Br(t,e,n)}}class Ir extends tr{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Or={offset:"stroke-dashoffset",array:"stroke-dasharray"},Fr={offset:"strokeDashoffset",array:"strokeDasharray"};function Wr(t,e,n=1,i=0,o=!0){t.pathLength=1;const s=o?Or:Fr;t[s.offset]=""+-i,t[s.array]=`${e} ${n}`}const Ur=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Nr(t,{attrX:e,attrY:n,attrScale:i,pathLength:o,pathSpacing:s=1,pathOffset:r=0,...a},l,c,u){if(Mr(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const t of Ur)void 0!==h[t]&&(d[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==o&&Wr(h,o,s,r,!1)}const $r=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"]),zr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Yr(t,e,n,i){Vr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute($r.has(n)?n:Ri(n),e.attrs[n])}function Hr(t,e,n){const i=Br(t,e,n);for(const n in t)if(Vi(t[n])||Vi(e[n])){i[-1!==cn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Xr extends er{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Os}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(un.has(e)){const t=Ji(e);return t&&t.default||0}return e=$r.has(e)?e:Ri(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Hr(t,e,n)}build(t,e,n){Nr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Yr(t,e,0,i)}mount(t){this.isSVGTag=zr(t.tagName),super.mount(t)}}const Gr=$s.length;function Kr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Kr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Gr;n++){const i=$s[n],o=t.props[i];(Us(o)||!1===o)&&(e[i]=o)}return e}function _r(t,e){if(!Array.isArray(e))return!1;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}const qr=[...Ns].reverse(),Zr=Ns.length;function Jr(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Fi(t,e,n)))}(t),n=ea(),i=!0,o=!1;const s=e=>(n,i)=>{const o=bi(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=Kr(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;e<Zr;e++){const p=qr[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=Us(f),y=p===r?m.isActive:null;!1===y&&(d=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&(i||o)&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...h},!m.isActive&&null===y||!f&&!m.prevProp||Ws(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==y){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}const x=Qr(m.prevProp,f);let w=x||p===r&&m.isActive&&!v&&g||e>d&&g,T=!1;const b=Array.isArray(f)?f:[f];let S=b.reduce(s(p),{});!1===y&&(S={});const{prevResolvedValues:P={}}=m,E={...P,...S},A=e=>{w=!0,u.has(e)&&(T=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in E){const e=S[t],n=P[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Pi(e)&&Pi(n)?!_r(e,n)||x:e!==n,i?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=S,m.isActive&&(h={...h,...S}),(i||o)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||T)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||o)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,o=bi(i,e);if(i.enteringChildren&&o){const{delayChildren:e}=o.transition||{};n.delay=ei(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=bi(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),o=t.getValue(n);o&&(o.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,o=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const o=r(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=ea(),o=!0}}}function Qr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!_r(e,t)}function ta(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ea(){return{animate:ta(!0),whileInView:ta(),whileHover:ta(),whileTap:ta(),whileDrag:ta(),whileFocus:ta(),exit:ta()}}function na(t,e){t.min=e.min,t.max=e.max}function ia(t,e){na(t.x,e.x),na(t.y,e.y)}function oa(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function sa(t){return t.max-t.min}function ra(t,e,n){return Math.abs(t-e)<=n}function aa(t,e,n,i=.5){t.origin=i,t.originPoint=Zt(e.min,e.max,t.origin),t.scale=sa(n)/sa(e),t.translate=Zt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function la(t,e,n,i){aa(t.x,e.x,n.x,i?i.originX:void 0),aa(t.y,e.y,n.y,i?i.originY:void 0)}function ca(t,e,n,i=0){const o=i?Zt(n.min,n.max,i):n.min;t.min=o+e.min,t.max=t.min+sa(e)}function ua(t,e,n,i){ca(t.x,e.x,n.x,i?.x),ca(t.y,e.y,n.y,i?.y)}function ha(t,e,n,i=0){const o=i?Zt(n.min,n.max,i):n.min;t.min=e.min-o,t.max=t.min+sa(e)}function da(t,e,n,i){ha(t.x,e.x,n.x,i?.x),ha(t.y,e.y,n.y,i?.y)}function pa(t,e,n,i,o){return t=hr(t-=e,1/n,i),void 0!==o&&(t=hr(t,1/o,i)),t}function ma(t,e=0,n=1,i=.5,o,s=t,r=t){if(Lt.test(e)){e=parseFloat(e);e=Zt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Zt(s.min,s.max,i);t===s&&(a-=e),t.min=pa(t.min,e,n,a,o),t.max=pa(t.max,e,n,a,o)}function fa(t,e,[n,i,o],s,r){ma(t,e[n],e[i],e[o],e.scale,s,r)}const ga=["x","scaleX","originX"],ya=["y","scaleY","originY"];function va(t,e,n,i){fa(t.x,e,ga,n?n.x:void 0,i?i.x:void 0),fa(t.y,e,ya,n?n.y:void 0,i?i.y:void 0)}function xa(t){return 0===t.translate&&1===t.scale}function wa(t){return xa(t.x)&&xa(t.y)}function Ta(t,e){return t.min===e.min&&t.max===e.max}function ba(t,e){return Ta(t.x,e.x)&&Ta(t.y,e.y)}function Sa(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Pa(t,e){return Sa(t.x,e.x)&&Sa(t.y,e.y)}function Ea(t){return sa(t.x)/sa(t.y)}function Aa(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ma(t){return[t("x"),t("y")]}function Va(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y,r=n?.z||0;if((o||s||r)&&(i=`translate3d(${o}px, ${s}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:o,rotateX:s,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),o&&(i+=`rotate(${o}deg) `),s&&(i+=`rotateX(${s}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const Ca=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],ka=Ca.length,Ra=t=>"string"==typeof t?parseFloat(t):t,Da=t=>"number"==typeof t||Bt.test(t);function La(t,e,n,i,o,s){o?(t.opacity=Zt(0,n.opacity??1,ja(i)),t.opacityExit=Zt(e.opacity??1,0,Ia(i))):s&&(t.opacity=Zt(e.opacity??1,n.opacity??1,i));for(let o=0;o<ka;o++){const s=Ca[o];let r=Ba(e,s),a=Ba(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Da(r)===Da(a)?(t[s]=Math.max(Zt(Ra(r),Ra(a),i),0),(Lt.test(a)||Lt.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=Zt(e.rotate||0,n.rotate||0,i))}function Ba(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ja=Oa(0,.5,G),Ia=Oa(.5,.95,C);function Oa(t,e,n){return i=>i<t?0:i>e?1:n(R(t,e,i))}function Fa(t,e,n){const i=Vi(t)?t:oi(t);return i.start(pi("",i,e,n)),i.animation}function Wa(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const Ua=(t,e)=>t.depth-e.depth;class Na{constructor(){this.children=[],this.isDirty=!1}add(t){x(this.children,t),this.isDirty=!0}remove(t){w(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ua),this.isDirty=!1,this.children.forEach(t)}}function $a(t,e){const n=dt.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(at(i),t(s-e))};return rt.setup(i,!0),()=>at(i)}function za(t){return Vi(t)?t.get():t}class Ya{constructor(){this.members=[]}add(t){x(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(w(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(w(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:o}=t.options;void 0!==i&&i===o||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Ha={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Xa={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ga=["","X","Y","Z"];let Ka=0;function _a(t,e,n,i){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),i&&(i[t]=0))}function qa(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Bi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&qa(i)}function Za({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Ka++,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,ot.value&&(Xa.nodes=Xa.calculatedTargetDeltas=Xa.calculatedProjections=0),this.nodes.forEach(tl),this.nodes.forEach(cl),this.nodes.forEach(ul),this.nodes.forEach(el),ot.addProjectionMetrics&&ot.addProjectionMetrics(Xa)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Na)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new D),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=No(e)&&!as(e),this.instance=e;const{layoutId:n,layout:i,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const o=()=>this.root.updateBlockedByResize=!1;rt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=$a(o,250),Ha.hasAnimatedSinceResize&&(Ha.hasAnimatedSinceResize=!1,this.nodes.forEach(ll)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||gl,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Pa(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...ri(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||ll(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),at(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(hl),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(ol),void this.nodes.forEach(il)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(sl);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(rl),this.nodes.forEach(al),this.nodes.forEach(Ja),this.nodes.forEach(Qa)):this.nodes.forEach(sl),this.clearAllSnapshots();const t=dt.now();lt.delta=b(0,1e3/60,t-lt.timestamp),lt.timestamp=t,lt.isProcessing=!0,ct.update.process(lt),ct.preRender.process(lt),ct.render.process(lt),lt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,To.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(nl),this.sharedNodes.forEach(dl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||sa(this.snapshot.measuredBox.x)||sa(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!wa(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||lr(this.latestValues)||s)&&(o(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),xl((i=n).x),xl(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Tl))){const{scroll:t}=this.root;t&&(vr(e.x,t.offset.x),vr(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(ia(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s}=i;i!==this.root&&o&&s.layoutScroll&&(o.wasRoot&&ia(e,t),vr(e.x,o.offset.x),vr(e.y,o.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};ia(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(vr(i.x,-n.scroll.offset.x),vr(i.y,-n.scroll.offset.y)),lr(n.latestValues)&&Tr(i,n.latestValues,n.layout?.layoutBox)}return lr(this.latestValues)&&Tr(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ia(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!lr(n.latestValues))continue;let i;n.instance&&(ar(n.latestValues)&&n.updateSnapshot(),i=Os(),ia(i,n.measurePageBox())),va(e,n.latestValues,n.snapshot?.layoutBox,i)}return lr(this.latestValues)&&va(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}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!==lt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:o}=this.options;if(!this.layout||!i&&!o)return;this.resolvedRelativeTargetAt=lt.timestamp;const s=this.getClosestProjectingParent();s&&this.linkedParentVersion!==s.layoutVersion&&!s.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&s&&s.layout?this.createRelativeTarget(s,this.layout.layoutBox,s.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ua(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):ia(this.target,this.layout.layoutBox),mr(this.target,this.targetDelta)):ia(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&s&&Boolean(s.resumingFrom)===Boolean(this.resumingFrom)&&!s.options.layoutScroll&&s.target&&1!==this.animationProgress?this.createRelativeTarget(s,this.target,s.target):this.relativeParent=this.relativeTarget=void 0),ot.value&&Xa.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!ar(this.parent.latestValues)&&!cr(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},da(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),ia(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===lt.timestamp&&(n=!1),n)return;const{layout:i,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!o)return;ia(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,r=this.treeScale.y;yr(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(oa(this.prevProjectionDelta.x,this.projectionDelta.x),oa(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),la(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===s&&this.treeScale.y===r&&Aa(this.projectionDelta.x,this.prevProjectionDelta.x)&&Aa(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a)),ot.value&&Xa.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,o=i?i.latestValues:{},s={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(fl));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);i?(r.x.translate=i.x,r.x.scale=Zt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Zt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(pl(r.x,t.x,n),pl(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(da(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),function(t,e,n,i){ml(t.x,e.x,n.x,i),ml(t.y,e.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,a,n),d&&ba(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),ia(d,this.relativeTarget)),l&&(this.animationValues=s,La(s,o,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=s),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(at(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{Ha.hasAnimatedSinceResize=!0,pt.layout++,this.motionValue||(this.motionValue=oi(0)),this.motionValue.jump(0,!1),this.currentAnimation=Fa(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{pt.layout--},onComplete:()=>{pt.layout--,t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&wl(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=sa(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=sa(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}ia(e,n),Tr(e,o),la(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ya);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&_a("z",t,i,this.animationValues);for(let e=0;e<Ga.length;e++)_a(`rotate${Ga[e]}`,t,i,this.animationValues),_a(`skew${Ga[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=za(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=za(e?.pointerEvents)||""),void(this.hasProjected&&!lr(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const o=i.animationValues||i.latestValues;this.applyTransformsToTarget();let s=Va(this.projectionDeltaWithTransform,this.treeScale,o);n&&(s=n(o,s)),t.transform=s;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?o.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:t.opacity=i===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0;for(const e in Dr){if(void 0===o[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Dr[e],l="none"===s?o[e]:n(o[e],i);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?za(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(il),this.root.sharedNodes.clear()}}}function Ja(t){t.updateLayout()}function Qa(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:o}=t.options,s=e.source!==t.layout.source;if("size"===o)Ma(t=>{const i=s?e.measuredBox[t]:e.layoutBox[t],o=sa(i);i.min=n[t].min,i.max=i.min+o});else if("x"===o||"y"===o){const t="x"===o?"y":"x";na(s?e.measuredBox[t]:e.layoutBox[t],n[t])}else wl(o,e.layoutBox,n)&&Ma(i=>{const o=s?e.measuredBox[i]:e.layoutBox[i],r=sa(n[i]);o.max=o.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};la(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?la(a,t.applyTransform(i,!0),e.measuredBox):la(a,n,e.layoutBox);const l=!wa(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:o,layout:s}=i;if(o&&s){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};da(a,e.layoutBox,o.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};da(l,n,s.layoutBox,r),Pa(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function tl(t){ot.value&&Xa.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function el(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function nl(t){t.clearSnapshot()}function il(t){t.clearMeasurements()}function ol(t){t.isLayoutDirty=!0,t.updateLayout()}function sl(t){t.isLayoutDirty=!1}function rl(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function al(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ll(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function cl(t){t.resolveTargetDelta()}function ul(t){t.calcProjection()}function hl(t){t.resetSkewAndRotation()}function dl(t){t.removeLeadSnapshot()}function pl(t,e,n){t.translate=Zt(e.translate,0,n),t.scale=Zt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ml(t,e,n,i){t.min=Zt(e.min,n.min,i),t.max=Zt(e.max,n.max,i)}function fl(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const gl={duration:.45,ease:[.4,0,.1,1]},yl=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),vl=yl("applewebkit/")&&!yl("chrome/")?Math.round:C;function xl(t){t.min=vl(t.min),t.max=vl(t.max)}function wl(t,e,n){return"position"===t||"preserve-aspect"===t&&!ra(Ea(e),Ea(n),.2)}function Tl(t){return t!==t.root&&t.scroll?.wasRoot}const bl=Za({attachResizeListener:(t,e)=>Wa(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Sl=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Pl(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Sl);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const o=e.get(i);o&&(o(),e.delete(i)),n()},dirty:n}}const El={current:void 0},Al=Za({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!El.current){const t=new bl({});t.mount(window),t.setOptions({layoutScroll:!0}),El.current=t}return El.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ml="[data-layout], [data-layout-id]",Vl=()=>{};function Cl(t){const e=Array.from(t.querySelectorAll(Ml));return t instanceof Element&&t.matches(Ml)&&(e.includes(t)||e.unshift(t)),e}function kl(t){const e=t.getAttribute("data-layout-id")||void 0,n=t.getAttribute("data-layout");let i;return""===n||"true"===n?i=!0:n&&(i=n),{layout:i,layoutId:e}}function Rl(t,e,n){const i=Fs.get(t),o=i??new jr({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0});return i&&o.projection||(o.projection=new Al(o.latestValues,e)),o.projection.setOptions({...n,visualElement:o}),o.current?o.projection.instance||o.projection.mount(t):o.mount(t),i||Fs.set(t,o),{element:t,visualElement:o,projection:o.projection}}function Dl(t,e,n){let i=t.parentElement;for(;i;){const t=e.get(i);if(t)return t;if(i===n)break;i=i.parentElement}}const Ll=rt,Bl=it.reduce((t,e)=>(t[e]=t=>at(t),t),{}),jl=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Il(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function Ol(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=Il(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e<i.length;e++){const n=i[e];"function"==typeof n?n():Il(t[e],null)}}}}(...t),t)}class Fl extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(fo(e)&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const t=e.offsetParent,n=fo(t)&&t.offsetWidth||0,i=fo(t)&&t.offsetHeight||0,o=getComputedStyle(e),s=this.props.sizeRef.current;s.height=parseFloat(o.height),s.width=parseFloat(o.width),s.top=e.offsetTop,s.left=e.offsetLeft,s.right=n-s.width-s.left,s.bottom=i-s.height-s.top,s.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Wl({children:t,isPresent:n,anchorX:o,anchorY:s,root:r,pop:a}){const l=e.useId(),c=e.useRef(null),u=e.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:h}=e.useContext(jl),p=t.props?.ref??t?.ref,m=Ol(c,p);return e.useInsertionEffect(()=>{const{width:t,height:e,top:i,left:d,right:p,bottom:m,direction:f}=u.current;if(n||!1===a||!c.current||!t||!e)return;const g="rtl"===f,y="left"===o?g?`right: ${p}`:`left: ${d}`:g?`left: ${d}`:`right: ${p}`,v="bottom"===s?`bottom: ${m}`:`top: ${i}`;c.current.dataset.motionPopId=l;const x=document.createElement("style");h&&(x.nonce=h);const w=r??document.head;return w.appendChild(x),x.sheet&&x.sheet.insertRule(`\n [data-motion-pop-id="${l}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${y}px !important;\n ${v}px !important;\n }\n `),()=>{c.current?.removeAttribute("data-motion-pop-id"),w.contains(x)&&w.removeChild(x)}},[n]),d(Fl,{isPresent:n,childRef:c,sizeRef:u,pop:a,children:!1===a?t:i.cloneElement(t,{ref:m})})}const Ul=({children:t,initial:n,isPresent:o,onExitComplete:s,custom:r,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:u,root:h})=>{const p=f(Nl),m=e.useId();let g=!0,y=e.useMemo(()=>(g=!1,{id:m,initial:n,isPresent:o,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;s&&s()},register:t=>(p.set(t,!1),()=>p.delete(t))}),[o,p,s]);return a&&g&&(y={...y}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[o]),i.useEffect(()=>{!o&&!p.size&&s&&s()},[o]),t=d(Wl,{pop:"popLayout"===l,isPresent:o,anchorX:c,anchorY:u,root:h,children:t}),d(v.Provider,{value:y,children:t})};function Nl(){return new Map}function $l(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:o,register:s}=n,r=e.useId();e.useEffect(()=>{if(t)return s(r)},[t]);const a=e.useCallback(()=>t&&o&&o(r),[r,o,t]);return!i&&o?[!1,a]:[!0]}const zl=t=>t.key||"";function Yl(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const Hl=e.createContext(null);function Xl(){const t=function(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}(),[n,i]=e.useState(0),o=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>rt.postRender(o),[o]),n]}const Gl=t=>!0===t,Kl=({children:t,id:n,inherit:i=!0})=>{const o=e.useContext(m),s=e.useContext(Hl),[r,a]=Xl(),l=e.useRef(null),c=o.id||s;null===l.current&&((t=>Gl(!0===t)||"id"===t)(i)&&c&&(n=n?c+"-"+n:c),l.current={id:n,group:Gl(i)&&o.group||Pl()});const u=e.useMemo(()=>({...l.current,forceRender:r}),[a]);return d(m.Provider,{value:u,children:t})},_l=e.createContext({strict:!1}),ql={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Zl=!1;function Jl(){return function(){if(Zl)return;const t={};for(const e in ql)t[e]={isEnabled:t=>ql[e].some(e=>!!t[e])};Js(t),Zl=!0}(),Qs()}function Ql(t){const e=Jl();for(const n in t)e[n]={...e[n],...t[n]};Js(e)}function tc(t){return"function"==typeof t}const ec=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function nc(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ec.has(t)}let ic=t=>!nc(t);function oc(t){"function"==typeof t&&(ic=e=>e.startsWith("on")?!nc(e):t(e))}try{oc(require("@emotion/is-prop-valid").default)}catch{}function sc(t,e,n){const i={};for(const o in t)"values"===o&&"object"==typeof t.values||Vi(t[o])||(ic(o)||!0===n&&nc(o)||!e&&!nc(o)||t.draggable&&o.startsWith("onDrag"))&&(i[o]=t[o]);return i}const rc=e.createContext(null),ac=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function lc(t){return"string"==typeof t&&!t.includes("-")&&!!(ac.indexOf(t)>-1||/[A-Z]/u.test(t))}const cc=(t,n)=>n.isSVG??lc(t)?new Xr(n):new jr(n,{allowProjection:t!==e.Fragment}),uc=e.createContext({});function hc(t){const{initial:n,animate:i}=function(t,e){if(zs(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Us(e)?e:void 0,animate:Us(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(uc));return e.useMemo(()=>({initial:n,animate:i}),[dc(n),dc(i)])}function dc(t){return Array.isArray(t)?t.join(" "):t}const pc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mc(t,e,n){for(const i in e)Vi(e[i])||Lr(i,n)||(t[i]=e[i])}function fc(t,n){const i={};return mc(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Mr(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function gc(t,e){const n={},i=fc(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const yc=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function vc(t,n,i,o){const s=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Nr(e,n,zr(o),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};mc(e,t.style,t),s.style={...e,...s.style}}return s}function xc(t,n,i,{latestValues:o},s,r=!1,a){const l=(a??lc(t)?vc:gc)(n,o,s,t),c=sc(n,"string"==typeof t,r),u=t!==e.Fragment?{...c,...l,ref:i}:{},{children:h}=n,d=e.useMemo(()=>Vi(h)?h.get():h,[h]);return e.createElement(t,{...u,children:d})}function wc(t,e,n,i){const o={},s=i(t,{});for(const t in s)o[t]=za(s[t]);let{initial:r,animate:a}=t;const l=zs(t),c=Ys(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!Ws(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=Ti(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[t]=e)}for(const e in t)o[e]=t[e]}}}return o}const Tc=t=>(n,i)=>{const o=e.useContext(uc),s=e.useContext(v),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,o){return{latestValues:wc(n,i,o,t),renderState:e()}}(t,n,o,s);return i?r():f(r)},bc=Tc({scrapeMotionValuesFromProps:Br,createRenderState:pc}),Sc=Tc({scrapeMotionValuesFromProps:Hr,createRenderState:yc}),Pc=Symbol.for("motionComponentSymbol");function Ec(t,n,i){const o=e.useRef(i);e.useInsertionEffect(()=>{o.current=i});const s=e.useRef(null);return e.useCallback(e=>{e&&t.onMount?.(e),n&&(e?n.mount(e):n.unmount());const i=o.current;if("function"==typeof i)if(e){const t=i(e);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):i(e);else i&&(i.current=e)},[n])}const Ac=e.createContext({});function Mc(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Vc(t,n,i,o,s,r){const{visualElement:a}=e.useContext(uc),l=e.useContext(_l),c=e.useContext(v),u=e.useContext(jl),h=u.reducedMotion,d=u.skipAnimations,p=e.useRef(null),m=e.useRef(!1);o=o||l.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:a,props:i,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:h,skipAnimations:d,isSVG:r}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const f=p.current,g=e.useContext(Ac);!f||f.projection||!s||"html"!==f.type&&"svg"!==f.type||function(t,e,n,i){const{layoutId:o,layout:s,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Cc(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:Boolean(r)||a&&Mc(a),visualElement:t,animationType:"string"==typeof s?s:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(p.current,i,s,g);const x=e.useRef(!1);e.useInsertionEffect(()=>{f&&x.current&&f.update(i,c)});const w=i[Li],T=e.useRef(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return y(()=>{m.current=!0,f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),T.current&&f.animationState&&f.animationState.animateChanges())}),e.useEffect(()=>{f&&(!T.current&&f.animationState&&f.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),T.current=!1),f.enteringChildren=void 0)}),f}function Cc(t){if(t)return!1!==t.options.allowProjection?t.projection:Cc(t.parent)}function kc(t,{forwardMotionProps:n=!1,type:i}={},o,s){o&&Ql(o);const r=i?"svg"===i:lc(t),a=r?Sc:bc;function l(i,o){let l;const c={...e.useContext(jl),...i,layoutId:Rc(i)},{isStatic:u}=c,h=hc(i),m=a(i,u);if(!u&&"undefined"!=typeof window){e.useContext(_l).strict;const n=function(t){const e=Jl(),{drag:n,layout:i}=e;if(!n&&!i)return{};const o={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(c);l=n.MeasureLayout,h.visualElement=Vc(t,m,c,s,n.ProjectionNode,r)}return p(uc.Provider,{value:h,children:[l&&h.visualElement?d(l,{visualElement:h.visualElement,...c}):null,xc(t,i,Ec(m,h.visualElement,o),m,u,n,r)]})}l.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const c=e.forwardRef(l);return c[Pc]=t,c}function Rc({layoutId:t}){const n=e.useContext(m).id;return n&&void 0!==t?n+"-"+t:t}function Dc(t,e){if("undefined"==typeof Proxy)return kc;const n=new Map,i=(n,i)=>kc(n,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(o,s)=>"create"===s?i:(n.has(s)||n.set(s,kc(s,void 0,t,e)),n.get(s))})}let Lc=0;const Bc={animation:{Feature:class extends nr{constructor(t){super(t),t.animationState||(t.animationState=Jr(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ws(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends nr{constructor(){super(...arguments),this.id=Lc++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=bi(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function jc(t){return{point:{x:t.pageX,y:t.pageY}}}const Ic=t=>e=>Co(e)&&t(e,jc(e));function Oc(t,e,n,i){return Wa(t,e,Ic(n),i)}const Fc=({current:t})=>t?t.ownerDocument.defaultView:null,Wc=(t,e)=>Math.abs(t-e);function Uc(t,e){const n=Wc(t.x,e.x),i=Wc(t.y,e.y);return Math.sqrt(n**2+i**2)}const Nc=new Set(["auto","scroll"]);class $c{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zc(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Hc(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Uc(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=lt;this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=zc(e,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const s=Hc("pointercancel"===t.type?this.lastMoveEventInfo:zc(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,s),i&&i(t,s)},!Co(t))return;this.dragSnapToOrigin=o,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=s,this.contextWindow=i||window;const a=zc(jc(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=lt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,Hc(a,this.history)),this.removeListeners=k(Oc(this.contextWindow,"pointermove",this.handlePointerMove),Oc(this.contextWindow,"pointerup",this.handlePointerUp),Oc(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Nc.has(t.overflowX)||Nc.has(t.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}),window.addEventListener("scroll",this.onWindowScroll),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},o=i.x-e.x,s=i.y-e.y;0===o&&0===s||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o,this.lastMoveEventInfo.point.y+=s):this.history.length>0&&(this.history[0].x-=o,this.history[0].y-=s),this.scrollPositions.set(t,i),rt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),at(this.updatePoint)}}function zc(t,e){return e?{point:e(t.point)}:t}function Yc(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Hc({point:t},e){return{point:t,delta:Yc(t,Gc(e)),offset:Yc(t,Xc(e)),velocity:Kc(e,.1)}}function Xc(t){return t[0]}function Gc(t){return t[t.length-1]}function Kc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=Gc(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>L(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&o.timestamp-i.timestamp>2*L(e)&&(i=t[1]);const s=B(o.timestamp-i.timestamp);if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function _c(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function qc(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}}const Zc=.35;function Jc(t,e,n){return{min:Qc(t,e),max:Qc(t,n)}}function Qc(t,e){return"number"==typeof t?t:t[e]||0}const tu=new WeakMap;class eu{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:o}=this.getProps();this.panSession=new $c(t,{onSessionStart:t=>{e&&this.snapToCursor(jc(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:o}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Eo(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ma(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Lt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=sa(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),o&&rt.update(()=>o(t,e),!1,!0),ki(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),s&&rt.update(()=>s(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,distanceThreshold:n,contextWindow:Fc(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!n)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&rt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!iu(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Zt(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Zt(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}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&&Mc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:_c(t.x,n,o),y:_c(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Zc){return!1===t?t=0:!0===t&&(t=Zc),{x:Jc(t,"left","right"),y:Jc(t,"top","bottom")}}(e),i!==this.constraints&&!Mc(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Ma(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Mc(e))return!1;const i=e.current;t.invariant(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const s=Sr(i,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:qc(t.x,e.x),y:qc(t.y,e.y)}}(o.layout.layoutBox,s);if(n){const t=n(or(r));this.hasMutatedConstraints=!!t,t&&(r=ir(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Ma(r=>{if(!iu(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==s&&s!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return ki(this.visualElement,t),n.start(pi(t,n,0,e,this.visualElement,!1))}stopAnimation(){Ma(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ma(e=>{const{drag:n}=this.getProps();if(!iu(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e],r=o.get()||0;o.set(t[e]-Zt(n,s,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Mc(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ma(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=sa(t),o=sa(e);return o>i?n=R(e.min,e.max-i,t.min):i>o&&(n=R(t.min,t.max-o,e.min)),b(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ma(e=>{if(!iu(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:s}=this.constraints[e];n.set(Zt(o,s,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;tu.set(this.visualElement,this);const t=this.visualElement.current,e=Oc(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),o=e.target,s=o!==t&&Lo(o);n&&i&&!s&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();Mc(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Qo(t,nu(n)),o=Qo(e,nu(n));return()=>{i(),o()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,s=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),rt.read(i);const r=Wa(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Ma(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),s(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Zc,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function nu(t){let e=!0;return()=>{e?e=!1:t()}}function iu(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ou=t=>(e,n)=>{t&&rt.update(()=>t(e,n),!1,!0)};let su=!1;class ru extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),su&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ha.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,{projection:s}=n;return s?(s.isPresent=o,t.layoutDependency!==e&&s.setOptions({...s.options,layoutDependency:e}),su=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||rt.postRender(()=>{const t=s.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),To.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;su=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function au(t){const[n,i]=$l(),o=e.useContext(m);return d(ru,{...t,layoutGroup:o,switchLayoutGroup:e.useContext(Ac),isPresent:n,safeToRemove:i})}const lu={pan:{Feature:class extends nr{constructor(){super(...arguments),this.removePointerDownListener=C}onPointerDown(t){this.session=new $c(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Fc(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ou(t),onStart:ou(e),onMove:ou(n),onEnd:(t,e)=>{delete this.session,i&&rt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Oc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends nr{constructor(t){super(t),this.removeGroupControls=C,this.removeListeners=C,this.controls=new eu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||C}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Al,MeasureLayout:au}};function cu(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const o=i["onHover"+n];o&&rt.postRender(()=>o(e,jc(e)))}function uu(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const o=i["onTap"+("End"===n?"":n)];o&&rt.postRender(()=>o(e,jc(e)))}const hu=new WeakMap,du=new WeakMap,pu=t=>{const e=hu.get(t.target);e&&e(t)},mu=t=>{t.forEach(pu)};function fu(t,e,n){const i=function({root:t,...e}){const n=t||document;du.has(n)||du.set(n,{});const i=du.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(mu,{root:t,...e})),i[o]}(e);return hu.set(t,n),i.observe(t),()=>{hu.delete(t),i.unobserve(t)}}const gu={some:0,all:1};const yu={inView:{Feature:class extends nr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:o}=t,s={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:gu[i]};this.stopObserver=fu(this.node.current,s,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),s=e?n:i;s&&s(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends nr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Wo(t,(t,e)=>(uu(this.node,e,"Start"),(t,{success:e})=>uu(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends nr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=k(Wa(this.node.current,"focus",()=>this.onFocus()),Wa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends nr{mount(){const{current:t}=this.node;t&&(this.unmount=Mo(t,(t,e)=>(cu(this.node,e,"Start"),t=>cu(this.node,t,"End"))))}unmount(){}}}},vu={layout:{ProjectionNode:Al,MeasureLayout:au}},xu=Dc({...Bc,...yu,...lu,...vu},cc);function wu({children:n,as:i="ul",axis:o="y",onReorder:s,values:r,...a},l){const c=f(()=>xu[i]),u=[],h=e.useRef(!1),p=e.useRef(null);t.invariant(Boolean(r),"Reorder.Group must be provided a values prop","reorder-values");const m={axis:o,groupRef:p,registerItem:(t,e)=>{const n=u.findIndex(e=>t===e.value);-1!==n?u[n].layout=e[o]:u.push({value:t,layout:e[o]}),u.sort(bu)},updateOrder:(t,e,n)=>{if(h.current)return;const i=function(t,e,n,i){if(!i)return t;const o=t.findIndex(t=>t.value===e);if(-1===o)return t;const s=i>0?1:-1,r=t[o+s];if(!r)return t;const a=t[o],l=r.layout,c=Zt(l.min,l.max,.5);return 1===s&&a.layout.max+n>c||-1===s&&a.layout.min+n<c?T(t,o,o+s):t}(u,t,e,n);if(u!==i){h.current=!0;const t=[...r];for(let e=0;e<i.length;e++)if(u[e].value!==i[e].value){const n=r.indexOf(u[e].value),o=r.indexOf(i[e].value);-1!==n&&-1!==o&&([t[n],t[o]]=[t[o],t[n]]);break}s(t)}}};e.useEffect(()=>{h.current=!1});const g={overflowAnchor:"none",...a.style};return d(c,{...a,style:g,ref:t=>{p.current=t,"function"==typeof l?l(t):l&&(l.current=t)},ignoreStrict:!0,children:d(rc.Provider,{value:m,children:n})})}const Tu=e.forwardRef(wu);function bu(t,e){return t.layout.min-e.layout.min}function Su(t){const n=f(()=>oi(t)),{isStatic:i}=e.useContext(jl);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function Pu(t,e){const n=Su(e()),i=()=>n.set(e());return i(),y(()=>{const e=()=>rt.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),at(i)}}),n}function Eu(t,e,n,i){if("function"==typeof t)return function(t){ni.current=[],t();const e=Pu(ni.current,t);return ni.current=void 0,e}(t);if(void 0!==n&&!Array.isArray(n)&&"function"!=typeof e)return function(t,e,n,i){const o=f(()=>Object.keys(n)),s=f(()=>({}));for(const r of o)s[r]=Eu(t,e,n[r],i);return s}(t,e,n,i);const o="function"==typeof e?e:cs(e,n,i),s=Array.isArray(t)?Au(t,o):Au([t],([t])=>o(t)),r=Array.isArray(t)?void 0:t.accelerate;return r&&!r.isTransformed&&"function"!=typeof e&&Array.isArray(n)&&!1!==i?.clamp&&(s.accelerate={...r,times:e,keyframes:n,isTransformed:!0,...i?.ease?{ease:i.ease}:{}}),s}function Au(t,e){const n=f(()=>[]);return Pu(t,()=>{n.length=0;const i=t.length;for(let e=0;e<i;e++)n[e]=t[e].get();return e(n)})}const Mu=new Set(["auto","scroll"]),Vu=new WeakMap,Cu=new WeakMap;let ku=null;function Ru(t,e){const n=getComputedStyle(t),i="x"===e?n.overflowX:n.overflowY,o=t===document.body||t===document.documentElement;return Mu.has(i)||o}function Du(t,e){let n=t?.parentElement;for(;n;){if(Ru(n,e))return n;n=n.parentElement}return null}function Lu(t,e,n,i){if(!t)return;ku=t;const o=Du(t,n);if(!o)return;const s=e-("x"===n?window.scrollX:window.scrollY),{amount:r,edge:a}=function(t,e,n){const i=e.getBoundingClientRect(),o=t-("x"===n?Math.max(0,i.left):Math.max(0,i.top)),s=("x"===n?Math.min(window.innerWidth,i.right):Math.min(window.innerHeight,i.bottom))-t;if(o<50){const t=1-o/50;return{amount:-25*t*t,edge:"start"}}if(s<50){const t=1-s/50;return{amount:25*t*t,edge:"end"}}return{amount:0,edge:null}}(s,o,n);if(null===a)return Cu.delete(o),void Vu.delete(o);const l=Cu.get(o),c=o===document.body||o===document.documentElement;if(l!==a){if(!("start"===a&&i<0||"end"===a&&i>0))return;Cu.set(o,a);const t="x"===n?o.scrollWidth-(c?window.innerWidth:o.clientWidth):o.scrollHeight-(c?window.innerHeight:o.clientHeight);Vu.set(o,t)}if(r>0){const t=Vu.get(o);if(("x"===n?c?window.scrollX:o.scrollLeft:c?window.scrollY:o.scrollTop)>=t)return}"x"===n?c?window.scrollBy({left:r}):o.scrollLeft+=r:c?window.scrollBy({top:r}):o.scrollTop+=r}function Bu(t,e=0){return Vi(t)?t:Su(e)}function ju({children:n,style:i={},value:o,as:s="li",onDrag:r,onDragEnd:a,layout:l=!0,...c},u){const h=f(()=>xu[s]),p=e.useContext(rc),m={x:Bu(i.x),y:Bu(i.y)},g=Eu([m.x,m.y],([t,e])=>t||e?1:"unset");t.invariant(Boolean(p),"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:v,updateOrder:x,groupRef:w}=p;return d(h,{drag:y,...c,dragSnapToOrigin:!0,style:{...i,x:m.x,y:m.y,zIndex:g},layout:l,onDrag:(t,e)=>{const{velocity:n,point:i}=e,s=m[y].get();x(o,s,n[y]),Lu(w.current,i[y],y,n[y]),r&&r(t,e)},onDragEnd:(t,e)=>{!function(){if(ku){const t=Du(ku,"y");t&&(Cu.delete(t),Vu.delete(t));const e=Du(ku,"x");e&&e!==t&&(Cu.delete(e),Vu.delete(e)),ku=null}}(),a&&a(t,e)},onLayoutMeasure:t=>{v(o,t)},ref:u,ignoreStrict:!0,children:n})}const Iu=e.forwardRef(ju);var Ou=Object.freeze({__proto__:null,Group:Tu,Item:Iu});function Fu(t){return"object"==typeof t&&!Array.isArray(t)}function Wu(t,e,n,i){return null==t?[]:"string"==typeof t&&Fu(e)?ro(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Uu(t,e,n){return t*(e+1)+n*e}function Nu(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function $u(t,e,n,i,o,s){!function(t,e,n){for(let i=0;i<t.length;i++){const o=t[i];o.at>e&&o.at<n&&(w(t,o),i--)}}(t,o,s);for(let r=0;r<e.length;r++)t.push({value:e[r],at:Zt(o,s,i[r]),easing:Q(n,r)})}function zu(t,e,n=0){const i=e+1+e*n;for(let e=0;e<t.length;e++)t[e]=t[e]/i}function Yu(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Hu(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Xu(t,e){return e[t]||(e[t]=[]),e[t]}function Gu(t){return Array.isArray(t)?t:[t]}function Ku(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const _u=t=>"number"==typeof t,qu=t=>t.every(_u);function Zu(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=No(t)&&!as(t)?new Xr(e):new jr(e);n.mount(t),Fs.set(t,n)}function Ju(t){const e=new Ir({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Fs.set(t,e)}function Qu(e,n,i,o){const s=[];if(function(t,e){return Vi(t)||"number"==typeof t||"string"==typeof t&&!Fu(e)}(e,n))s.push(Fa(e,Fu(n)&&n.default||n,i&&i.default||i));else{if(null==e)return s;const r=Wu(e,n,o),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t<a;t++){const e=r[t],o=e instanceof Element?Zu:Ju;Fs.has(e)||o(e);const l=Fs.get(e),c={...i};"delay"in c&&"function"==typeof c.delay&&(c.delay=c.delay(t,a)),s.push(...Ii(l,{...n,transition:c},{}))}}return s}function th(e,n,i){const o=[],s=function(e,{defaultTransition:n={},...i}={},o,s){const r=n.duration||.3,a=new Map,l=new Map,c={},u=new Map;let h=0,d=0,p=0;for(let i=0;i<e.length;i++){const a=e[i];if("string"==typeof a){u.set(a,d);continue}if(!Array.isArray(a)){u.set(a.name,Nu(d,a.at,h,u));continue}let[m,f,g={}]=a;void 0!==g.at&&(d=Nu(d,g.at,h,u));let y=0;const v=(e,i,o,a=0,l=0)=>{const c=Gu(e),{delay:u=0,times:h=We(c),type:m=n.type||"keyframes",repeat:f,repeatType:g,repeatDelay:v=0,...x}=i;let{ease:w=n.ease||"easeOut",duration:T}=i;const b="function"==typeof u?u(a,l):u,S=c.length,P=Bn(m)?m:s?.[m||"keyframes"];if(S<=2&&P){let t=100;if(2===S&&qu(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...x};void 0!==T&&(e.duration=L(T));const i=me(e,t,P);w=i.ease,T=i.duration}T??(T=r);const E=d+b;1===h.length&&0===h[0]&&(h[1]=1);const A=h.length-c.length;if(A>0&&Fe(h,A),1===c.length&&c.unshift(null),f&&t.warning(f<20,`Sequence segments can't repeat ${f} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),f&&f<20){const t=T>0?v/T:0;T=Uu(T,f,v);const e=[...c],n=[...h];w=Array.isArray(w)?[...w]:[w];const i=[...w],o="reverse"===g||"mirror"===g;let s=e,r=i;o&&(s=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?N(t):t)));for(let a=0;a<f;a++){const l=o&&a%2==0,u=l?s:e,d=l?r:i,p=(a+1)*(1+t);t>0&&(c.push(c[c.length-1]),h.push(p),w.push("linear")),c.push(...u);for(let t=0;t<u.length;t++)h.push(n[t]+p),w.push(0===t?"linear":Q(d,t-1))}zu(h,f,t)}const M=E+T;$u(o,c,w,h,E,M),y=Math.max(b+T,y),p=Math.max(M,p)};if(Vi(m))v(f,g,Xu("default",Hu(m,l)));else{const t=Wu(m,f,o,c),e=t.length;for(let n=0;n<e;n++){const i=Hu(t[n],l);for(const t in f)v(f[t],Ku(g,t),Xu(t,i),n,e)}}h=d,d+=y}return l.forEach((t,e)=>{for(const o in t){const s=t[o];s.sort(Yu);const r=[],l=[],c=[];for(let t=0;t<s.length;t++){const{at:e,value:n,easing:i}=s[t];r.push(n),l.push(R(0,p,e)),c.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),r.unshift(r[0]),c.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),r.push(null)),a.has(e)||a.set(e,{keyframes:{},transition:{}});const u=a.get(e);u.keyframes[o]=r;const{type:h,...d}=n;u.transition[o]={...d,duration:p,ease:c,times:l,...i}}}),a}(e.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=oi(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:Be});return s.forEach(({keyframes:t,transition:e},n)=>{o.push(...Qu(n,t,e))}),o}function eh(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;return function(t,o,s){let r,a=[];const l={};if(void 0!==n&&(l.reduceMotion=n),void 0!==i&&(l.skipAnimations=i),c=t,Array.isArray(c)&&c.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(r=n),a=th(t,{...l,...i},e)}else{const{onComplete:n,...i}=s||{};"function"==typeof n&&(r=n),a=Qu(t,o,{...l,...i},e)}var c;const u=new qn(a);return r&&u.finished.then(r),e&&(e.animations.push(u),u.finished.then(()=>{w(e.animations,u)})),u}}const nh=eh();const ih=e=>function(n,i,o){return new qn(function(e,n,i,o){if(null==e)return[];const s=ro(e,o),r=s.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;t<r;t++){const e=s[t],o={...i};"function"==typeof o.delay&&(o.delay=o.delay(t,r));for(const t in n){let i=n[t];Array.isArray(i)||(i=[i]);const s={...ri(o,t)};s.duration&&(s.duration=L(s.duration)),s.delay&&(s.delay=L(s.delay));const r=ti(e),l=Qn(t,s.pseudoElement||""),c=r.get(l);c&&c.stop(),a.push({map:r,key:l,unresolvedKeyframes:i,options:{...s,element:e,name:t,allowFlatten:!o.type&&!o.ease}})}}for(let t=0;t<a.length;t++){const{unresolvedKeyframes:e,options:n}=a[t],{element:i,name:o,pseudoElement:s}=n;s||null!==e[0]||(e[0]=Uo(i,o)),qe(e),oo(e,o),!s&&e.length<2&&e.unshift(Uo(i,o)),n.keyframes=e}const l=[];for(let t=0;t<a.length;t++){const{map:e,key:n,options:i}=a[t],o=new In(i);e.set(n,o),o.finished.finally(()=>e.delete(n)),l.push(o)}return l}(n,i,o,e))},oh=ih();function sh(t){return"undefined"!=typeof window&&(t?Vn():Mn())}const rh={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ah(t,e,n,i){const o=n[e],{length:s,position:r}=rh[e],a=o.current,l=n.time;o.current=Math.abs(t[`scroll${r}`]),o.scrollLength=t[`scroll${s}`]-t[`client${s}`],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=R(0,o.scrollLength,o.current);const c=i-l;o.velocity=c>50?0:j(o.current-a,c)}const lh={start:0,center:.5,end:1};function ch(t,e,n=0){let i=0;if(t in lh&&(t=lh[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const uh=[0,0];function hh(t,e,n,i){let o=Array.isArray(t)?t:uh,s=0,r=0;return"number"==typeof t?o=[t,t]:"string"==typeof t&&(o=(t=t.trim()).includes(" ")?t.split(" "):[t,lh[t]?t:"0"]),s=ch(o[0],n,i),r=ch(o[1],e),s-r}const dh={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},ph={x:0,y:0};function mh(t,e,n){const{offset:i=dh.All}=n,{target:o=t,axis:s="y"}=n,r="y"===s?"height":"width",a=o!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(fo(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let o=null,s=i.parentNode;for(;!o;)"svg"===s.tagName&&(o=s),s=i.parentNode;i=o}}return n}(o,t):ph,l=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),c={width:t.clientWidth,height:t.clientHeight};e[s].offset.length=0;let u=!e[s].interpolate;const h=i.length;for(let t=0;t<h;t++){const n=hh(i[t],c[r],l[r],a[s]);u||n===e[s].interpolatorOffsets[t]||(u=!0),e[s].offset[t]=n}u&&(e[s].interpolate=Oe(e[s].offset,We(i),{clamp:!1}),e[s].interpolatorOffsets=[...e[s].offset]),e[s].progress=b(0,1,e[s].interpolate(e[s].current))}function fh(t,e,n,i={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){ah(t,"x",e,n),ah(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&mh(t,n,i)},notify:()=>e(n)}}const gh=new WeakMap,yh=new WeakMap,vh=new WeakMap,xh=new WeakMap,wh=new WeakMap,Th=t=>t===document.scrollingElement?window:t;function bh(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return C;let o=vh.get(e);o||(o=new Set,vh.set(e,o));const s=fh(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(o.add(s),!gh.has(e)){const t=()=>{for(const t of o)t.measure(lt.timestamp);rt.preUpdate(n)},n=()=>{for(const t of o)t.notify()},i=()=>rt.read(t);gh.set(e,i);const s=Th(e);window.addEventListener("resize",i),e!==document.documentElement&&yh.set(e,Qo(e,i)),s.addEventListener("scroll",i),i()}if(n&&!wh.has(e)){const t=gh.get(e),n={width:e.scrollWidth,height:e.scrollHeight};xh.set(e,n);const i=()=>{const i=e.scrollWidth,o=e.scrollHeight;n.width===i&&n.height===o||(t(),n.width=i,n.height=o)},o=rt.read(i,!0);wh.set(e,o)}const r=gh.get(e);return rt.read(r,!1,!0),()=>{at(r);const t=vh.get(e);if(!t)return;if(t.delete(s),t.size)return;const n=gh.get(e);gh.delete(e),n&&(Th(e).removeEventListener("scroll",n),yh.get(e)?.(),window.removeEventListener("resize",n));const i=wh.get(e);i&&(at(i),wh.delete(e)),xh.delete(e)}}const Sh=[[dh.Enter,"entry"],[dh.Exit,"exit"],[dh.Any,"cover"],[dh.All,"contain"]],Ph={start:0,end:1};function Eh(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=Ph[e[0]],i=Ph[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function Ah(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=Eh(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],o=e[t];if(i[0]!==o[0]||i[1]!==o[1])return!1}return!0}function Mh(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Sh)if(Ah(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Vh=new Map;function Ch(t){const e={value:0},n=bh(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function kh({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let o=Vh.get(e);o||(o=new Map,Vh.set(e,o));const s=n.target??"self";let r=o.get(s);r||(r={},o.set(s,r));const a=i+(n.offset??[]).join(",");if(!r[a])if(n.target&&sh(n.target)){const t=Mh(n.offset);r[a]=t?new ViewTimeline({subject:n.target,axis:i}):Ch({container:e,...n})}else sh()?r[a]=new ScrollTimeline({source:e,axis:i}):r[a]=Ch({container:e,...n});return r[a]}function Rh(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return C;const o={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||function(t){return t&&(t.target||t.offset)}(e)?bh(n=>{t(n[e.axis].progress,n)},e):ts(t,kh(e))}(t,o):function(t,e){const n=kh(e),i=e.target?Mh(e.offset):void 0,o=e.target?sh(e.target)&&!!i:sh();return t.attachTimeline({timeline:o?n:void 0,...i&&o&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),ts(e=>{t.time=t.iterationDuration*e},n))})}(t,o)}const Dh={some:0,all:1};function Lh(t,e,{root:n,margin:i,amount:o="some"}={}){const s=ro(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof o?o:Dh[o]});return s.forEach(t=>a.observe(t)),()=>a.disconnect()}const Bh=Dc();function jh(t){return e.useEffect(()=>()=>t(),[])}const Ih={renderer:cc,...Bc,...yu},Oh={...Ih,...lu,...vu},Fh={renderer:cc,...Bc};function Wh(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])}const Uh=()=>({scrollX:oi(0),scrollY:oi(0),scrollXProgress:oi(0),scrollYProgress:oi(0)}),Nh=t=>!!t&&!t.current;function $h(t,e,n,i){return{factory:o=>{let s;const r=()=>{Nh(n)||Nh(i)?To.read(r):s=Rh(o,{...e,axis:t,container:n?.current||void 0,target:i?.current||void 0})};return To.read(r),()=>{bo(r),s?.()}},times:[0,1],keyframes:[0,1],ease:t=>t,duration:1}}function zh({container:n,target:i,...o}={}){const s=f(Uh);(function(t,e){return"undefined"!=typeof window&&(t?Vn()&&!!Mh(e):Mn())})(i,o.offset)&&(s.scrollXProgress.accelerate=$h("x",o,n,i),s.scrollYProgress.accelerate=$h("y",o,n,i));const r=e.useRef(null),a=e.useRef(!1),l=e.useCallback(()=>(r.current=Rh((t,{x:e,y:n})=>{s.scrollX.set(e.current),s.scrollXProgress.set(e.progress),s.scrollY.set(n.current),s.scrollYProgress.set(n.progress)},{...o,container:n?.current||void 0,target:i?.current||void 0}),()=>{r.current?.()}),[n,i,JSON.stringify(o.offset)]);return y(()=>(a.current=!1,Nh(n)||Nh(i)?void(a.current=!0):l()),[l]),e.useEffect(()=>{if(!a.current)return;let e;const o=()=>{const o=Nh(n),s=Nh(i);t.invariant(!o,"Container ref is defined but not hydrated","use-scroll-ref"),t.invariant(!s,"Target ref is defined but not hydrated","use-scroll-ref"),o||s||(e=l())};return To.read(o),()=>{bo(o),e?.()}},[l]),s}function Yh(t,n={}){const{isStatic:i}=e.useContext(jl),o=()=>Vi(t)?t.get():t;if(i)return Eu(o);const s=Su(o());return e.useInsertionEffect(()=>hs(s,t,n),[s,JSON.stringify(n)]),s}function Hh(t){const n=e.useRef(0),{isStatic:i}=e.useContext(jl);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return rt.update(e,!0),()=>at(e)},[t])}class Xh extends ii{constructor(){super(...arguments),this.isEnabled=!1}add(t){(un.has(t)||$n.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function Gh(){!Gs.current&&_s();const[t]=e.useState(Xs.current);return t}function Kh(){const t=Gh(),{reducedMotion:n}=e.useContext(jl);return"never"!==n&&("always"===n||t)}function _h(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&Mi(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{_h(t,e)})})}function qh(){let e=!1;const n=new Set,i={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(i,o){t.invariant(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");const s=[];return n.forEach(t=>{s.push(Fi(t,i,{transitionOverride:o}))}),Promise.all(s)},set:i=>(t.invariant(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),n.forEach(t=>{!function(t,e){Array.isArray(e)?_h(t,e):"string"==typeof e?_h(t,[e]):Mi(t,e)}(t,i)})),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(e=!0,()=>{e=!1,i.stop()})};return i}function Zh(){const t=f(qh);return y(t.mount,[]),t}const Jh=Zh;class Qh{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const td=()=>new Qh;function ed(t){return null!==t&&"object"==typeof t&&Pc in t}function nd(){return id}function id(t){El.current&&(El.current.isUpdating=!1,El.current.blockUpdate(),t&&t())}const od=new Map,sd=new Map,rd=(t,e)=>`${t}: ${un.has(e)?"transform":e}`;function ad(t,e,n){const i=rd(t,e),o=od.get(i);if(!o)return null;const{animation:s,startTime:r}=o;function a(){window.MotionCancelOptimisedAnimation?.(t,e,n)}return s.onfinish=a,null===r||window.MotionHandoffIsComplete?.(t)?(a(),null):r}let ld,cd;const ud=new Set;function hd(){ud.forEach(t=>{t.animation.play(),t.animation.startTime=t.startTime}),ud.clear()}const dd=()=>({});class pd extends tr{constructor(){super(...arguments),this.measureInstanceViewportBox=Os}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}}const md=Tc({scrapeMotionValuesFromProps:dd,createRenderState:dd});let fd=0;const gd=t=>t>.001?1/t:1e5;let yd=!1;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:o,presenceAffectsLayout:s=!0,mode:r="sync",propagate:a=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[p,g]=$l(a),v=e.useMemo(()=>Yl(t),[t]),x=a&&!p?[]:v.map(zl),w=e.useRef(!0),T=e.useRef(v),b=f(()=>new Map),S=e.useRef(new Set),[P,E]=e.useState(v),[A,M]=e.useState(v);y(()=>{w.current=!1,T.current=v;for(let t=0;t<A.length;t++){const e=zl(A[t]);x.includes(e)?(b.delete(e),S.current.delete(e)):!0!==b.get(e)&&b.set(e,!1)}},[A,x.length,x.join("-")]);const V=[];if(v!==P){let t=[...v];for(let e=0;e<A.length;e++){const n=A[e],i=zl(n);x.includes(i)||(t.splice(e,0,n),V.push(n))}return"wait"===r&&V.length&&(t=V),M(Yl(t)),E(v),null}const{forceRender:C}=e.useContext(m);return d(h,{children:A.map(t=>{const e=zl(t),h=!(a&&!p)&&(v===A||x.includes(e));return d(Ul,{isPresent:h,initial:!(w.current&&!i)&&void 0,custom:n,presenceAffectsLayout:s,mode:r,root:u,onExitComplete:h?void 0:()=>{if(S.current.has(e))return;if(!b.has(e))return;S.current.add(e),b.set(e,!0);let t=!0;b.forEach(e=>{e||(t=!1)}),t&&(C?.(),M(T.current),a&&g?.(),o&&o())},anchorX:l,anchorY:c,children:t},e)})})},t.AnimateSharedLayout=({children:e})=>(i.useEffect(()=>{t.invariant(!1,"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations")},[]),d(Kl,{id:f(()=>"asl-"+fd++),children:e})),t.AsyncMotionValueAnimation=Gn,t.DOMKeyframesResolver=no,t.DOMVisualElement=er,t.DeprecatedLayoutGroupContext=Hl,t.DocumentProjectionNode=bl,t.DragControls=Qh,t.Feature=nr,t.FlatTree=Na,t.GroupAnimation=Kn,t.GroupAnimationWithThen=qn,t.HTMLProjectionNode=Al,t.HTMLVisualElement=jr,t.JSAnimation=_e,t.KeyframeResolver=bn,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.sharedTransitions=new Map,this.notifyReady=Vl,this.rejectReady=Vl,this.scope=t,this.updateDom=e,this.defaultOptions=n,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),rt.postRender(()=>{this.start().then(this.notifyReady).catch(this.rejectReady)})}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}async start(){const t=Cl(this.scope),e=this.buildRecords(t);e.forEach(({projection:t})=>{const e=Boolean(t.currentAnimation),n=Boolean(t.options.layoutId);if(e&&n){const e=function(t){const e=t.targetWithTransforms||t.target;if(!e)return;const n={x:{min:0,max:0},y:{min:0,max:0}},i={x:{min:0,max:0},y:{min:0,max:0}};return ia(n,e),ia(i,e),{animationId:t.root?.animationId??0,measuredBox:n,layoutBox:i,latestValues:t.animationValues||t.latestValues||{},source:t.id}}(t);e?t.snapshot=e:t.snapshot&&(t.snapshot=void 0)}else t.snapshot&&(t.currentAnimation||t.isProjecting())&&(t.snapshot=void 0);t.isPresent=!0,t.willUpdate()}),await this.updateDom();const n=Cl(this.scope),i=this.buildRecords(n);this.handleExitingElements(e,i),i.forEach(({projection:t})=>{const e=t.instance,n=t.resumeFrom?.instance;if(!e||!n)return;if(!("style"in e))return;const i=e.style.transform,o=n.style.transform;i&&o&&i===o&&(e.style.transform="",e.style.transformOrigin="")}),i.forEach(({projection:t})=>{t.isPresent=!0});const o=function(t,e){const n=t[0]||e[0];return n?.projection.root}(i,e);o?.didUpdate(),await new Promise(t=>{rt.postRender(()=>t())});const s=function(t){const e=new Set;return t.forEach(t=>{const n=t.projection.currentAnimation;n&&e.add(n)}),Array.from(e)}(i);return new Kn(s)}buildRecords(t){const e=[],n=new Map;for(const i of t){const t=Dl(i,n,this.scope),{layout:o,layoutId:s}=kl(i),r=(s?this.sharedTransitions.get(s):void 0)||this.defaultOptions,a=Rl(i,t?.projection,{layout:o,layoutId:s,animationType:"string"==typeof o?o:"both",transition:r});n.set(i,a),e.push(a)}return e}handleExitingElements(t,e){const n=new Set(e.map(t=>t.element));t.forEach(t=>{n.has(t.element)||(t.projection.options.layoutId&&(t.projection.isPresent=!1,t.projection.relegate()),t.visualElement.unmount(),Fs.delete(t.element))});const i=new Set(t.map(t=>t.element));e.forEach(({element:t,projection:e})=>{i.has(t)&&e.resumeFrom&&!e.resumeFrom.instance&&!e.isLead()&&(e.resumeFrom=void 0,e.snapshot=void 0)})}},t.LayoutGroup=Kl,t.LayoutGroupContext=m,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,o]=e.useState(!tc(n)),s=e.useRef(void 0);if(!tc(n)){const{renderer:t,...e}=n;s.current=t,Ql(e)}return e.useEffect(()=>{tc(n)&&n().then(({renderer:t,...e})=>{Ql(e),s.current=t,o(!0)})},[]),d(_l.Provider,{value:{renderer:s.current,strict:i},children:t})},t.MotionConfig=function({children:t,isValidProp:n,...i}){n&&oc(n);const o=e.useContext(jl);(i={...o,...i}).transition=si(i.transition,o.transition),i.isStatic=f(()=>i.isStatic);const s=e.useMemo(()=>i,[JSON.stringify(i.transition),i.transformPagePoint,i.reducedMotion,i.skipAnimations]);return d(jl.Provider,{value:s,children:t})},t.MotionConfigContext=jl,t.MotionContext=uc,t.MotionGlobalConfig=P,t.MotionValue=ii,t.NativeAnimation=In,t.NativeAnimationExtended=Wn,t.NativeAnimationWrapper=Zn,t.NodeStack=Ya,t.ObjectVisualElement=Ir,t.PopChild=Wl,t.PresenceChild=Ul,t.PresenceContext=v,t.Reorder=Ou,t.SVGVisualElement=Xr,t.SubscriptionManager=D,t.SwitchLayoutGroupContext=Ac,t.ViewTransitionBuilder=Ls,t.VisualElement=tr,t.WillChangeMotionValue=Xh,t.acceleratedValues=$n,t.activeAnimations=pt,t.addAttrValue=ho,t.addDomEvent=Wa,t.addPointerEvent=Oc,t.addPointerInfo=Ic,t.addScaleCorrector=function(t){for(const e in t)Dr[e]=t[e],ft(e)&&(Dr[e].isCSSVariable=!0)},t.addStyleValue=vo,t.addUniqueItem=x,t.addValueToWillChange=ki,t.alpha=Tt,t.analyseComplexValue=Yt,t.animate=nh,t.animateMini=oh,t.animateMotionValue=pi,t.animateSingleValue=Fa,t.animateTarget=Ii,t.animateValue=function(t){return new _e(t)},t.animateVariant=Oi,t.animateView=function(t,e={}){return new Ls(t,e)},t.animateVisualElement=Fi,t.animationControls=qh,t.animationMapKey=Qn,t.animations=Bc,t.anticipate=H,t.applyAxisDelta=pr,t.applyBoxDelta=mr,t.applyGeneratorOptions=jn,t.applyPointDelta=dr,t.applyPxDefaults=oo,t.applyTreeDeltas=yr,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const o=!0===i?1:"number"==typeof i?i:0;let s;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=gi(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a)<Math.abs(l),n=i.x+a*e,o=i.y+l*e,h=t?Math.sign(u.x-n):Math.sign(u.y-o);void 0!==s&&0!==h&&h!==s?(c=-c,u=gi(i.x,i.y,r.x,r.y,c,e)):0!==h&&(s=h)}const h=o?fi(0,i.x,u.x,r.x,i.y,u.y,r.y):0,d=o?fi(1,i.x,u.x,r.x,i.y,u.y,r.y):0,p=o?O(-180,180,d-h):0;return t=>{const e={x:mi(t,i.x,u.x,r.x),y:mi(t,i.y,u.y,r.y)};if(o){const n=fi(t,i.x,u.x,r.x,i.y,u.y,r.y),s=h+p*t;e.rotate=O(-180,180,n-s)*o}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateVisualElement(t,n,i,o,s){if(!("x"in n)&&!("y"in n))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,g={delay:o,...ri(i||{},"x")};delete g.path;const y=oi(0);y.start(pi("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),y.animation&&s.push(y.animation),delete n.x,delete n.y}};return n},t.aspectRatio=Ea,t.attachFollow=hs,t.attachSpring=function(t,e,n){return hs(t,e,{type:"spring",...n})},t.attrEffect=po,t.axisDeltaEquals=Aa,t.axisEquals=Ta,t.axisEqualsRounded=Sa,t.backIn=z,t.backInOut=Y,t.backOut=$,t.boxEquals=ba,t.boxEqualsRounded=Pa,t.buildHTMLStyles=Mr,t.buildProjectionTransform=Va,t.buildSVGAttrs=Nr,t.buildSVGPath=Wr,t.buildTransform=Ar,t.calcAxisDelta=aa,t.calcBoxDelta=la,t.calcChildStagger=ei,t.calcGeneratorDuration=pe,t.calcLength=sa,t.calcRelativeAxis=ca,t.calcRelativeAxisPosition=ha,t.calcRelativeBox=ua,t.calcRelativePosition=da,t.camelCaseAttributes=$r,t.camelToDash=Ri,t.cancelFrame=at,t.cancelMicrotask=bo,t.cancelSync=Bl,t.checkVariantsDidChange=Qr,t.circIn=X,t.circInOut=K,t.circOut=G,t.clamp=b,t.cleanDirtyNodes=el,t.collectMotionValues=ni,t.color=Wt,t.compareByDepth=Ua,t.complex=Gt,t.containsCSSVariable=xt,t.convertBoundingBoxToBox=ir,t.convertBoxToBoundingBox=or,t.convertOffsetToTimes=Ue,t.copyAxisDeltaInto=oa,t.copyAxisInto=na,t.copyBoxInto=ia,t.correctBorderRadius=kr,t.correctBoxShadow=Rr,t.correctParentTransform=function(t){return e=>{const n=t.current;if(!n)return e;const i=function(t){const{transform:e}=getComputedStyle(t);if(!e||"none"===e)return null;const n=e.match(/^matrix3d\((.*)\)$/u)||e.match(/^matrix\((.*)\)$/u);if(!n)return null;const i=n[1].split(",").map(Number),o=e.startsWith("matrix3d"),s=i[0],r=i[1],a=o?i[4]:i[2],l=o?i[5]:i[3],c=s*l-r*a;return Math.abs(c)<1e-10?null:{a:l/c,b:-r/c,c:-a/c,d:s/c}}(n);if(!i)return e;const o=n.getBoundingClientRect(),s=o.left+window.scrollX+o.width/2,r=o.top+window.scrollY+o.height/2,a=e.x-s,l=e.y-r;return{x:s+i.a*a+i.c*l,y:r+i.b*a+i.d*l}}},t.createAnimationState=Jr,t.createAxis=Is,t.createAxisDelta=Bs,t.createBox=Os,t.createDelta=js,t.createGeneratorEasing=me,t.createProjectionNode=Za,t.createRenderBatcher=st,t.createScopedAnimate=eh,t.cubicBezier=W,t.cubicBezierAsString=kn,t.defaultEasing=Ne,t.defaultOffset=We,t.defaultTransformValue=sn,t.defaultValueTypes=Zi,t.degrees=Dt,t.delay=$a,t.delayInSeconds=function(t,e){return $a(t,L(e))},t.dimensionValueTypes=Ui,t.disableInstantTransitions=function(){P.instantAnimations=!1},t.distance=Wc,t.distance2D=Uc,t.domAnimation=Ih,t.domMax=Oh,t.domMin=Fh,t.eachAxis=Ma,t.easeIn=_,t.easeInOut=Z,t.easeOut=q,t.easingDefinitionToFunction=nt,t.fillOffset=Fe,t.fillWildcards=qe,t.filterProps=sc,t.findDimensionValueType=Ni,t.findValueType=gs,t.flushKeyframeResolvers=Tn,t.followValue=us,t.frame=rt,t.frameData=lt,t.frameSteps=ct,t.generateLinearEasing=he,t.getAnimatableNone=to,t.getAnimationMap=ti,t.getComputedStyle=Uo,t.getDefaultTransition=ui,t.getDefaultValueType=Ji,t.getEasingForSegment=Q,t.getFeatureDefinitions=Qs,t.getFinalKeyframe=Ye,t.getMixer=se,t.getOptimisedAppearId=Bi,t.getOriginIndex=ls,t.getValueAsType=lo,t.getValueTransition=ri,t.getVariableValue=xi,t.getVariantContext=Kr,t.getViewAnimationLayerInfo=Ss,t.getViewAnimations=Es,t.globalProjectionState=Ha,t.has2DTranslate=cr,t.hasReducedMotionListener=Gs,t.hasScale=ar,t.hasTransform=lr,t.hasWarned=function(t){return I.has(t)},t.hex=kt,t.hover=Mo,t.hsla=Ft,t.hslaToRgba=_t,t.inView=Lh,t.inertia=Ie,t.initPrefersReducedMotion=_s,t.interpolate=Oe,t.invisibleValues=ne,t.isAnimationControls=Ws,t.isBezierDefinition=tt,t.isBrowser=g,t.isCSSVariableName=ft,t.isCSSVariableToken=yt,t.isControllingVariants=zs,t.isDeltaZero=wa,t.isDragActive=Po,t.isDragging=So,t.isEasingArray=J,t.isElementKeyboardAccessible=Ro,t.isElementTextInput=Lo,t.isForcedMotionValue=Lr,t.isGenerator=Bn,t.isHTMLElement=fo,t.isKeyframesTarget=Pi,t.isMotionComponent=ed,t.isMotionValue=Vi,t.isNear=ra,t.isNodeOrChild=Vo,t.isNumericalString=E,t.isObject=A,t.isPrimaryPointer=Co,t.isSVGElement=No,t.isSVGSVGElement=as,t.isSVGTag=zr,t.isTransitionDefined=di,t.isValidMotionProp=nc,t.isVariantLabel=Us,t.isVariantNode=Ys,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&Cn()||!e||"string"==typeof e&&(e in Rn||Cn())||tt(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=Ci,t.isZeroValueString=M,t.keyframes=$e,t.m=Bh,t.makeAnimationInstant=Nn,t.makeUseVisualState=Tc,t.mapEasingToNativeEasing=Dn,t.mapValue=function(t,e,n,i){const o=cs(e,n,i);return ms(()=>o(t.get()))},t.maxGeneratorDuration=de,t.measurePageBox=Sr,t.measureViewportBox=br,t.memo=V,t.microtask=To,t.millisecondsToSeconds=B,t.mirrorEasing=U,t.mix=ce,t.mixArray=re,t.mixColor=ee,t.mixComplex=le,t.mixImmediate=qt,t.mixLinearColor=Jt,t.mixNumber=Zt,t.mixObject=ae,t.mixValues=La,t.mixVisibility=ie,t.motion=xu,t.motionValue=oi,t.moveItem=T,t.nodeGroup=Pl,t.noop=C,t.number=wt,t.numberValueTypes=qi,t.observeTimeline=ts,t.optimizedAppearDataAttribute=Li,t.optimizedAppearDataId=Di,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:ro(t)[0]||document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=vi,t.parseValueFromTransform=rn,t.percent=Lt,t.pipe=k,t.pixelsToPercent=Cr,t.positionalKeys=Si,t.prefersReducedMotion=Xs,t.press=Wo,t.progress=R,t.progressPercentage=Ot,t.propEffect=mo,t.propagateDirtyNodes=tl,t.px=Bt,t.readTransformValue=an,t.recordStats=function(){if(ot.value)throw ss(),new Error("Stats are already being measured");const t=ot;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},rt.postRender(es,!0),rs},t.removeAxisDelta=ma,t.removeAxisTransforms=fa,t.removeBoxTransforms=va,t.removeItem=w,t.removePointDelta=pa,t.renderHTML=Vr,t.renderSVG=Yr,t.resize=Qo,t.resolveElements=ro,t.resolveMotionValue=za,t.resolveTransition=si,t.resolveVariant=bi,t.resolveVariantFromProps=Ti,t.reverseEasing=N,t.rgbUnit=Vt,t.rgba=Ct,t.rootProjectionNode=El,t.scale=bt,t.scaleCorrectors=Dr,t.scalePoint=hr,t.scrapeHTMLMotionValuesFromProps=Br,t.scrapeSVGMotionValuesFromProps=Hr,t.scroll=Rh,t.scrollInfo=bh,t.secondsToMilliseconds=L,t.setDragLock=Eo,t.setFeatureDefinitions=Js,t.setStyle=Pn,t.setTarget=Mi,t.spring=Be,t.springValue=function(t,e){return us(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(o,s)=>{const r="number"==typeof n?n:ls(n,s),a=Math.abs(r-o);let l=t*a;if(i){const e=s*t;l=nt(i)(l/e)*e}return e+l}},t.startOptimizedAppearAnimation=function(t,e,n,i,o){if(window.MotionIsMounted)return;const s=t.dataset[Di];if(!s)return;window.MotionHandoffAnimation=ad;const r=rd(s,e);cd||(cd=Ln(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"}),od.set(r,{animation:cd,startTime:null}),window.MotionHandoffAnimation=ad,window.MotionHasOptimisedAnimation=(t,e)=>{if(!t)return!1;if(!e)return sd.has(t);const n=rd(t,e);return Boolean(od.get(n))},window.MotionHandoffMarkAsComplete=t=>{sd.has(t)&&sd.set(t,!0)},window.MotionHandoffIsComplete=t=>!0===sd.get(t),window.MotionCancelOptimisedAnimation=(t,e,n,i)=>{const o=rd(t,e),s=od.get(o);s&&(n&&void 0===i?n.postRender(()=>{n.postRender(()=>{s.animation.cancel()})}):s.animation.cancel(),n&&i?(ud.add(s),n.render(hd)):(od.delete(o),od.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(t,e,n)=>{const i=Bi(t);if(!i)return;const o=window.MotionHasOptimisedAnimation?.(i,e),s=t.props.values?.[e];if(!o||!s)return;const r=n.on("change",t=>{s.get()!==t&&(window.MotionCancelOptimisedAnimation?.(i,e),r())});return r});const a=()=>{cd.cancel();const s=Ln(t,e,n,i);void 0===ld&&(ld=performance.now()),s.startTime=ld,od.set(r,{animation:s,startTime:ld}),o&&o(s)};sd.set(s,!1),cd.ready?cd.ready.then(a).catch(C):a()},t.startWaapiAnimation=Ln,t.statsBuffer=ot,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(i):Math.ceil(i);return b(0,1,o/t)}},t.styleEffect=xo,t.supportedWaapiEasing=Rn,t.supportsBrowserAnimation=Xn,t.supportsFlags=En,t.supportsLinearEasing=Cn,t.supportsPartialKeyframes=so,t.supportsScrollTimeline=Mn,t.supportsViewTimeline=Vn,t.svgEffect=wo,t.sync=Ll,t.testValueType=Wi,t.time=dt,t.transform=cs,t.transformAxis=xr,t.transformBox=Tr,t.transformBoxPoints=sr,t.transformPropOrder=cn,t.transformProps=un,t.transformValue=ms,t.transformValueTypes=_i,t.transformViewBoxPoint=function(t){return e=>{const n=t.current;if(!n)return e;const i=n.viewBox?.baseVal;if(!i||0===i.width&&0===i.height)return e;const o=n.getBoundingClientRect();if(0===o.width||0===o.height)return e;const s=i.width/o.width,r=i.height/o.height,a=o.left+window.scrollX,l=o.top+window.scrollY;return{x:(e.x-a)*s+a,y:(e.y-l)*r+l}}},t.translateAxis=vr,t.unwrapMotionComponent=function(t){if(ed(t))return t[Pc]},t.updateMotionValuesFromProps=Hs,t.useAnimate=function(){const t=f(()=>({current:null,animations:[]})),n=Kh()??void 0,{skipAnimations:i}=e.useContext(jl),o=e.useMemo(()=>eh({scope:t,reduceMotion:n,skipAnimations:i}),[t,n,i]);return jh(()=>{t.animations.forEach(t=>t.stop()),t.animations.length=0}),[t,o]},t.useAnimateMini=function(){const t=f(()=>({current:null,animations:[]})),e=f(()=>ih(t));return jh(()=>{t.animations.forEach(t=>t.stop())}),[t,e]},t.useAnimation=Jh,t.useAnimationControls=Zh,t.useAnimationFrame=Hh,t.useComposedRefs=Ol,t.useCycle=function(...t){const n=e.useRef(0),[i,o]=e.useState(t[n.current]),s=e.useCallback(e=>{n.current="number"!=typeof e?O(0,t.length,n.current+1):e,o(t[n.current])},[t.length,...t]);return[i,s]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),o=md({},!1),s=f(()=>new pd({props:{onUpdate:t=>{i({...t})}},visualState:o,presenceContext:null},{initialState:t}));return e.useLayoutEffect(()=>(s.mount({}),()=>s.unmount()),[s]),[n,f(()=>t=>Fi(s,t))]},t.useDeprecatedInvertedScale=function(n){let i=Su(1),o=Su(1);const{visualElement:s}=e.useContext(uc);return t.invariant(!(!n&&!s),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),t.warning(yd,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),yd=!0,n?(i=n.scaleX||i,o=n.scaleY||o):s&&(i=s.getValue("scaleX",1),o=s.getValue("scaleY",1)),{scaleX:Eu(i,gd),scaleY:Eu(o,gd)}},t.useDomEvent=function(t,n,i,o){e.useEffect(()=>{const e=t.current;if(i&&e)return Wa(e,n,i,o)},[t,n,i,o])},t.useDragControls=function(){return f(td)},t.useElementScroll=function(t){return zh({container:t})},t.useFollowValue=Yh,t.useForceUpdate=Xl,t.useInView=function(t,{root:n,margin:i,amount:o,once:s=!1,initial:r=!1}={}){const[a,l]=e.useState(r);return e.useEffect(()=>{if(!t.current||s&&a)return;const e={root:n&&n.current||void 0,margin:i,amount:o};return Lh(t.current,()=>(l(!0),s?void 0:()=>l(!1)),e)},[n,t,i,s,o]),a},t.useInstantLayoutTransition=nd,t.useInstantTransition=function(){const[t,n]=Xl(),i=nd(),o=e.useRef(-1);return e.useEffect(()=>{rt.postRender(()=>rt.postRender(()=>{n===o.current&&(P.instantAnimations=!1)}))},[n]),e=>{i(()=>{P.instantAnimations=!0,t(),e(),o.current=n+1})}},t.useIsPresent=function(){return null===(t=e.useContext(v))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return Pu(e.filter(Vi),function(){let i="";for(let o=0;o<n;o++){i+=t[o];const n=e[o];n&&(i+=Vi(n)?n.get():n)}return i})},t.useMotionValue=Su,t.useMotionValueEvent=Wh,t.usePageInView=function(){const[t,n]=e.useState(!0);return e.useEffect(()=>{const t=()=>n(!document.hidden);return document.hidden&&t(),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),t},t.usePresence=$l,t.usePresenceData=function(){const t=e.useContext(v);return t?t.custom:void 0},t.useReducedMotion=Gh,t.useReducedMotionConfig=Kh,t.useResetProjection=function(){return e.useCallback(()=>{const t=El.current;t&&t.resetTree()},[])},t.useScroll=zh,t.useSpring=function(t,e={}){return Yh(t,{type:"spring",...e})},t.useTime=function(){const t=Su(0);return Hh(e=>t.set(e)),t},t.useTransform=Eu,t.useUnmountEffect=jh,t.useVelocity=function(t){const e=Su(t.getVelocity()),n=()=>{const i=t.getVelocity();e.set(i),i&&rt.update(n)};return Wh(t,"change",()=>{rt.update(n,!1,!0)}),e},t.useViewportScroll=function(){return zh()},t.useWillChange=function(){return f(()=>new Xh("auto"))},t.variantPriorityOrder=Ns,t.variantProps=$s,t.velocityPerSecond=j,t.vh=jt,t.visualElementStore=Fs,t.vw=It,t.warnOnce=function(t,e,n){t||I.has(e)||(console.warn(S(e,n)),I.add(e))},t.wrap=O});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var i=n(e),o=React,s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(t,e,n){var i,o={},r=null,u=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,i)&&!c.hasOwnProperty(i)&&(o[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===o[i]&&(o[i]=e[i]);return{$$typeof:s,type:t,key:r,ref:u,props:o,_owner:l.current}}const h=r,d=u,p=u,m=e.createContext({});function f(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null);function x(t,e){-1===t.indexOf(e)&&t.push(e)}function w(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function S([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[o]=t.splice(e,1);t.splice(i,0,o)}return t}const b=(t,e,n)=>n>e?e:n<t?t:n;function T(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}t.warning=()=>{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(T(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(T(e,n))});const P={},E=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),A=t=>"object"==typeof t&&null!==t,M=t=>/^0[^.\s]+$/u.test(t);function C(t){let e;return()=>(void 0===e&&(e=t()),e)}const V=t=>t,k=(...t)=>t.reduce((t,e)=>n=>e(t(n))),R=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class D{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>w(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const L=t=>1e3*t,B=t=>t/1e3,O=(t,e)=>e?t*(1e3/e):0,I=new Set;function j(t,e,n){t||I.has(e)||(console.warn(T(e,n)),I.add(e))}const F=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},W=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function $(t,e,n,i){if(t===e&&n===i)return V;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=W(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:W(o(t),e,i)}const N=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,U=t=>e=>1-t(1-e),z=$(.33,1.53,.69,.99),Y=U(z),H=N(Y),X=t=>t>=1?1:(t*=2)<1?.5*Y(t):.5*(2-Math.pow(2,-10*(t-1))),G=t=>1-Math.sin(Math.acos(t)),K=U(G),_=N(G),q=$(.42,0,1,1),Z=$(0,0,.58,1),J=$(.42,0,.58,1);const Q=t=>Array.isArray(t)&&"number"!=typeof t[0];function tt(t,e){return Q(t)?t[F(0,t.length,e)]:t}const et=t=>Array.isArray(t)&&"number"==typeof t[0],nt={linear:V,easeIn:q,easeInOut:J,easeOut:Z,circIn:G,circInOut:_,circOut:K,backIn:Y,backInOut:H,backOut:z,anticipate:X},it=e=>{if(et(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,o,s]=e;return $(n,i,o,s)}return"string"==typeof e?(t.invariant(void 0!==nt[e],`Invalid easing type '${e}'`,"invalid-easing-type"),nt[e]):e},ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function st(t,e){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,r=ot.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,o=!1;const s=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){s.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,o=!1,r=!1)=>{const a=r&&i?e:n;return o&&s.add(t),a.add(t),t},cancel:t=>{n.delete(t),s.delete(t)},process:t=>{if(r=t,i)return void(o=!0);i=!0;const s=e;e=n,n=s,e.forEach(a),e.clear(),i=!1,o&&(o=!1,l.process(t))}};return l}(s),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:p,postRender:m}=r,f=()=>{const s=P.useManualTiming,r=s?o.timestamp:performance.now();n=!1,s||(o.delta=i?1e3/60:Math.max(Math.min(r-o.timestamp,40),1)),o.timestamp=r,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),h.process(o),d.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:ot.reduce((e,s)=>{const a=r[s];return e[s]=(e,s=!1,r=!1)=>(n||(n=!0,i=!0,o.isProcessing||t(f)),a.schedule(e,s,r)),e},{}),cancel:t=>{for(let e=0;e<ot.length;e++)r[ot[e]].cancel(t)},state:o,steps:r}}const{schedule:rt,cancel:at,state:lt,steps:ct}=st("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:V,!0);let ut;function ht(){ut=void 0}const dt={now:()=>(void 0===ut&&dt.set(lt.isProcessing||P.useManualTiming?lt.timestamp:performance.now()),ut),set:t=>{ut=t,queueMicrotask(ht)}},pt=t=>e=>"string"==typeof e&&e.startsWith(t),mt=pt("--"),ft=pt("var(--"),gt=t=>!!ft(t)&&yt.test(t.split("/*")[0].trim()),yt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const xt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},wt={...xt,transform:t=>b(0,1,t)},St={...xt,default:1},bt=t=>Math.round(1e5*t)/1e5,Tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Pt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Et=(t,e)=>n=>Boolean("string"==typeof n&&Pt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),At=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[o,s,r,a]=i.match(Tt);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Mt={...xt,transform:t=>Math.round((t=>b(0,255,t))(t))},Ct={test:Et("rgb","red"),parse:At("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Mt.transform(t)+", "+Mt.transform(e)+", "+Mt.transform(n)+", "+bt(wt.transform(i))+")"};const Vt={test:Et("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:Ct.transform},kt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Rt=kt("deg"),Dt=kt("%"),Lt=kt("px"),Bt=kt("vh"),Ot=kt("vw"),It=(()=>({...Dt,parse:t=>Dt.parse(t)/100,transform:t=>Dt.transform(100*t)}))(),jt={test:Et("hsl","hue"),parse:At("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Dt.transform(bt(e))+", "+Dt.transform(bt(n))+", "+bt(wt.transform(i))+")"},Ft={test:t=>Ct.test(t)||Vt.test(t)||jt.test(t),parse:t=>Ct.test(t)?Ct.parse(t):jt.test(t)?jt.parse(t):Vt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ct.transform(t):jt.transform(t),getAnimatableNone:t=>{const e=Ft.parse(t);return e.alpha=0,Ft.transform(e)}},Wt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $t="number",Nt="color",Ut=/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 zt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},o=[];let s=0;const r=e.replace(Ut,t=>(Ft.test(t)?(i.color.push(s),o.push(Nt),n.push(Ft.parse(t))):t.startsWith("var(")?(i.var.push(s),o.push("var"),n.push(t)):(i.number.push(s),o.push($t),n.push(parseFloat(t))),++s,"${}")).split("${}");return{values:n,split:r,indexes:i,types:o}}function Yt({split:t,types:e}){const n=t.length;return i=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],void 0!==i[s]){const t=e[s];o+=t===$t?bt(i[s]):t===Nt?Ft.transform(i[s]):i[s]}return o}}const Ht=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Ft.test(n)?Ft.getAnimatableNone(n):n;var n};const Xt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Tt)?.length||0)+(t.match(Wt)?.length||0)>0},parse:function(t){return zt(t).values},createTransformer:function(t){return Yt(zt(t))},getAnimatableNone:function(t){const e=zt(t);return Yt(e)(e.values.map((t,n)=>Ht(t,e.split[n])))}};function Gt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Kt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=Gt(a,i,t+1/3),s=Gt(a,i,t),r=Gt(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}function _t(t,e){return n=>n>0?e:t}const qt=(t,e,n)=>t+(e-t)*n,Zt=(t,e,n)=>{const i=t*t,o=n*(e*e-i)+i;return o<0?0:Math.sqrt(o)},Jt=[Vt,Ct,jt];function Qt(e){const n=(i=e,Jt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let o=n.parse(e);return n===jt&&(o=Kt(o)),o}const te=(t,e)=>{const n=Qt(t),i=Qt(e);if(!n||!i)return _t(t,e);const o={...n};return t=>(o.red=Zt(n.red,i.red,t),o.green=Zt(n.green,i.green,t),o.blue=Zt(n.blue,i.blue,t),o.alpha=qt(n.alpha,i.alpha,t),Ct.transform(o))},ee=new Set(["none","hidden"]);function ne(t,e){return ee.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function ie(t,e){return n=>qt(t,e,n)}function oe(t){return"number"==typeof t?ie:"string"==typeof t?gt(t)?_t:Ft.test(t)?te:ae:Array.isArray(t)?se:"object"==typeof t?Ft.test(t)?te:re:_t}function se(t,e){const n=[...t],i=n.length,o=t.map((t,n)=>oe(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}}function re(t,e){const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=oe(t[o])(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const ae=(e,n)=>{const i=Xt.createTransformer(n),o=zt(e),s=zt(n);return o.indexes.var.length===s.indexes.var.length&&o.indexes.color.length===s.indexes.color.length&&o.indexes.number.length>=s.indexes.number.length?ee.has(e)&&!s.values.length||ee.has(n)&&!o.values.length?ne(e,n):k(se(function(t,e){const n=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const s=e.types[o],r=t.indexes[s][i[s]],a=t.values[r]??0;n[o]=a,i[s]++}return n}(o,s),s.values),i):(t.warning(!0,`Complex values '${e}' and '${n}' 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"),_t(e,n))};function le(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return qt(t,e,n);return oe(t)(t,e)}const ce=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>rt.update(e,t),stop:()=>at(e),now:()=>lt.isProcessing?lt.timestamp:dt.now()}},ue=(t,e,n=10)=>{let i="";const o=Math.max(Math.round(e/n),2);for(let e=0;e<o;e++)i+=Math.round(1e4*t(e/(o-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},he=2e4;function de(t){let e=0;let n=t.next(e);for(;!n.done&&e<he;)e+=50,n=t.next(e);return e>=he?1/0:e}function pe(t,e=100,n){const i=n({...t,keyframes:[0,e]}),o=Math.min(de(i),he);return{type:"keyframes",ease:t=>i.next(o*t).value/e,duration:B(o)}}const me=100,fe=10,ge=1,ye=0,ve=800,xe=.3,we=.3,Se={granular:.01,default:2},be={granular:.005,default:.5},Te=.01,Pe=10,Ee=.05,Ae=1;function Me(t,e){return t*Math.sqrt(1-e*e)}const Ce=.001;const Ve=["duration","bounce"],ke=["stiffness","damping","mass"];function Re(t,e){return e.some(e=>void 0!==t[e])}function De(e){let n={velocity:ye,stiffness:me,damping:fe,mass:ge,isResolvedFromDuration:!1,...e};if(!Re(e,ke)&&Re(e,Ve))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,i=2*Math.PI/(1.2*t),o=i*i,s=2*b(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:ge,stiffness:o,damping:s}}else{const i=function({duration:e=ve,bounce:n=xe,velocity:i=ye,mass:o=ge}){let s,r;t.warning(e<=L(Pe),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=b(Ee,Ae,a),e=b(Te,Pe,B(e)),a<1?(s=t=>{const n=t*a,o=n*e,s=n-i,r=Me(t,a),l=Math.exp(-o);return Ce-s/r*l},r=t=>{const n=t*a*e,o=n*i+i,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=Me(Math.pow(t,2),a);return(-s(t)+Ce>0?-1:1)*((o-r)*l)/c}):(s=t=>Math.exp(-t*e)*((t-i)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(i-t)));const l=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/e);if(e=L(e),isNaN(l))return{stiffness:me,damping:fe,duration:e};{const t=Math.pow(l,2)*o;return{stiffness:t,damping:2*a*Math.sqrt(o*t),duration:e}}}({...e,velocity:0});n={...n,...i,mass:ge},n.isResolvedFromDuration=!0}return n}function Le(t=we,e=xe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:o}=n;const s=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=De({...n,velocity:-B(n.velocity||0)}),m=d||0,f=c/(2*Math.sqrt(l*u)),g=r-s,y=B(Math.sqrt(l/u)),v=Math.abs(g)<5;let x,w,S,b,T,P;if(i||(i=v?Se.granular:Se.default),o||(o=v?be.granular:be.default),f<1)S=Me(y,f),b=(m+f*y*g)/S,x=t=>{const e=Math.exp(-f*y*t);return r-e*(b*Math.sin(S*t)+g*Math.cos(S*t))},T=f*y*b+g*S,P=f*y*g-b*S,w=t=>Math.exp(-f*y*t)*(T*Math.sin(S*t)+P*Math.cos(S*t));else if(1===f){x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);const t=m+y*g;w=e=>Math.exp(-y*e)*(y*t*e-m)}else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(m+f*y*g)/t,n=f*y*e-g*t,i=f*y*g-e*t;w=e=>{const o=Math.exp(-f*y*e),s=Math.min(t*e,300);return o*(n*Math.sinh(s)+i*Math.cosh(s))}}const E={calculatedDuration:p&&h||null,velocity:t=>L(w(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*y*t),n=Math.sin(S*t),s=Math.cos(S*t),l=r-e*(b*n+g*s),c=L(e*(T*n+P*s));return a.done=Math.abs(c)<=i&&Math.abs(r-l)<=o,a.value=a.done?r:l,a}const e=x(t);if(p)a.done=t>=h;else{const n=L(w(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=o}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(de(E),he),e=ue(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}Le.applyToOptions=t=>{const e=pe(t,100,Le);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};function Be(t,e,n){const i=Math.max(e-5,0);return O(n-t(i),e-i)}function Oe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let w,S;const b=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,S=Le({keyframes:[d.value,p(d.value)],velocity:Be(v,t,d.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return S||void 0!==w||(e=!0,x(t),b(t)),void 0!==w&&t>=w?S.next(t-w):(!e&&x(t),d)}}}function Ie(e,n,{clamp:i=!0,ease:o,mixer:s}={}){const r=e.length;if(t.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const l=function(t,e,n){const i=[],o=n||P.mix||le,s=t.length-1;for(let n=0;n<s;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||V:e;s=k(t,s)}i.push(s)}return i}(n,o,s),c=l.length,u=t=>{if(a&&t<e[0])return n[0];let i=0;if(c>1)for(;i<e.length-2&&!(t<e[i+1]);i++);const o=R(e[i],e[i+1],t);return l[i](o)};return i?t=>u(b(e[0],e[r-1],t)):u}function je(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=R(0,e,i);t.push(qt(n,1,o))}}function Fe(t){const e=[0];return je(e,t.length-1),e}function We(t,e){return t.map(t=>t*e)}function $e(t,e){return t.map(()=>e||J).splice(0,t.length-1)}function Ne({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const o=Q(i)?i.map(it):it(i),s={done:!1,value:e[0]},r=Ie(We(n&&n.length===e.length?n:Fe(e),t),e,{ease:Array.isArray(o)?o:$e(e,o)});return{calculatedDuration:t,next:e=>(s.value=r(e),s.done=e>=t,s)}}const Ue=t=>null!==t;function ze(t,{repeat:e,repeatType:n="loop"},i,o=1){const s=t.filter(Ue),r=o<0||e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}const Ye={decay:Oe,inertia:Oe,tween:Ne,keyframes:Ne,spring:Le};function He(t){"string"==typeof t.type&&(t.type=Ye[t.type])}class Xe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ge=t=>t/100;class Ke extends Xe{constructor(t){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:t}=this.options;t&&t.updatedAt!==dt.now()&&this.tick(dt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;He(t);const{type:e=Ne,repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=t;let{keyframes:r}=t;const a=e||Ne;a!==Ne&&"number"!=typeof r[0]&&(this.mixKeyframes=k(Ge,le(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===o&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-s})),null===l.calculatedDuration&&(l.calculatedDuration=de(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,x=this.currentTime,w=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(w=s)),x=b(0,1,n)*r}y?(this.delayState.value=c[0],v=this.delayState):v=w.next(x),o&&!y&&(v.value=o(v.value));let{done:S}=v;y||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return T&&p!==Oe&&(v.value=ze(c,this.options,f,this.speed)),m&&m(v.value),T&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return B(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(this.currentTime)}set time(t){t=L(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Be(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(dt.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=B(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ce,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(dt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&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(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function _e(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const qe=t=>180*t/Math.PI,Ze=t=>{const e=qe(Math.atan2(t[1],t[0]));return Qe(e)},Je={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ze,rotateZ:Ze,skewX:t=>qe(Math.atan(t[1])),skewY:t=>qe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Qe=t=>((t%=360)<0&&(t+=360),t),tn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),en=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),nn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:tn,scaleY:en,scale:t=>(tn(t)+en(t))/2,rotateX:t=>Qe(qe(Math.atan2(t[6],t[5]))),rotateY:t=>Qe(qe(Math.atan2(-t[2],t[0]))),rotateZ:Ze,rotate:Ze,skewX:t=>qe(Math.atan(t[4])),skewY:t=>qe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function on(t){return t.includes("scale")?1:0}function sn(t,e){if(!t||"none"===t)return on(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=nn,o=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Je,o=e}if(!o)return on(e);const s=i[e],r=o[1].split(",").map(an);return"function"==typeof s?s(r):r[s]}const rn=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return sn(n,e)};function an(t){return parseFloat(t.trim())}const ln=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cn=(()=>new Set([...ln,"pathRotation"]))(),un=t=>t===xt||t===Lt,hn=new Set(["x","y","z"]),dn=ln.filter(t=>!hn.has(t));const pn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-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})=>sn(e,"x"),y:(t,{transform:e})=>sn(e,"y")};pn.translateX=pn.x,pn.translateY=pn.y;const mn=new Set;let fn=!1,gn=!1,yn=!1;function vn(){if(gn){const t=Array.from(mn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return dn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}gn=!1,fn=!1,mn.forEach(t=>t.complete(yn)),mn.clear()}function xn(){mn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(gn=!0)})}function wn(){yn=!0,xn(),vn(),yn=!1}class Sn{constructor(t,e,n,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(mn.add(this),fn||(fn=!0,rt.read(xn),rt.resolveKeyframes(vn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const o=i?.get(),s=t[t.length-1];if(void 0!==o)t[0]=o;else if(n&&e){const i=n.readValue(e,s);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=s),i&&void 0===o&&i.set(t[0])}_e(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),mn.delete(this)}cancel(){"scheduled"===this.state&&(mn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const bn=t=>t.startsWith("--");function Tn(t,e,n){bn(e)?t.style.setProperty(e,n):t.style[e]=n}const Pn={};function En(t,e){const n=C(t);return()=>Pn[e]??n()}const An=En(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Mn=En(()=>void 0!==window.ViewTimeline,"viewTimeline"),Cn=En(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Vn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,kn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vn([0,.65,.55,1]),circOut:Vn([.55,0,1,.45]),backIn:Vn([.31,.01,.66,-.59]),backOut:Vn([.33,1.53,.69,.99])};function Rn(t,e){return t?"function"==typeof t?Cn()?ue(t,e):"ease-out":et(t)?Vn(t):Array.isArray(t)?t.map(t=>Rn(t,e)||kn.easeOut):kn[t]:void 0}function Dn(t,e,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Rn(a,o);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:o,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function Ln(t){return"function"==typeof t&&"applyToOptions"in t}function Bn({type:t,...e}){return Ln(t)&&Cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class On extends Xe{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:o,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Bn(e);this.animation=Dn(n,i,o,c,s),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=ze(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Tn(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return B(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=L(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&An()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),V):i(this)}}const In={anticipate:X,backInOut:H,circInOut:_};function jn(t){"string"==typeof t.ease&&t.ease in In&&(t.ease=In[t.ease])}class Fn extends On{constructor(t){jn(t),He(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:o,...s}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ke({...s,autoplay:!1}),a=Math.max(10,dt.now()-this.startTime),l=b(0,10,a-10),c=r.sample(a).value,{name:u}=this.options;o&&u&&Tn(o,u,c),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,c,l),r.stop()}}const Wn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Xt.test(t)&&"0"!==t||t.startsWith("url(")));function $n(t){t.duration=0,t.type="keyframes"}const Nn=new Set(["opacity","clipPath","filter","transform"]),Un=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const zn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Yn=C(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Hn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:o,damping:s,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return Yn()&&n&&(Nn.has(n)||zn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Un.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==o&&0!==s&&"inertia"!==r}class Xn extends Xe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=dt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:o,repeatType:s,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||Sn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,o){this.keyframeResolver=void 0;const{name:s,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=dt.now();let h=!0;(function(e,n,i,o){const s=e[0];if(null===s)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=Wn(s,n),l=Wn(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${s}" to "${r}". "${a?r:s}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(e)||("spring"===i||Ln(i))&&o)})(e,s,r,a)||(h=!1,!P.instantAnimations&&l||u?.(ze(e,i,n)),e[0]=e[e.length-1],$n(i),i.repeat=0);const d={startTime:o?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},p=h&&!c&&Hn(d),m=d.motionValue?.owner?.current;let f;if(p)try{f=new Fn({...d,element:m})}catch{f=new Ke(d)}else f=new Ke(d);f.finished.then(()=>{this.notifyFinished()}).catch(V),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),wn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Gn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Kn(this.animations,"duration")}get iterationDuration(){return Kn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Kn(t,e){let n=0;for(let i=0;i<t.length;i++){const o=t[i][e];null!==o&&o>n&&(n=o)}return n}class _n extends Gn{then(t,e){return this.finished.finally(t).then(()=>{})}}class qn extends On{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Zn=new WeakMap,Jn=(t,e="")=>`${t}:${e}`;function Qn(t){let e=Zn.get(t);return e||(e=new Map,Zn.set(t,e)),e}function ti(t,e,n,i=0,o=1){const s=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(s,r):1===o?s*i:a-s*i}const ei={current:void 0};class ni{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=dt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=dt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new D);const n=this.events[t].add(e);return"change"===t?()=>{n(),rt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ei.current&&ei.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return O(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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 ii(t,e){return new ni(t,e)}function oi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function si(t,e){const n=t?.[e]??t?.default??t;return n!==t?oi(n,t):n}const ri={type:"spring",stiffness:500,damping:25,restSpeed:10},ai={type:"keyframes",duration:.8},li={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ci=(t,{keyframes:e})=>e.length>2?ai:cn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ri:li,ui=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function hi(t){for(const e in t)if(!ui.has(e))return!0;return!1}const di=(t,e,n,i={},o,s)=>r=>{const a=si(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=L(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};hi(a)||Object.assign(u,ci(t,u)),u.duration&&(u.duration=L(u.duration)),u.repeatDelay&&(u.repeatDelay=L(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&($n(u),0===u.delay&&(h=!0)),(P.instantAnimations||P.skipAnimations||o?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,$n(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!s&&void 0!==e.get()){const t=ze(u.keyframes,a);if(void 0!==t)return void rt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Ke(u):new Xn(u)};function pi(t,e,n,i){const o=1-t;return o*o*e+2*o*t*n+t*t*i}function mi(t,e,n,i,o,s,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(s-o)+2*t*(r-s);return Math.atan2(l,a)*(180/Math.PI)}function fi(t,e,n,i,o,s){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=o*l;return{x:t+r*s+-a/l*n,y:e+a*s+r/l*n}}return{x:t,y:e}}const gi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yi(t){const e=gi.exec(t);if(!e)return[,];const[,n,i,o]=e;return[`--${n??i}`,o]}function vi(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[o,s]=yi(e);if(!o)return;const r=window.getComputedStyle(n).getPropertyValue(o);if(r){const t=r.trim();return E(t)?parseFloat(t):t}return gt(s)?vi(s,n,i+1):s}function xi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function wi(t,e,n,i){if("function"==typeof e){const[o,s]=xi(i);e=e(void 0!==n?n:t.custom,o,s)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,s]=xi(i);e=e(void 0!==n?n:t.custom,o,s)}return e}function Si(t,e,n){const i=t.getProps();return wi(i,e,void 0!==n?n:i.custom,t)}const bi=new Set(["width","height","top","left","right","bottom",...ln]),Ti=t=>Array.isArray(t);function Pi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ii(n))}function Ei(t){return Ti(t)?t[t.length-1]||0:t}function Ai(t,e){const n=Si(t,e);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const e in s){Pi(t,e,Ei(s[e]))}}const Mi=t=>Boolean(t&&t.getVelocity);function Ci(t){return Boolean(Mi(t)&&t.add)}function Vi(t,e){const n=t.getValue("willChange");if(Ci(n))return n.add(e);if(!n&&P.WillChange){const n=new P.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function ki(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ri="framerAppearId",Di="data-"+ki(Ri);function Li(t){return t.props[Di]}function Bi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Oi(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();s=s?oi(s,l):l;const c=s?.reduceMotion,u=s?.skipAnimations;i&&(s=i);const h=[],d=o&&t.animationState&&t.animationState.getState()[o],p=s?.path;p&&p.animateVisualElement(t,a,s,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),o=a[e];if(void 0===o||d&&Bi(d,e))continue;const r={delay:n,...si(s||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(o)&&o===l&&!r.velocity){rt.update(()=>i.set(o));continue}let p=!1;if(window.MotionHandoffAnimation){const n=Li(t);if(n){const t=window.MotionHandoffAnimation(n,e,rt);null!==t&&(r.startTime=t,p=!0)}}Vi(t,e);const m=c??t.shouldReduceMotion;i.start(di(e,i,o,m&&bi.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>rt.update(()=>{r&&Ai(t,r)});h.length?Promise.all(h).then(e):e()}return h}function Ii(t,e,n={}){const i=Si(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(Oi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,o=0,s=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Ii(l,e,{...r,delay:n+("function"==typeof i?0:i)+ti(t.variantChildren,l,i,o,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,s,r,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[s,r]:[r,s];return t().then(()=>e())}return Promise.all([s(),r(n.delay)])}function ji(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>Ii(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=Ii(t,e,n);else{const o="function"==typeof e?Si(t,e,n.custom):e;i=Promise.all(Oi(t,o,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Fi=t=>e=>e.test(t),Wi=[xt,Lt,Dt,Rt,Ot,Bt,{test:t=>"auto"===t,parse:t=>t}],$i=t=>Wi.find(Fi(t));function Ni(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||M(t))}const Ui=new Set(["brightness","contrast","saturate","opacity"]);function zi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Tt)||[];if(!i)return t;const o=n.replace(i,"");let s=Ui.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const Yi=/\b([a-z-]*)\(.*?\)/gu,Hi={...Xt,getAnimatableNone:t=>{const e=t.match(Yi);return e?e.map(zi).join(" "):t}},Xi={...Xt,getAnimatableNone:t=>{const e=Xt.parse(t);return Xt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Gi={...xt,transform:Math.round},Ki={rotate:Rt,pathRotation:Rt,rotateX:Rt,rotateY:Rt,rotateZ:Rt,scale:St,scaleX:St,scaleY:St,scaleZ:St,skew:Rt,skewX:Rt,skewY:Rt,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:wt,originX:It,originY:It,originZ:Lt},_i={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,inset:Lt,insetBlock:Lt,insetBlockStart:Lt,insetBlockEnd:Lt,insetInline:Lt,insetInlineStart:Lt,insetInlineEnd:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,paddingBlock:Lt,paddingBlockStart:Lt,paddingBlockEnd:Lt,paddingInline:Lt,paddingInlineStart:Lt,paddingInlineEnd:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,marginBlock:Lt,marginBlockStart:Lt,marginBlockEnd:Lt,marginInline:Lt,marginInlineStart:Lt,marginInlineEnd:Lt,fontSize:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt,...Ki,zIndex:Gi,fillOpacity:wt,strokeOpacity:wt,numOctaves:Gi},qi={..._i,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:Hi,WebkitFilter:Hi,mask:Xi,WebkitMask:Xi},Zi=t=>qi[t],Ji=new Set([Hi,Xi]);function Qi(t,e){let n=Zi(t);return Ji.has(n)||(n=Xt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const to=new Set(["auto","none","0"]);class eo extends Sn{constructor(t,e,n,i,o){super(t,e,n,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),gt(i))){const o=vi(i,e.current);void 0!==o&&(t[n]=o),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!bi.has(n)||2!==t.length)return;const[i,o]=t,s=$i(i),r=$i(o);if(vt(i)!==vt(o)&&pn[n])this.needsMeasurement=!0;else if(s!==r)if(un(s)&&un(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else pn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Ni(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,o=0;for(;o<t.length&&!i;){const e=t[o];"string"==typeof e&&!to.has(e)&&zt(e).values.length&&(i=t[o]),o++}if(i&&n)for(const o of e)t[o]=Qi(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=pn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const o=n.length-1,s=n[o];n[o]=pn[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const no=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function io(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&no.has(e)&&(t[n]=t[n]+"px")}const oo=C(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function so(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const o=n?.[t]??i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(t=>null!=t)}function ro(t){return(e,n)=>{const i=so(e),o=[];for(const e of i){const i=t(e,n);o.push(i)}return()=>{for(const t of o)t()}}}const ao=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class lo{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,o=!0){const s=this.values.get(t);s&&s.onRemove();const r=()=>{const i=e.get();this.latest[t]=o?ao(i,_i[t]):i,n&&rt.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&&at(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}}function co(t){const e=new WeakMap;return(n,i)=>{const o=e.get(n)??new lo;e.set(n,o);const s=[];for(const e in i){const r=i[e],a=t(n,o,e,r);s.push(a)}return()=>{for(const t of s)t()}}}const uo=(t,e,n,i)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),s=o?n:n.startsWith("data")||n.startsWith("aria")?ki(n):n,r=o?()=>{t[s]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(s):t.setAttribute(s,String(i))};return e.set(n,i,r)},ho=ro(co(uo)),po=co((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function mo(t){return A(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const fo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const go=new Set(["originX","originY","originZ"]),yo=(t,e,n,i)=>{let o,s;return cn.has(n)?(e.get("transform")||(mo(t)||e.get("transformBox")||yo(t,e,"transformBox",new ni("fill-box")),e.set("transform",new ni("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i<ln.length;i++){const o=ln[i],s=t.latest[o];if(void 0===s)continue;let r=!0;if("number"==typeof s)r=s===(o.startsWith("scale")?1:0);else{const t=parseFloat(s);r=o.startsWith("scale")?1===t:0===t}r||(n=!1,e+=`${fo[o]||o}(${s}) `)}const i=t.latest.pathRotation;return i&&(n=!1,e+=`rotate(${"number"==typeof i?`${i}deg`:i}) `),n?"none":e.trim()}(e)})),s=e.get("transform")):go.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new ni(""),()=>{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",o=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${o}`}),s=e.get("transformOrigin")):o=bn(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,o,s)},vo=ro(co(yo));const xo=ro(co((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return rt.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new ni("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return uo(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?yo:uo)(t,e,n,i)}));const{schedule:wo,cancel:So}=st(queueMicrotask,!1),bo={x:!1,y:!1};function To(){return bo.x||bo.y}function Po(t){return"x"===t||"y"===t?bo[t]?null:(bo[t]=!0,()=>{bo[t]=!1}):bo.x||bo.y?null:(bo.x=bo.y=!0,()=>{bo.x=bo.y=!1})}function Eo(t,e){const n=so(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Ao(t,e,n={}){const[i,o,s]=Eo(t,n);return i.forEach(t=>{let n,i=!1,s=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),s&&(s=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?s=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||To())return;s=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,o))},o),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,o),window.addEventListener("pointercancel",a,o)},o)}),s}const Mo=(t,e)=>!!e&&(t===e||Mo(t,e.parentElement)),Co=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Vo=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ko(t){return Vo.has(t.tagName)||!0===t.isContentEditable}const Ro=new Set(["INPUT","SELECT","TEXTAREA"]);function Do(t){return Ro.has(t.tagName)||!0===t.isContentEditable}const Lo=new WeakSet;function Bo(t){return e=>{"Enter"===e.key&&t(e)}}function Oo(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Io(t){return Co(t)&&!To()}const jo=new WeakSet;function Fo(t,e,n={}){const[i,o,s]=Eo(t,n),r=t=>{const i=t.currentTarget;if(!Io(t))return;if(jo.has(t))return;Lo.add(i),n.stopPropagation&&jo.add(t);const s=e(i,t),r={...o,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Lo.has(i)&&Lo.delete(i),Io(t)&&"function"==typeof s&&s(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||Mo(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,o),mo(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Bo(()=>{if(Lo.has(n))return;Oo(n,"down");const t=Bo(()=>{Oo(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Oo(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,o)),ko(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),s}function Wo(t,e){const n=window.getComputedStyle(t);return bn(e)?n.getPropertyValue(e):n[e]}function $o(t){return A(t)&&"ownerSVGElement"in t}const No=new WeakMap;let Uo;const zo=(t,e,n)=>(i,o)=>o&&o[0]?o[0][t+"Size"]:$o(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Yo=zo("inline","width","offsetWidth"),Ho=zo("block","height","offsetHeight");function Xo({target:t,borderBoxSize:e}){No.get(t)?.forEach(n=>{n(t,{get width(){return Yo(t,e)},get height(){return Ho(t,e)}})})}function Go(t){t.forEach(Xo)}function Ko(t,e){Uo||"undefined"!=typeof ResizeObserver&&(Uo=new ResizeObserver(Go));const n=so(t);return n.forEach(t=>{let n=No.get(t);n||(n=new Set,No.set(t,n)),n.add(e),Uo?.observe(t)}),()=>{n.forEach(t=>{const n=No.get(t);n?.delete(e),n?.size||Uo?.unobserve(t)})}}const _o=new Set;let qo;function Zo(t){return _o.add(t),qo||(qo=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};_o.forEach(e=>e(t))},window.addEventListener("resize",qo)),()=>{_o.delete(t),_o.size||"function"!=typeof qo||(window.removeEventListener("resize",qo),qo=void 0)}}function Jo(t,e){return"function"==typeof t?Zo(t):Ko(t,e)}function Qo(t,e){let n;const i=()=>{const{currentTime:i}=e,o=(null===i?0:i.value)/100;n!==o&&t(o),n=o};return rt.preUpdate(i,!0),()=>at(i)}const ts={value:null,addProjectionMetrics:null};function es(t){return $o(t)&&"svg"===t.tagName}function ns(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function is(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],o=Ie(t[1+n],t[2+n],t[3+n]);return e?o(i):o}function os(t,e){const n=ii(Mi(t)?t.get():t);return ss(n,t,e),n}function ss(t,e,n={}){const i=t.get();let o,s=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{s&&(s.stop(),s=null),t.animation=void 0},c=()=>{(()=>{const e=as(t.get()),i=as(r);if(e===i)return void l();const a=s?s.getGeneratorVelocity():t.getVelocity();l(),s=new Ke({keyframes:[e,i],velocity:a,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})})(),t.animation=s??void 0,t.events.animationStart?.notify(),s?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((t,e)=>{r=t,o=t=>e(rs(t,a)),rt.postRender(c)},l),Mi(e)){let i=!0===n.skipInitialAnimation;const o=e.on("change",e=>{i?(i=!1,t.jump(rs(e,a),!1)):t.set(rs(e,a))}),s=t.on("destroy",o);return()=>{o(),s()}}return l}function rs(t,e){return e?t+e:t}function as(t){return"number"==typeof t?t:parseFloat(t)}function ls(t){const e=[];ei.current=e;const n=t();ei.current=void 0;const i=ii(n);return function(t,e,n){const i=()=>e.set(n()),o=()=>rt.preRender(i,!1,!0),s=t.map(t=>t.on("change",o));e.on("destroy",()=>{s.forEach(t=>t()),at(i)})}(e,i,t),i}const cs=[...Wi,Ft,Xt],us=t=>cs.find(Fi(t));let hs=0;const ds=()=>"motion-view-"+hs++;function ps(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function ms(t,e,n,i,o,s=[]){const r=so(t);if(i)return r.map((t,r)=>{const a=e.get(t);if(a)return a;const l=i[r]??ds();return t.style?.setProperty("view-transition-name",l),n.push(t),e.set(t,l),ps(t,o,s),l});const a=r.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return r.map((t,i)=>{const r=e.get(t);if(r)return r;const l=a[i];let c;return l&&"none"!==l&&"auto"!==l&&"match-element"!==l&&!(t=>t.startsWith("motion-view-"))(l)?c=l:(c=ds(),t.style?.setProperty("view-transition-name",c),n.push(t)),e.set(t,c),ps(t,o,s),c})}function fs(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let gs={},ys=null;const vs=(t,e)=>{gs[t]=e},xs=()=>{ys||(ys=document.createElement("style"),ys.id="motion-view");let t="";for(const e in gs){const n=gs[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}ys.textContent=t,document.head.appendChild(ys),gs={}},ws=()=>{ys&&ys.parentElement&&ys.parentElement.removeChild(ys)};function Ss(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function bs(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const Ts=["layout","enter","exit","new","old"],Ps={group:["layout"],new:["new","enter"],old:["old","exit"]},Es={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}},As=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Ms(t){const{update:e,targets:n,resolveDefs:i,noCrop:o,pairs:s,classNames:r,options:a}=t;if(!document.startViewTransition)return(async()=>(await e(),new Gn([])))();const l=new Map,c=[],u=[],h=new Map,d=new Set,p=new Map,m=new Map,f=new Map,g=t=>{n.forEach((e,n)=>{const a=r.get(n);let g;if("root"!==n&&i.has(n))if(s.has(n))if("old"===t)f.set(n,so(n)),g=ms(n,l,c,void 0,a,u),m.set(n,g);else{for(const t of f.get(n)??[])t.style?.removeProperty("view-transition-name"),l.delete(t);g=ms(s.get(n),l,c,m.get(n),a,u)}else g=ms(n,l,c,void 0,a,u);else g=[n];const y="root"!==n&&!o.has(n);g.forEach((n,i)=>{const o=h.get(n);h.set(n,o&&o!==e?{...o,...e}:e),y&&d.add(n);const s=p.get(n)??{};s[t]=[i,g.length],p.set(n,s)})})},y=(t,e)=>{const n=p.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},v=(t,e,n,i,o)=>{const s=Cs(si(a,n),si(function(t,e){for(const n of Ps[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof s.delay&&(s.delay=s.delay(i,o)),s},x=new Map,w=t=>{d.size&&l.forEach((e,n)=>{d.has(e)&&((t,e,n)=>{const i={};for(const e of As)i[e]=t[e];const o=x.get(e)??{};o[n]=i,x.set(e,o)})(getComputedStyle(n),e,t)})},S=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||vs(":root",{"view-transition-name":"none"}),vs("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),d.forEach(t=>{vs(`::view-transition-group(${t})`,{overflow:"clip"}),vs(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),xs()},b=()=>{!function(t,e=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class")}(c,u),ws()},T=async()=>{await e();const t=d.size;g("new"),w("new"),d.size>t&&S()};let P;try{g("old"),w("old"),S(),P=document.startViewTransition(T)}catch(t){return b(),Promise.reject(t)}return P.finished.finally(b),new Promise((t,e)=>{P.ready.then(()=>{const e=bs(),n=[],i=new Set,o=new Set;h.forEach((t,e)=>{const s=p.get(e),r=!!s?.new&&!s?.old,l=!!s?.old&&!s?.new;for(const s of Ts){if(!t[s])continue;if("enter"===s&&!r)continue;if("exit"===s&&!l)continue;const c=fs(s),[u,h]=y(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[s];for(let[m,f]of Object.entries(d)){if(null==f)continue;if("x"===m||"y"===m){j(!1,`animateView() animates view-transition layers with CSS properties; the "${m}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===s&&r&&null!=t.enter?.keyframes[m])continue;if("old"===s&&l&&null!=t.exit?.keyframes[m])continue;const d=Cs(si(a,m),si(p,m));if(!Array.isArray(f)){const e="enter"===s?t.exit?.keyframes[m]:void 0,n="opacity"===m||("new"===c?r:l),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?Es[c]?.[m]:void 0;void 0!==i&&(f=[i,f])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=L(d.duration)),d.delay&&(d.delay=L(d.delay)),n.push(new On({...d,element:document.documentElement,name:m,pseudoElement:`::view-transition-${c}(${e})`,keyframes:f})),i.add(`${e}:${c}`),"opacity"===m&&o.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:s}=e;if(!s)continue;const r=Ss(s);if(!r)continue;const a=h.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){o.has(`${r.layer}:new`)&&o.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new qn(t)):t.cancel();continue}const l=p.get(r.layer),c=!("old"!==r.type&&"new"!==r.type||!l?.old||!l?.new),u=r.type.startsWith("group")||c?"group":r.type,[d,m]=y(r.layer,u);let f=v(a,u,"group"===u?"layout":"",-1===d?0:d,m);const g=f.visualDuration;f.duration&&(f.duration=L(f.duration)),f=Bn(f);const x=c&&void 0!==g?L(g):f.duration,w=c?"linear":Rn(f.ease,f.duration);e.updateTiming({delay:L(f.delay??0),duration:x,easing:w}),n.push(new qn(t))}x.forEach((t,e)=>{if(!t.old&&!t.new)return;const i=h.get(e),[o,s]=y(e,"group"),r=v(i,"group","layout",-1===o?0:o,s);r.duration&&(r.duration=L(r.duration)),r.delay&&(r.delay=L(r.delay));for(const i of As){const o=t.old?.[i]||t.new?.[i]||"0px",s=t.new?.[i]||t.old?.[i]||"0px";0===parseFloat(o)&&0===parseFloat(s)||n.push(new On({...r,element:document.documentElement,name:i,pseudoElement:`::view-transition-group(${e})`,keyframes:[o,s]}))}}),t(new Gn(n))}).catch(()=>P.updateCallbackDone.then(()=>t(new Gn([])),e))})}function Cs(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let Vs=[],ks=null;function Rs(){ks=null;const[t]=Vs;var e;t&&(w(Vs,e=t),ks=e,Ms(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(Rs))}function Ds(){for(let t=Vs.length-1;t>=0;t--){const e=Vs[t],{interrupt:n}=e.options;if("immediate"===n){const n=Vs.slice(0,t+1).map(t=>t.update),i=Vs.slice(t+1);e.update=()=>{n.forEach(t=>t())},Vs=[e,...i];break}}ks&&"immediate"!==Vs[0]?.options.interrupt||Rs()}class Ls{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.noCrop=new Set,this.pairs=new Map,this.classNames=new Map,this.notifyReady=V,this.notifyReject=V,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(V),n=this,Vs.push(n),wo.render(Ds)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return t?this.noCrop.delete(this.currentSubject):this.noCrop.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:o}=this;o.has(i)||o.set(i,{});o.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Bs=()=>({translate:0,scale:1,origin:0,originPoint:0}),Os=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Is=()=>({min:0,max:0}),js=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Fs=new WeakMap;function Ws(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function $s(t){return"string"==typeof t||Array.isArray(t)}const Ns=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Us=["initial",...Ns];function zs(t){return Ws(t.animate)||Us.some(e=>$s(t[e]))}function Ys(t){return Boolean(zs(t)||t.variants)}function Hs(t,e,n){for(const i in e){const o=e[i],s=n[i];if(Mi(o))t.addValue(i,o);else if(Mi(s))t.addValue(i,ii(o,{owner:t}));else if(s!==o)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(o):e.hasAnimated||e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,ii(void 0!==e?e:o,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Xs={current:null},Gs={current:!1},Ks="undefined"!=typeof window;function _s(){if(Gs.current=!0,Ks)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xs.current=t.matches;t.addEventListener("change",e),e()}else Xs.current=!1}const qs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Zs={};function Js(t){Zs=t}function Qs(){return Zs}class tr{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:s,visualState:r},a={}){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=Sn,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 t=dt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,rt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=o,this.options=a,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=zs(e),this.isVariantNode=Ys(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==l[t]&&Mi(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Fs.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Gs.current||_s(),this.shouldReduceMotion=Xs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),at(this.notifyUpdate),at(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Nn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:o,ease:s,duration:r}=e.accelerate,a=new On({element:this.current,name:t,keyframes:i,times:o,ease:s,duration:L(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=cn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&rt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),o&&o()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Zs){const e=Zs[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<qs.length;e++){const n=qs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=Hs(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=ii(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(E(n)||M(n))?n=parseFloat(n):!us(n)&&Xt.test(e)&&(n=Qi(t,e)),this.setBaseTarget(t,Mi(n)?n.get():n)),Mi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=wi(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Mi(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new D),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){wo.render(this.render)}}class er extends tr{constructor(){super(...arguments),this.KeyframeResolver=eo}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Mi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class nr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function ir({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function or({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function sr(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 rr(t){return void 0===t||1===t}function ar({scale:t,scaleX:e,scaleY:n}){return!rr(t)||!rr(e)||!rr(n)}function lr(t){return ar(t)||cr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function cr(t){return ur(t.x)||ur(t.y)}function ur(t){return t&&"0%"!==t}function hr(t,e,n){return n+e*(t-n)}function dr(t,e,n,i,o){return void 0!==o&&(t=hr(t,o,i)),hr(t,n,i)+e}function pr(t,e=0,n=1,i,o){t.min=dr(t.min,e,n,i,o),t.max=dr(t.max,e,n,i,o)}function mr(t,{x:e,y:n}){pr(t.x,e.translate,e.scale,e.originPoint),pr(t.y,n.translate,n.scale,n.originPoint)}const fr=.999999999999,gr=1.0000000000001;function yr(t,e,n,i=!1){const o=n.length;if(!o)return;let s,r;e.x=e.y=1;for(let a=0;a<o;a++){s=n[a],r=s.projectionDelta;const{visualElement:o}=s.options;o&&o.props.style&&"contents"===o.props.style.display||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(vr(t.x,-s.scroll.offset.x),vr(t.y,-s.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,mr(t,r)),i&&lr(s.latestValues)&&Sr(t,s.latestValues,s.layout?.layoutBox))}e.x<gr&&e.x>fr&&(e.x=1),e.y<gr&&e.y>fr&&(e.y=1)}function vr(t,e){t.min+=e,t.max+=e}function xr(t,e,n,i,o=.5){pr(t,e,n,qt(t.min,t.max,o),i)}function wr(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Sr(t,e,n){const i=n??t;xr(t.x,wr(e.x,i.x),e.scaleX,e.scale,e.originX),xr(t.y,wr(e.y,i.y),e.scaleY,e.scale,e.originY)}function br(t,e){return ir(sr(t.getBoundingClientRect(),e))}function Tr(t,e,n){const i=br(t,n),{scroll:o}=e;return o&&(vr(i.x,o.offset.x),vr(i.y,o.offset.y)),i}const Pr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Er=ln.length;function Ar(t,e,n){let i="",o=!0;for(let s=0;s<Er;s++){const r=ln[s],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=ao(a,_i[r]);if(!l){o=!1;i+=`${Pr[r]||r}(${t}) `}n&&(e[r]=t)}}const s=t.pathRotation;return s&&(o=!1,i+=`rotate(${ao(s,_i.pathRotation)}) `),i=i.trim(),n?i=n(e,o?"":i):o&&(i="none"),i}function Mr(t,e,n){const{style:i,vars:o,transformOrigin:s}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(cn.has(t))r=!0;else if(mt(t))o[t]=n;else{const e=ao(n,_i[t]);t.startsWith("origin")?(a=!0,s[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=Ar(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=s;i.transformOrigin=`${t} ${e} ${n}`}}function Cr(t,{style:e,vars:n},i,o){const s=t.style;let r;for(r in e)s[r]=e[r];for(r in o?.applyProjectionStyles(s,i),n)s.setProperty(r,n[r])}function Vr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const kr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Lt.test(t))return t;t=parseFloat(t)}return`${Vr(t,e.target.x)}% ${Vr(t,e.target.y)}%`}},Rr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,o=Xt.parse(t);if(o.length>5)return i;const s=Xt.createTransformer(t),r="number"!=typeof o[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;o[0+r]/=a,o[1+r]/=l;const c=qt(a,l,.5);return"number"==typeof o[2+r]&&(o[2+r]/=c),"number"==typeof o[3+r]&&(o[3+r]/=c),s(o)}},Dr={borderRadius:{...kr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:kr,borderTopRightRadius:kr,borderBottomLeftRadius:kr,borderBottomRightRadius:kr,boxShadow:Rr};function Lr(t,{layout:e,layoutId:n}){return cn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Dr[t]||"opacity"===t)}function Br(t,e,n){const i=t.style,o=e?.style,s={};if(!i)return s;for(const e in i)(Mi(i[e])||o&&Mi(o[e])||Lr(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(s[e]=i[e]);return s}class Or extends er{constructor(){super(...arguments),this.type="html",this.renderInstance=Cr}readValueFromInstance(t,e){if(cn.has(e))return this.projection?.isProjecting?on(e):rn(t,e);{const i=(n=t,window.getComputedStyle(n)),o=(mt(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return br(t,e)}build(t,e,n){Mr(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Br(t,e,n)}}class Ir extends tr{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const jr={offset:"stroke-dashoffset",array:"stroke-dasharray"},Fr={offset:"strokeDashoffset",array:"strokeDasharray"};function Wr(t,e,n=1,i=0,o=!0){t.pathLength=1;const s=o?jr:Fr;t[s.offset]=""+-i,t[s.array]=`${e} ${n}`}const $r=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Nr(t,{attrX:e,attrY:n,attrScale:i,pathLength:o,pathSpacing:s=1,pathOffset:r=0,...a},l,c,u){if(Mr(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const t of $r)void 0!==h[t]&&(d[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==o&&Wr(h,o,s,r,!1)}const Ur=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"]),zr=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Yr(t,e,n,i){Cr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ur.has(n)?n:ki(n),e.attrs[n])}function Hr(t,e,n){const i=Br(t,e,n);for(const n in t)if(Mi(t[n])||Mi(e[n])){i[-1!==ln.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Xr extends er{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=js}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(cn.has(e)){const t=Zi(e);return t&&t.default||0}return e=Ur.has(e)?e:ki(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Hr(t,e,n)}build(t,e,n){Nr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){Yr(t,e,0,i)}mount(t){this.isSVGTag=zr(t.tagName),super.mount(t)}}const Gr=Us.length;function Kr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Kr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Gr;n++){const i=Us[n],o=t.props[i];($s(o)||!1===o)&&(e[i]=o)}return e}function _r(t,e){if(!Array.isArray(e))return!1;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}const qr=[...Ns].reverse(),Zr=Ns.length;function Jr(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>ji(t,e,n)))}(t),n=ea(),i=!0,o=!1;const s=e=>(n,i)=>{const o=Si(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=Kr(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;e<Zr;e++){const p=qr[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],g=$s(f),y=p===r?m.isActive:null;!1===y&&(d=e);let v=f===l[p]&&f!==a[p]&&g;if(v&&(i||o)&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...h},!m.isActive&&null===y||!f&&!m.prevProp||Ws(f)||"boolean"==typeof f)continue;if("exit"===p&&m.isActive&&!0!==y){m.prevResolvedValues&&(h={...h,...m.prevResolvedValues});continue}const x=Qr(m.prevProp,f);let w=x||p===r&&m.isActive&&!v&&g||e>d&&g,S=!1;const b=Array.isArray(f)?f:[f];let T=b.reduce(s(p),{});!1===y&&(T={});const{prevResolvedValues:P={}}=m,E={...P,...T},A=e=>{w=!0,u.has(e)&&(S=!0,u.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in E){const e=T[t],n=P[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Ti(e)&&Ti(n)?!_r(e,n)||x:e!==n,i?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):m.protectedKeys[t]=!0}m.prevProp=f,m.prevResolvedValues=T,m.isActive&&(h={...h,...T}),(i||o)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||S)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||o)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,o=Si(i,e);if(i.enteringChildren&&o){const{delayChildren:e}=o.transition||{};n.delay=ti(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=Si(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),o=t.getValue(n);o&&(o.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,o=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const o=r(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=ea(),o=!0}}}function Qr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!_r(e,t)}function ta(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ea(){return{animate:ta(!0),whileInView:ta(),whileHover:ta(),whileTap:ta(),whileDrag:ta(),whileFocus:ta(),exit:ta()}}function na(t,e){t.min=e.min,t.max=e.max}function ia(t,e){na(t.x,e.x),na(t.y,e.y)}function oa(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function sa(t){return t.max-t.min}function ra(t,e,n){return Math.abs(t-e)<=n}function aa(t,e,n,i=.5){t.origin=i,t.originPoint=qt(e.min,e.max,t.origin),t.scale=sa(n)/sa(e),t.translate=qt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function la(t,e,n,i){aa(t.x,e.x,n.x,i?i.originX:void 0),aa(t.y,e.y,n.y,i?i.originY:void 0)}function ca(t,e,n,i=0){const o=i?qt(n.min,n.max,i):n.min;t.min=o+e.min,t.max=t.min+sa(e)}function ua(t,e,n,i){ca(t.x,e.x,n.x,i?.x),ca(t.y,e.y,n.y,i?.y)}function ha(t,e,n,i=0){const o=i?qt(n.min,n.max,i):n.min;t.min=e.min-o,t.max=t.min+sa(e)}function da(t,e,n,i){ha(t.x,e.x,n.x,i?.x),ha(t.y,e.y,n.y,i?.y)}function pa(t,e,n,i,o){return t=hr(t-=e,1/n,i),void 0!==o&&(t=hr(t,1/o,i)),t}function ma(t,e=0,n=1,i=.5,o,s=t,r=t){if(Dt.test(e)){e=parseFloat(e);e=qt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=qt(s.min,s.max,i);t===s&&(a-=e),t.min=pa(t.min,e,n,a,o),t.max=pa(t.max,e,n,a,o)}function fa(t,e,[n,i,o],s,r){ma(t,e[n],e[i],e[o],e.scale,s,r)}const ga=["x","scaleX","originX"],ya=["y","scaleY","originY"];function va(t,e,n,i){fa(t.x,e,ga,n?n.x:void 0,i?i.x:void 0),fa(t.y,e,ya,n?n.y:void 0,i?i.y:void 0)}function xa(t){return 0===t.translate&&1===t.scale}function wa(t){return xa(t.x)&&xa(t.y)}function Sa(t,e){return t.min===e.min&&t.max===e.max}function ba(t,e){return Sa(t.x,e.x)&&Sa(t.y,e.y)}function Ta(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Pa(t,e){return Ta(t.x,e.x)&&Ta(t.y,e.y)}function Ea(t){return sa(t.x)/sa(t.y)}function Aa(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Ma(t){return[t("x"),t("y")]}function Ca(t,e,n){let i="";const o=t.x.translate/e.x,s=t.y.translate/e.y,r=n?.z||0;if((o||s||r)&&(i=`translate3d(${o}px, ${s}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:o,rotateX:s,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),o&&(i+=`rotate(${o}deg) `),s&&(i+=`rotateX(${s}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const Va=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],ka=Va.length,Ra=t=>"string"==typeof t?parseFloat(t):t,Da=t=>"number"==typeof t||Lt.test(t);function La(t,e,n,i,o,s){o?(t.opacity=qt(0,n.opacity??1,Oa(i)),t.opacityExit=qt(e.opacity??1,0,Ia(i))):s&&(t.opacity=qt(e.opacity??1,n.opacity??1,i));for(let o=0;o<ka;o++){const s=Va[o];let r=Ba(e,s),a=Ba(n,s);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||Da(r)===Da(a)?(t[s]=Math.max(qt(Ra(r),Ra(a),i),0),(Dt.test(a)||Dt.test(r))&&(t[s]+="%")):t[s]=a}(e.rotate||n.rotate)&&(t.rotate=qt(e.rotate||0,n.rotate||0,i))}function Ba(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Oa=ja(0,.5,K),Ia=ja(.5,.95,V);function ja(t,e,n){return i=>i<t?0:i>e?1:n(R(t,e,i))}function Fa(t,e,n){const i=Mi(t)?t:ii(t);return i.start(di("",i,e,n)),i.animation}function Wa(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const $a=(t,e)=>t.depth-e.depth;class Na{constructor(){this.children=[],this.isDirty=!1}add(t){x(this.children,t),this.isDirty=!0}remove(t){w(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort($a),this.isDirty=!1,this.children.forEach(t)}}function Ua(t,e){const n=dt.now(),i=({timestamp:o})=>{const s=o-n;s>=e&&(at(i),t(s-e))};return rt.setup(i,!0),()=>at(i)}function za(t){return Mi(t)?t.get():t}class Ya{constructor(){this.members=[]}add(t){x(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(w(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(w(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:o}=t.options;void 0!==i&&i===o||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Ha={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Xa={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ga=["","X","Y","Z"];let Ka=0;function _a(t,e,n,i){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),i&&(i[t]=0))}function qa(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Li(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&qa(i)}function Za({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:o}){return class{constructor(t={},n=e?.()){this.id=Ka++,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,ts.value&&(Xa.nodes=Xa.calculatedTargetDeltas=Xa.calculatedProjections=0),this.nodes.forEach(tl),this.nodes.forEach(cl),this.nodes.forEach(ul),this.nodes.forEach(el),ts.addProjectionMetrics&&ts.addProjectionMetrics(Xa)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Na)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new D),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=$o(e)&&!es(e),this.instance=e;const{layoutId:n,layout:i,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const o=()=>this.root.updateBlockedByResize=!1;rt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=Ua(o,250),Ha.hasAnimatedSinceResize&&(Ha.hasAnimatedSinceResize=!1,this.nodes.forEach(ll)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&o&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||gl,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Pa(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...si(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||ll(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),at(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(hl),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(ol),void this.nodes.forEach(il)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(sl);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(rl),this.nodes.forEach(al),this.nodes.forEach(Ja),this.nodes.forEach(Qa)):this.nodes.forEach(sl),this.clearAllSnapshots();const t=dt.now();lt.delta=b(0,1e3/60,t-lt.timestamp),lt.timestamp=t,lt.isProcessing=!0,ct.update.process(lt),ct.preRender.process(lt),ct.render.process(lt),lt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(nl),this.sharedNodes.forEach(dl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||sa(this.snapshot.measuredBox.x)||sa(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!wa(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||lr(this.latestValues)||s)&&(o(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),xl((i=n).x),xl(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Sl))){const{scroll:t}=this.root;t&&(vr(e.x,t.offset.x),vr(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(ia(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:o,options:s}=i;i!==this.root&&o&&s.layoutScroll&&(o.wasRoot&&ia(e,t),vr(e.x,o.offset.x),vr(e.y,o.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};ia(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(vr(i.x,-n.scroll.offset.x),vr(i.y,-n.scroll.offset.y)),lr(n.latestValues)&&Sr(i,n.latestValues,n.layout?.layoutBox)}return lr(this.latestValues)&&Sr(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ia(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!lr(n.latestValues))continue;let i;n.instance&&(ar(n.latestValues)&&n.updateSnapshot(),i=js(),ia(i,n.measurePageBox())),va(e,n.latestValues,n.snapshot?.layoutBox,i)}return lr(this.latestValues)&&va(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}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!==lt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:o}=this.options;if(!this.layout||!i&&!o)return;this.resolvedRelativeTargetAt=lt.timestamp;const s=this.getClosestProjectingParent();s&&this.linkedParentVersion!==s.layoutVersion&&!s.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&s&&s.layout?this.createRelativeTarget(s,this.layout.layoutBox,s.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ua(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):ia(this.target,this.layout.layoutBox),mr(this.target,this.targetDelta)):ia(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&s&&Boolean(s.resumingFrom)===Boolean(this.resumingFrom)&&!s.options.layoutScroll&&s.target&&1!==this.animationProgress?this.createRelativeTarget(s,this.target,s.target):this.relativeParent=this.relativeTarget=void 0),ts.value&&Xa.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!ar(this.parent.latestValues)&&!cr(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},da(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),ia(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===lt.timestamp&&(n=!1),n)return;const{layout:i,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!o)return;ia(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,r=this.treeScale.y;yr(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(oa(this.prevProjectionDelta.x,this.projectionDelta.x),oa(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),la(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===s&&this.treeScale.y===r&&Aa(this.projectionDelta.x,this.prevProjectionDelta.x)&&Aa(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a)),ts.value&&Xa.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,o=i?i.latestValues:{},s={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=(i?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(fl));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);i?(r.x.translate=i.x,r.x.scale=qt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=qt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(pl(r.x,t.x,n),pl(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(da(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),function(t,e,n,i){ml(t.x,e.x,n.x,i),ml(t.y,e.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,a,n),d&&ba(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),ia(d,this.relativeTarget)),l&&(this.animationValues=s,La(s,o,this.latestValues,n,h,u)),i&&void 0!==i.rotate&&(this.animationValues||(this.animationValues=s),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(at(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{Ha.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ii(0)),this.motionValue.jump(0,!1),this.currentAnimation=Fa(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:o}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&wl(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=sa(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=sa(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}ia(e,n),Sr(e,o),la(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ya);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&_a("z",t,i,this.animationValues);for(let e=0;e<Ga.length;e++)_a(`rotate${Ga[e]}`,t,i,this.animationValues),_a(`skew${Ga[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=za(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=za(e?.pointerEvents)||""),void(this.hasProjected&&!lr(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const o=i.animationValues||i.latestValues;this.applyTransformsToTarget();let s=Ca(this.projectionDeltaWithTransform,this.treeScale,o);n&&(s=n(o,s)),t.transform=s;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?o.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:t.opacity=i===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0;for(const e in Dr){if(void 0===o[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Dr[e],l="none"===s?o[e]:n(o[e],i);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?za(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(il),this.root.sharedNodes.clear()}}}function Ja(t){t.updateLayout()}function Qa(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:o}=t.options,s=e.source!==t.layout.source;if("size"===o)Ma(t=>{const i=s?e.measuredBox[t]:e.layoutBox[t],o=sa(i);i.min=n[t].min,i.max=i.min+o});else if("x"===o||"y"===o){const t="x"===o?"y":"x";na(s?e.measuredBox[t]:e.layoutBox[t],n[t])}else wl(o,e.layoutBox,n)&&Ma(i=>{const o=s?e.measuredBox[i]:e.layoutBox[i],r=sa(n[i]);o.max=o.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};la(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};s?la(a,t.applyTransform(i,!0),e.measuredBox):la(a,n,e.layoutBox);const l=!wa(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:o,layout:s}=i;if(o&&s){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};da(a,e.layoutBox,o.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};da(l,n,s.layoutBox,r),Pa(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function tl(t){ts.value&&Xa.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function el(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function nl(t){t.clearSnapshot()}function il(t){t.clearMeasurements()}function ol(t){t.isLayoutDirty=!0,t.updateLayout()}function sl(t){t.isLayoutDirty=!1}function rl(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function al(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ll(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function cl(t){t.resolveTargetDelta()}function ul(t){t.calcProjection()}function hl(t){t.resetSkewAndRotation()}function dl(t){t.removeLeadSnapshot()}function pl(t,e,n){t.translate=qt(e.translate,0,n),t.scale=qt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ml(t,e,n,i){t.min=qt(e.min,n.min,i),t.max=qt(e.max,n.max,i)}function fl(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const gl={duration:.45,ease:[.4,0,.1,1]},yl=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),vl=yl("applewebkit/")&&!yl("chrome/")?Math.round:V;function xl(t){t.min=vl(t.min),t.max=vl(t.max)}function wl(t,e,n){return"position"===t||"preserve-aspect"===t&&!ra(Ea(e),Ea(n),.2)}function Sl(t){return t!==t.root&&t.scroll?.wasRoot}const bl=Za({attachResizeListener:(t,e)=>Wa(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Tl=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Pl(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Tl);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const o=e.get(i);o&&(o(),e.delete(i)),n()},dirty:n}}const El={current:void 0},Al=Za({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!El.current){const t=new bl({});t.mount(window),t.setOptions({layoutScroll:!0}),El.current=t}return El.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),Ml="[data-layout],[data-layout-id]",Cl=new WeakMap;let Vl;function kl(t){const e=[];return t instanceof HTMLElement&&t.matches(Ml)&&e.push(t),t.querySelectorAll(Ml).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function Rl(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function Dl(t,e){let n=Cl.get(t);if(n)n.setOptions(Rl(t,e));else{let i=Fs.get(t);i||(i=new Or({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0})),t.style.transform&&!lr(i.latestValues)&&(t.style.transform=""),n=new Al(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=Cl.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...Rl(t,e),visualElement:i}),n.mount(t),Cl.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function Ll(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),Cl.delete(t)}function Bl(){const t=Vl;Vl=void 0,function(){if(lt.isProcessing)return;const t=dt.now();lt.delta=b(0,1e3/60,t-lt.timestamp),lt.timestamp=t,lt.isProcessing=!0,ct.update.process(lt),ct.preRender.process(lt),ct.render.process(lt),lt.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(i=e.keys(),[...i].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),o=Dl(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,o);n.set(t,o)}var i;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const o=[];for(const e of t){const t=e.runUpdate();t&&o.push(t)}const s=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),wo.render(()=>{for(const e of t)e.finalize()})};o.length?Promise.all(o).then(s):s()}const Ol=rt,Il=ot.reduce((t,e)=>(t[e]=t=>at(t),t),{}),jl=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Fl(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function Wl(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=Fl(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e<i.length;e++){const n=i[e];"function"==typeof n?n():Fl(t[e],null)}}}}(...t),t)}class $l extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(mo(e)&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const t=e.offsetParent,n=mo(t)&&t.offsetWidth||0,i=mo(t)&&t.offsetHeight||0,o=getComputedStyle(e),s=this.props.sizeRef.current;s.height=parseFloat(o.height),s.width=parseFloat(o.width),s.top=e.offsetTop,s.left=e.offsetLeft,s.right=n-s.width-s.left,s.bottom=i-s.height-s.top,s.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Nl({children:t,isPresent:n,anchorX:o,anchorY:s,root:r,pop:a}){const l=e.useId(),c=e.useRef(null),u=e.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:h}=e.useContext(jl),p=t.props?.ref??t?.ref,m=Wl(c,p);return e.useInsertionEffect(()=>{const{width:t,height:e,top:i,left:d,right:p,bottom:m,direction:f}=u.current;if(n||!1===a||!c.current||!t||!e)return;const g="rtl"===f,y="left"===o?g?`right: ${p}`:`left: ${d}`:g?`left: ${d}`:`right: ${p}`,v="bottom"===s?`bottom: ${m}`:`top: ${i}`;c.current.dataset.motionPopId=l;const x=document.createElement("style");h&&(x.nonce=h);const w=r??document.head;return w.appendChild(x),x.sheet&&x.sheet.insertRule(`\n [data-motion-pop-id="${l}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${y}px !important;\n ${v}px !important;\n }\n `),()=>{c.current?.removeAttribute("data-motion-pop-id"),w.contains(x)&&w.removeChild(x)}},[n]),d($l,{isPresent:n,childRef:c,sizeRef:u,pop:a,children:!1===a?t:i.cloneElement(t,{ref:m})})}const Ul=({children:t,initial:n,isPresent:o,onExitComplete:s,custom:r,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:u,root:h})=>{const p=f(zl),m=e.useId(),g=e.useRef(o),x=e.useRef(s);y(()=>{g.current=o,x.current=s});let w=!0,S=e.useMemo(()=>(w=!1,{id:m,initial:n,isPresent:o,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;s&&s()},register:t=>(p.set(t,!1),()=>{p.delete(t),!g.current&&!p.size&&x.current?.()})}),[o,p,s]);return a&&w&&(S={...S}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[o]),i.useEffect(()=>{!o&&!p.size&&s&&s()},[o]),t=d(Nl,{pop:"popLayout"===l,isPresent:o,anchorX:c,anchorY:u,root:h,children:t}),d(v.Provider,{value:S,children:t})};function zl(){return new Map}function Yl(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:o,register:s}=n,r=e.useId();e.useEffect(()=>{if(t)return s(r)},[t]);const a=e.useCallback(()=>t&&o&&o(r),[r,o,t]);return!i&&o?[!1,a]:[!0]}const Hl=t=>t.key||"";function Xl(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const Gl=e.createContext(null);function Kl(){const t=function(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}(),[n,i]=e.useState(0),o=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>rt.postRender(o),[o]),n]}const _l=t=>!0===t,ql=({children:t,id:n,inherit:i=!0})=>{const o=e.useContext(m),s=e.useContext(Gl),[r,a]=Kl(),l=e.useRef(null),c=o.id||s;null===l.current&&((t=>_l(!0===t)||"id"===t)(i)&&c&&(n=n?c+"-"+n:c),l.current={id:n,group:_l(i)&&o.group||Pl()});const u=e.useMemo(()=>({...l.current,forceRender:r}),[a]);return d(m.Provider,{value:u,children:t})},Zl=e.createContext({strict:!1}),Jl={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Ql=!1;function tc(){return function(){if(Ql)return;const t={};for(const e in Jl)t[e]={isEnabled:t=>Jl[e].some(e=>!!t[e])};Js(t),Ql=!0}(),Qs()}function ec(t){const e=tc();for(const n in t)e[n]={...e[n],...t[n]};Js(e)}function nc(t){return"function"==typeof t}const ic=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function oc(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ic.has(t)}let sc=t=>!oc(t);function rc(t){"function"==typeof t&&(sc=e=>e.startsWith("on")?!oc(e):t(e))}try{rc(require("@emotion/is-prop-valid").default)}catch{}function ac(t,e,n){const i={};for(const o in t)"values"===o&&"object"==typeof t.values||Mi(t[o])||(sc(o)||!0===n&&oc(o)||!e&&!oc(o)||t.draggable&&o.startsWith("onDrag"))&&(i[o]=t[o]);return i}const lc=e.createContext(null),cc=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function uc(t){return"string"==typeof t&&!t.includes("-")&&!!(cc.indexOf(t)>-1||/[A-Z]/u.test(t))}const hc=(t,n)=>n.isSVG??uc(t)?new Xr(n):new Or(n,{allowProjection:t!==e.Fragment}),dc=e.createContext({});function pc(t){const{initial:n,animate:i}=function(t,e){if(zs(t)){const{initial:e,animate:n}=t;return{initial:!1===e||$s(e)?e:void 0,animate:$s(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(dc));return e.useMemo(()=>({initial:n,animate:i}),[mc(n),mc(i)])}function mc(t){return Array.isArray(t)?t.join(" "):t}const fc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function gc(t,e,n){for(const i in e)Mi(e[i])||Lr(i,n)||(t[i]=e[i])}function yc(t,n){const i={};return gc(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Mr(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function vc(t,e){const n={},i=yc(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const xc=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function wc(t,n,i,o){const s=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Nr(e,n,zr(o),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};gc(e,t.style,t),s.style={...e,...s.style}}return s}function Sc(t,n,i,{latestValues:o},s,r=!1,a){const l=(a??uc(t)?wc:vc)(n,o,s,t),c=ac(n,"string"==typeof t,r),u=t!==e.Fragment?{...c,...l,ref:i}:{},{children:h}=n,d=e.useMemo(()=>Mi(h)?h.get():h,[h]);return e.createElement(t,{...u,children:d})}function bc(t,e,n,i){const o={},s=i(t,{});for(const t in s)o[t]=za(s[t]);let{initial:r,animate:a}=t;const l=zs(t),c=Ys(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!Ws(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=wi(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[t]=e)}for(const e in t)o[e]=t[e]}}}return o}const Tc=t=>(n,i)=>{const o=e.useContext(dc),s=e.useContext(v),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,o){return{latestValues:bc(n,i,o,t),renderState:e()}}(t,n,o,s);return i?r():f(r)},Pc=Tc({scrapeMotionValuesFromProps:Br,createRenderState:fc}),Ec=Tc({scrapeMotionValuesFromProps:Hr,createRenderState:xc}),Ac=Symbol.for("motionComponentSymbol");function Mc(t,n,i){const o=e.useRef(i);e.useInsertionEffect(()=>{o.current=i});const s=e.useRef(null);return e.useCallback(e=>{e&&t.onMount?.(e),n&&(e?n.mount(e):n.unmount());const i=o.current;if("function"==typeof i)if(e){const t=i(e);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):i(e);else i&&(i.current=e)},[n])}const Cc=e.createContext({});function Vc(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function kc(t,n,i,o,s,r){const{visualElement:a}=e.useContext(dc),l=e.useContext(Zl),c=e.useContext(v),u=e.useContext(jl),h=u.reducedMotion,d=u.skipAnimations,p=e.useRef(null),m=e.useRef(!1);o=o||l.renderer,!p.current&&o&&(p.current=o(t,{visualState:n,parent:a,props:i,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:h,skipAnimations:d,isSVG:r}),m.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const f=p.current,g=e.useContext(Cc);!f||f.projection||!s||"html"!==f.type&&"svg"!==f.type||function(t,e,n,i){const{layoutId:o,layout:s,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Rc(t.parent)),t.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:Boolean(r)||a&&Vc(a),visualElement:t,animationType:"string"==typeof s?s:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(p.current,i,s,g);const x=e.useRef(!1);e.useInsertionEffect(()=>{f&&x.current&&f.update(i,c)});const w=i[Di],S=e.useRef(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return y(()=>{m.current=!0,f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),S.current&&f.animationState&&f.animationState.animateChanges())}),e.useEffect(()=>{f&&(!S.current&&f.animationState&&f.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),f.enteringChildren=void 0)}),f}function Rc(t){if(t)return!1!==t.options.allowProjection?t.projection:Rc(t.parent)}function Dc(t,{forwardMotionProps:n=!1,type:i}={},o,s){o&&ec(o);const r=i?"svg"===i:uc(t),a=r?Ec:Pc;function l(i,o){let l;const c={...e.useContext(jl),...i,layoutId:Lc(i)},{isStatic:u}=c,h=pc(i),m=a(i,u);if(!u&&"undefined"!=typeof window){e.useContext(Zl).strict;const n=function(t){const e=tc(),{drag:n,layout:i}=e;if(!n&&!i)return{};const o={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}(c);l=n.MeasureLayout,h.visualElement=kc(t,m,c,s,n.ProjectionNode,r)}return p(dc.Provider,{value:h,children:[l&&h.visualElement?d(l,{visualElement:h.visualElement,...c}):null,Sc(t,i,Mc(m,h.visualElement,o),m,u,n,r)]})}l.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const c=e.forwardRef(l);return c[Ac]=t,c}function Lc({layoutId:t}){const n=e.useContext(m).id;return n&&void 0!==t?n+"-"+t:t}function Bc(t,e){if("undefined"==typeof Proxy)return Dc;const n=new Map,i=(n,i)=>Dc(n,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(o,s)=>"create"===s?i:(n.has(s)||n.set(s,Dc(s,void 0,t,e)),n.get(s))})}let Oc=0;const Ic={animation:{Feature:class extends nr{constructor(t){super(t),t.animationState||(t.animationState=Jr(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ws(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends nr{constructor(){super(...arguments),this.id=Oc++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=Si(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function jc(t){return{point:{x:t.pageX,y:t.pageY}}}const Fc=t=>e=>Co(e)&&t(e,jc(e));function Wc(t,e,n,i){return Wa(t,e,Fc(n),i)}const $c=({current:t})=>t?t.ownerDocument.defaultView:null,Nc=(t,e)=>Math.abs(t-e);function Uc(t,e){const n=Nc(t.x,e.x),i=Nc(t.y,e.y);return Math.sqrt(n**2+i**2)}const zc=new Set(["auto","scroll"]);class Yc{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Hc(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Gc(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Uc(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:o}=lt;this.history.push({...i,timestamp:o});const{onStart:s,onMove:r}=this.handlers;e||(s&&s(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Hc(e,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:o}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const s=Gc("pointercancel"===t.type?this.lastMoveEventInfo:Hc(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,s),i&&i(t,s)},!Co(t))return;this.dragSnapToOrigin=o,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=s,this.contextWindow=i||window;const a=Hc(jc(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=lt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,Gc(a,this.history));const h={passive:!0,capture:!0};this.removeListeners=k(Wc(this.contextWindow,"pointermove",this.handlePointerMove,h),Wc(this.contextWindow,"pointerup",this.handlePointerUp,h),Wc(this.contextWindow,"pointercancel",this.handlePointerUp,h)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(zc.has(t.overflowX)||zc.has(t.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}),window.addEventListener("scroll",this.onWindowScroll),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},o=i.x-e.x,s=i.y-e.y;0===o&&0===s||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o,this.lastMoveEventInfo.point.y+=s):this.history.length>0&&(this.history[0].x-=o,this.history[0].y-=s),this.scrollPositions.set(t,i),rt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),at(this.updatePoint)}}function Hc(t,e){return e?{point:e(t.point)}:t}function Xc(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Gc({point:t},e){return{point:t,delta:Xc(t,_c(e)),offset:Xc(t,Kc(e)),velocity:qc(e,.1)}}function Kc(t){return t[0]}function _c(t){return t[t.length-1]}function qc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const o=_c(t);for(;n>=0&&(i=t[n],!(o.timestamp-i.timestamp>L(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&o.timestamp-i.timestamp>2*L(e)&&(i=t[1]);const s=B(o.timestamp-i.timestamp);if(0===s)return{x:0,y:0};const r={x:(o.x-i.x)/s,y:(o.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Zc(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Jc(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}}const Qc=.35;function tu(t,e,n){return{min:eu(t,e),max:eu(t,n)}}function eu(t,e){return"number"==typeof t?t:t[e]||0}const nu=new WeakMap;class iu{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:o}=this.getProps();this.panSession=new Yc(t,{onSessionStart:t=>{e&&this.snapToCursor(jc(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:o}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Po(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ma(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Dt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=sa(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),o&&rt.update(()=>o(t,e),!1,!0),Vi(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:o,onDrag:s}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),s&&rt.update(()=>s(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints)&&this.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:o,distanceThreshold:n,contextWindow:$c(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!n)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:r}=this.getProps();r&&rt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!su(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?qt(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?qt(n,t,i.max):Math.min(t,n)),t}(s,this.constraints[t],this.elastic[t])),o.set(s)}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&&Vc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:o}){return{x:Zc(t.x,n,o),y:Zc(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Qc){return!1===t?t=0:!0===t&&(t=Qc),{x:tu(t,"left","right"),y:tu(t,"top","bottom")}}(e),i!==this.constraints&&!Vc(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&Ma(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Vc(e))return!1;const i=e.current;t.invariant(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const s=Tr(i,o.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Jc(t.x,e.x),y:Jc(t.y,e.y)}}(o.layout.layoutBox,s);if(n){const t=n(or(r));this.hasMutatedConstraints=!!t,t&&(r=ir(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Ma(r=>{if(!su(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==s&&s!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Vi(this.visualElement,t),n.start(di(t,n,0,e,this.visualElement,!1))}stopAnimation(){Ma(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ma(e=>{const{drag:n}=this.getProps();if(!su(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:s}=i.layout.layoutBox[e],r=o.get()||0;o.set(t[e]-qt(n,s,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Vc(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ma(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=sa(t),o=sa(e);return o>i?n=R(e.min,e.max-i,t.min):i>o&&(n=R(t.min,t.max-o,e.min)),b(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ma(e=>{if(!su(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:s}=this.constraints[e];n.set(qt(o,s,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;nu.set(this.visualElement,this);const t=this.visualElement.current,e=Wc(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),o=e.target,s=o!==t&&Do(o);n&&i&&!s&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();Vc(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Jo(t,ou(n)),o=Jo(e,ou(n));return()=>{i(),o()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,s=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),rt.read(i);const r=Wa(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Ma(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),s(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Qc,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:r}}}function ou(t){let e=!0;return()=>{e?e=!1:t()}}function su(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ru=t=>(e,n)=>{t&&rt.update(()=>t(e,n),!1,!0)};let au=!1;class lu extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;o&&(e.group&&e.group.add(o),n&&n.register&&i&&n.register(o),au&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ha.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:o}=this.props,{projection:s}=n;return s?(s.isPresent=o,t.layoutDependency!==e&&s.setOptions({...s.options,layoutDependency:e}),au=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||rt.postRender(()=>{const t=s.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),wo.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;au=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function cu(t){const[n,i]=Yl(),o=e.useContext(m);return d(lu,{...t,layoutGroup:o,switchLayoutGroup:e.useContext(Cc),isPresent:n,safeToRemove:i})}const uu={pan:{Feature:class extends nr{constructor(){super(...arguments),this.removePointerDownListener=V}onPointerDown(t){this.session=new Yc(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$c(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ru(t),onStart:ru(e),onMove:ru(n),onEnd:(t,e)=>{delete this.session,i&&rt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Wc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends nr{constructor(t){super(t),this.removeGroupControls=V,this.removeListeners=V,this.controls=new iu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||V}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Al,MeasureLayout:cu}};function hu(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const o=i["onHover"+n];o&&rt.postRender(()=>o(e,jc(e)))}function du(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const o=i["onTap"+("End"===n?"":n)];o&&rt.postRender(()=>o(e,jc(e)))}const pu=new WeakMap,mu=new WeakMap,fu=t=>{const e=pu.get(t.target);e&&e(t)},gu=t=>{t.forEach(fu)};function yu(t,e,n){const i=function({root:t,...e}){const n=t||document;mu.has(n)||mu.set(n,{});const i=mu.get(n),o=JSON.stringify(e);return i[o]||(i[o]=new IntersectionObserver(gu,{root:t,...e})),i[o]}(e);return pu.set(t,n),i.observe(t),()=>{pu.delete(t),i.unobserve(t)}}const vu={some:0,all:1};const xu={inView:{Feature:class extends nr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:o}=t,s={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:vu[i]};this.stopObserver=yu(this.node.current,s,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),s=e?n:i;s&&s(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends nr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=Fo(t,(t,e)=>(du(this.node,e,"Start"),(t,{success:e})=>du(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends nr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=k(Wa(this.node.current,"focus",()=>this.onFocus()),Wa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends nr{mount(){const{current:t}=this.node;t&&(this.unmount=Ao(t,(t,e)=>(hu(this.node,e,"Start"),t=>hu(this.node,t,"End"))))}unmount(){}}}},wu={layout:{ProjectionNode:Al,MeasureLayout:cu}},Su=Bc({...Ic,...xu,...uu,...wu},hc);function bu({children:n,as:i="ul",axis:o="y",onReorder:s,values:r,...a},l){const c=f(()=>Su[i]),u=[],h=e.useRef(!1),p=e.useRef(null);t.invariant(Boolean(r),"Reorder.Group must be provided a values prop","reorder-values");const m={axis:o,groupRef:p,registerItem:(t,e)=>{const n=u.findIndex(e=>t===e.value);-1!==n?u[n].layout=e[o]:u.push({value:t,layout:e[o]}),u.sort(Pu)},updateOrder:(t,e,n)=>{if(h.current)return;const i=function(t,e,n,i){if(!i)return t;const o=t.findIndex(t=>t.value===e);if(-1===o)return t;const s=i>0?1:-1,r=t[o+s];if(!r)return t;const a=t[o],l=r.layout,c=qt(l.min,l.max,.5);return 1===s&&a.layout.max+n>c||-1===s&&a.layout.min+n<c?S(t,o,o+s):t}(u,t,e,n);if(u!==i){h.current=!0;const t=[...r];for(let e=0;e<i.length;e++)if(u[e].value!==i[e].value){const n=r.indexOf(u[e].value),o=r.indexOf(i[e].value);-1!==n&&-1!==o&&([t[n],t[o]]=[t[o],t[n]]);break}s(t)}}};e.useEffect(()=>{h.current=!1});const g={overflowAnchor:"none",...a.style};return d(c,{...a,style:g,ref:t=>{p.current=t,"function"==typeof l?l(t):l&&(l.current=t)},ignoreStrict:!0,children:d(lc.Provider,{value:m,children:n})})}const Tu=e.forwardRef(bu);function Pu(t,e){return t.layout.min-e.layout.min}function Eu(t){const n=f(()=>ii(t)),{isStatic:i}=e.useContext(jl);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function Au(t,e){const n=Eu(e()),i=()=>n.set(e());return i(),y(()=>{const e=()=>rt.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),at(i)}}),n}function Mu(t,e,n,i){if("function"==typeof t)return function(t){ei.current=[],t();const e=Au(ei.current,t);return ei.current=void 0,e}(t);if(void 0!==n&&!Array.isArray(n)&&"function"!=typeof e)return function(t,e,n,i){const o=f(()=>Object.keys(n)),s=f(()=>({}));for(const r of o)s[r]=Mu(t,e,n[r],i);return s}(t,e,n,i);const o="function"==typeof e?e:is(e,n,i),s=Array.isArray(t)?Cu(t,o):Cu([t],([t])=>o(t)),r=Array.isArray(t)?void 0:t.accelerate;return r&&!r.isTransformed&&"function"!=typeof e&&Array.isArray(n)&&!1!==i?.clamp&&(s.accelerate={...r,times:e,keyframes:n,isTransformed:!0,...i?.ease?{ease:i.ease}:{}}),s}function Cu(t,e){const n=f(()=>[]);return Au(t,()=>{n.length=0;const i=t.length;for(let e=0;e<i;e++)n[e]=t[e].get();return e(n)})}const Vu=new Set(["auto","scroll"]),ku=new WeakMap,Ru=new WeakMap;let Du=null;function Lu(t,e){const n=getComputedStyle(t),i="x"===e?n.overflowX:n.overflowY,o=t===document.body||t===document.documentElement;return Vu.has(i)||o}function Bu(t,e){let n=t?.parentElement;for(;n;){if(Lu(n,e))return n;n=n.parentElement}return null}function Ou(t,e,n,i){if(!t)return;Du=t;const o=Bu(t,n);if(!o)return;const s=e-("x"===n?window.scrollX:window.scrollY),{amount:r,edge:a}=function(t,e,n){const i=e.getBoundingClientRect(),o=t-("x"===n?Math.max(0,i.left):Math.max(0,i.top)),s=("x"===n?Math.min(window.innerWidth,i.right):Math.min(window.innerHeight,i.bottom))-t;if(o<50){const t=1-o/50;return{amount:-25*t*t,edge:"start"}}if(s<50){const t=1-s/50;return{amount:25*t*t,edge:"end"}}return{amount:0,edge:null}}(s,o,n);if(null===a)return Ru.delete(o),void ku.delete(o);const l=Ru.get(o),c=o===document.body||o===document.documentElement;if(l!==a){if(!("start"===a&&i<0||"end"===a&&i>0))return;Ru.set(o,a);const t="x"===n?o.scrollWidth-(c?window.innerWidth:o.clientWidth):o.scrollHeight-(c?window.innerHeight:o.clientHeight);ku.set(o,t)}if(r>0){const t=ku.get(o);if(("x"===n?c?window.scrollX:o.scrollLeft:c?window.scrollY:o.scrollTop)>=t)return}"x"===n?c?window.scrollBy({left:r}):o.scrollLeft+=r:c?window.scrollBy({top:r}):o.scrollTop+=r}function Iu(t,e=0){return Mi(t)?t:Eu(e)}function ju({children:n,style:i={},value:o,as:s="li",onDrag:r,onDragEnd:a,layout:l=!0,...c},u){const h=f(()=>Su[s]),p=e.useContext(lc),m={x:Iu(i.x),y:Iu(i.y)},g=Mu([m.x,m.y],([t,e])=>t||e?1:"unset");t.invariant(Boolean(p),"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:v,updateOrder:x,groupRef:w}=p;return d(h,{drag:y,...c,dragSnapToOrigin:!0,style:{...i,x:m.x,y:m.y,zIndex:g},layout:l,onDrag:(t,e)=>{const{velocity:n,point:i}=e,s=m[y].get();x(o,s,n[y]),Ou(w.current,i[y],y,n[y]),r&&r(t,e)},onDragEnd:(t,e)=>{!function(){if(Du){const t=Bu(Du,"y");t&&(Ru.delete(t),ku.delete(t));const e=Bu(Du,"x");e&&e!==t&&(Ru.delete(e),ku.delete(e)),Du=null}}(),a&&a(t,e)},onLayoutMeasure:t=>{v(o,t)},ref:u,ignoreStrict:!0,children:n})}const Fu=e.forwardRef(ju);var Wu=Object.freeze({__proto__:null,Group:Tu,Item:Fu});function $u(t){return"object"==typeof t&&!Array.isArray(t)}function Nu(t,e,n,i){return null==t?[]:"string"==typeof t&&$u(e)?so(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Uu(t,e,n){return t*(e+1)+n*e}function zu(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Yu(t,e,n,i,o,s){!function(t,e,n){for(let i=0;i<t.length;i++){const o=t[i];o.at>e&&o.at<n&&(w(t,o),i--)}}(t,o,s);for(let r=0;r<e.length;r++)t.push({value:e[r],at:qt(o,s,i[r]),easing:tt(n,r)})}function Hu(t,e,n=0){const i=e+1+e*n;for(let e=0;e<t.length;e++)t[e]=t[e]/i}function Xu(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Gu(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Ku(t,e){return e[t]||(e[t]=[]),e[t]}function _u(t){return Array.isArray(t)?t:[t]}function qu(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Zu=t=>"number"==typeof t,Ju=t=>t.every(Zu);function Qu(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=$o(t)&&!es(t)?new Xr(e):new Or(e);n.mount(t),Fs.set(t,n)}function th(t){const e=new Ir({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Fs.set(t,e)}function eh(e,n,i,o){const s=[];if(function(t,e){return Mi(t)||"number"==typeof t||"string"==typeof t&&!$u(e)}(e,n))s.push(Fa(e,$u(n)&&n.default||n,i&&i.default||i));else{if(null==e)return s;const r=Nu(e,n,o),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t<a;t++){const e=r[t],o=e instanceof Element?Qu:th;Fs.has(e)||o(e);const l=Fs.get(e),c={...i};"delay"in c&&"function"==typeof c.delay&&(c.delay=c.delay(t,a)),s.push(...Oi(l,{...n,transition:c},{}))}}return s}function nh(e,n,i){const o=[],s=function(e,{defaultTransition:n={},...i}={},o,s){const r=n.duration||.3,a=new Map,l=new Map,c={},u=new Map;let h=0,d=0,p=0;for(let i=0;i<e.length;i++){const a=e[i];if("string"==typeof a){u.set(a,d);continue}if(!Array.isArray(a)){u.set(a.name,zu(d,a.at,h,u));continue}let[m,f,g={}]=a;void 0!==g.at&&(d=zu(d,g.at,h,u));let y=0;const v=(e,i,o,a=0,l=0)=>{const c=_u(e),{delay:u=0,times:h=Fe(c),type:m=n.type||"keyframes",repeat:f,repeatType:g,repeatDelay:v=0,...x}=i;let{ease:w=n.ease||"easeOut",duration:S}=i;const b="function"==typeof u?u(a,l):u,T=c.length,P=Ln(m)?m:s?.[m||"keyframes"];if(T<=2&&P){let t=100;if(2===T&&Ju(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...x};void 0!==S&&(e.duration=L(S));const i=pe(e,t,P);w=i.ease,S=i.duration}S??(S=r);const E=d+b;1===h.length&&0===h[0]&&(h[1]=1);const A=h.length-c.length;if(A>0&&je(h,A),1===c.length&&c.unshift(null),f&&t.warning(f<20,`Sequence segments can't repeat ${f} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),f&&f<20){const t=S>0?v/S:0;S=Uu(S,f,v);const e=[...c],n=[...h];w=Array.isArray(w)?[...w]:[w];const i=[...w],o="reverse"===g||"mirror"===g;let s=e,r=i;o&&(s=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?U(t):t)));for(let a=0;a<f;a++){const l=o&&a%2==0,u=l?s:e,d=l?r:i,p=(a+1)*(1+t);t>0&&(c.push(c[c.length-1]),h.push(p),w.push("linear")),c.push(...u);for(let t=0;t<u.length;t++)h.push(n[t]+p),w.push(0===t?"linear":tt(d,t-1))}Hu(h,f,t)}const M=E+S;Yu(o,c,w,h,E,M),y=Math.max(b+S,y),p=Math.max(M,p)};if(Mi(m))v(f,g,Ku("default",Gu(m,l)));else{const t=Nu(m,f,o,c),e=t.length;for(let n=0;n<e;n++){const i=Gu(t[n],l);for(const t in f)v(f[t],qu(g,t),Ku(t,i),n,e)}}h=d,d+=y}return l.forEach((t,e)=>{for(const o in t){const s=t[o];s.sort(Xu);const r=[],l=[],c=[];for(let t=0;t<s.length;t++){const{at:e,value:n,easing:i}=s[t];r.push(n),l.push(R(0,p,e)),c.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),r.unshift(r[0]),c.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),r.push(null)),a.has(e)||a.set(e,{keyframes:{},transition:{}});const u=a.get(e);u.keyframes[o]=r;const{type:h,...d}=n;u.transition[o]={...d,duration:p,ease:c,times:l,...i}}}),a}(e.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=ii(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:Le});return s.forEach(({keyframes:t,transition:e},n)=>{o.push(...eh(n,t,e))}),o}function ih(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;return function(t,o,s){let r,a=[];const l={};if(void 0!==n&&(l.reduceMotion=n),void 0!==i&&(l.skipAnimations=i),c=t,Array.isArray(c)&&c.some(Array.isArray)){const{onComplete:n,...i}=o||{};"function"==typeof n&&(r=n),a=nh(t,{...l,...i},e)}else{const{onComplete:n,...i}=s||{};"function"==typeof n&&(r=n),a=eh(t,o,{...l,...i},e)}var c;const u=new _n(a);return r&&u.finished.then(r),e&&(e.animations.push(u),u.finished.then(()=>{w(e.animations,u)})),u}}const oh=ih();const sh=e=>function(n,i,o){return new _n(function(e,n,i,o){if(null==e)return[];const s=so(e,o),r=s.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;t<r;t++){const e=s[t],o={...i};"function"==typeof o.delay&&(o.delay=o.delay(t,r));for(const t in n){let i=n[t];Array.isArray(i)||(i=[i]);const s={...si(o,t)};s.duration&&(s.duration=L(s.duration)),s.delay&&(s.delay=L(s.delay));const r=Qn(e),l=Jn(t,s.pseudoElement||""),c=r.get(l);c&&c.stop(),a.push({map:r,key:l,unresolvedKeyframes:i,options:{...s,element:e,name:t,allowFlatten:!o.type&&!o.ease}})}}for(let t=0;t<a.length;t++){const{unresolvedKeyframes:e,options:n}=a[t],{element:i,name:o,pseudoElement:s}=n;s||null!==e[0]||(e[0]=Wo(i,o)),_e(e),io(e,o),!s&&e.length<2&&e.unshift(Wo(i,o)),n.keyframes=e}const l=[];for(let t=0;t<a.length;t++){const{map:e,key:n,options:i}=a[t],o=new On(i);e.set(n,o),o.finished.finally(()=>e.delete(n)),l.push(o)}return l}(n,i,o,e))},rh=sh();function ah(t){return"undefined"!=typeof window&&(t?Mn():An())}const lh={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ch(t,e,n,i){const o=n[e],{length:s,position:r}=lh[e],a=o.current,l=n.time;o.current=Math.abs(t[`scroll${r}`]),o.scrollLength=t[`scroll${s}`]-t[`client${s}`],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=R(0,o.scrollLength,o.current);const c=i-l;o.velocity=c>50?0:O(o.current-a,c)}const uh={start:0,center:.5,end:1};function hh(t,e,n=0){let i=0;if(t in uh&&(t=uh[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const dh=[0,0];function ph(t,e,n,i){let o=Array.isArray(t)?t:dh,s=0,r=0;return"number"==typeof t?o=[t,t]:"string"==typeof t&&(o=(t=t.trim()).includes(" ")?t.split(" "):[t,uh[t]?t:"0"]),s=hh(o[0],n,i),r=hh(o[1],e),s-r}const mh={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},fh={x:0,y:0};function gh(t,e,n){const{offset:i=mh.All}=n,{target:o=t,axis:s="y"}=n,r="y"===s?"height":"width",a=o!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(mo(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let o=null,s=i.parentNode;for(;!o;)"svg"===s.tagName&&(o=s),s=i.parentNode;i=o}}return n}(o,t):fh,l=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),c={width:t.clientWidth,height:t.clientHeight};e[s].offset.length=0;let u=!e[s].interpolate;const h=i.length;for(let t=0;t<h;t++){const n=ph(i[t],c[r],l[r],a[s]);u||n===e[s].interpolatorOffsets[t]||(u=!0),e[s].offset[t]=n}u&&(e[s].interpolate=Ie(e[s].offset,Fe(i),{clamp:!1}),e[s].interpolatorOffsets=[...e[s].offset]),e[s].progress=b(0,1,e[s].interpolate(e[s].current))}function yh(t,e,n,i={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){ch(t,"x",e,n),ch(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&gh(t,n,i)},notify:()=>e(n)}}const vh=new WeakMap,xh=new WeakMap,wh=new WeakMap,Sh=new WeakMap,bh=new WeakMap,Th=t=>t===document.scrollingElement?window:t;function Ph(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return V;let o=wh.get(e);o||(o=new Set,wh.set(e,o));const s=yh(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(o.add(s),!vh.has(e)){const t=()=>{for(const t of o)t.measure(lt.timestamp);rt.preUpdate(n)},n=()=>{for(const t of o)t.notify()},i=()=>rt.read(t);vh.set(e,i);const s=Th(e);window.addEventListener("resize",i),e!==document.documentElement&&xh.set(e,Jo(e,i)),s.addEventListener("scroll",i),i()}if(n&&!bh.has(e)){const t=vh.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Sh.set(e,n);const i=()=>{const i=e.scrollWidth,o=e.scrollHeight;n.width===i&&n.height===o||(t(),n.width=i,n.height=o)},o=rt.read(i,!0);bh.set(e,o)}const r=vh.get(e);return rt.read(r,!1,!0),()=>{at(r);const t=wh.get(e);if(!t)return;if(t.delete(s),t.size)return;const n=vh.get(e);vh.delete(e),n&&(Th(e).removeEventListener("scroll",n),xh.get(e)?.(),window.removeEventListener("resize",n));const i=bh.get(e);i&&(at(i),bh.delete(e)),Sh.delete(e)}}const Eh=[[mh.Enter,"entry"],[mh.Exit,"exit"],[mh.Any,"cover"],[mh.All,"contain"]],Ah={start:0,end:1};function Mh(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=Ah[e[0]],i=Ah[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function Ch(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=Mh(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],o=e[t];if(i[0]!==o[0]||i[1]!==o[1])return!1}return!0}function Vh(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Eh)if(Ch(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const kh=new Map;function Rh(t){const e={value:0},n=Ph(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function Dh({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let o=kh.get(e);o||(o=new Map,kh.set(e,o));const s=n.target??"self";let r=o.get(s);r||(r={},o.set(s,r));const a=i+(n.offset??[]).join(",");if(!r[a])if(n.target&&ah(n.target)){const t=Vh(n.offset);r[a]=t?new ViewTimeline({subject:n.target,axis:i}):Rh({container:e,...n})}else ah()?r[a]=new ScrollTimeline({source:e,axis:i}):r[a]=Rh({container:e,...n});return r[a]}function Lh(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return V;const o={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||function(t){return t&&(t.target||t.offset)}(e)?Ph(n=>{t(n[e.axis].progress,n)},e):Qo(t,Dh(e))}(t,o):function(t,e){const n=Dh(e),i=e.target?Vh(e.offset):void 0,o=e.target?ah(e.target)&&!!i:ah();return t.attachTimeline({timeline:o?n:void 0,...i&&o&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),Qo(e=>{t.time=t.iterationDuration*e},n))})}(t,o)}const Bh={some:0,all:1};function Oh(t,e,{root:n,margin:i,amount:o="some"}={}){const s=so(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof o?o:Bh[o]});return s.forEach(t=>a.observe(t)),()=>a.disconnect()}const Ih=Bc();function jh(t){return e.useEffect(()=>()=>t(),[])}const Fh={renderer:hc,...Ic,...xu},Wh={...Fh,...uu,...wu},$h={renderer:hc,...Ic};function Nh(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])}const Uh=()=>({scrollX:ii(0),scrollY:ii(0),scrollXProgress:ii(0),scrollYProgress:ii(0)}),zh=t=>!!t&&!t.current;function Yh(t,e,n,i){return{factory:o=>{let s;const r=()=>{zh(n)||zh(i)?wo.read(r):s=Lh(o,{...e,axis:t,container:n?.current||void 0,target:i?.current||void 0})};return wo.read(r),()=>{So(r),s?.()}},times:[0,1],keyframes:[0,1],ease:t=>t,duration:1}}function Hh({container:n,target:i,...o}={}){const s=f(Uh);(function(t,e){return"undefined"!=typeof window&&(t?Mn()&&!!Vh(e):An())})(i,o.offset)&&(s.scrollXProgress.accelerate=Yh("x",o,n,i),s.scrollYProgress.accelerate=Yh("y",o,n,i));const r=e.useRef(null),a=e.useRef(!1),l=e.useCallback(()=>(r.current=Lh((t,{x:e,y:n})=>{s.scrollX.set(e.current),s.scrollXProgress.set(e.progress),s.scrollY.set(n.current),s.scrollYProgress.set(n.progress)},{...o,container:n?.current||void 0,target:i?.current||void 0}),()=>{r.current?.()}),[n,i,JSON.stringify(o.offset)]);return y(()=>(a.current=!1,zh(n)||zh(i)?void(a.current=!0):l()),[l]),e.useEffect(()=>{if(!a.current)return;let e;const o=()=>{const o=zh(n),s=zh(i);t.invariant(!o,"Container ref is defined but not hydrated","use-scroll-ref"),t.invariant(!s,"Target ref is defined but not hydrated","use-scroll-ref"),o||s||(e=l())};return wo.read(o),()=>{So(o),e?.()}},[l]),s}function Xh(t,n={}){const{isStatic:i}=e.useContext(jl),o=()=>Mi(t)?t.get():t;if(i)return Mu(o);const s=Eu(o());return e.useInsertionEffect(()=>ss(s,t,n),[s,JSON.stringify(n)]),s}function Gh(t){const n=e.useRef(0),{isStatic:i}=e.useContext(jl);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return rt.update(e,!0),()=>at(e)},[t])}class Kh extends ni{constructor(){super(...arguments),this.isEnabled=!1}add(t){(cn.has(t)||Nn.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function _h(){!Gs.current&&_s();const[t]=e.useState(Xs.current);return t}function qh(){const t=_h(),{reducedMotion:n}=e.useContext(jl);return"never"!==n&&("always"===n||t)}function Zh(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&Ai(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{Zh(t,e)})})}function Jh(){let e=!1;const n=new Set,i={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(i,o){t.invariant(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");const s=[];return n.forEach(t=>{s.push(ji(t,i,{transitionOverride:o}))}),Promise.all(s)},set:i=>(t.invariant(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),n.forEach(t=>{!function(t,e){Array.isArray(e)?Zh(t,e):"string"==typeof e?Zh(t,[e]):Ai(t,e)}(t,i)})),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(e=!0,()=>{e=!1,i.stop()})};return i}function Qh(){const t=f(Jh);return y(t.mount,[]),t}const td=Qh;class ed{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const nd=()=>new ed;function id(t){return null!==t&&"object"==typeof t&&Ac in t}function od(){return sd}function sd(t){El.current&&(El.current.isUpdating=!1,El.current.blockUpdate(),t&&t())}const rd=new Map,ad=new Map,ld=(t,e)=>`${t}: ${cn.has(e)?"transform":e}`;function cd(t,e,n){const i=ld(t,e),o=rd.get(i);if(!o)return null;const{animation:s,startTime:r}=o;function a(){window.MotionCancelOptimisedAnimation?.(t,e,n)}return s.onfinish=a,null===r||window.MotionHandoffIsComplete?.(t)?(a(),null):r}let ud,hd;const dd=new Set;function pd(){dd.forEach(t=>{t.animation.play(),t.animation.startTime=t.startTime}),dd.clear()}const md=()=>({});class fd extends tr{constructor(){super(...arguments),this.measureInstanceViewportBox=js}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}}const gd=Tc({scrapeMotionValuesFromProps:md,createRenderState:md});let yd=0;const vd=t=>t>.001?1/t:1e5;let xd=!1;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:o,presenceAffectsLayout:s=!0,mode:r="sync",propagate:a=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[p,g]=Yl(a),v=e.useMemo(()=>Xl(t),[t]),x=a&&!p?[]:v.map(Hl),w=e.useRef(!0),S=e.useRef(v),b=f(()=>new Map),T=e.useRef(new Set),[P,E]=e.useState(v),[A,M]=e.useState(v);y(()=>{w.current=!1,S.current=v;for(let t=0;t<A.length;t++){const e=Hl(A[t]);x.includes(e)?(b.delete(e),T.current.delete(e)):!0!==b.get(e)&&b.set(e,!1)}},[A,x.length,x.join("-")]);const C=[];if(v!==P){let t=[...v];for(let e=0;e<A.length;e++){const n=A[e],i=Hl(n);x.includes(i)||(t.splice(e,0,n),C.push(n))}return"wait"===r&&C.length&&(t=C),M(Xl(t)),E(v),null}const{forceRender:V}=e.useContext(m);return d(h,{children:A.map(t=>{const e=Hl(t),h=!(a&&!p)&&(v===A||x.includes(e));return d(Ul,{isPresent:h,initial:!(w.current&&!i)&&void 0,custom:n,presenceAffectsLayout:s,mode:r,root:u,onExitComplete:h?void 0:()=>{if(T.current.has(e))return;if(!b.has(e))return;T.current.add(e),b.set(e,!0);let t=!0;b.forEach(e=>{e||(t=!1)}),t&&(V?.(),M(S.current),a&&g?.(),o&&o())},anchorX:l,anchorY:c,children:t},e)})})},t.AnimateSharedLayout=({children:e})=>(i.useEffect(()=>{t.invariant(!1,"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations")},[]),d(ql,{id:f(()=>"asl-"+yd++),children:e})),t.AsyncMotionValueAnimation=Xn,t.DOMKeyframesResolver=eo,t.DOMVisualElement=er,t.DeprecatedLayoutGroupContext=Gl,t.DocumentProjectionNode=bl,t.DragControls=ed,t.Feature=nr,t.FlatTree=Na,t.GroupAnimation=Gn,t.GroupAnimationWithThen=_n,t.HTMLProjectionNode=Al,t.HTMLVisualElement=Or,t.JSAnimation=Ke,t.KeyframeResolver=Sn,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),Vl||(Vl=[],queueMicrotask(Bl)),Vl.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return kl(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of kl(this.scope)){if(this.tracked.has(e))continue;const n=Dl(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:o}=e.options,s=e.getStack(),r=s&&s.members.some(t=>t!==e&&t.instance?.isConnected);if(o&&e.isLead()&&r&&!t.has(o)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),Ll(n,e)}}),e.relegate())return;n.remove()}Ll(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new Gn([...t]))}},t.LayoutGroup=ql,t.LayoutGroupContext=m,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,o]=e.useState(!nc(n)),s=e.useRef(void 0);if(!nc(n)){const{renderer:t,...e}=n;s.current=t,ec(e)}return e.useEffect(()=>{nc(n)&&n().then(({renderer:t,...e})=>{ec(e),s.current=t,o(!0)})},[]),d(Zl.Provider,{value:{renderer:s.current,strict:i},children:t})},t.MotionConfig=function({children:t,isValidProp:n,...i}){n&&rc(n);const o=e.useContext(jl);(i={...o,...i}).transition=oi(i.transition,o.transition),i.isStatic=f(()=>i.isStatic);const s=e.useMemo(()=>i,[JSON.stringify(i.transition),i.transformPagePoint,i.reducedMotion,i.skipAnimations]);return d(jl.Provider,{value:s,children:t})},t.MotionConfigContext=jl,t.MotionContext=dc,t.MotionGlobalConfig=P,t.MotionValue=ni,t.NativeAnimation=On,t.NativeAnimationExtended=Fn,t.NativeAnimationWrapper=qn,t.NodeStack=Ya,t.ObjectVisualElement=Ir,t.PopChild=Nl,t.PresenceChild=Ul,t.PresenceContext=v,t.Reorder=Wu,t.SVGVisualElement=Xr,t.SubscriptionManager=D,t.SwitchLayoutGroupContext=Cc,t.ViewTransitionBuilder=Ls,t.VisualElement=tr,t.WillChangeMotionValue=Kh,t.acceleratedValues=Nn,t.addAttrValue=uo,t.addDomEvent=Wa,t.addPointerEvent=Wc,t.addPointerInfo=Fc,t.addScaleCorrector=function(t){for(const e in t)Dr[e]=t[e],mt(e)&&(Dr[e].isCSSVariable=!0)},t.addStyleValue=yo,t.addUniqueItem=x,t.addValueToWillChange=Vi,t.alpha=wt,t.analyseComplexValue=zt,t.animate=oh,t.animateMini=rh,t.animateMotionValue=di,t.animateSingleValue=Fa,t.animateTarget=Oi,t.animateValue=function(t){return new Ke(t)},t.animateVariant=Ii,t.animateView=function(t,e={}){return new Ls(t,e)},t.animateVisualElement=ji,t.animationControls=Jh,t.animationMapKey=Jn,t.animations=Ic,t.anticipate=X,t.applyAxisDelta=pr,t.applyBoxDelta=mr,t.applyGeneratorOptions=Bn,t.applyPointDelta=dr,t.applyPxDefaults=io,t.applyTreeDeltas=yr,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const o=!0===i?1:"number"==typeof i?i:0;let s;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=fi(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a)<Math.abs(l),n=i.x+a*e,o=i.y+l*e,h=t?Math.sign(u.x-n):Math.sign(u.y-o);void 0!==s&&0!==h&&h!==s?(c=-c,u=fi(i.x,i.y,r.x,r.y,c,e)):0!==h&&(s=h)}const h=o?mi(0,i.x,u.x,r.x,i.y,u.y,r.y):0,d=o?mi(1,i.x,u.x,r.x,i.y,u.y,r.y):0,p=o?F(-180,180,d-h):0;return t=>{const e={x:pi(t,i.x,u.x,r.x),y:pi(t,i.y,u.y,r.y)};if(o){const n=mi(t,i.x,u.x,r.x,i.y,u.y,r.y),s=h+p*t;e.rotate=F(-180,180,n-s)*o}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateVisualElement(t,n,i,o,s){if(!("x"in n)&&!("y"in n))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,m=e({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t.getValue("pathRotation",0):void 0,g={delay:o,...si(i||{},"x")};delete g.path;const y=ii(0);y.start(di("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),y.animation&&s.push(y.animation),delete n.x,delete n.y}};return n},t.aspectRatio=Ea,t.attachFollow=ss,t.attachSpring=function(t,e,n){return ss(t,e,{type:"spring",...n})},t.attrEffect=ho,t.axisDeltaEquals=Aa,t.axisEquals=Sa,t.axisEqualsRounded=Ta,t.backIn=Y,t.backInOut=H,t.backOut=z,t.boxEquals=ba,t.boxEqualsRounded=Pa,t.buildHTMLStyles=Mr,t.buildProjectionTransform=Ca,t.buildSVGAttrs=Nr,t.buildSVGPath=Wr,t.buildTransform=Ar,t.calcAxisDelta=aa,t.calcBoxDelta=la,t.calcChildStagger=ti,t.calcGeneratorDuration=de,t.calcLength=sa,t.calcRelativeAxis=ca,t.calcRelativeAxisPosition=ha,t.calcRelativeBox=ua,t.calcRelativePosition=da,t.camelCaseAttributes=Ur,t.camelToDash=ki,t.cancelFrame=at,t.cancelMicrotask=So,t.cancelSync=Il,t.checkVariantsDidChange=Qr,t.circIn=G,t.circInOut=_,t.circOut=K,t.clamp=b,t.cleanDirtyNodes=el,t.collectMotionValues=ei,t.color=Ft,t.compareByDepth=$a,t.complex=Xt,t.containsCSSVariable=vt,t.convertBoundingBoxToBox=ir,t.convertBoxToBoundingBox=or,t.convertOffsetToTimes=We,t.copyAxisDeltaInto=oa,t.copyAxisInto=na,t.copyBoxInto=ia,t.correctBorderRadius=kr,t.correctBoxShadow=Rr,t.correctParentTransform=function(t){return e=>{const n=t.current;if(!n)return e;const i=function(t){const{transform:e}=getComputedStyle(t);if(!e||"none"===e)return null;const n=e.match(/^matrix3d\((.*)\)$/u)||e.match(/^matrix\((.*)\)$/u);if(!n)return null;const i=n[1].split(",").map(Number),o=e.startsWith("matrix3d"),s=i[0],r=i[1],a=o?i[4]:i[2],l=o?i[5]:i[3],c=s*l-r*a;return Math.abs(c)<1e-10?null:{a:l/c,b:-r/c,c:-a/c,d:s/c}}(n);if(!i)return e;const o=n.getBoundingClientRect(),s=o.left+window.scrollX+o.width/2,r=o.top+window.scrollY+o.height/2,a=e.x-s,l=e.y-r;return{x:s+i.a*a+i.c*l,y:r+i.b*a+i.d*l}}},t.createAnimationState=Jr,t.createAxis=Is,t.createAxisDelta=Bs,t.createBox=js,t.createDelta=Os,t.createGeneratorEasing=pe,t.createProjectionNode=Za,t.createRenderBatcher=st,t.createScopedAnimate=ih,t.cubicBezier=$,t.cubicBezierAsString=Vn,t.defaultEasing=$e,t.defaultOffset=Fe,t.defaultTransformValue=on,t.defaultValueTypes=qi,t.degrees=Rt,t.delay=Ua,t.delayInSeconds=function(t,e){return Ua(t,L(e))},t.dimensionValueTypes=Wi,t.disableInstantTransitions=function(){P.instantAnimations=!1},t.distance=Nc,t.distance2D=Uc,t.domAnimation=Fh,t.domMax=Wh,t.domMin=$h,t.eachAxis=Ma,t.easeIn=q,t.easeInOut=J,t.easeOut=Z,t.easingDefinitionToFunction=it,t.fillOffset=je,t.fillWildcards=_e,t.filterProps=ac,t.findDimensionValueType=$i,t.findValueType=us,t.flushKeyframeResolvers=wn,t.followValue=os,t.frame=rt,t.frameData=lt,t.frameSteps=ct,t.generateLinearEasing=ue,t.getAnimatableNone=Qi,t.getAnimationMap=Qn,t.getComputedStyle=Wo,t.getDefaultTransition=ci,t.getDefaultValueType=Zi,t.getEasingForSegment=tt,t.getFeatureDefinitions=Qs,t.getFinalKeyframe=ze,t.getMixer=oe,t.getOptimisedAppearId=Li,t.getOriginIndex=ns,t.getValueAsType=ao,t.getValueTransition=si,t.getVariableValue=vi,t.getVariantContext=Kr,t.getViewAnimationLayerInfo=Ss,t.getViewAnimations=bs,t.globalProjectionState=Ha,t.has2DTranslate=cr,t.hasReducedMotionListener=Gs,t.hasScale=ar,t.hasTransform=lr,t.hasWarned=function(t){return I.has(t)},t.hex=Vt,t.hover=Ao,t.hsla=jt,t.hslaToRgba=Kt,t.inView=Oh,t.inertia=Oe,t.initPrefersReducedMotion=_s,t.interpolate=Ie,t.invisibleValues=ee,t.isAnimationControls=Ws,t.isBezierDefinition=et,t.isBrowser=g,t.isCSSVariableName=mt,t.isCSSVariableToken=gt,t.isControllingVariants=zs,t.isDeltaZero=wa,t.isDragActive=To,t.isDragging=bo,t.isEasingArray=Q,t.isElementKeyboardAccessible=ko,t.isElementTextInput=Do,t.isForcedMotionValue=Lr,t.isGenerator=Ln,t.isHTMLElement=mo,t.isKeyframesTarget=Ti,t.isMotionComponent=id,t.isMotionValue=Mi,t.isNear=ra,t.isNodeOrChild=Mo,t.isNumericalString=E,t.isObject=A,t.isPrimaryPointer=Co,t.isSVGElement=$o,t.isSVGSVGElement=es,t.isSVGTag=zr,t.isTransitionDefined=hi,t.isValidMotionProp=oc,t.isVariantLabel=$s,t.isVariantNode=Ys,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&Cn()||!e||"string"==typeof e&&(e in kn||Cn())||et(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=Ci,t.isZeroValueString=M,t.keyframes=Ne,t.m=Ih,t.makeAnimationInstant=$n,t.makeUseVisualState=Tc,t.mapEasingToNativeEasing=Rn,t.mapValue=function(t,e,n,i){const o=is(e,n,i);return ls(()=>o(t.get()))},t.maxGeneratorDuration=he,t.measurePageBox=Tr,t.measureViewportBox=br,t.memo=C,t.microtask=wo,t.millisecondsToSeconds=B,t.mirrorEasing=N,t.mix=le,t.mixArray=se,t.mixColor=te,t.mixComplex=ae,t.mixImmediate=_t,t.mixLinearColor=Zt,t.mixNumber=qt,t.mixObject=re,t.mixValues=La,t.mixVisibility=ne,t.motion=Su,t.motionValue=ii,t.moveItem=S,t.nodeGroup=Pl,t.noop=V,t.number=xt,t.numberValueTypes=_i,t.observeTimeline=Qo,t.optimizedAppearDataAttribute=Di,t.optimizedAppearDataId=Ri,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:so(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=yi,t.parseValueFromTransform=sn,t.percent=Dt,t.pipe=k,t.pixelsToPercent=Vr,t.positionalKeys=bi,t.prefersReducedMotion=Xs,t.press=Fo,t.progress=R,t.progressPercentage=It,t.propEffect=po,t.propagateDirtyNodes=tl,t.px=Lt,t.readTransformValue=rn,t.recordStats=function(){if(ts.value)throw ts.value=null,ts.addProjectionMetrics=null,new Error("Stats are already being measured");const t=ts;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=ma,t.removeAxisTransforms=fa,t.removeBoxTransforms=va,t.removeItem=w,t.removePointDelta=pa,t.renderHTML=Cr,t.renderSVG=Yr,t.resize=Jo,t.resolveElements=so,t.resolveMotionValue=za,t.resolveTransition=oi,t.resolveVariant=Si,t.resolveVariantFromProps=wi,t.reverseEasing=U,t.rgbUnit=Mt,t.rgba=Ct,t.rootProjectionNode=El,t.scale=St,t.scaleCorrectors=Dr,t.scalePoint=hr,t.scrapeHTMLMotionValuesFromProps=Br,t.scrapeSVGMotionValuesFromProps=Hr,t.scroll=Lh,t.scrollInfo=Ph,t.secondsToMilliseconds=L,t.setDragLock=Po,t.setFeatureDefinitions=Js,t.setStyle=Tn,t.setTarget=Ai,t.spring=Le,t.springValue=function(t,e){return os(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(o,s)=>{const r="number"==typeof n?n:ns(n,s),a=Math.abs(r-o);let l=t*a;if(i){const e=s*t;l=it(i)(l/e)*e}return e+l}},t.startOptimizedAppearAnimation=function(t,e,n,i,o){if(window.MotionIsMounted)return;const s=t.dataset[Ri];if(!s)return;window.MotionHandoffAnimation=cd;const r=ld(s,e);hd||(hd=Dn(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"}),rd.set(r,{animation:hd,startTime:null}),window.MotionHandoffAnimation=cd,window.MotionHasOptimisedAnimation=(t,e)=>{if(!t)return!1;if(!e)return ad.has(t);const n=ld(t,e);return Boolean(rd.get(n))},window.MotionHandoffMarkAsComplete=t=>{ad.has(t)&&ad.set(t,!0)},window.MotionHandoffIsComplete=t=>!0===ad.get(t),window.MotionCancelOptimisedAnimation=(t,e,n,i)=>{const o=ld(t,e),s=rd.get(o);s&&(n&&void 0===i?n.postRender(()=>{n.postRender(()=>{s.animation.cancel()})}):s.animation.cancel(),n&&i?(dd.add(s),n.render(pd)):(rd.delete(o),rd.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(t,e,n)=>{const i=Li(t);if(!i)return;const o=window.MotionHasOptimisedAnimation?.(i,e),s=t.props.values?.[e];if(!o||!s)return;const r=n.on("change",t=>{s.get()!==t&&(window.MotionCancelOptimisedAnimation?.(i,e),r())});return r});const a=()=>{hd.cancel();const s=Dn(t,e,n,i);void 0===ud&&(ud=performance.now()),s.startTime=ud,rd.set(r,{animation:s,startTime:ud}),o&&o(s)};ad.set(s,!1),hd.ready?hd.ready.then(a).catch(V):a()},t.startWaapiAnimation=Dn,t.statsBuffer=ts,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(i):Math.ceil(i);return b(0,1,o/t)}},t.styleEffect=vo,t.supportedWaapiEasing=kn,t.supportsBrowserAnimation=Hn,t.supportsFlags=Pn,t.supportsLinearEasing=Cn,t.supportsPartialKeyframes=oo,t.supportsScrollTimeline=An,t.supportsViewTimeline=Mn,t.svgEffect=xo,t.sync=Ol,t.testValueType=Fi,t.time=dt,t.transform=is,t.transformAxis=xr,t.transformBox=Sr,t.transformBoxPoints=sr,t.transformPropOrder=ln,t.transformProps=cn,t.transformValue=ls,t.transformValueTypes=Ki,t.transformViewBoxPoint=function(t){return e=>{const n=t.current;if(!n)return e;const i=n.viewBox?.baseVal;if(!i||0===i.width&&0===i.height)return e;const o=n.getBoundingClientRect();if(0===o.width||0===o.height)return e;const s=i.width/o.width,r=i.height/o.height,a=o.left+window.scrollX,l=o.top+window.scrollY;return{x:(e.x-a)*s+a,y:(e.y-l)*r+l}}},t.translateAxis=vr,t.unwrapMotionComponent=function(t){if(id(t))return t[Ac]},t.updateMotionValuesFromProps=Hs,t.useAnimate=function(){const t=f(()=>({current:null,animations:[]})),n=qh()??void 0,{skipAnimations:i}=e.useContext(jl),o=e.useMemo(()=>ih({scope:t,reduceMotion:n,skipAnimations:i}),[t,n,i]);return jh(()=>{t.animations.forEach(t=>t.stop()),t.animations.length=0}),[t,o]},t.useAnimateMini=function(){const t=f(()=>({current:null,animations:[]})),e=f(()=>sh(t));return jh(()=>{t.animations.forEach(t=>t.stop())}),[t,e]},t.useAnimation=td,t.useAnimationControls=Qh,t.useAnimationFrame=Gh,t.useComposedRefs=Wl,t.useCycle=function(...t){const n=e.useRef(0),[i,o]=e.useState(t[n.current]),s=e.useCallback(e=>{n.current="number"!=typeof e?F(0,t.length,n.current+1):e,o(t[n.current])},[t.length,...t]);return[i,s]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),o=gd({},!1),s=f(()=>new fd({props:{onUpdate:t=>{i({...t})}},visualState:o,presenceContext:null},{initialState:t}));return e.useLayoutEffect(()=>(s.mount({}),()=>s.unmount()),[s]),[n,f(()=>t=>ji(s,t))]},t.useDeprecatedInvertedScale=function(n){let i=Eu(1),o=Eu(1);const{visualElement:s}=e.useContext(dc);return t.invariant(!(!n&&!s),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),t.warning(xd,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),xd=!0,n?(i=n.scaleX||i,o=n.scaleY||o):s&&(i=s.getValue("scaleX",1),o=s.getValue("scaleY",1)),{scaleX:Mu(i,vd),scaleY:Mu(o,vd)}},t.useDomEvent=function(t,n,i,o){e.useEffect(()=>{const e=t.current;if(i&&e)return Wa(e,n,i,o)},[t,n,i,o])},t.useDragControls=function(){return f(nd)},t.useElementScroll=function(t){return Hh({container:t})},t.useFollowValue=Xh,t.useForceUpdate=Kl,t.useInView=function(t,{root:n,margin:i,amount:o,once:s=!1,initial:r=!1}={}){const[a,l]=e.useState(r);return e.useEffect(()=>{if(!t.current||s&&a)return;const e={root:n&&n.current||void 0,margin:i,amount:o};return Oh(t.current,()=>(l(!0),s?void 0:()=>l(!1)),e)},[n,t,i,s,o]),a},t.useInstantLayoutTransition=od,t.useInstantTransition=function(){const[t,n]=Kl(),i=od(),o=e.useRef(-1);return e.useEffect(()=>{rt.postRender(()=>rt.postRender(()=>{n===o.current&&(P.instantAnimations=!1)}))},[n]),e=>{i(()=>{P.instantAnimations=!0,t(),e(),o.current=n+1})}},t.useIsPresent=function(){return null===(t=e.useContext(v))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return Au(e.filter(Mi),function(){let i="";for(let o=0;o<n;o++){i+=t[o];const n=e[o];n&&(i+=Mi(n)?n.get():n)}return i})},t.useMotionValue=Eu,t.useMotionValueEvent=Nh,t.usePageInView=function(){const[t,n]=e.useState(!0);return e.useEffect(()=>{const t=()=>n(!document.hidden);return document.hidden&&t(),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),t},t.usePresence=Yl,t.usePresenceData=function(){const t=e.useContext(v);return t?t.custom:void 0},t.useReducedMotion=_h,t.useReducedMotionConfig=qh,t.useResetProjection=function(){return e.useCallback(()=>{const t=El.current;t&&t.resetTree()},[])},t.useScroll=Hh,t.useSpring=function(t,e={}){return Xh(t,{type:"spring",...e})},t.useTime=function(){const t=Eu(0);return Gh(e=>t.set(e)),t},t.useTransform=Mu,t.useUnmountEffect=jh,t.useVelocity=function(t){const e=Eu(t.getVelocity()),n=()=>{const i=t.getVelocity();e.set(i),i&&rt.update(n)};return Nh(t,"change",()=>{rt.update(n,!1,!0)}),e},t.useViewportScroll=function(){return Hh()},t.useWillChange=function(){return f(()=>new Kh("auto"))},t.variantPriorityOrder=Ns,t.variantProps=Us,t.velocityPerSecond=O,t.vh=Bt,t.visualElementStore=Fs,t.vw=Ot,t.warnOnce=j,t.wrap=F});