framer-motion 12.24.10 → 12.24.12
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.
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/{feature-bundle-OJqyiRBo.js → feature-bundle-W9TOG4_M.js} +103 -4
- package/dist/cjs/{feature-bundle-OJqyiRBo.js.map → feature-bundle-W9TOG4_M.js.map} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/dom-mini.js +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/gestures/drag/VisualElementDragControls.mjs +1 -0
- package/dist/es/gestures/drag/VisualElementDragControls.mjs.map +1 -1
- package/dist/es/gestures/pan/PanSession.mjs +99 -1
- package/dist/es/gestures/pan/PanSession.mjs.map +1 -1
- package/dist/framer-motion.dev.js +119 -6
- package/dist/framer-motion.js +1 -1
- package/dist/mini.js +1 -1
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-animate.js.map +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-motion.js.map +1 -1
- package/dist/size-rollup-waapi-animate.js +1 -1
- package/dist/size-rollup-waapi-animate.js.map +1 -1
- package/package.json +3 -3
|
@@ -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,useInsertionEffect as l,useCallback as h,useLayoutEffect as u,useEffect 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;function bt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const At={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Et={...At,transform:t=>y(0,1,t)},Vt={...At,default:1},Mt=t=>Math.round(1e5*t)/1e5,Ct=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Dt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kt=(t,e)=>n=>Boolean("string"==typeof n&&Dt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Rt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Ct);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Lt={...At,transform:t=>Math.round((t=>y(0,255,t))(t))},Bt={test:kt("rgb","red"),parse:Rt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Lt.transform(t)+", "+Lt.transform(e)+", "+Lt.transform(n)+", "+Mt(Et.transform(i))+")"};const jt={test:kt("#"),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:Bt.transform},Ft=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),It=Ft("deg"),Ot=Ft("%"),Ut=Ft("px"),Nt=Ft("vh"),$t=Ft("vw"),Wt=(()=>({...Ot,parse:t=>Ot.parse(t)/100,transform:t=>Ot.transform(100*t)}))(),Yt={test:kt("hsl","hue"),parse:Rt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Ot.transform(Mt(e))+", "+Ot.transform(Mt(n))+", "+Mt(Et.transform(i))+")"},Xt={test:t=>Bt.test(t)||jt.test(t)||Yt.test(t),parse:t=>Bt.test(t)?Bt.parse(t):Yt.test(t)?Yt.parse(t):jt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Bt.transform(t):Yt.transform(t),getAnimatableNone:t=>{const e=Xt.parse(t);return e.alpha=0,Xt.transform(e)}},Kt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const zt="number",Ht="color",Gt=/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 qt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Gt,t=>(Xt.test(t)?(i.color.push(o),s.push(Ht),n.push(Xt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(zt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Zt(t){return qt(t).values}function _t(t){const{split:e,types:n}=qt(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===zt?Mt(t[o]):e===Ht?Xt.transform(t[o]):t[o]}return s}}const Jt=t=>"number"==typeof t?0:Xt.test(t)?Xt.getAnimatableNone(t):t;const Qt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Ct)?.length||0)+(t.match(Kt)?.length||0)>0},parse:Zt,createTransformer:_t,getAnimatableNone:function(t){const e=Zt(t);return _t(t)(e.map(Jt))}};function te(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 ee(t,e){return n=>n>0?e:t}const ne=(t,e,n)=>t+(e-t)*n,ie=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},se=[jt,Bt,Yt];function oe(t){const e=(n=t,se.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===Yt&&(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=te(a,i,t+1/3),o=te(a,i,t),r=te(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 re=(t,e)=>{const n=oe(t),i=oe(e);if(!n||!i)return ee(t,e);const s={...n};return t=>(s.red=ie(n.red,i.red,t),s.green=ie(n.green,i.green,t),s.blue=ie(n.blue,i.blue,t),s.alpha=ne(n.alpha,i.alpha,t),Bt.transform(s))},ae=new Set(["none","hidden"]);function le(t,e){return n=>ne(t,e,n)}function he(t){return"number"==typeof t?le:"string"==typeof t?Pt(t)?ee:Xt.test(t)?re:de:Array.isArray(t)?ue:"object"==typeof t?Xt.test(t)?re:ce:ee}function ue(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>he(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function ce(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=he(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const de=(t,e)=>{const n=Qt.createTransformer(e),i=qt(t),s=qt(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?ae.has(t)&&!s.values.length||ae.has(e)&&!i.values.length?function(t,e){return ae.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):M(ue(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"),ee(t,e))};function pe(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ne(t,e,n);return he(t)(t,e)}const me=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()}},fe=(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)})`},ge=2e4;function ye(t){let e=0;let n=t.next(e);for(;!n.done&&e<ge;)e+=50,n=t.next(e);return e>=ge?1/0:e}function ve(t,e,n){const i=Math.max(e-5,0);return L(n-t(i),e-i)}const xe=100,Te=10,we=1,Pe=0,Se=800,be=.3,Ae=.3,Ee={granular:.01,default:2},Ve={granular:.005,default:.5},Me=.01,Ce=10,De=.05,ke=1,Re=.001;function Le({duration:t=Se,bounce:e=be,velocity:n=Pe,mass:i=we}){let s,o;x(t<=k(Ce),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=y(De,ke,r),t=y(Me,Ce,R(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=je(e,r),l=Math.exp(-s);return Re-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=je(Math.pow(e,2),r);return(-s(e)+Re>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<Be;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=k(t),isNaN(a))return{stiffness:xe,damping:Te,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const Be=12;function je(t,e){return t*Math.sqrt(1-e*e)}const Fe=["duration","bounce"],Ie=["stiffness","damping","mass"];function Oe(t,e){return e.some(e=>void 0!==t[e])}function Ue(t=Ae,e=be){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:Pe,stiffness:xe,damping:Te,mass:we,isResolvedFromDuration:!1,...t};if(!Oe(t,Ie)&&Oe(t,Fe))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:we,stiffness:s,damping:o}}else{const n=Le(t);e={...e,...n,mass:we},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?Ee.granular:Ee.default),s||(s=x?Ve.granular:Ve.default),f<1){const t=je(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):ve(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(ye(w),ge),e=fe(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function Ne({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=Ue({keyframes:[d.value,p(d.value)],velocity:ve(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 $e(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||pe,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 We(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(ne(n,1,s))}}(e,t.length-1),e}function Ye({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:We(e),t),a=$e(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)}}Ue.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(ye(i),ge);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:R(s)}}(t,100,Ue);return t.ease=e.ease,t.duration=k(e.duration),t.type="keyframes",t};const Xe=t=>null!==t;function Ke(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Xe),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const ze={decay:Ne,inertia:Ne,tween:Ye,keyframes:Ye,spring:Ue};function He(t){"string"==typeof t.type&&(t.type=ze[t.type])}class Ge{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const qe=t=>t/100;class Ze extends Ge{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;He(t);const{type:e=Ye,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Ye;a!==Ye&&"number"!=typeof r[0]&&(this.mixKeyframes=M(qe,pe(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=ye(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!==Ne&&(w.value=Ke(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=me,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 _e=t=>180*t/Math.PI,Je=t=>{const e=_e(Math.atan2(t[1],t[0]));return tn(e)},Qe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Je,rotateZ:Je,skewX:t=>_e(Math.atan(t[1])),skewY:t=>_e(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},tn=t=>((t%=360)<0&&(t+=360),t),en=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),nn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),sn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:en,scaleY:nn,scale:t=>(en(t)+nn(t))/2,rotateX:t=>tn(_e(Math.atan2(t[6],t[5]))),rotateY:t=>tn(_e(Math.atan2(-t[2],t[0]))),rotateZ:Je,rotate:Je,skewX:t=>_e(Math.atan(t[4])),skewY:t=>_e(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function on(t){return t.includes("scale")?1:0}function rn(t,e){if(!t||"none"===t)return on(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=sn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Qe,s=e}if(!s)return on(e);const o=i[e],r=s[1].split(",").map(an);return"function"==typeof o?o(r):r[o]}function an(t){return parseFloat(t.trim())}const ln=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hn=(()=>new Set(ln))(),un=t=>t===At||t===Ut,cn=new Set(["x","y","z"]),dn=ln.filter(t=>!cn.has(t));const pn={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})=>rn(e,"x"),y:(t,{transform:e})=>rn(e,"y")};pn.translateX=pn.x,pn.translateY=pn.y;const mn=new Set;let fn=!1,gn=!1,yn=!1;function vn(){if(gn){const t=Array.from(mn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return dn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}gn=!1,fn=!1,mn.forEach(t=>t.complete(yn)),mn.clear()}function xn(){mn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(gn=!0)})}class Tn{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?(mn.add(this),fn||(fn=!0,dt.read(xn),dt.resolveKeyframes(vn))):(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),mn.delete(this)}cancel(){"scheduled"===this.state&&(mn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const wn=A(()=>void 0!==window.ScrollTimeline),Pn={};function Sn(t,e){const n=A(t);return()=>Pn[e]??n()}const bn=Sn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),An=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,En={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:An([0,.65,.55,1]),circOut:An([.55,0,1,.45]),backIn:An([.31,.01,.66,-.59]),backOut:An([.33,1.53,.69,.99])};function Vn(t,e){return t?"function"==typeof t?bn()?fe(t,e):"ease-out":G(t)?An(t):Array.isArray(t)?t.map(t=>Vn(t,e)||En.easeOut):En[t]:void 0}function Mn(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=Vn(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 Cn(t){return"function"==typeof t&&"applyToOptions"in t}class Dn extends Ge{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 Cn(t)&&bn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Mn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Ke(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&&wn()?(this.animation.timeline=t,E):e(this)}}const kn={anticipate:$,backInOut:N,circInOut:X};function Rn(t){"string"==typeof t.ease&&t.ease in kn&&(t.ease=kn[t.ease])}class Ln extends Dn{constructor(t){Rn(t),He(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 Ze({...o,autoplay:!1}),a=k(this.finishedTime??this.time);e.setWithVelocity(r.sample(a-10).value,r.sample(a).value,10),r.stop()}}const Bn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Qt.test(t)&&"0"!==t||t.startsWith("url(")));function jn(t){t.duration=0,t.type="keyframes"}const Fn=new Set(["opacity","clipPath","filter","transform"]),In=A(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class On extends Ge{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||Tn;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=Bn(s,e),a=Bn(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||Cn(n))&&i)}(t,s,o,r)||(!w.instantAnimations&&a||h?.(Ke(t,n,e)),t[0]=t[t.length-1],jn(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 In()&&n&&Fn.has(n)&&("transform"!==n||!h)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}(u)?new Ln({...u,element:u.motionValue.owner.current}):new Ze(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(),yn=!0,xn(),vn(),yn=!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 Un=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Nn(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=Un.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)?Nn(s,e,n+1):s}function $n(t,e){return t?.[e]??t?.default??t}const Wn=new Set(["width","height","top","left","right","bottom",...ln]),Yn=t=>e=>e.test(t),Xn=[At,Ut,Ot,It,$t,Nt,{test:t=>"auto"===t,parse:t=>t}],Kn=t=>Xn.find(Yn(t));function zn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||b(t))}const Hn=new Set(["brightness","contrast","saturate","opacity"]);function Gn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Ct)||[];if(!i)return t;const s=n.replace(i,"");let o=Hn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const qn=/\b([a-z-]*)\(.*?\)/gu,Zn={...Qt,getAnimatableNone:t=>{const e=t.match(qn);return e?e.map(Gn).join(" "):t}},_n={...At,transform:Math.round},Jn={borderWidth:Ut,borderTopWidth:Ut,borderRightWidth:Ut,borderBottomWidth:Ut,borderLeftWidth:Ut,borderRadius:Ut,radius:Ut,borderTopLeftRadius:Ut,borderTopRightRadius:Ut,borderBottomRightRadius:Ut,borderBottomLeftRadius:Ut,width:Ut,maxWidth:Ut,height:Ut,maxHeight:Ut,top:Ut,right:Ut,bottom:Ut,left:Ut,inset:Ut,insetBlock:Ut,insetBlockStart:Ut,insetBlockEnd:Ut,insetInline:Ut,insetInlineStart:Ut,insetInlineEnd:Ut,padding:Ut,paddingTop:Ut,paddingRight:Ut,paddingBottom:Ut,paddingLeft:Ut,paddingBlock:Ut,paddingBlockStart:Ut,paddingBlockEnd:Ut,paddingInline:Ut,paddingInlineStart:Ut,paddingInlineEnd:Ut,margin:Ut,marginTop:Ut,marginRight:Ut,marginBottom:Ut,marginLeft:Ut,marginBlock:Ut,marginBlockStart:Ut,marginBlockEnd:Ut,marginInline:Ut,marginInlineStart:Ut,marginInlineEnd:Ut,backgroundPositionX:Ut,backgroundPositionY:Ut,...{rotate:It,rotateX:It,rotateY:It,rotateZ:It,scale:Vt,scaleX:Vt,scaleY:Vt,scaleZ:Vt,skew:It,skewX:It,skewY:It,distance:Ut,translateX:Ut,translateY:Ut,translateZ:Ut,x:Ut,y:Ut,z:Ut,perspective:Ut,transformPerspective:Ut,opacity:Et,originX:Wt,originY:Wt,originZ:Ut},zIndex:_n,fillOpacity:Et,strokeOpacity:Et,numOctaves:_n},Qn={...Jn,color:Xt,backgroundColor:Xt,outlineColor:Xt,fill:Xt,stroke:Xt,borderColor:Xt,borderTopColor:Xt,borderRightColor:Xt,borderBottomColor:Xt,borderLeftColor:Xt,filter:Zn,WebkitFilter:Zn},ti=t=>Qn[t];function ei(t,e){let n=ti(t);return n!==Zn&&(n=Qt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ni=new Set(["auto","none","0"]);class ii extends Tn{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=Nn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Wn.has(n)||2!==t.length)return;const[i,s]=t,o=Kn(i),r=Kn(s);if(bt(i)!==bt(s)&&pn[n])this.needsMeasurement=!0;else if(o!==r)if(un(o)&&un(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else pn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||zn(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&&!ni.has(e)&&qt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=ei(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=pn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=pn[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 si=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class oi{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 ri(t,e){return new oi(t,e)}const{schedule:ai,cancel:li}=ct(queueMicrotask,!1),hi={x:!1,y:!1};function ui(){return hi.x||hi.y}function ci(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 di(t){return!("touch"===t.pointerType||ui())}const pi=(t,e)=>!!e&&(t===e||pi(t,e.parentElement)),mi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,fi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function gi(t){return fi.has(t.tagName)||!0===t.isContentEditable}const yi=new WeakSet;function vi(t){return e=>{"Enter"===e.key&&t(e)}}function xi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ti(t){return mi(t)&&!ui()}function wi(t,e,n={}){const[i,s,o]=ci(t,n),r=t=>{const i=t.currentTarget;if(!Ti(t))return;yi.add(i);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),yi.has(i)&&yi.delete(i),Ti(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||pi(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=vi(()=>{if(yi.has(n))return;xi(n,"down");const t=vi(()=>{xi(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>xi(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),gi(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Pi(t){return S(t)&&"ownerSVGElement"in t}const Si=t=>Boolean(t&&t.getVelocity),bi=[...Xn,Xt,Qt];function Ai(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ei={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Ut.test(t))return t;t=parseFloat(t)}return`${Ai(t,e.target.x)}% ${Ai(t,e.target.y)}%`}},Vi={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Qt.parse(t);if(s.length>5)return i;const o=Qt.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=ne(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=h),"number"==typeof s[3+r]&&(s[3+r]/=h),o(s)}},Mi={borderRadius:{...Ei,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ei,borderTopRightRadius:Ei,borderBottomLeftRadius:Ei,borderBottomRightRadius:Ei,boxShadow:Vi};function Ci(t,{layout:e,layoutId:n}){return hn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Mi[t]||"opacity"===t)}const Di={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ki=ln.length;function Ri(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(hn.has(t))r=!0;else if(Tt(t))s[t]=n;else{const e=si(n,Jn[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<ki;o++){const r=ln[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=si(a,Jn[r]);l||(s=!1,i+=`${Di[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 Li=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Bi(t,e,n){for(const i in e)Si(e[i])||Ci(i,n)||(t[i]=e[i])}function ji(t,e){const n={};return Bi(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Ri(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Fi(t,e){const n={},i=ji(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 Ii={offset:"stroke-dashoffset",array:"stroke-dasharray"},Oi={offset:"strokeDashoffset",array:"strokeDasharray"};const Ui=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ni(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,h,u){if(Ri(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 Ui)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?Ii:Oi;t[o.offset]=Ut.transform(-i);const r=Ut.transform(e),a=Ut.transform(n);t[o.array]=`${r} ${a}`}(c,s,o,r,!1)}const $i=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Wi=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Yi(t,e,n,i){const o=s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ni(n,e,Wi(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Bi(e,t.style,t),o.style={...e,...o.style}}return o}const Xi=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 Ki(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Xi.has(t)}let zi=t=>!Ki(t);try{"function"==typeof(Hi=require("@emotion/is-prop-valid").default)&&(zi=t=>t.startsWith("on")?!Ki(t):Hi(t))}catch{}var Hi;const Gi=["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 qi(t){return"string"==typeof t&&!t.includes("-")&&!!(Gi.indexOf(t)>-1||/[A-Z]/u.test(t))}function Zi(t,e,n,{latestValues:i},a,l=!1,h){const u=(h??qi(t)?Yi:Fi)(e,i,a,t),c=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(zi(s)||!0===n&&Ki(s)||!e&&!Ki(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(()=>Si(p)?p.get():p,[p]);return r(t,{...d,children:m})}const _i=n(null);function Ji(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Qi(t,e,n,i){if("function"==typeof e){const[s,o]=Ji(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]=Ji(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function ts(t){return Si(t)?t.get():t}function es(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=ts(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=Qi(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 ns=t=>(e,n)=>{const s=i(tt),o=i(_i),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:es(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 is(t,e,n){const{style:i}=t,s={};for(const o in i)(Si(i[o])||e.style&&Si(e.style[o])||Ci(o,t)||void 0!==n?.getValue(o)?.liveStyle)&&(s[o]=i[o]);return s}const ss=ns({scrapeMotionValuesFromProps:is,createRenderState:Li});function os(t,e,n){const i=is(t,e,n);for(const n in t)if(Si(t[n])||Si(e[n])){i[-1!==ln.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const rs=ns({scrapeMotionValuesFromProps:os,createRenderState:$i}),as="undefined"!=typeof window,ls={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"]},hs={};for(const t in ls)hs[t]={isEnabled:e=>ls[t].some(t=>!!e[t])};const us=Symbol.for("motionComponentSymbol");function cs(t,e,n){const i=a(n);l(()=>{i.current=n});const s=a(null);return h(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());const o=i.current;if("function"==typeof o)if(n){const t=o(n);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):o(n);else o&&(o.current=n)},[e])}const ds=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ps="data-"+ds("framerAppearId"),ms=n({});function fs(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const gs=as?u:c;function ys(t,e,n,s,o,r){const{visualElement:h}=i(tt),u=i(J),d=i(_i),p=i(Q).reducedMotion,m=a(null);s=s||u.renderer,!m.current&&s&&(m.current=s(t,{visualState:e,parent:h,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:p,isSVG:r}));const f=m.current,g=i(ms);!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:vs(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&fs(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);l(()=>{f&&y.current&&f.update(n,d)});const v=n[ps],x=a(Boolean(v)&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return gs(()=>{f&&(y.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),x.current&&f.animationState&&f.animationState.animateChanges())}),c(()=>{f&&(!x.current&&f.animationState&&f.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),x.current=!1),f.enteringChildren=void 0)}),f}function vs(t){if(t)return!1!==t.options.allowProjection?t.projection:vs(t.parent)}function xs(n,{forwardMotionProps:s=!1,type:o}={},r,a){r&&function(t){for(const e in t)hs[e]={...hs[e],...t[e]}}(r);const l=o?"svg"===o:qi(n),h=l?rs:ss;function u(o,r){let u;const c={...i(Q),...o,layoutId:Ts(o)},{isStatic:d}=c,p=at(o),m=h(o,d);if(!d&&as){i(J).strict;const t=function(t){const{drag:e,layout:n}=hs;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=ys(n,m,c,a,t.ProjectionNode,l)}return t(tt.Provider,{value:p,children:[u&&p.visualElement?e(u,{visualElement:p.visualElement,...c}):null,Zi(n,o,cs(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[us]=n,c}function Ts({layoutId:t}){const e=i(_).id;return e&&void 0!==t?e+"-"+t:t}function ws({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ps(t){return void 0===t||1===t}function Ss({scale:t,scaleX:e,scaleY:n}){return!Ps(t)||!Ps(e)||!Ps(n)}function bs(t){return Ss(t)||As(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function As(t){return Es(t.x)||Es(t.y)}function Es(t){return t&&"0%"!==t}function Vs(t,e,n){return n+e*(t-n)}function Ms(t,e,n,i,s){return void 0!==s&&(t=Vs(t,s,i)),Vs(t,n,i)+e}function Cs(t,e=0,n=1,i,s){t.min=Ms(t.min,e,n,i,s),t.max=Ms(t.max,e,n,i,s)}function Ds(t,{x:e,y:n}){Cs(t.x,e.translate,e.scale,e.originPoint),Cs(t.y,n.translate,n.scale,n.originPoint)}const ks=.999999999999,Rs=1.0000000000001;function Ls(t,e){t.min=t.min+e,t.max=t.max+e}function Bs(t,e,n,i,s=.5){Cs(t,e,n,ne(t.min,t.max,s),i)}function js(t,e){Bs(t.x,e.x,e.scaleX,e.scale,e.originX),Bs(t.y,e.y,e.scaleY,e.scale,e.originY)}function Fs(t,e){return ws(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 Is=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Os={current:null},Us={current:!1};const Ns=new WeakMap;const $s=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ws{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=Tn,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]&&Si(e)&&e.set(a[t])}}mount(t){this.current=t,Ns.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Us.current||function(){if(Us.current=!0,as)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Os.current=t.matches;t.addEventListener("change",e),e()}else Os.current=!1}(),this.shouldReduceMotion=Os.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=hn.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 hs){const e=hs[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<$s.length;e++){const n=$s[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(Si(s))t.addValue(i,s);else if(Si(o))t.addValue(i,ri(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,ri(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=ri(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,!bi.find(Yn(i))&&Qt.test(e)&&(n=ei(t,e))),this.setBaseTarget(t,Si(n)?n.get():n)),Si(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=Qi(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||Si(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(){ai.render(this.render)}}class Ys extends Ws{constructor(){super(...arguments),this.KeyframeResolver=ii}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;Si(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Xs(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 Ks extends Ys{constructor(){super(...arguments),this.type="html",this.renderInstance=Xs}readValueFromInstance(t,e){if(hn.has(e))return this.projection?.isProjecting?on(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return rn(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 Fs(t,e)}build(t,e,n){Ri(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return is(t,e,n)}}const zs=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 Hs extends Ys{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Is}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(hn.has(e)){const t=ti(e);return t&&t.default||0}return e=zs.has(e)?e:ds(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return os(t,e,n)}build(t,e,n){Ni(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Xs(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(zs.has(n)?n:ds(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Wi(t.tagName),super.mount(t)}}const Gs=(t,e)=>e.isSVG??qi(t)?new Hs(e):new Ks(e,{allowProjection:t!==o});function qs(t,e,n){const i=t.getProps();return Qi(i,e,void 0!==n?n:i.custom,t)}const Zs=t=>Array.isArray(t);function _s(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ri(n))}function Js(t){return Zs(t)?t[t.length-1]||0:t}function Qs(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Si(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 to(t){return t.props[ps]}const eo=t=>null!==t;const no={type:"spring",stiffness:500,damping:25,restSpeed:10},io={type:"keyframes",duration:.8},so={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oo=(t,{keyframes:e})=>e.length>2?io:hn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:no:so;const ro=(t,e,n,i={},s,o)=>r=>{const a=$n(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,oo(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)&&(jn(u),0===u.delay&&(c=!0)),(w.instantAnimations||w.skipAnimations)&&(c=!0,jn(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(eo),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 Ze(u):new On(u)};function ao({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function lo(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&&ao(h,e))continue;const r={delay:n,...$n(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=to(t);if(n){const t=window.MotionHandoffAnimation(n,e,dt);null!==t&&(r.startTime=t,c=!0)}}Qs(t,e),i.start(ro(e,i,s,t.shouldReduceMotion&&Wn.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=qs(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)_s(t,e,Js(o[e]))}(t,r)})}),l}function ho(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 uo(t,e,n={}){const i=qs(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(lo(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(uo(l,e,{...r,delay:n+("function"==typeof i?0:i)+ho(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 co(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 po=st.length;function mo(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&mo(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<po;n++){const i=st[n],s=t.props[i];(nt(s)||!1===s)&&(e[i]=s)}return e}const fo=[...it].reverse(),go=it.length;function yo(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=>uo(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=uo(t,e,n);else{const s="function"==typeof e?qs(t,e,n.custom):e;i=Promise.all(lo(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function vo(t){let e=yo(t),n=wo(),i=!0;const s=e=>(n,i)=>{const s=qs(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=mo(t.parent)||{},l=[],h=new Set;let u={},c=1/0;for(let e=0;e<go;e++){const d=fo[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=xo(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=Zs(e)&&Zs(n)?!co(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=qs(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=ho(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(h.size){const e={};if("boolean"!=typeof r.initial){const n=qs(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=wo()}}}function xo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!co(e,t)}function To(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wo(){return{animate:To(!0),whileInView:To(),whileHover:To(),whileTap:To(),whileDrag:To(),whileFocus:To(),exit:To()}}class Po{constructor(t){this.isMounted=!1,this.node=t}update(){}}let So=0;const bo={animation:{Feature:class extends Po{constructor(t){super(t),t.animationState||(t.animationState=vo(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 Po{constructor(){super(...arguments),this.id=So++}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 Ao(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Eo(t){return{point:{x:t.pageX,y:t.pageY}}}function Vo(t,e,n,i){return Ao(t,e,(t=>e=>mi(e)&&t(e,Eo(e)))(n),i)}function Mo(t){return t.max-t.min}function Co(t,e,n,i=.5){t.origin=i,t.originPoint=ne(e.min,e.max,t.origin),t.scale=Mo(n)/Mo(e),t.translate=ne(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 Do(t,e,n,i){Co(t.x,e.x,n.x,i?i.originX:void 0),Co(t.y,e.y,n.y,i?i.originY:void 0)}function ko(t,e,n){t.min=n.min+e.min,t.max=t.min+Mo(e)}function Ro(t,e,n){t.min=e.min-n.min,t.max=t.min+Mo(e)}function Lo(t,e,n){Ro(t.x,e.x,n.x),Ro(t.y,e.y,n.y)}function Bo(t){return[t("x"),t("y")]}const jo=({current:t})=>t?t.ownerDocument.defaultView:null,Fo=(t,e)=>Math.abs(t-e);class Io{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=No(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Fo(t.x,e.x),i=Fo(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=Oo(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&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=No("pointercancel"===t.type?this.lastMoveEventInfo:Oo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!mi(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const r=Oo(Eo(t),this.transformPagePoint),{point:a}=r,{timestamp:l}=mt;this.history=[{...a,timestamp:l}];const{onSessionStart:h}=e;h&&h(t,No(r,this.history)),this.removeListeners=M(Vo(this.contextWindow,"pointermove",this.handlePointerMove),Vo(this.contextWindow,"pointerup",this.handlePointerUp),Vo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pt(this.updatePoint)}}function Oo(t,e){return e?{point:e(t.point)}:t}function Uo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function No({point:t},e){return{point:t,delta:Uo(t,Wo(e)),offset:Uo(t,$o(e)),velocity:Yo(e,.1)}}function $o(t){return t[0]}function Wo(t){return t[t.length-1]}function Yo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Wo(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 Xo(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 Ko(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 zo=.35;function Ho(t,e,n){return{min:Go(t,e),max:Go(t,n)}}function Go(t,e){return"number"==typeof t?t:t[e]||0}const qo=new WeakMap;class Zo{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 Io(t,{onSessionStart:t=>{e?(this.stopAnimation(),this.snapToCursor(Eo(t).point)):this.pauseAnimation()},onStart:(t,e)=>{this.stopAnimation();const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?hi[o]?null:(hi[o]=!0,()=>{hi[o]=!1}):hi.x||hi.y?null:(hi.x=hi.y=!0,()=>{hi.x=hi.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),Bo(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Ot.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Mo(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&dt.postRender(()=>s(t,e)),Qs(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:()=>Bo(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:jo(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||!_o(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?ne(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ne(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&&fs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Xo(t.x,n,s),y:Xo(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=zo){return!1===t?t=0:!0===t&&(t=zo),{x:Ho(t,"left","right"),y:Ho(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Bo(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||!fs(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=Fs(t,n),{scroll:s}=e;return s&&(Ls(i.x,s.offset.x),Ls(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Ko(t.x,e.x),y:Ko(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=ws(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Bo(r=>{if(!_o(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 Qs(this.visualElement,t),n.start(ro(t,n,0,e,this.visualElement,!1))}stopAnimation(){Bo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bo(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){Bo(e=>{const{drag:n}=this.getProps();if(!_o(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],r=s.get()||0;s.set(t[e]-ne(n,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!fs(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Bo(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=Mo(t),s=Mo(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(),Bo(e=>{if(!_o(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(ne(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;qo.set(this.visualElement,this);const t=Vo(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&!gi(t.target)&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();fs(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=Ao(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Bo(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=zo,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function _o(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Jo=t=>(e,n)=>{t&&dt.postRender(()=>t(e,n))};const Qo=(t,e)=>t.depth-e.depth;class tr{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(Qo),this.isDirty=!1,this.children.forEach(t)}}const er=["TopLeft","TopRight","BottomLeft","BottomRight"],nr=er.length,ir=t=>"string"==typeof t?parseFloat(t):t,sr=t=>"number"==typeof t||Ut.test(t);function or(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const rr=lr(0,.5,Y),ar=lr(.5,.95,E);function lr(t,e,n){return i=>i<t?0:i>e?1:n(C(t,e,i))}function hr(t,e){t.min=e.min,t.max=e.max}function ur(t,e){hr(t.x,e.x),hr(t.y,e.y)}function cr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function dr(t,e,n,i,s){return t=Vs(t-=e,1/n,i),void 0!==s&&(t=Vs(t,1/s,i)),t}function pr(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){Ot.test(e)&&(e=parseFloat(e),e=ne(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=ne(o.min,o.max,i);t===o&&(a-=e),t.min=dr(t.min,e,n,a,s),t.max=dr(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const mr=["x","scaleX","originX"],fr=["y","scaleY","originY"];function gr(t,e,n,i){pr(t.x,e,mr,n?n.x:void 0,i?i.x:void 0),pr(t.y,e,fr,n?n.y:void 0,i?i.y:void 0)}function yr(t){return 0===t.translate&&1===t.scale}function vr(t){return yr(t.x)&&yr(t.y)}function xr(t,e){return t.min===e.min&&t.max===e.max}function Tr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function wr(t,e){return Tr(t.x,e.x)&&Tr(t.y,e.y)}function Pr(t){return Mo(t.x)/Mo(t.y)}function Sr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class br{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 Ar={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Er=["","X","Y","Z"];let Vr=0;function Mr(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Cr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=to(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&&Cr(i)}function Dr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Vr++,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(Lr),this.nodes.forEach(Nr),this.nodes.forEach($r),this.nodes.forEach(Br)},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 tr)}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=Pi(e)&&!(Pi(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),Ar.hasAnimatedSinceResize&&(Ar.hasAnimatedSinceResize=!1,this.nodes.forEach(Ur)))})}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()||Hr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!wr(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={...$n(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||Ur(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(Wr),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&&Cr(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(Fr);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Ir);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Or),this.nodes.forEach(kr),this.nodes.forEach(Rr)):this.nodes.forEach(Ir),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,ai.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(jr),this.sharedNodes.forEach(Yr)}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||Mo(this.snapshot.measuredBox.x)||Mo(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&&!vr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||bs(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)),Zr((i=n).x),Zr(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(Jr))){const{scroll:t}=this.root;t&&(Ls(e.x,t.offset.x),Ls(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(ur(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&&ur(e,t),Ls(e.x,s.offset.x),Ls(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};ur(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&&js(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),bs(i.latestValues)&&js(n,i.latestValues)}return bs(this.latestValues)&&js(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};ur(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!bs(n.latestValues))continue;Ss(n.latestValues)&&n.updateSnapshot();const i=Is();ur(i,n.measurePageBox()),gr(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return bs(this.latestValues)&&gr(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,ko(r.x,a.x,l.x),ko(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):ur(this.target,this.layout.layoutBox),Ds(this.target,this.targetDelta)):ur(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&&!Ss(this.parent.latestValues)&&!As(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}},Lo(this.relativeTargetOrigin,e,n),ur(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;ur(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&&js(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ds(t,r)),i&&bs(o.latestValues)&&js(t,o.latestValues))}e.x<Rs&&e.x>ks&&(e.x=1),e.y<Rs&&e.y>ks&&(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?(cr(this.prevProjectionDelta.x,this.projectionDelta.x),cr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Do(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Sr(this.projectionDelta.x,this.prevProjectionDelta.x)&&Sr(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(zr));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,g;Xr(o.x,t.x,n),Xr(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lo(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,g=n,Kr(p.x,m.x,f.x,g),Kr(p.y,m.y,f.y,g),c&&(l=this.relativeTarget,d=c,xr(l.x,d.x)&&xr(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),ur(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=ne(0,n.opacity??1,rr(i)),t.opacityExit=ne(e.opacity??1,0,ar(i))):o&&(t.opacity=ne(e.opacity??1,n.opacity??1,i));for(let s=0;s<nr;s++){const o=`border${er[s]}Radius`;let r=or(e,o),a=or(n,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||sr(r)===sr(a)?(t[o]=Math.max(ne(ir(r),ir(a),i),0),(Ot.test(a)||Ot.test(r))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=ne(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(()=>{Ar.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ri(0)),this.currentAnimation=function(t,e,n){const i=Si(t)?t:ri(t);return i.start(ro("",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&&_r(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Mo(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Mo(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}ur(e,n),js(e,s),Do(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new br);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&&Mr("z",t,i,this.animationValues);for(let e=0;e<Er.length;e++)Mr(`rotate${Er[e]}`,t,i,this.animationValues),Mr(`skew${Er[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=ts(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=ts(e?.pointerEvents)||""),void(this.hasProjected&&!bs(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 Mi){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Mi[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?ts(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(Fr),this.root.sharedNodes.clear()}}}function kr(t){t.updateLayout()}function Rr(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?Bo(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Mo(i);i.min=n[t].min,i.max=i.min+s}):_r(s,e.layoutBox,n)&&Bo(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Mo(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}};Do(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?Do(a,t.applyTransform(i,!0),e.measuredBox):Do(a,n,e.layoutBox);const l=!vr(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}};Lo(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Lo(a,n,o.layoutBox),wr(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 Lr(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 Br(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function jr(t){t.clearSnapshot()}function Fr(t){t.clearMeasurements()}function Ir(t){t.isLayoutDirty=!1}function Or(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ur(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Nr(t){t.resolveTargetDelta()}function $r(t){t.calcProjection()}function Wr(t){t.resetSkewAndRotation()}function Yr(t){t.removeLeadSnapshot()}function Xr(t,e,n){t.translate=ne(e.translate,0,n),t.scale=ne(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Kr(t,e,n,i){t.min=ne(e.min,n.min,i),t.max=ne(e.max,n.max,i)}function zr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Hr={duration:.45,ease:[.4,0,.1,1]},Gr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),qr=Gr("applewebkit/")&&!Gr("chrome/")?Math.round:E;function Zr(t){t.min=qr(t.min),t.max=qr(t.max)}function _r(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Pr(e),s=Pr(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function Jr(t){return t!==t.root&&t.scroll?.wasRoot}const Qr=Dr({attachResizeListener:(t,e)=>Ao(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ta={current:void 0},ea=Dr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ta.current){const t=new Qr({});t.mount(window),t.setOptions({layoutScroll:!0}),ta.current=t}return ta.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});let na=!1;class ia 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),na&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Ar.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,na=!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(),ai.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;na=!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 sa(t){const[n,s]=function(t=!0){const e=i(_i);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=e,r=p();c(()=>{if(t)return o(r)},[t]);const a=h(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,a]:[!0]}(),o=i(_);return e(ia,{...t,layoutGroup:o,switchLayoutGroup:i(ms),isPresent:n,safeToRemove:s})}const oa={pan:{Feature:class extends Po{constructor(){super(...arguments),this.removePointerDownListener=E}onPointerDown(t){this.session=new Io(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jo(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Jo(t),onStart:Jo(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&dt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=Vo(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 Po{constructor(t){super(t),this.removeGroupControls=E,this.removeListeners=E,this.controls=new Zo(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:ea,MeasureLayout:sa}};function ra(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,Eo(e)))}function aa(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,Eo(e)))}const la=new WeakMap,ha=new WeakMap,ua=t=>{const e=la.get(t.target);e&&e(t)},ca=t=>{t.forEach(ua)};function da(t,e,n){const i=function({root:t,...e}){const n=t||document;ha.has(n)||ha.set(n,{});const i=ha.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(ca,{root:t,...e})),i[s]}(e);return la.set(t,n),i.observe(t),()=>{la.delete(t),i.unobserve(t)}}const pa={some:0,all:1};const ma={...bo,...{inView:{Feature:class extends Po{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:pa[i]};return da(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 Po{mount(){const{current:t}=this.node;t&&(this.unmount=wi(t,(t,e)=>(aa(this.node,e,"Start"),(t,{success:e})=>aa(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Po{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(Ao(this.node.current,"focus",()=>this.onFocus()),Ao(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Po{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=ci(t,n),r=t=>{if(!di(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{di(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)=>(ra(this.node,e,"Start"),t=>ra(this.node,t,"End"))))}unmount(){}}}},...oa,...{layout:{ProjectionNode:ea,MeasureLayout:sa}}};function fa(t,e){return xs(t,e,ma,Gs)}const ga=fa("div");export{ga 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,useInsertionEffect as l,useCallback as h,useLayoutEffect as u,useEffect 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 y(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const g=(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=()=>{},w=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(x=(t,e,n)=>{t||"undefined"==typeof console||console.warn(v(e,n))},w=(t,e,n)=>{if(!t)throw new Error(v(e,n))});const T={},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),()=>y(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),W=t=>(t*=2)<1?.5*U(t):.5*(2-Math.pow(2,-10*(t-1))),$=t=>1-Math.sin(Math.acos(t)),Y=I($),X=F($),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:$,circInOut:X,circOut:Y,backIn:U,backInOut:N,backOut:O,anticipate:W},Z=t=>{if(G(t)){w(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?(w(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=T.useManualTiming?s.timestamp:performance.now();n=!1,T.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 yt;function gt(){yt=void 0}const vt={now:()=>(void 0===yt&&vt.set(mt.isProcessing||T.useManualTiming?mt.timestamp:performance.now()),yt),set:t=>{yt=t,queueMicrotask(gt)}},xt=t=>e=>"string"==typeof e&&e.startsWith(t),wt=xt("--"),Tt=xt("var(--"),Pt=t=>!!Tt(t)&&St.test(t.split("/*")[0].trim()),St=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function bt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const At={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Et={...At,transform:t=>g(0,1,t)},Vt={...At,default:1},Mt=t=>Math.round(1e5*t)/1e5,Ct=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Dt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kt=(t,e)=>n=>Boolean("string"==typeof n&&Dt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Rt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Ct);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Lt={...At,transform:t=>Math.round((t=>g(0,255,t))(t))},Bt={test:kt("rgb","red"),parse:Rt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Lt.transform(t)+", "+Lt.transform(e)+", "+Lt.transform(n)+", "+Mt(Et.transform(i))+")"};const jt={test:kt("#"),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:Bt.transform},Ft=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),It=Ft("deg"),Ot=Ft("%"),Ut=Ft("px"),Nt=Ft("vh"),Wt=Ft("vw"),$t=(()=>({...Ot,parse:t=>Ot.parse(t)/100,transform:t=>Ot.transform(100*t)}))(),Yt={test:kt("hsl","hue"),parse:Rt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Ot.transform(Mt(e))+", "+Ot.transform(Mt(n))+", "+Mt(Et.transform(i))+")"},Xt={test:t=>Bt.test(t)||jt.test(t)||Yt.test(t),parse:t=>Bt.test(t)?Bt.parse(t):Yt.test(t)?Yt.parse(t):jt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Bt.transform(t):Yt.transform(t),getAnimatableNone:t=>{const e=Xt.parse(t);return e.alpha=0,Xt.transform(e)}},Kt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const zt="number",Ht="color",Gt=/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 qt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Gt,t=>(Xt.test(t)?(i.color.push(o),s.push(Ht),n.push(Xt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(zt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Zt(t){return qt(t).values}function _t(t){const{split:e,types:n}=qt(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===zt?Mt(t[o]):e===Ht?Xt.transform(t[o]):t[o]}return s}}const Jt=t=>"number"==typeof t?0:Xt.test(t)?Xt.getAnimatableNone(t):t;const Qt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Ct)?.length||0)+(t.match(Kt)?.length||0)>0},parse:Zt,createTransformer:_t,getAnimatableNone:function(t){const e=Zt(t);return _t(t)(e.map(Jt))}};function te(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 ee(t,e){return n=>n>0?e:t}const ne=(t,e,n)=>t+(e-t)*n,ie=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},se=[jt,Bt,Yt];function oe(t){const e=(n=t,se.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===Yt&&(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=te(a,i,t+1/3),o=te(a,i,t),r=te(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 re=(t,e)=>{const n=oe(t),i=oe(e);if(!n||!i)return ee(t,e);const s={...n};return t=>(s.red=ie(n.red,i.red,t),s.green=ie(n.green,i.green,t),s.blue=ie(n.blue,i.blue,t),s.alpha=ne(n.alpha,i.alpha,t),Bt.transform(s))},ae=new Set(["none","hidden"]);function le(t,e){return n=>ne(t,e,n)}function he(t){return"number"==typeof t?le:"string"==typeof t?Pt(t)?ee:Xt.test(t)?re:de:Array.isArray(t)?ue:"object"==typeof t?Xt.test(t)?re:ce:ee}function ue(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>he(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function ce(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=he(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const de=(t,e)=>{const n=Qt.createTransformer(e),i=qt(t),s=qt(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?ae.has(t)&&!s.values.length||ae.has(e)&&!i.values.length?function(t,e){return ae.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):M(ue(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"),ee(t,e))};function pe(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ne(t,e,n);return he(t)(t,e)}const me=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()}},fe=(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)})`},ye=2e4;function ge(t){let e=0;let n=t.next(e);for(;!n.done&&e<ye;)e+=50,n=t.next(e);return e>=ye?1/0:e}function ve(t,e,n){const i=Math.max(e-5,0);return L(n-t(i),e-i)}const xe=100,we=10,Te=1,Pe=0,Se=800,be=.3,Ae=.3,Ee={granular:.01,default:2},Ve={granular:.005,default:.5},Me=.01,Ce=10,De=.05,ke=1,Re=.001;function Le({duration:t=Se,bounce:e=be,velocity:n=Pe,mass:i=Te}){let s,o;x(t<=k(Ce),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=g(De,ke,r),t=g(Me,Ce,R(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=je(e,r),l=Math.exp(-s);return Re-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=je(Math.pow(e,2),r);return(-s(e)+Re>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<Be;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=k(t),isNaN(a))return{stiffness:xe,damping:we,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const Be=12;function je(t,e){return t*Math.sqrt(1-e*e)}const Fe=["duration","bounce"],Ie=["stiffness","damping","mass"];function Oe(t,e){return e.some(e=>void 0!==t[e])}function Ue(t=Ae,e=be){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:Pe,stiffness:xe,damping:we,mass:Te,isResolvedFromDuration:!1,...t};if(!Oe(t,Ie)&&Oe(t,Fe))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*g(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Te,stiffness:s,damping:o}}else{const n=Le(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)),y=r-o,v=R(Math.sqrt(l/u)),x=Math.abs(y)<5;let w;if(i||(i=x?Ee.granular:Ee.default),s||(s=x?Ve.granular:Ve.default),f<1){const t=je(v,f);w=e=>{const n=Math.exp(-f*v*e);return r-n*((m+f*v*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===f)w=t=>r-Math.exp(-v*t)*(y+(m+v*y)*t);else{const t=v*Math.sqrt(f*f-1);w=e=>{const n=Math.exp(-f*v*e),i=Math.min(t*e,300);return r-n*((m+f*v*y)*Math.sinh(i)+t*y*Math.cosh(i))/t}}const T={calculatedDuration:p&&c||null,next:t=>{const e=w(t);if(p)a.done=t>=c;else{let n=0===t?m:0;f<1&&(n=0===t?k(m):ve(w,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(T),ye),e=fe(e=>T.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return T}function Ne({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,y=void 0===r?f:r(f);y!==f&&(m=y-c);const g=t=>-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=h,d.value=d.done?y:n};let w,T;const P=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,T=Ue({keyframes:[d.value,p(d.value)],velocity:ve(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};return P(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),P(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function We(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(w(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||T.mix||pe,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(g(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(ne(n,1,s))}}(e,t.length-1),e}function Ye({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=We(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)}}Ue.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(ge(i),ye);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:R(s)}}(t,100,Ue);return t.ease=e.ease,t.duration=k(e.duration),t.type="keyframes",t};const Xe=t=>null!==t;function Ke(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Xe),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const ze={decay:Ne,inertia:Ne,tween:Ye,keyframes:Ye,spring:Ue};function He(t){"string"==typeof t.type&&(t.type=ze[t.type])}class Ge{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const qe=t=>t/100;class Ze extends Ge{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;He(t);const{type:e=Ye,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Ye;a!==Ye&&"number"!=typeof r[0]&&(this.mixKeyframes=M(qe,pe(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 y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let x=this.currentTime,w=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===c?(n=1-n,d&&(n-=d/r)):"mirror"===c&&(w=o)),x=g(0,1,n)*r}const T=v?{done:!1,value:h[0]}:w.next(x);s&&(T.value=s(T.value));let{done:P}=T;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!==Ne&&(T.value=Ke(h,this.options,f,this.speed)),m&&m(T.value),S&&this.finish(),T}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=me,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 _e=t=>180*t/Math.PI,Je=t=>{const e=_e(Math.atan2(t[1],t[0]));return tn(e)},Qe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Je,rotateZ:Je,skewX:t=>_e(Math.atan(t[1])),skewY:t=>_e(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},tn=t=>((t%=360)<0&&(t+=360),t),en=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),nn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),sn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:en,scaleY:nn,scale:t=>(en(t)+nn(t))/2,rotateX:t=>tn(_e(Math.atan2(t[6],t[5]))),rotateY:t=>tn(_e(Math.atan2(-t[2],t[0]))),rotateZ:Je,rotate:Je,skewX:t=>_e(Math.atan(t[4])),skewY:t=>_e(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function on(t){return t.includes("scale")?1:0}function rn(t,e){if(!t||"none"===t)return on(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=sn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Qe,s=e}if(!s)return on(e);const o=i[e],r=s[1].split(",").map(an);return"function"==typeof o?o(r):r[o]}function an(t){return parseFloat(t.trim())}const ln=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hn=(()=>new Set(ln))(),un=t=>t===At||t===Ut,cn=new Set(["x","y","z"]),dn=ln.filter(t=>!cn.has(t));const pn={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})=>rn(e,"x"),y:(t,{transform:e})=>rn(e,"y")};pn.translateX=pn.x,pn.translateY=pn.y;const mn=new Set;let fn=!1,yn=!1,gn=!1;function vn(){if(yn){const t=Array.from(mn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return dn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}yn=!1,fn=!1,mn.forEach(t=>t.complete(gn)),mn.clear()}function xn(){mn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(yn=!0)})}class wn{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?(mn.add(this),fn||(fn=!0,dt.read(xn),dt.resolveKeyframes(vn))):(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),mn.delete(this)}cancel(){"scheduled"===this.state&&(mn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Tn=A(()=>void 0!==window.ScrollTimeline),Pn={};function Sn(t,e){const n=A(t);return()=>Pn[e]??n()}const bn=Sn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),An=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,En={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:An([0,.65,.55,1]),circOut:An([.55,0,1,.45]),backIn:An([.31,.01,.66,-.59]),backOut:An([.33,1.53,.69,.99])};function Vn(t,e){return t?"function"==typeof t?bn()?fe(t,e):"ease-out":G(t)?An(t):Array.isArray(t)?t.map(t=>Vn(t,e)||En.easeOut):En[t]:void 0}function Mn(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=Vn(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 Cn(t){return"function"==typeof t&&"applyToOptions"in t}class Dn extends Ge{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!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,w("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Cn(t)&&bn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Mn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Ke(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.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){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.manualStartTime=null,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 this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=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 kn={anticipate:W,backInOut:N,circInOut:X};function Rn(t){"string"==typeof t.ease&&t.ease in kn&&(t.ease=kn[t.ease])}class Ln extends Dn{constructor(t){Rn(t),He(t),super(t),void 0!==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 Ze({...o,autoplay:!1}),a=Math.max(10,vt.now()-this.startTime),l=g(0,10,a-10);e.setWithVelocity(r.sample(Math.max(0,a-l)).value,r.sample(a).value,l),r.stop()}}const Bn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Qt.test(t)&&"0"!==t||t.startsWith("url(")));function jn(t){t.duration=0,t.type="keyframes"}const Fn=new Set(["opacity","clipPath","filter","transform"]),In=A(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class On extends Ge{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||wn;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=Bn(s,e),a=Bn(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||Cn(n))&&i)}(t,s,o,r)||(!T.instantAnimations&&a||h?.(Ke(t,n,e)),t[0]=t[t.length-1],jn(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 In()&&n&&Fn.has(n)&&("transform"!==n||!h)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}(u)?new Ln({...u,element:u.motionValue.owner.current}):new Ze(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,xn(),vn(),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 Un=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Nn(t,e,n=1){w(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=Un.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)?Nn(s,e,n+1):s}function Wn(t,e){return t?.[e]??t?.default??t}const $n=new Set(["width","height","top","left","right","bottom",...ln]),Yn=t=>e=>e.test(t),Xn=[At,Ut,Ot,It,Wt,Nt,{test:t=>"auto"===t,parse:t=>t}],Kn=t=>Xn.find(Yn(t));function zn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||b(t))}const Hn=new Set(["brightness","contrast","saturate","opacity"]);function Gn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Ct)||[];if(!i)return t;const s=n.replace(i,"");let o=Hn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const qn=/\b([a-z-]*)\(.*?\)/gu,Zn={...Qt,getAnimatableNone:t=>{const e=t.match(qn);return e?e.map(Gn).join(" "):t}},_n={...At,transform:Math.round},Jn={borderWidth:Ut,borderTopWidth:Ut,borderRightWidth:Ut,borderBottomWidth:Ut,borderLeftWidth:Ut,borderRadius:Ut,radius:Ut,borderTopLeftRadius:Ut,borderTopRightRadius:Ut,borderBottomRightRadius:Ut,borderBottomLeftRadius:Ut,width:Ut,maxWidth:Ut,height:Ut,maxHeight:Ut,top:Ut,right:Ut,bottom:Ut,left:Ut,inset:Ut,insetBlock:Ut,insetBlockStart:Ut,insetBlockEnd:Ut,insetInline:Ut,insetInlineStart:Ut,insetInlineEnd:Ut,padding:Ut,paddingTop:Ut,paddingRight:Ut,paddingBottom:Ut,paddingLeft:Ut,paddingBlock:Ut,paddingBlockStart:Ut,paddingBlockEnd:Ut,paddingInline:Ut,paddingInlineStart:Ut,paddingInlineEnd:Ut,margin:Ut,marginTop:Ut,marginRight:Ut,marginBottom:Ut,marginLeft:Ut,marginBlock:Ut,marginBlockStart:Ut,marginBlockEnd:Ut,marginInline:Ut,marginInlineStart:Ut,marginInlineEnd:Ut,backgroundPositionX:Ut,backgroundPositionY:Ut,...{rotate:It,rotateX:It,rotateY:It,rotateZ:It,scale:Vt,scaleX:Vt,scaleY:Vt,scaleZ:Vt,skew:It,skewX:It,skewY:It,distance:Ut,translateX:Ut,translateY:Ut,translateZ:Ut,x:Ut,y:Ut,z:Ut,perspective:Ut,transformPerspective:Ut,opacity:Et,originX:$t,originY:$t,originZ:Ut},zIndex:_n,fillOpacity:Et,strokeOpacity:Et,numOctaves:_n},Qn={...Jn,color:Xt,backgroundColor:Xt,outlineColor:Xt,fill:Xt,stroke:Xt,borderColor:Xt,borderTopColor:Xt,borderRightColor:Xt,borderBottomColor:Xt,borderLeftColor:Xt,filter:Zn,WebkitFilter:Zn},ti=t=>Qn[t];function ei(t,e){let n=ti(t);return n!==Zn&&(n=Qt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ni=new Set(["auto","none","0"]);class ii extends wn{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=Nn(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=Kn(i),r=Kn(s);if(bt(i)!==bt(s)&&pn[n])this.needsMeasurement=!0;else if(o!==r)if(un(o)&&un(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else pn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||zn(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&&!ni.has(e)&&qt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=ei(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=pn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=pn[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 si=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class oi{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 ri(t,e){return new oi(t,e)}const{schedule:ai,cancel:li}=ct(queueMicrotask,!1),hi={x:!1,y:!1};function ui(){return hi.x||hi.y}function ci(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 di(t){return!("touch"===t.pointerType||ui())}const pi=(t,e)=>!!e&&(t===e||pi(t,e.parentElement)),mi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,fi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function yi(t){return fi.has(t.tagName)||!0===t.isContentEditable}const gi=new WeakSet;function vi(t){return e=>{"Enter"===e.key&&t(e)}}function xi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function wi(t){return mi(t)&&!ui()}function Ti(t,e,n={}){const[i,s,o]=ci(t,n),r=t=>{const i=t.currentTarget;if(!wi(t))return;gi.add(i);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),gi.has(i)&&gi.delete(i),wi(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||pi(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=vi(()=>{if(gi.has(n))return;xi(n,"down");const t=vi(()=>{xi(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>xi(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),yi(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Pi(t){return S(t)&&"ownerSVGElement"in t}const Si=t=>Boolean(t&&t.getVelocity),bi=[...Xn,Xt,Qt];function Ai(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ei={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Ut.test(t))return t;t=parseFloat(t)}return`${Ai(t,e.target.x)}% ${Ai(t,e.target.y)}%`}},Vi={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Qt.parse(t);if(s.length>5)return i;const o=Qt.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=ne(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=h),"number"==typeof s[3+r]&&(s[3+r]/=h),o(s)}},Mi={borderRadius:{...Ei,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ei,borderTopRightRadius:Ei,borderBottomLeftRadius:Ei,borderBottomRightRadius:Ei,boxShadow:Vi};function Ci(t,{layout:e,layoutId:n}){return hn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Mi[t]||"opacity"===t)}const Di={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ki=ln.length;function Ri(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(hn.has(t))r=!0;else if(wt(t))s[t]=n;else{const e=si(n,Jn[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<ki;o++){const r=ln[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=si(a,Jn[r]);l||(s=!1,i+=`${Di[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 Li=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Bi(t,e,n){for(const i in e)Si(e[i])||Ci(i,n)||(t[i]=e[i])}function ji(t,e){const n={};return Bi(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Ri(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Fi(t,e){const n={},i=ji(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 Ii={offset:"stroke-dashoffset",array:"stroke-dasharray"},Oi={offset:"strokeDashoffset",array:"strokeDasharray"};const Ui=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ni(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,h,u){if(Ri(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 Ui)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?Ii:Oi;t[o.offset]=Ut.transform(-i);const r=Ut.transform(e),a=Ut.transform(n);t[o.array]=`${r} ${a}`}(c,s,o,r,!1)}const Wi=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),$i=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Yi(t,e,n,i){const o=s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ni(n,e,$i(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};Bi(e,t.style,t),o.style={...e,...o.style}}return o}const Xi=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 Ki(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Xi.has(t)}let zi=t=>!Ki(t);try{"function"==typeof(Hi=require("@emotion/is-prop-valid").default)&&(zi=t=>t.startsWith("on")?!Ki(t):Hi(t))}catch{}var Hi;const Gi=["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 qi(t){return"string"==typeof t&&!t.includes("-")&&!!(Gi.indexOf(t)>-1||/[A-Z]/u.test(t))}function Zi(t,e,n,{latestValues:i},a,l=!1,h){const u=(h??qi(t)?Yi:Fi)(e,i,a,t),c=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(zi(s)||!0===n&&Ki(s)||!e&&!Ki(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(()=>Si(p)?p.get():p,[p]);return r(t,{...d,children:m})}const _i=n(null);function Ji(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Qi(t,e,n,i){if("function"==typeof e){const[s,o]=Ji(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]=Ji(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function ts(t){return Si(t)?t.get():t}function es(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=ts(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=Qi(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 ns=t=>(e,n)=>{const s=i(tt),o=i(_i),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:es(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 is(t,e,n){const{style:i}=t,s={};for(const o in i)(Si(i[o])||e.style&&Si(e.style[o])||Ci(o,t)||void 0!==n?.getValue(o)?.liveStyle)&&(s[o]=i[o]);return s}const ss=ns({scrapeMotionValuesFromProps:is,createRenderState:Li});function os(t,e,n){const i=is(t,e,n);for(const n in t)if(Si(t[n])||Si(e[n])){i[-1!==ln.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const rs=ns({scrapeMotionValuesFromProps:os,createRenderState:Wi}),as="undefined"!=typeof window,ls={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"]},hs={};for(const t in ls)hs[t]={isEnabled:e=>ls[t].some(t=>!!e[t])};const us=Symbol.for("motionComponentSymbol");function cs(t,e,n){const i=a(n);l(()=>{i.current=n});const s=a(null);return h(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());const o=i.current;if("function"==typeof o)if(n){const t=o(n);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):o(n);else o&&(o.current=n)},[e])}const ds=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ps="data-"+ds("framerAppearId"),ms=n({});function fs(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const ys=as?u:c;function gs(t,e,n,s,o,r){const{visualElement:h}=i(tt),u=i(J),d=i(_i),p=i(Q).reducedMotion,m=a(null);s=s||u.renderer,!m.current&&s&&(m.current=s(t,{visualState:e,parent:h,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:p,isSVG:r}));const f=m.current,y=i(ms);!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:vs(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&fs(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:h})}(m.current,n,o,y);const g=a(!1);l(()=>{f&&g.current&&f.update(n,d)});const v=n[ps],x=a(Boolean(v)&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return ys(()=>{f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),x.current&&f.animationState&&f.animationState.animateChanges())}),c(()=>{f&&(!x.current&&f.animationState&&f.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),x.current=!1),f.enteringChildren=void 0)}),f}function vs(t){if(t)return!1!==t.options.allowProjection?t.projection:vs(t.parent)}function xs(n,{forwardMotionProps:s=!1,type:o}={},r,a){r&&function(t){for(const e in t)hs[e]={...hs[e],...t[e]}}(r);const l=o?"svg"===o:qi(n),h=l?rs:ss;function u(o,r){let u;const c={...i(Q),...o,layoutId:ws(o)},{isStatic:d}=c,p=at(o),m=h(o,d);if(!d&&as){i(J).strict;const t=function(t){const{drag:e,layout:n}=hs;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=gs(n,m,c,a,t.ProjectionNode,l)}return t(tt.Provider,{value:p,children:[u&&p.visualElement?e(u,{visualElement:p.visualElement,...c}):null,Zi(n,o,cs(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[us]=n,c}function ws({layoutId:t}){const e=i(_).id;return e&&void 0!==t?e+"-"+t:t}function Ts({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ps(t){return void 0===t||1===t}function Ss({scale:t,scaleX:e,scaleY:n}){return!Ps(t)||!Ps(e)||!Ps(n)}function bs(t){return Ss(t)||As(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function As(t){return Es(t.x)||Es(t.y)}function Es(t){return t&&"0%"!==t}function Vs(t,e,n){return n+e*(t-n)}function Ms(t,e,n,i,s){return void 0!==s&&(t=Vs(t,s,i)),Vs(t,n,i)+e}function Cs(t,e=0,n=1,i,s){t.min=Ms(t.min,e,n,i,s),t.max=Ms(t.max,e,n,i,s)}function Ds(t,{x:e,y:n}){Cs(t.x,e.translate,e.scale,e.originPoint),Cs(t.y,n.translate,n.scale,n.originPoint)}const ks=.999999999999,Rs=1.0000000000001;function Ls(t,e){t.min=t.min+e,t.max=t.max+e}function Bs(t,e,n,i,s=.5){Cs(t,e,n,ne(t.min,t.max,s),i)}function js(t,e){Bs(t.x,e.x,e.scaleX,e.scale,e.originX),Bs(t.y,e.y,e.scaleY,e.scale,e.originY)}function Fs(t,e){return Ts(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 Is=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Os={current:null},Us={current:!1};const Ns=new WeakMap;const Ws=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class $s{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=wn,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]&&Si(e)&&e.set(a[t])}}mount(t){this.current=t,Ns.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Us.current||function(){if(Us.current=!0,as)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Os.current=t.matches;t.addEventListener("change",e),e()}else Os.current=!1}(),this.shouldReduceMotion=Os.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=hn.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 hs){const e=hs[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<Ws.length;e++){const n=Ws[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(Si(s))t.addValue(i,s);else if(Si(o))t.addValue(i,ri(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,ri(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=ri(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,!bi.find(Yn(i))&&Qt.test(e)&&(n=ei(t,e))),this.setBaseTarget(t,Si(n)?n.get():n)),Si(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=Qi(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||Si(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(){ai.render(this.render)}}class Ys extends $s{constructor(){super(...arguments),this.KeyframeResolver=ii}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;Si(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Xs(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 Ks extends Ys{constructor(){super(...arguments),this.type="html",this.renderInstance=Xs}readValueFromInstance(t,e){if(hn.has(e))return this.projection?.isProjecting?on(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return rn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(wt(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Fs(t,e)}build(t,e,n){Ri(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return is(t,e,n)}}const zs=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 Hs extends Ys{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Is}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(hn.has(e)){const t=ti(e);return t&&t.default||0}return e=zs.has(e)?e:ds(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return os(t,e,n)}build(t,e,n){Ni(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Xs(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(zs.has(n)?n:ds(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=$i(t.tagName),super.mount(t)}}const Gs=(t,e)=>e.isSVG??qi(t)?new Hs(e):new Ks(e,{allowProjection:t!==o});function qs(t,e,n){const i=t.getProps();return Qi(i,e,void 0!==n?n:i.custom,t)}const Zs=t=>Array.isArray(t);function _s(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ri(n))}function Js(t){return Zs(t)?t[t.length-1]||0:t}function Qs(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Si(i)&&i.add))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function to(t){return t.props[ps]}const eo=t=>null!==t;const no={type:"spring",stiffness:500,damping:25,restSpeed:10},io={type:"keyframes",duration:.8},so={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oo=(t,{keyframes:e})=>e.length>2?io:hn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:no:so;const ro=(t,e,n,i={},s,o)=>r=>{const a=Wn(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,oo(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)&&(jn(u),0===u.delay&&(c=!0)),(T.instantAnimations||T.skipAnimations)&&(c=!0,jn(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(eo),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 Ze(u):new On(u)};function ao({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function lo(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&&ao(h,e))continue;const r={delay:n,...Wn(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=to(t);if(n){const t=window.MotionHandoffAnimation(n,e,dt);null!==t&&(r.startTime=t,c=!0)}}Qs(t,e),i.start(ro(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=qs(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)_s(t,e,Js(o[e]))}(t,r)})}),l}function ho(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 uo(t,e,n={}){const i=qs(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(lo(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(uo(l,e,{...r,delay:n+("function"==typeof i?0:i)+ho(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 co(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 po=st.length;function mo(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&mo(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<po;n++){const i=st[n],s=t.props[i];(nt(s)||!1===s)&&(e[i]=s)}return e}const fo=[...it].reverse(),yo=it.length;function go(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=>uo(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=uo(t,e,n);else{const s="function"==typeof e?qs(t,e,n.custom):e;i=Promise.all(lo(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function vo(t){let e=go(t),n=To(),i=!0;const s=e=>(n,i)=>{const s=qs(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=mo(t.parent)||{},l=[],h=new Set;let u={},c=1/0;for(let e=0;e<yo;e++){const d=fo[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],f=nt(m),y=d===o?p.isActive:null;!1===y&&(c=e);let g=m===a[d]&&m!==r[d]&&f;if(g&&i&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...u},!p.isActive&&null===y||!m&&!p.prevProp||et(m)||"boolean"==typeof m)continue;const v=xo(p.prevProp,m);let x=v||d===o&&p.isActive&&!g&&f||e>c&&f,w=!1;const T=Array.isArray(m)?m:[m];let P=T.reduce(s(d),{});!1===y&&(P={});const{prevResolvedValues:S={}}=p,b={...S,...P},A=e=>{x=!0,h.has(e)&&(w=!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=Zs(e)&&Zs(n)?!co(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=g&&v;x&&(!E||w)&&l.push(...T.map(e=>{const n={type:d};if("string"==typeof e&&i&&!E&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=qs(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=ho(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(h.size){const e={};if("boolean"!=typeof r.initial){const n=qs(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=To()}}}function xo(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!co(e,t)}function wo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function To(){return{animate:wo(!0),whileInView:wo(),whileHover:wo(),whileTap:wo(),whileDrag:wo(),whileFocus:wo(),exit:wo()}}class Po{constructor(t){this.isMounted=!1,this.node=t}update(){}}let So=0;const bo={animation:{Feature:class extends Po{constructor(t){super(t),t.animationState||(t.animationState=vo(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 Po{constructor(){super(...arguments),this.id=So++}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 Ao(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Eo(t){return{point:{x:t.pageX,y:t.pageY}}}function Vo(t,e,n,i){return Ao(t,e,(t=>e=>mi(e)&&t(e,Eo(e)))(n),i)}function Mo(t){return t.max-t.min}function Co(t,e,n,i=.5){t.origin=i,t.originPoint=ne(e.min,e.max,t.origin),t.scale=Mo(n)/Mo(e),t.translate=ne(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 Do(t,e,n,i){Co(t.x,e.x,n.x,i?i.originX:void 0),Co(t.y,e.y,n.y,i?i.originY:void 0)}function ko(t,e,n){t.min=n.min+e.min,t.max=t.min+Mo(e)}function Ro(t,e,n){t.min=e.min-n.min,t.max=t.min+Mo(e)}function Lo(t,e,n){Ro(t.x,e.x,n.x),Ro(t.y,e.y,n.y)}function Bo(t){return[t("x"),t("y")]}const jo=({current:t})=>t?t.ownerDocument.defaultView:null,Fo=(t,e)=>Math.abs(t-e);const Io=new Set(["auto","scroll"]);class Oo{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Wo(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Fo(t.x,e.x),i=Fo(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=Uo(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&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Wo("pointercancel"===t.type?this.lastMoveEventInfo:Uo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!mi(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=Uo(Eo(t),this.transformPagePoint),{point:l}=a,{timestamp:h}=mt;this.history=[{...l,timestamp:h}];const{onSessionStart:u}=e;u&&u(t,Wo(a,this.history)),this.removeListeners=M(Vo(this.contextWindow,"pointermove",this.handlePointerMove),Vo(this.contextWindow,"pointerup",this.handlePointerUp),Vo(this.contextWindow,"pointercancel",this.handlePointerUp)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Io.has(t.overflowX)||Io.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),dt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),pt(this.updatePoint)}}function Uo(t,e){return e?{point:e(t.point)}:t}function No(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Wo({point:t},e){return{point:t,delta:No(t,Yo(e)),offset:No(t,$o(e)),velocity:Xo(e,.1)}}function $o(t){return t[0]}function Yo(t){return t[t.length-1]}function Xo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Yo(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 Ko(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 zo(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 Ho=.35;function Go(t,e,n){return{min:qo(t,e),max:qo(t,n)}}function qo(t,e){return"number"==typeof t?t:t[e]||0}const Zo=new WeakMap;class _o{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 Oo(t,{onSessionStart:t=>{e?(this.stopAnimation(),this.snapToCursor(Eo(t).point)):this.pauseAnimation()},onStart:(t,e)=>{this.stopAnimation();const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?hi[o]?null:(hi[o]=!0,()=>{hi[o]=!1}):hi.x||hi.y?null:(hi.x=hi.y=!0,()=>{hi.x=hi.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),Bo(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Ot.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Mo(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&dt.postRender(()=>s(t,e)),Qs(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:()=>Bo(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:jo(this.visualElement),element:this.visualElement.current})}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||!Jo(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?ne(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?ne(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&&fs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Ko(t.x,n,s),y:Ko(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Ho){return!1===t?t=0:!0===t&&(t=Ho),{x:Go(t,"left","right"),y:Go(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Bo(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||!fs(t))return!1;const n=t.current;w(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=Fs(t,n),{scroll:s}=e;return s&&(Ls(i.x,s.offset.x),Ls(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:zo(t.x,e.x),y:zo(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=Ts(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Bo(r=>{if(!Jo(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 Qs(this.visualElement,t),n.start(ro(t,n,0,e,this.visualElement,!1))}stopAnimation(){Bo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bo(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){Bo(e=>{const{drag:n}=this.getProps();if(!Jo(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],r=s.get()||0;s.set(t[e]-ne(n,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!fs(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Bo(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=Mo(t),s=Mo(e);return s>i?n=C(e.min,e.max-i,t.min):i>s&&(n=C(t.min,t.max-s,e.min)),g(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(),Bo(e=>{if(!Jo(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(ne(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;Zo.set(this.visualElement,this);const t=Vo(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&!yi(t.target)&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();fs(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=Ao(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Bo(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=Ho,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Jo(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Qo=t=>(e,n)=>{t&&dt.postRender(()=>t(e,n))};const tr=(t,e)=>t.depth-e.depth;class er{constructor(){this.children=[],this.isDirty=!1}add(t){f(this.children,t),this.isDirty=!0}remove(t){y(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(tr),this.isDirty=!1,this.children.forEach(t)}}const nr=["TopLeft","TopRight","BottomLeft","BottomRight"],ir=nr.length,sr=t=>"string"==typeof t?parseFloat(t):t,or=t=>"number"==typeof t||Ut.test(t);function rr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ar=hr(0,.5,Y),lr=hr(.5,.95,E);function hr(t,e,n){return i=>i<t?0:i>e?1:n(C(t,e,i))}function ur(t,e){t.min=e.min,t.max=e.max}function cr(t,e){ur(t.x,e.x),ur(t.y,e.y)}function dr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function pr(t,e,n,i,s){return t=Vs(t-=e,1/n,i),void 0!==s&&(t=Vs(t,1/s,i)),t}function mr(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){Ot.test(e)&&(e=parseFloat(e),e=ne(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=ne(o.min,o.max,i);t===o&&(a-=e),t.min=pr(t.min,e,n,a,s),t.max=pr(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const fr=["x","scaleX","originX"],yr=["y","scaleY","originY"];function gr(t,e,n,i){mr(t.x,e,fr,n?n.x:void 0,i?i.x:void 0),mr(t.y,e,yr,n?n.y:void 0,i?i.y:void 0)}function vr(t){return 0===t.translate&&1===t.scale}function xr(t){return vr(t.x)&&vr(t.y)}function wr(t,e){return t.min===e.min&&t.max===e.max}function Tr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Pr(t,e){return Tr(t.x,e.x)&&Tr(t.y,e.y)}function Sr(t){return Mo(t.x)/Mo(t.y)}function br(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Ar{constructor(){this.members=[]}add(t){f(this.members,t),t.scheduleRender()}remove(t){if(y(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 Er={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Vr=["","X","Y","Z"];let Mr=0;function Cr(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Dr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=to(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&&Dr(i)}function kr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Mr++,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(Br),this.nodes.forEach(Wr),this.nodes.forEach($r),this.nodes.forEach(jr)},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 er)}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=Pi(e)&&!(Pi(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),Er.hasAnimatedSinceResize&&(Er.hasAnimatedSinceResize=!1,this.nodes.forEach(Nr)))})}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()||Gr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Pr(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={...Wn(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||Nr(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(Yr),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&&Dr(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(Ir);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Or);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ur),this.nodes.forEach(Rr),this.nodes.forEach(Lr)):this.nodes.forEach(Or),this.clearAllSnapshots();const t=vt.now();mt.delta=g(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,ai.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Fr),this.sharedNodes.forEach(Xr)}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||Mo(this.snapshot.measuredBox.x)||Mo(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&&!xr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||bs(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)),_r((i=n).x),_r(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&&(Ls(e.x,t.offset.x),Ls(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(cr(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&&cr(e,t),Ls(e.x,s.offset.x),Ls(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};cr(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&&js(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),bs(i.latestValues)&&js(n,i.latestValues)}return bs(this.latestValues)&&js(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};cr(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!bs(n.latestValues))continue;Ss(n.latestValues)&&n.updateSnapshot();const i=Is();cr(i,n.measurePageBox()),gr(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return bs(this.latestValues)&&gr(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,ko(r.x,a.x,l.x),ko(r.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):cr(this.target,this.layout.layoutBox),Ds(this.target,this.targetDelta)):cr(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&&!Ss(this.parent.latestValues)&&!As(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}},Lo(this.relativeTargetOrigin,e,n),cr(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;cr(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&&js(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ds(t,r)),i&&bs(o.latestValues)&&js(t,o.latestValues))}e.x<Rs&&e.x>ks&&(e.x=1),e.y<Rs&&e.y>ks&&(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?(dr(this.prevProjectionDelta.x,this.projectionDelta.x),dr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Do(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&br(this.projectionDelta.x,this.prevProjectionDelta.x)&&br(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(Hr));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,y;Kr(o.x,t.x,n),Kr(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Lo(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,y=n,zr(p.x,m.x,f.x,y),zr(p.y,m.y,f.y,y),c&&(l=this.relativeTarget,d=c,wr(l.x,d.x)&&wr(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),cr(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=ne(0,n.opacity??1,ar(i)),t.opacityExit=ne(e.opacity??1,0,lr(i))):o&&(t.opacity=ne(e.opacity??1,n.opacity??1,i));for(let s=0;s<ir;s++){const o=`border${nr[s]}Radius`;let r=rr(e,o),a=rr(n,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||or(r)===or(a)?(t[o]=Math.max(ne(sr(r),sr(a),i),0),(Ot.test(a)||Ot.test(r))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=ne(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(()=>{Er.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ri(0)),this.currentAnimation=function(t,e,n){const i=Si(t)?t:ri(t);return i.start(ro("",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&&Jr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Mo(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Mo(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}cr(e,n),js(e,s),Do(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Ar);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&&Cr("z",t,i,this.animationValues);for(let e=0;e<Vr.length;e++)Cr(`rotate${Vr[e]}`,t,i,this.animationValues),Cr(`skew${Vr[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=ts(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=ts(e?.pointerEvents)||""),void(this.hasProjected&&!bs(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 Mi){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=Mi[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?ts(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(Ir),this.root.sharedNodes.clear()}}}function Rr(t){t.updateLayout()}function Lr(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?Bo(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Mo(i);i.min=n[t].min,i.max=i.min+s}):Jr(s,e.layoutBox,n)&&Bo(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Mo(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}};Do(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?Do(a,t.applyTransform(i,!0),e.measuredBox):Do(a,n,e.layoutBox);const l=!xr(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}};Lo(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Lo(a,n,o.layoutBox),Pr(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 Br(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 jr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Fr(t){t.clearSnapshot()}function Ir(t){t.clearMeasurements()}function Or(t){t.isLayoutDirty=!1}function Ur(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Nr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Wr(t){t.resolveTargetDelta()}function $r(t){t.calcProjection()}function Yr(t){t.resetSkewAndRotation()}function Xr(t){t.removeLeadSnapshot()}function Kr(t,e,n){t.translate=ne(e.translate,0,n),t.scale=ne(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function zr(t,e,n,i){t.min=ne(e.min,n.min,i),t.max=ne(e.max,n.max,i)}function Hr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Gr={duration:.45,ease:[.4,0,.1,1]},qr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Zr=qr("applewebkit/")&&!qr("chrome/")?Math.round:E;function _r(t){t.min=Zr(t.min),t.max=Zr(t.max)}function Jr(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Sr(e),s=Sr(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function Qr(t){return t!==t.root&&t.scroll?.wasRoot}const ta=kr({attachResizeListener:(t,e)=>Ao(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ea={current:void 0},na=kr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ea.current){const t=new ta({});t.mount(window),t.setOptions({layoutScroll:!0}),ea.current=t}return ea.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});let ia=!1;class sa 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),ia&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Er.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,ia=!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(),ai.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;ia=!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 oa(t){const[n,s]=function(t=!0){const e=i(_i);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=e,r=p();c(()=>{if(t)return o(r)},[t]);const a=h(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,a]:[!0]}(),o=i(_);return e(sa,{...t,layoutGroup:o,switchLayoutGroup:i(ms),isPresent:n,safeToRemove:s})}const ra={pan:{Feature:class extends Po{constructor(){super(...arguments),this.removePointerDownListener=E}onPointerDown(t){this.session=new Oo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jo(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=Vo(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 Po{constructor(t){super(t),this.removeGroupControls=E,this.removeListeners=E,this.controls=new _o(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:na,MeasureLayout:oa}};function aa(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,Eo(e)))}function la(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,Eo(e)))}const ha=new WeakMap,ua=new WeakMap,ca=t=>{const e=ha.get(t.target);e&&e(t)},da=t=>{t.forEach(ca)};function pa(t,e,n){const i=function({root:t,...e}){const n=t||document;ua.has(n)||ua.set(n,{});const i=ua.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(da,{root:t,...e})),i[s]}(e);return ha.set(t,n),i.observe(t),()=>{ha.delete(t),i.unobserve(t)}}const ma={some:0,all:1};const fa={...bo,...{inView:{Feature:class extends Po{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:ma[i]};return pa(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 Po{mount(){const{current:t}=this.node;t&&(this.unmount=Ti(t,(t,e)=>(la(this.node,e,"Start"),(t,{success:e})=>la(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Po{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(Ao(this.node.current,"focus",()=>this.onFocus()),Ao(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Po{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=ci(t,n),r=t=>{if(!di(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{di(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)=>(aa(this.node,e,"Start"),t=>aa(this.node,t,"End"))))}unmount(){}}}},...ra,...{layout:{ProjectionNode:na,MeasureLayout:oa}}};function ya(t,e){return xs(t,e,fa,Gs)}const ga=ya("div");export{ga as MotionDiv};
|
|
2
2
|
//# sourceMappingURL=size-rollup-motion.js.map
|