framer-motion 12.24.0 → 12.24.1

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