framer-motion 12.24.10 → 12.24.11

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/dom-mini.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let n=()=>{};function i(t){let e;return()=>(void 0===e&&(e=t()),e)}"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const s=t=>t,o=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},a=t=>1e3*t,r=t=>t/1e3;function l(t,e){return n=t,Array.isArray(n)&&"number"!=typeof n[0]?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t;var n}const u=(t,e,n)=>t+(e-t)*n,h=2e4;function c(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(function(t){let e=0,n=t.next(e);for(;!n.done&&e<h;)e+=50,n=t.next(e);return e>=h?1/0:e}(i),h);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:r(s)}}function d(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=o(0,e,i);t.push(u(n,1,s))}}function f(t){const e=[0];return d(e,t.length-1),e}const p=t=>null!==t;class m{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)}}function g(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const y=t=>t.startsWith("--");const A=i(()=>void 0!==window.ScrollTimeline),b={};function T(t,e){const n=i(t);return()=>b[e]??n()}const v=T(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),k=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,E={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:k([0,.65,.55,1]),circOut:k([.55,0,1,.45]),backIn:k([.31,.01,.66,-.59]),backOut:k([.33,1.53,.69,.99])};function w(t,e){return t?"function"==typeof t?v()?((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)})`})(t,e):"ease-out":(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?k(t):Array.isArray(t)?t.map(t=>w(t,e)||E.easeOut):E[t]:void 0}function M(t){return"function"==typeof t&&"applyToOptions"in t}class S extends m{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:i,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:r,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return M(t)&&v()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const c=w(r,s);Array.isArray(c)&&(h.easing=c);const d={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(h,d)}(e,i,s,u,o),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(p),a=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return a&&void 0!==i?i:o[a]}(s,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){y(e)?t.style.setProperty(e,n):t.style[e]=n}(e,i,t),this.animation.cancel()}l?.(),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=a(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&&A()?(this.animation.timeline=t,s):e(this)}}class B{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return x(this.animations,"duration")}get iterationDuration(){return x(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function x(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class I extends B{then(t,e){return this.finished.finally(t).then(()=>{})}}const O=new WeakMap,R=(t,e="")=>`${t}:${e}`;function F(t){const e=O.get(t)||new Map;return O.set(t,e),e}function W(t,e){return t?.[e]??t?.default??t}const P=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","backgroundPositionX","backgroundPositionY"]);function $(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&P.has(e)&&(t[n]=t[n]+"px")}function N(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}function V(t,e){const n=window.getComputedStyle(t);return y(e)?n.getPropertyValue(e):n[e]}const L=t=>Boolean(t&&t.getVelocity);function D(t,e,n,i){return"string"==typeof t&&function(t){return"object"==typeof t&&!Array.isArray(t)}(e)?N(t,0,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function C(t,e,n){return t*(e+1)}function K(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function _(t,n,i,s,o,a){!function(t,n,i){for(let s=0;s<t.length;s++){const o=t[s];o.at>n&&o.at<i&&(e(t,o),s--)}}(t,o,a);for(let e=0;e<n.length;e++)t.push({value:n[e],at:u(o,a,s[e]),easing:l(i,e)})}function j(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function q(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function z(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function H(t,e){return e[t]||(e[t]=[]),e[t]}function X(t){return Array.isArray(t)?t:[t]}function Y(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const G=t=>"number"==typeof t,J=t=>t.every(G);function Q(t,e,i,s){const o=N(t),r=o.length;n(Boolean(r),"No valid elements provided.","no-valid-elements");const l=[];for(let t=0;t<r;t++){const n=o[t],s={...i};"function"==typeof s.delay&&(s.delay=s.delay(t,r));for(const t in e){let i=e[t];Array.isArray(i)||(i=[i]);const o={...W(s,t)};o.duration&&(o.duration=a(o.duration)),o.delay&&(o.delay=a(o.delay));const r=F(n),u=R(t,o.pseudoElement||""),h=r.get(u);h&&h.stop(),l.push({map:r,key:u,unresolvedKeyframes:i,options:{...o,element:n,name:t,allowFlatten:!s.type&&!s.ease}})}}for(let t=0;t<l.length;t++){const{unresolvedKeyframes:e,options:n}=l[t],{element:i,name:s,pseudoElement:o}=n;o||null!==e[0]||(e[0]=V(i,s)),g(e),$(e,s),!o&&e.length<2&&e.unshift(V(i,s)),n.keyframes=e}const u=[];for(let t=0;t<l.length;t++){const{map:e,key:n,options:i}=l[t],s=new S(i);e.set(n,s),s.finished.finally(()=>e.delete(n)),u.push(s)}return u}const U=(()=>function(t,e,n){return new I(Q(t,e,n))})();t.animate=U,t.animateSequence=function(t,e){const i=[];return function(t,{defaultTransition:e={},...i}={},s,r){const u=e.duration||.3,h=new Map,p=new Map,m={},g=new Map;let y=0,A=0,b=0;for(let i=0;i<t.length;i++){const s=t[i];if("string"==typeof s){g.set(s,A);continue}if(!Array.isArray(s)){g.set(s.name,K(A,s.at,y,g));continue}let[o,h,T={}]=s;void 0!==T.at&&(A=K(A,T.at,y,g));let v=0;const k=(t,i,s,o=0,h=0)=>{const p=X(t),{delay:m=0,times:g=f(p),type:y="keyframes",repeat:T,repeatType:k,repeatDelay:E=0,...w}=i;let{ease:S=e.ease||"easeOut",duration:B}=i;const x="function"==typeof m?m(o,h):m,I=p.length,O=M(y)?y:r?.[y||"keyframes"];if(I<=2&&O){let t=100;if(2===I&&J(p)){const e=p[1]-p[0];t=Math.abs(e)}const e={...w};void 0!==B&&(e.duration=a(B));const n=c(e,t,O);S=n.ease,B=n.duration}B??(B=u);const R=A+x;1===g.length&&0===g[0]&&(g[1]=1);const F=g.length-p.length;if(F>0&&d(g,F),1===p.length&&p.unshift(null),T){n(T<20,"Repeat count too high, must be less than 20","repeat-count-high"),B=C(B,T);const t=[...p],e=[...g];S=Array.isArray(S)?[...S]:[S];const i=[...S];for(let n=0;n<T;n++){p.push(...t);for(let s=0;s<t.length;s++)g.push(e[s]+(n+1)),S.push(0===s?"linear":l(i,s-1))}j(g,T)}const W=R+B;_(s,p,S,g,R,W),v=Math.max(x+B,v),b=Math.max(W,b)};if(L(o))k(h,T,H("default",z(o,p)));else{const t=D(o,h,0,m),e=t.length;for(let n=0;n<e;n++){const i=z(t[n],p);for(const t in h)k(h[t],Y(T,t),H(t,i),n,e)}}y=A,A+=v}return p.forEach((t,n)=>{for(const s in t){const a=t[s];a.sort(q);const r=[],l=[],u=[];for(let t=0;t<a.length;t++){const{at:e,value:n,easing:i}=a[t];r.push(n),l.push(o(0,b,e)),u.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),r.unshift(r[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),r.push(null)),h.has(n)||h.set(n,{keyframes:{},transition:{}});const c=h.get(n);c.keyframes[s]=r,c.transition[s]={...e,duration:b,ease:u,times:l,...i}}}),h}(t,e).forEach(({keyframes:t,transition:e},n)=>{i.push(...Q(n,t,e))}),new I(i)}});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let n=()=>{};function i(t){let e;return()=>(void 0===e&&(e=t()),e)}"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(n=(t,e,n)=>{if(!t)throw new Error(function(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}(e,n))});const s=t=>t,o=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},a=t=>1e3*t,r=t=>t/1e3;function l(t,e){return n=t,Array.isArray(n)&&"number"!=typeof n[0]?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t;var n}const u=(t,e,n)=>t+(e-t)*n,h=2e4;function c(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(function(t){let e=0,n=t.next(e);for(;!n.done&&e<h;)e+=50,n=t.next(e);return e>=h?1/0:e}(i),h);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:r(s)}}function d(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=o(0,e,i);t.push(u(n,1,s))}}function f(t){const e=[0];return d(e,t.length-1),e}const m=t=>null!==t;class p{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)}}function g(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const y=t=>t.startsWith("--");const A=i(()=>void 0!==window.ScrollTimeline),T={};function b(t,e){const n=i(t);return()=>T[e]??n()}const v=b(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),k=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,S={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:k([0,.65,.55,1]),circOut:k([.55,0,1,.45]),backIn:k([.31,.01,.66,-.59]),backOut:k([.33,1.53,.69,.99])};function E(t,e){return t?"function"==typeof t?v()?((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)})`})(t,e):"ease-out":(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?k(t):Array.isArray(t)?t.map(t=>E(t,e)||S.easeOut):S[t]:void 0}function w(t){return"function"==typeof t&&"applyToOptions"in t}class M extends p{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:i,keyframes:s,pseudoElement:o,allowFlatten:a=!1,finalKeyframe:r,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=a,this.options=t,n("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return w(t)&&v()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:r="easeOut",times:l}={},u){const h={[e]:n};l&&(h.offset=l);const c=E(r,s);Array.isArray(c)&&(h.easing=c);const d={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"};return u&&(d.pseudoElement=u),t.animate(h,d)}(e,i,s,u,o),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=function(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(m),a=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return a&&void 0!==i?i:o[a]}(s,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){y(e)?t.style.setProperty(e,n):t.style[e]=n}(e,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){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=a(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&&A()?(this.animation.timeline=t,s):e(this)}}class B{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return x(this.animations,"duration")}get iterationDuration(){return x(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function x(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class I extends B{then(t,e){return this.finished.finally(t).then(()=>{})}}const O=new WeakMap,R=(t,e="")=>`${t}:${e}`;function F(t){const e=O.get(t)||new Map;return O.set(t,e),e}function W(t,e){return t?.[e]??t?.default??t}const P=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","backgroundPositionX","backgroundPositionY"]);function $(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&P.has(e)&&(t[n]=t[n]+"px")}function N(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=n?.[t]??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}function V(t,e){const n=window.getComputedStyle(t);return y(e)?n.getPropertyValue(e):n[e]}const L=t=>Boolean(t&&t.getVelocity);function D(t,e,n,i){return"string"==typeof t&&function(t){return"object"==typeof t&&!Array.isArray(t)}(e)?N(t,0,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function C(t,e,n){return t*(e+1)}function K(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function _(t,n,i,s,o,a){!function(t,n,i){for(let s=0;s<t.length;s++){const o=t[s];o.at>n&&o.at<i&&(e(t,o),s--)}}(t,o,a);for(let e=0;e<n.length;e++)t.push({value:n[e],at:u(o,a,s[e]),easing:l(i,e)})}function j(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function q(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function z(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function H(t,e){return e[t]||(e[t]=[]),e[t]}function X(t){return Array.isArray(t)?t:[t]}function Y(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const G=t=>"number"==typeof t,J=t=>t.every(G);function Q(t,e,i,s){const o=N(t),r=o.length;n(Boolean(r),"No valid elements provided.","no-valid-elements");const l=[];for(let t=0;t<r;t++){const n=o[t],s={...i};"function"==typeof s.delay&&(s.delay=s.delay(t,r));for(const t in e){let i=e[t];Array.isArray(i)||(i=[i]);const o={...W(s,t)};o.duration&&(o.duration=a(o.duration)),o.delay&&(o.delay=a(o.delay));const r=F(n),u=R(t,o.pseudoElement||""),h=r.get(u);h&&h.stop(),l.push({map:r,key:u,unresolvedKeyframes:i,options:{...o,element:n,name:t,allowFlatten:!s.type&&!s.ease}})}}for(let t=0;t<l.length;t++){const{unresolvedKeyframes:e,options:n}=l[t],{element:i,name:s,pseudoElement:o}=n;o||null!==e[0]||(e[0]=V(i,s)),g(e),$(e,s),!o&&e.length<2&&e.unshift(V(i,s)),n.keyframes=e}const u=[];for(let t=0;t<l.length;t++){const{map:e,key:n,options:i}=l[t],s=new M(i);e.set(n,s),s.finished.finally(()=>e.delete(n)),u.push(s)}return u}const U=(()=>function(t,e,n){return new I(Q(t,e,n))})();t.animate=U,t.animateSequence=function(t,e){const i=[];return function(t,{defaultTransition:e={},...i}={},s,r){const u=e.duration||.3,h=new Map,m=new Map,p={},g=new Map;let y=0,A=0,T=0;for(let i=0;i<t.length;i++){const s=t[i];if("string"==typeof s){g.set(s,A);continue}if(!Array.isArray(s)){g.set(s.name,K(A,s.at,y,g));continue}let[o,h,b={}]=s;void 0!==b.at&&(A=K(A,b.at,y,g));let v=0;const k=(t,i,s,o=0,h=0)=>{const m=X(t),{delay:p=0,times:g=f(m),type:y="keyframes",repeat:b,repeatType:k,repeatDelay:S=0,...E}=i;let{ease:M=e.ease||"easeOut",duration:B}=i;const x="function"==typeof p?p(o,h):p,I=m.length,O=w(y)?y:r?.[y||"keyframes"];if(I<=2&&O){let t=100;if(2===I&&J(m)){const e=m[1]-m[0];t=Math.abs(e)}const e={...E};void 0!==B&&(e.duration=a(B));const n=c(e,t,O);M=n.ease,B=n.duration}B??(B=u);const R=A+x;1===g.length&&0===g[0]&&(g[1]=1);const F=g.length-m.length;if(F>0&&d(g,F),1===m.length&&m.unshift(null),b){n(b<20,"Repeat count too high, must be less than 20","repeat-count-high"),B=C(B,b);const t=[...m],e=[...g];M=Array.isArray(M)?[...M]:[M];const i=[...M];for(let n=0;n<b;n++){m.push(...t);for(let s=0;s<t.length;s++)g.push(e[s]+(n+1)),M.push(0===s?"linear":l(i,s-1))}j(g,b)}const W=R+B;_(s,m,M,g,R,W),v=Math.max(x+B,v),T=Math.max(W,T)};if(L(o))k(h,b,H("default",z(o,m)));else{const t=D(o,h,0,p),e=t.length;for(let n=0;n<e;n++){const i=z(t[n],m);for(const t in h)k(h[t],Y(b,t),H(t,i),n,e)}}y=A,A+=v}return m.forEach((t,n)=>{for(const s in t){const a=t[s];a.sort(q);const r=[],l=[],u=[];for(let t=0;t<a.length;t++){const{at:e,value:n,easing:i}=a[t];r.push(n),l.push(o(0,T,e)),u.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),r.unshift(r[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),r.push(null)),h.has(n)||h.set(n,{keyframes:{},transition:{}});const c=h.get(n);c.keyframes[s]=r,c.transition[s]={...e,duration:T,ease:u,times:l,...i}}}),h}(t,e).forEach(({keyframes:t,transition:e},n)=>{i.push(...Q(n,t,e))}),new I(i)}});
package/dist/dom.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=(t,e,n)=>n>e?e:n<t?t:n;function s(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}t.warning=()=>{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(s(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(s(e,n))});const r={},o=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function a(t){return"object"==typeof t&&null!==t}const l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t,h=(t,e)=>n=>e(t(n)),d=(...t)=>t.reduce(h),p=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class f{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(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 m=t=>1e3*t,g=t=>t/1e3;function y(t,e){return e?t*(1e3/e):0}const v=new Set;const w=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},b=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function T(t,e,n,i){if(t===e&&n===i)return c;const s=e=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=b(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:b(s(t),e,i)}const x=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,S=t=>e=>1-t(1-e),M=T(.33,1.53,.69,.99),V=S(M),A=x(V),k=t=>(t*=2)<1?.5*V(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),C=S(E),P=x(E),B=T(.42,0,1,1),O=T(0,0,.58,1),R=T(.42,0,.58,1);const F=t=>Array.isArray(t)&&"number"!=typeof t[0];function I(t,e){return F(t)?t[w(0,t.length,e)]:t}const D=t=>Array.isArray(t)&&"number"==typeof t[0],L={linear:c,easeIn:B,easeInOut:R,easeOut:O,circIn:E,circInOut:P,circOut:C,backIn:V,backInOut:A,backOut:M,anticipate:k},W=e=>{if(D(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,s,r]=e;return T(n,i,s,r)}return"string"==typeof e?(t.invariant(void 0!==L[e],`Invalid easing type '${e}'`,"invalid-easing-type"),L[e]):e},N=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],j={value:null,addProjectionMetrics:null};function $(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=N.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){o.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,r=!1)=>{const a=r&&s?n:i;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),o.delete(t)},process:t=>{a=t,s?r=!0:(s=!0,[n,i]=[i,n],n.forEach(u),e&&j.value&&j.value.frameloop[e].push(l),l=0,n.clear(),s=!1,r&&(r=!1,c.process(t)))}};return c}(o,e?n:void 0),t),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:h,update:d,preRender:p,render:f,postRender:m}=a,g=()=>{const o=r.useManualTiming?s.timestamp:performance.now();n=!1,r.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,l.process(s),u.process(s),c.process(s),h.process(s),d.process(s),p.process(s),f.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(g))};return{schedule:N.reduce((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(g)),o.schedule(e,r,a)),e},{}),cancel:t=>{for(let e=0;e<N.length;e++)a[N[e]].cancel(t)},state:s,steps:a}}const{schedule:K,cancel:U,state:Y,steps:z}=$("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);let X;function H(){X=void 0}const G={now:()=>(void 0===X&&G.set(Y.isProcessing||r.useManualTiming?Y.timestamp:performance.now()),X),set:t=>{X=t,queueMicrotask(H)}},q={layout:0,mainThread:0,waapi:0},Z=t=>e=>"string"==typeof e&&e.startsWith(t),_=Z("--"),J=Z("var(--"),Q=t=>!!J(t)&&tt.test(t.split("/*")[0].trim()),tt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function et(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const nt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},it={...nt,transform:t=>i(0,1,t)},st={...nt,default:1},rt=t=>Math.round(1e5*t)/1e5,ot=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const at=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,lt=(t,e)=>n=>Boolean("string"==typeof n&&at.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),ut=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,o,a]=i.match(ot);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ct={...nt,transform:t=>Math.round((t=>i(0,255,t))(t))},ht={test:lt("rgb","red"),parse:ut("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ct.transform(t)+", "+ct.transform(e)+", "+ct.transform(n)+", "+rt(it.transform(i))+")"};const dt={test:lt("#"),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:ht.transform},pt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ft=pt("deg"),mt=pt("%"),gt=pt("px"),yt=pt("vh"),vt=pt("vw"),wt=(()=>({...mt,parse:t=>mt.parse(t)/100,transform:t=>mt.transform(100*t)}))(),bt={test:lt("hsl","hue"),parse:ut("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+mt.transform(rt(e))+", "+mt.transform(rt(n))+", "+rt(it.transform(i))+")"},Tt={test:t=>ht.test(t)||dt.test(t)||bt.test(t),parse:t=>ht.test(t)?ht.parse(t):bt.test(t)?bt.parse(t):dt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ht.transform(t):bt.transform(t),getAnimatableNone:t=>{const e=Tt.parse(t);return e.alpha=0,Tt.transform(e)}},xt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const St="number",Mt="color",Vt=/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 At(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const o=e.replace(Vt,t=>(Tt.test(t)?(i.color.push(r),s.push(Mt),n.push(Tt.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(St),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:i,types:s}}function kt(t){return At(t).values}function Et(t){const{split:e,types:n}=At(t),i=e.length;return t=>{let s="";for(let r=0;r<i;r++)if(s+=e[r],void 0!==t[r]){const e=n[r];s+=e===St?rt(t[r]):e===Mt?Tt.transform(t[r]):t[r]}return s}}const Ct=t=>"number"==typeof t?0:Tt.test(t)?Tt.getAnimatableNone(t):t;const Pt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(ot)?.length||0)+(t.match(xt)?.length||0)>0},parse:kt,createTransformer:Et,getAnimatableNone:function(t){const e=kt(t);return Et(t)(e.map(Ct))}};function Bt(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 Ot({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Bt(a,i,t+1/3),r=Bt(a,i,t),o=Bt(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}function Rt(t,e){return n=>n>0?e:t}const Ft=(t,e,n)=>t+(e-t)*n,It=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Dt=[dt,ht,bt];function Lt(e){const n=(i=e,Dt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(e);return n===bt&&(s=Ot(s)),s}const Wt=(t,e)=>{const n=Lt(t),i=Lt(e);if(!n||!i)return Rt(t,e);const s={...n};return t=>(s.red=It(n.red,i.red,t),s.green=It(n.green,i.green,t),s.blue=It(n.blue,i.blue,t),s.alpha=Ft(n.alpha,i.alpha,t),ht.transform(s))},Nt=new Set(["none","hidden"]);function jt(t,e){return Nt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function $t(t,e){return n=>Ft(t,e,n)}function Kt(t){return"number"==typeof t?$t:"string"==typeof t?Q(t)?Rt:Tt.test(t)?Wt:zt:Array.isArray(t)?Ut:"object"==typeof t?Tt.test(t)?Wt:Yt:Rt}function Ut(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Kt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Yt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Kt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const zt=(e,n)=>{const i=Pt.createTransformer(n),s=At(e),r=At(n);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Nt.has(e)&&!r.values.length||Nt.has(n)&&!s.values.length?jt(e,n):d(Ut(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(s,r),r.values),i):(t.warning(!0,`Complex values '${e}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Rt(e,n))};function Xt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ft(t,e,n);return Kt(t)(t,e)}const Ht=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>K.update(e,t),stop:()=>U(e),now:()=>Y.isProcessing?Y.timestamp:G.now()}},Gt=(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)})`},qt=2e4;function Zt(t){let e=0;let n=t.next(e);for(;!n.done&&e<qt;)e+=50,n=t.next(e);return e>=qt?1/0:e}function _t(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Zt(i),qt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:g(s)}}function Jt(t,e,n){const i=Math.max(e-5,0);return y(n-t(i),e-i)}const Qt=100,te=10,ee=1,ne=0,ie=800,se=.3,re=.3,oe={granular:.01,default:2},ae={granular:.005,default:.5},le=.01,ue=10,ce=.05,he=1,de=.001;function pe({duration:e=ie,bounce:n=se,velocity:s=ne,mass:r=ee}){let o,a;t.warning(e<=m(ue),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=i(ce,he,l),e=i(le,ue,g(e)),l<1?(o=t=>{const n=t*l,i=n*e,r=n-s,o=me(t,l),a=Math.exp(-i);return de-r/o*a},a=t=>{const n=t*l*e,i=n*s+s,r=Math.pow(l,2)*Math.pow(t,2)*e,a=Math.exp(-n),u=me(Math.pow(t,2),l);return(-o(t)+de>0?-1:1)*((i-r)*a)/u}):(o=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(s-t)));const u=function(t,e,n){let i=n;for(let n=1;n<fe;n++)i-=t(i)/e(i);return i}(o,a,5/e);if(e=m(e),isNaN(u))return{stiffness:Qt,damping:te,duration:e};{const t=Math.pow(u,2)*r;return{stiffness:t,damping:2*l*Math.sqrt(r*t),duration:e}}}const fe=12;function me(t,e){return t*Math.sqrt(1-e*e)}const ge=["duration","bounce"],ye=["stiffness","damping","mass"];function ve(t,e){return e.some(e=>void 0!==t[e])}function we(t=re,e=se){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:c,mass:h,duration:d,velocity:p,isResolvedFromDuration:f}=function(t){let e={velocity:ne,stiffness:Qt,damping:te,mass:ee,isResolvedFromDuration:!1,...t};if(!ve(t,ye)&&ve(t,ge))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),r=s*s,o=2*i(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:ee,stiffness:r,damping:o}}else{const n=pe(t);e={...e,...n,mass:ee},e.isResolvedFromDuration=!0}return e}({...n,velocity:-g(n.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(u*h)),w=a-o,b=g(Math.sqrt(u/h)),T=Math.abs(w)<5;let x;if(s||(s=T?oe.granular:oe.default),r||(r=T?ae.granular:ae.default),v<1){const t=me(b,v);x=e=>{const n=Math.exp(-v*b*e);return a-n*((y+v*b*w)/t*Math.sin(t*e)+w*Math.cos(t*e))}}else if(1===v)x=t=>a-Math.exp(-b*t)*(w+(y+b*w)*t);else{const t=b*Math.sqrt(v*v-1);x=e=>{const n=Math.exp(-v*b*e),i=Math.min(t*e,300);return a-n*((y+v*b*w)*Math.sinh(i)+t*w*Math.cosh(i))/t}}const S={calculatedDuration:f&&d||null,next:t=>{const e=x(t);if(f)l.done=t>=d;else{let n=0===t?y:0;v<1&&(n=0===t?m(y):Jt(x,t,e));const i=Math.abs(n)<=s,o=Math.abs(a-e)<=r;l.done=i&&o}return l.value=l.done?a:e,l},toString:()=>{const t=Math.min(Zt(S),qt),e=Gt(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function be({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/i),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=we({keyframes:[d.value,p(d.value)],velocity:Jt(v,t,d.value),damping:s,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}function Te(e,n,{clamp:s=!0,ease:o,mixer:a}={}){const l=e.length;if(t.invariant(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const u=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const h=function(t,e,n){const i=[],s=n||r.mix||Xt,o=t.length-1;for(let n=0;n<o;n++){let r=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||c:e;r=d(t,r)}i.push(r)}return i}(n,o,a),f=h.length,m=t=>{if(u&&t<e[0])return n[0];let i=0;if(f>1)for(;i<e.length-2&&!(t<e[i+1]);i++);const s=p(e[i],e[i+1],t);return h[i](s)};return s?t=>m(i(e[0],e[l-1],t)):m}function xe(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=p(0,e,i);t.push(Ft(n,1,s))}}function Se(t){const e=[0];return xe(e,t.length-1),e}function Me(t,e){return t.map(t=>t*e)}function Ve(t,e){return t.map(()=>e||R).splice(0,t.length-1)}function Ae({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=F(i)?i.map(W):W(i),r={done:!1,value:e[0]},o=Te(Me(n&&n.length===e.length?n:Se(e),t),e,{ease:Array.isArray(s)?s:Ve(e,s)});return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}we.applyToOptions=t=>{const e=_t(t,100,we);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};const ke=t=>null!==t;function Ee(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(ke),o=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}const Ce={decay:be,inertia:be,tween:Ae,keyframes:Ae,spring:we};function Pe(t){"string"==typeof t.type&&(t.type=Ce[t.type])}class Be{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 Oe=t=>t/100;class Re extends Be{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!==G.now()&&this.tick(G.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},q.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Pe(t);const{type:e=Ae,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Ae;a!==Ae&&"number"!=typeof o[0]&&(this.mixKeyframes=d(Oe,Xt(o[0],o[1])),o=[0,100]);const l=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Zt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+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:s,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let w=this.currentTime,b=n;if(h){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(b=o)),w=i(0,1,n)*a}const T=v?{done:!1,value:c[0]}:b.next(w);r&&(T.value=r(T.value));let{done:x}=T;v||null===l||(x=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&f!==be&&(T.value=Ee(c,this.options,g,this.speed)),m&&m(T.value),S&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return g(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+g(t)}get time(){return g(this.currentTime)}set time(t){t=m(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(G.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=g(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Ht,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(G.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,q.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Fe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ie=t=>180*t/Math.PI,De=t=>{const e=Ie(Math.atan2(t[1],t[0]));return We(e)},Le={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:De,rotateZ:De,skewX:t=>Ie(Math.atan(t[1])),skewY:t=>Ie(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},We=t=>((t%=360)<0&&(t+=360),t),Ne=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),je=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),$e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ne,scaleY:je,scale:t=>(Ne(t)+je(t))/2,rotateX:t=>We(Ie(Math.atan2(t[6],t[5]))),rotateY:t=>We(Ie(Math.atan2(-t[2],t[0]))),rotateZ:De,rotate:De,skewX:t=>Ie(Math.atan(t[4])),skewY:t=>Ie(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ke(t){return t.includes("scale")?1:0}function Ue(t,e){if(!t||"none"===t)return Ke(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=$e,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Le,s=e}if(!s)return Ke(e);const r=i[e],o=s[1].split(",").map(ze);return"function"==typeof r?r(o):o[r]}const Ye=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ue(n,e)};function ze(t){return parseFloat(t.trim())}const Xe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],He=(()=>new Set(Xe))(),Ge=t=>t===nt||t===gt,qe=new Set(["x","y","z"]),Ze=Xe.filter(t=>!qe.has(t));const _e={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})=>Ue(e,"x"),y:(t,{transform:e})=>Ue(e,"y")};_e.translateX=_e.x,_e.translateY=_e.y;const Je=new Set;let Qe=!1,tn=!1,en=!1;function nn(){if(tn){const t=Array.from(Je).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 Ze.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)})}tn=!1,Qe=!1,Je.forEach(t=>t.complete(en)),Je.clear()}function sn(){Je.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(tn=!0)})}function rn(){en=!0,sn(),nn(),en=!1}class on{constructor(t,e,n,i,s,r=!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=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Je.add(this),Qe||(Qe=!0,K.read(sn),K.resolveKeyframes(nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}Fe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Je.delete(this)}cancel(){"scheduled"===this.state&&(Je.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const an=t=>t.startsWith("--");function ln(t,e,n){an(e)?t.style.setProperty(e,n):t.style[e]=n}const un=u(()=>void 0!==window.ScrollTimeline),cn={};function hn(t,e){const n=u(t);return()=>cn[e]??n()}const dn=hn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),pn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,fn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pn([0,.65,.55,1]),circOut:pn([.55,0,1,.45]),backIn:pn([.31,.01,.66,-.59]),backOut:pn([.33,1.53,.69,.99])};function mn(t,e){return t?"function"==typeof t?dn()?Gt(t,e):"ease-out":D(t)?pn(t):Array.isArray(t)?t.map(t=>mn(t,e)||fn.easeOut):fn[t]:void 0}function gn(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=mn(a,s);Array.isArray(h)&&(c.easing=h),j.value&&q.waapi++;const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};u&&(d.pseudoElement=u);const p=t.animate(c,d);return j.value&&p.finished.finally(()=>{q.waapi--}),p}function yn(t){return"function"==typeof t&&"applyToOptions"in t}function vn({type:t,...e}){return yn(t)&&dn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class wn extends Be{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(r),this.allowFlatten=o,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=vn(e);this.animation=gn(n,i,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=Ee(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):ln(n,i,t),this.animation.cancel()}l?.(),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 g(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+g(t)}get time(){return g(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=m(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&&un()?(this.animation.timeline=t,c):e(this)}}const bn={anticipate:k,backInOut:A,circInOut:P};function Tn(t){"string"==typeof t.ease&&t.ease in bn&&(t.ease=bn[t.ease])}class xn extends wn{constructor(t){Tn(t),Pe(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new Re({...r,autoplay:!1}),a=m(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const Sn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Pt.test(t)&&"0"!==t||t.startsWith("url(")));function Mn(t){t.duration=0,t.type="keyframes"}const Vn=new Set(["opacity","clipPath","filter","transform"]),An=u(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function kn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return An()&&n&&Vn.has(n)&&("transform"!==n||!u)&&!l&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}class En extends Be{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=G.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:l,element:u,...c},d=u?.KeyframeResolver||on;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:o,type:a,velocity:l,delay:u,isHandoff:h,onUpdate:d}=i;this.resolvedAt=G.now(),function(e,n,i,s){const r=e[0];if(null===r)return!1;if("display"===n||"visibility"===n)return!0;const o=e[e.length-1],a=Sn(r,n),l=Sn(o,n);return t.warning(a===l,`You are trying to animate ${n} from "${r}" to "${o}". "${a?o:r}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(e)||("spring"===i||yn(i))&&s)}(e,o,a,l)||(!r.instantAnimations&&u||d?.(Ee(e,i,n)),e[0]=e[e.length-1],Mn(i),i.repeat=0);const p={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=!h&&kn(p)?new xn({...p,element:p.motionValue.owner.current}):new Re(p);f.finished.then(()=>this.notifyFinished()).catch(c),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),rn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Cn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Pn(this.animations,"duration")}get iterationDuration(){return Pn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Pn(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class Bn extends Cn{then(t,e){return this.finished.finally(t).then(()=>{})}}class On extends wn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Rn=new WeakMap,Fn=(t,e="")=>`${t}:${e}`;function In(t){const e=Rn.get(t)||new Map;return Rn.set(t,e),e}const Dn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ln(t){const e=Dn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Wn(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=Ln(e);if(!s)return;const a=window.getComputedStyle(n).getPropertyValue(s);if(a){const t=a.trim();return o(t)?parseFloat(t):t}return Q(r)?Wn(r,n,i+1):r}function Nn(t,e){return t?.[e]??t?.default??t}const jn=new Set(["width","height","top","left","right","bottom",...Xe]),$n=t=>e=>e.test(t),Kn=[nt,gt,mt,ft,vt,yt,{test:t=>"auto"===t,parse:t=>t}],Un=t=>Kn.find($n(t));function Yn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const zn=new Set(["brightness","contrast","saturate","opacity"]);function Xn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(ot)||[];if(!i)return t;const s=n.replace(i,"");let r=zn.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const Hn=/\b([a-z-]*)\(.*?\)/gu,Gn={...Pt,getAnimatableNone:t=>{const e=t.match(Hn);return e?e.map(Xn).join(" "):t}},qn={...nt,transform:Math.round},Zn={rotate:ft,rotateX:ft,rotateY:ft,rotateZ:ft,scale:st,scaleX:st,scaleY:st,scaleZ:st,skew:ft,skewX:ft,skewY:ft,distance:gt,translateX:gt,translateY:gt,translateZ:gt,x:gt,y:gt,z:gt,perspective:gt,transformPerspective:gt,opacity:it,originX:wt,originY:wt,originZ:gt},_n={borderWidth:gt,borderTopWidth:gt,borderRightWidth:gt,borderBottomWidth:gt,borderLeftWidth:gt,borderRadius:gt,radius:gt,borderTopLeftRadius:gt,borderTopRightRadius:gt,borderBottomRightRadius:gt,borderBottomLeftRadius:gt,width:gt,maxWidth:gt,height:gt,maxHeight:gt,top:gt,right:gt,bottom:gt,left:gt,inset:gt,insetBlock:gt,insetBlockStart:gt,insetBlockEnd:gt,insetInline:gt,insetInlineStart:gt,insetInlineEnd:gt,padding:gt,paddingTop:gt,paddingRight:gt,paddingBottom:gt,paddingLeft:gt,paddingBlock:gt,paddingBlockStart:gt,paddingBlockEnd:gt,paddingInline:gt,paddingInlineStart:gt,paddingInlineEnd:gt,margin:gt,marginTop:gt,marginRight:gt,marginBottom:gt,marginLeft:gt,marginBlock:gt,marginBlockStart:gt,marginBlockEnd:gt,marginInline:gt,marginInlineStart:gt,marginInlineEnd:gt,backgroundPositionX:gt,backgroundPositionY:gt,...Zn,zIndex:qn,fillOpacity:it,strokeOpacity:it,numOctaves:qn},Jn={..._n,color:Tt,backgroundColor:Tt,outlineColor:Tt,fill:Tt,stroke:Tt,borderColor:Tt,borderTopColor:Tt,borderRightColor:Tt,borderBottomColor:Tt,borderLeftColor:Tt,filter:Gn,WebkitFilter:Gn},Qn=t=>Jn[t];function ti(t,e){let n=Qn(t);return n!==Gn&&(n=Pt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ei=new Set(["auto","none","0"]);class ni extends on{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(),Q(i))){const s=Wn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!jn.has(n)||2!==t.length)return;const[i,s]=t,r=Un(i),o=Un(s);if(et(i)!==et(s)&&_e[n])this.needsMeasurement=!0;else if(r!==o)if(Ge(r)&&Ge(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else _e[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Yn(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!ei.has(e)&&At(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=ti(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_e[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,r=n[s];n[s]=_e[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const ii=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","backgroundPositionX","backgroundPositionY"]);function si(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&ii.has(e)&&(t[n]=t[n]+"px")}const ri=u(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),oi=new Set(["opacity","clipPath","filter","transform"]);function ai(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function li(t){return(e,n)=>{const i=ai(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const ui=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class ci{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const r=this.values.get(t);r&&r.onRemove();const o=()=>{const i=e.get();this.latest[t]=s?ui(i,_n[t]):i,n&&K.render(n)};o();const a=e.on("change",o);i&&e.addDependent(i);const l=()=>{a(),n&&U(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function hi(t){const e=new WeakMap,n=[];return(i,s)=>{const r=e.get(i)??new ci;e.set(i,r);for(const e in s){const o=s[e],a=t(i,r,e,o);n.push(a)}return()=>{for(const t of n)t()}}}const di=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),r=s?n:n.startsWith("data")||n.startsWith("aria")?n.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`):n;const o=s?()=>{t[r]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(r):t.setAttribute(r,String(i))};return e.set(n,i,o)},pi=li(hi(di)),fi=hi((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function mi(t){return a(t)&&"offsetHeight"in t}const gi={current:void 0};class yi{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=G.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=G.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 f);const n=this.events[t].add(e);return"change"===t?()=>{n(),K.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 gi.current&&gi.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=G.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return y(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 vi(t,e){return new yi(t,e)}const wi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const bi=new Set(["originX","originY","originZ"]),Ti=(t,e,n,i)=>{let s,r;return He.has(n)?(e.get("transform")||(mi(t)||e.get("transformBox")||Ti(t,e,"transformBox",new yi("fill-box")),e.set("transform",new yi("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i<Xe.length;i++){const s=Xe[i],r=t.latest[s];if(void 0===r)continue;let o=!0;o="number"==typeof r?r===(s.startsWith("scale")?1:0):0===parseFloat(r),o||(n=!1,e+=`${wi[s]||s}(${t.latest[s]}) `)}return n?"none":e.trim()}(e)})),r=e.get("transform")):bi.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new yi(""),()=>{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),r=e.get("transformOrigin")):s=an(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,r)},xi=li(hi(Ti)),Si=gt.transform;const Mi=li(hi((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return K.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>t.setAttribute("stroke-dashoffset",Si(-e.latest[n]))):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new yi("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${Si(n)} ${Si(i??1-Number(n))}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return di(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?Ti:di)(t,e,n,i)}));const{schedule:Vi,cancel:Ai}=$(queueMicrotask,!1),ki={x:!1,y:!1};function Ei(){return ki.x||ki.y}function Ci(t,e){const n=ai(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Pi(t){return!("touch"===t.pointerType||Ei())}const Bi=(t,e)=>!!e&&(t===e||Bi(t,e.parentElement)),Oi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ri=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Fi(t){return Ri.has(t.tagName)||!0===t.isContentEditable}const Ii=new WeakSet;function Di(t){return e=>{"Enter"===e.key&&t(e)}}function Li(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Wi(t){return Oi(t)&&!Ei()}function Ni(t,e){const n=window.getComputedStyle(t);return an(e)?n.getPropertyValue(e):n[e]}function ji(t){return a(t)&&"ownerSVGElement"in t}const $i=new WeakMap;let Ki;const Ui=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:ji(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Yi=Ui("inline","width","offsetWidth"),zi=Ui("block","height","offsetHeight");function Xi({target:t,borderBoxSize:e}){$i.get(t)?.forEach(n=>{n(t,{get width(){return Yi(t,e)},get height(){return zi(t,e)}})})}function Hi(t){t.forEach(Xi)}function Gi(t,e){Ki||"undefined"!=typeof ResizeObserver&&(Ki=new ResizeObserver(Hi));const n=ai(t);return n.forEach(t=>{let n=$i.get(t);n||(n=new Set,$i.set(t,n)),n.add(e),Ki?.observe(t)}),()=>{n.forEach(t=>{const n=$i.get(t);n?.delete(e),n?.size||Ki?.unobserve(t)})}}const qi=new Set;let Zi;function _i(t){return qi.add(t),Zi||(Zi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qi.forEach(e=>e(t))},window.addEventListener("resize",Zi)),()=>{qi.delete(t),qi.size||"function"!=typeof Zi||(window.removeEventListener("resize",Zi),Zi=void 0)}}function Ji(t,e){return"function"==typeof t?_i(t):Gi(t,e)}function Qi(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return K.preUpdate(i,!0),()=>U(i)}function ts(){const{value:t}=j;null!==t?(t.frameloop.rate.push(Y.delta),t.animations.mainThread.push(q.mainThread),t.animations.waapi.push(q.waapi),t.animations.layout.push(q.layout)):U(ts)}function es(t){return t.reduce((t,e)=>t+e,0)/t.length}function ns(t,e=es){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const is=t=>Math.round(1e3/t);function ss(){j.value=null,j.addProjectionMetrics=null}function rs(){const{value:t}=j;if(!t)throw new Error("Stats are not being measured");ss(),U(ts);const e={frameloop:{setup:ns(t.frameloop.setup),rate:ns(t.frameloop.rate),read:ns(t.frameloop.read),resolveKeyframes:ns(t.frameloop.resolveKeyframes),preUpdate:ns(t.frameloop.preUpdate),update:ns(t.frameloop.update),preRender:ns(t.frameloop.preRender),render:ns(t.frameloop.render),postRender:ns(t.frameloop.postRender)},animations:{mainThread:ns(t.animations.mainThread),waapi:ns(t.animations.waapi),layout:ns(t.animations.layout)},layoutProjection:{nodes:ns(t.layoutProjection.nodes),calculatedTargetDeltas:ns(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:ns(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=is(n.min),n.max=is(n.max),n.avg=is(n.avg),[n.min,n.max]=[n.max,n.min],e}function os(t){return ji(t)&&"svg"===t.tagName}function as(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function ls(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Te(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function us(t){const e=[];gi.current=e;const n=t();gi.current=void 0;const i=vi(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>K.preRender(i,!1,!0),r=t.map(t=>t.on("change",s));e.on("destroy",()=>{r.forEach(t=>t()),U(i)})}(e,i,t),i}const cs=t=>Boolean(t&&t.getVelocity);function hs(t,e,n){const i=t.get();let s,r=null,o=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{r&&(r.stop(),r=null)};if(t.attach((e,i)=>{o=e,s=t=>i(ds(t,a)),K.postRender(()=>{l(),r=new Re({keyframes:[ps(t.get()),ps(o)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s}),t.events.animationStart?.notify(),r?.then(()=>{t.events.animationComplete?.notify()})})},l),cs(e)){const n=e.on("change",e=>t.set(ds(e,a))),i=t.on("destroy",n);return()=>{n(),i()}}return l}function ds(t,e){return e?t+e:t}function ps(t){return"number"==typeof t?t:parseFloat(t)}const fs=[...Kn,Tt,Pt],ms=t=>fs.find($n(t));function gs(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let ys={},vs=null;const ws=(t,e)=>{ys[t]=e},bs=()=>{vs||(vs=document.createElement("style"),vs.id="motion-view");let t="";for(const e in ys){const n=ys[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}vs.textContent=t,document.head.appendChild(vs),ys={}},Ts=()=>{vs&&vs.parentElement&&vs.parentElement.removeChild(vs)};function xs(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ss(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function Ms(){return document.getAnimations().filter(Ss)}const Vs=["layout","enter","exit","new","old"];function As(t){const{update:e,targets:n,options:i}=t;if(!document.startViewTransition)return new Promise(async t=>{await e(),t(new Cn([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||ws(":root",{"view-transition-name":"none"}),ws("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),bs();const s=document.startViewTransition(async()=>{await e()});return s.finished.finally(()=>{Ts()}),new Promise(t=>{s.ready.then(()=>{const e=Ms(),s=[];n.forEach((t,e)=>{for(const n of Vs){if(!t[n])continue;const{keyframes:r,options:o}=t[n];for(let[t,a]of Object.entries(r)){if(!a)continue;const r={...Nn(i,t),...Nn(o,t)},l=gs(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=m(r.duration)),r.delay&&(r.delay=m(r.delay));const u=new wn({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});s.push(u)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:r}=e;if(!r)continue;const o=xs(r);if(!o)continue;const a=n.get(o.layer);if(a)ks(a,"enter")&&ks(a,"exit")&&e.getKeyframes().some(t=>t.mixBlendMode)?s.push(new On(t)):t.cancel();else{const n="group"===o.type?"layout":"";let r={...Nn(i,n)};r.duration&&(r.duration=m(r.duration)),r=vn(r);const a=mn(r.ease,r.duration);e.updateTiming({delay:m(r.delay??0),duration:r.duration,easing:a}),s.push(new On(t))}}t(new Cn(s))})})}function ks(t,e){return t?.[e]?.keyframes.opacity}let Es=[],Cs=null;function Ps(){Cs=null;const[t]=Es;var e;t&&(n(Es,e=t),Cs=e,As(e).then(t=>{e.notifyReady(t),t.finished.finally(Ps)}))}function Bs(){for(let t=Es.length-1;t>=0;t--){const e=Es[t],{interrupt:n}=e.options;if("immediate"===n){const n=Es.slice(0,t+1).map(t=>t.update),i=Es.slice(t+1);e.update=()=>{n.forEach(t=>t())},Es=[e,...i];break}}Cs&&"immediate"!==Es[0]?.options.interrupt||Ps()}class Os{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.notifyReady=c,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...e},n=this,Es.push(n),Vi.render(Bs)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Rs=K,Fs=N.reduce((t,e)=>(t[e]=t=>U(t),t),{});function Is(t){return"object"==typeof t&&!Array.isArray(t)}function Ds(t,e,n,i){return"string"==typeof t&&Is(e)?ai(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Ls(t,e,n){return t*(e+1)}function Ws(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Ns(t,e,i,s,r,o){!function(t,e,i){for(let s=0;s<t.length;s++){const r=t[s];r.at>e&&r.at<i&&(n(t,r),s--)}}(t,r,o);for(let n=0;n<e.length;n++)t.push({value:e[n],at:Ft(r,o,s[n]),easing:I(i,n)})}function js(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function $s(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Ks(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Us(t,e){return e[t]||(e[t]=[]),e[t]}function Ys(t){return Array.isArray(t)?t:[t]}function zs(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Xs=t=>"number"==typeof t,Hs=t=>t.every(Xs),Gs=new WeakMap;function qs(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Zs(t,e,n,i){if("function"==typeof e){const[s,r]=qs(i);e=e(void 0!==n?n:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,r]=qs(i);e=e(void 0!==n?n:t.custom,s,r)}return e}function _s(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,vi(n))}function Js(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function Qs(t,e){const n=function(t,e){const n=t.getProps();return Zs(n,e,n.custom,t)}(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r){_s(t,e,Js(r[e]))}}function tr(t,e){const n=t.getValue("willChange");if(i=n,Boolean(cs(i)&&i.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}const er=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),nr="data-"+er("framerAppearId");function ir(t){return t.props[nr]}const sr=t=>null!==t;const rr={type:"spring",stiffness:500,damping:25,restSpeed:10},or={type:"keyframes",duration:.8},ar={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},lr=(t,{keyframes:e})=>e.length>2?or:He.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:rr:ar;const ur=(t,e,n,i={},s,o)=>a=>{const l=Nn(i,t)||{},u=l.delay||i.delay||0;let{elapsed:c=0}=i;c-=m(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||Object.assign(h,lr(t,h)),h.duration&&(h.duration=m(h.duration)),h.repeatDelay&&(h.repeatDelay=m(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(Mn(h),0===h.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations)&&(d=!0,Mn(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(sr),r=e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}(h.keyframes,l);if(void 0!==t)return void K.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new Re(h):new En(h)};function cr({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function hr(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(r=i);const l=[],u=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||u&&cr(u,e))continue;const o={delay:n,...Nn(r||{},e)},c=i.get();if(void 0!==c&&!i.isAnimating&&!Array.isArray(s)&&s===c&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=ir(t);if(n){const t=window.MotionHandoffAnimation(n,e,K);null!==t&&(o.startTime=t,h=!0)}}tr(t,e),i.start(ur(e,i,s,t.shouldReduceMotion&&jn.has(e)?{type:!1}:o,t,h));const d=i.animation;d&&l.push(d)}return o&&Promise.all(l).then(()=>{K.update(()=>{o&&Qs(t,o)})}),l}const dr={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"]},pr={};for(const t in dr)pr[t]={isEnabled:e=>dr[t].some(t=>!!e[t])};const fr=()=>({x:{min:0,max:0},y:{min:0,max:0}}),mr="undefined"!=typeof window,gr={current:null},yr={current:!1};const vr=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function wr(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||vr.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const br=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Tr{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=on,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=G.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,K.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;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=o,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=wr(e),this.isVariantNode=function(t){return Boolean(wr(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&cs(e)&&e.set(a[t])}}mount(t){this.current=t,Gs.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:(yr.current||function(){if(yr.current=!0,mr)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gr.current=t.matches;t.addEventListener("change",e),e()}else gr.current=!1}(),this.shouldReduceMotion=gr.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),U(this.notifyUpdate),U(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=He.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&K.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 pr){const e=pr[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<br.length;e++){const n=br[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],r=n[i];if(cs(s))t.addValue(i,s);else if(cs(r))t.addValue(i,vi(s,{owner:t}));else if(r!==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,vi(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=vi(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(o(n)||l(n))?n=parseFloat(n):!ms(n)&&Pt.test(e)&&(n=ti(t,e)),this.setBaseTarget(t,cs(n)?n.get():n)),cs(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=Zs(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||cs(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 f),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Vi.render(this.render)}}class xr extends Tr{constructor(){super(...arguments),this.KeyframeResolver=ni}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;cs(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const Sr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Mr=Xe.length;function Vr(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(He.has(t))o=!0;else if(_(t))s[t]=n;else{const e=ui(n,_n[t]);t.startsWith("origin")?(a=!0,r[t]=e):i[t]=e}}if(e.transform||(o||n?i.transform=function(t,e,n){let i="",s=!0;for(let r=0;r<Mr;r++){const o=Xe[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=ui(a,_n[o]);l||(s=!1,i+=`${Sr[o]||o}(${t}) `),n&&(e[o]=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}=r;i.transformOrigin=`${t} ${e} ${n}`}}function Ar(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}function kr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Er={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!gt.test(t))return t;t=parseFloat(t)}return`${kr(t,e.target.x)}% ${kr(t,e.target.y)}%`}},Cr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Pt.parse(t);if(s.length>5)return i;const r=Pt.createTransformer(t),o="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=Ft(a,l,.5);return"number"==typeof s[2+o]&&(s[2+o]/=u),"number"==typeof s[3+o]&&(s[3+o]/=u),r(s)}},Pr={borderRadius:{...Er,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Er,borderTopRightRadius:Er,borderBottomLeftRadius:Er,borderBottomRightRadius:Er,boxShadow:Cr};function Br(t,{layout:e,layoutId:n}){return He.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Pr[t]||"opacity"===t)}function Or(t,e,n){const{style:i}=t,s={};for(const r in i)(cs(i[r])||e.style&&cs(e.style[r])||Br(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(s[r]=i[r]);return s}class Rr extends xr{constructor(){super(...arguments),this.type="html",this.renderInstance=Ar}readValueFromInstance(t,e){if(He.has(e))return this.projection?.isProjecting?Ke(e):Ye(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(_(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(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))}(t,e)}build(t,e,n){Vr(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Or(t,e,n)}}class Fr extends Tr{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Ir={offset:"stroke-dashoffset",array:"stroke-dasharray"},Dr={offset:"strokeDashoffset",array:"strokeDasharray"};const Lr=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Wr(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(Vr(t,a,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox);for(const t of Lr)void 0!==h[t]&&(d[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Ir:Dr;t[r.offset]=gt.transform(-i);const o=gt.transform(e),a=gt.transform(n);t[r.array]=`${o} ${a}`}(h,s,r,o,!1)}const Nr=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 jr extends xr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fr}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(He.has(e)){const t=Qn(e);return t&&t.default||0}return e=Nr.has(e)?e:er(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const i=Or(t,e,n);for(const n in t)(cs(t[n])||cs(e[n]))&&(i[-1!==Xe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return i}(t,e,n)}build(t,e,n){Wr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Ar(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Nr.has(n)?n:er(n),e.attrs[n])}(t,e,0,i)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function $r(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ji(t)&&!os(t)?new jr(e):new Rr(e);n.mount(t),Gs.set(t,n)}function Kr(t){const e=new Fr({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Gs.set(t,e)}function Ur(e,n,i,s){const r=[];if(function(t,e){return cs(t)||"number"==typeof t||"string"==typeof t&&!Is(e)}(e,n))r.push(function(t,e,n){const i=cs(t)?t:vi(t);return i.start(ur("",i,e,n)),i.animation}(e,Is(n)&&n.default||n,i&&i.default||i));else{const o=Ds(e,n,s),a=o.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let e=0;e<a;e++){const s=o[e];t.invariant(null!==s,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");const l=s instanceof Element?$r:Kr;Gs.has(s)||l(s);const u=Gs.get(s),c={...i};"delay"in c&&"function"==typeof c.delay&&(c.delay=c.delay(e,a)),r.push(...hr(u,{...n,transition:c},{}))}}return r}function Yr(e,n,i){const s=[],r=function(e,{defaultTransition:n={},...i}={},s,r){const o=n.duration||.3,a=new Map,l=new Map,u={},c=new Map;let h=0,d=0,f=0;for(let i=0;i<e.length;i++){const a=e[i];if("string"==typeof a){c.set(a,d);continue}if(!Array.isArray(a)){c.set(a.name,Ws(d,a.at,h,c));continue}let[p,g,y={}]=a;void 0!==y.at&&(d=Ws(d,y.at,h,c));let v=0;const w=(e,i,s,a=0,l=0)=>{const u=Ys(e),{delay:c=0,times:h=Se(u),type:p="keyframes",repeat:g,repeatType:y,repeatDelay:w=0,...b}=i;let{ease:T=n.ease||"easeOut",duration:x}=i;const S="function"==typeof c?c(a,l):c,M=u.length,V=yn(p)?p:r?.[p||"keyframes"];if(M<=2&&V){let t=100;if(2===M&&Hs(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...b};void 0!==x&&(e.duration=m(x));const n=_t(e,t,V);T=n.ease,x=n.duration}x??(x=o);const A=d+S;1===h.length&&0===h[0]&&(h[1]=1);const k=h.length-u.length;if(k>0&&xe(h,k),1===u.length&&u.unshift(null),g){t.invariant(g<20,"Repeat count too high, must be less than 20","repeat-count-high"),x=Ls(x,g);const e=[...u],n=[...h];T=Array.isArray(T)?[...T]:[T];const i=[...T];for(let t=0;t<g;t++){u.push(...e);for(let s=0;s<e.length;s++)h.push(n[s]+(t+1)),T.push(0===s?"linear":I(i,s-1))}js(h,g)}const E=A+x;Ns(s,u,T,h,A,E),v=Math.max(S+x,v),f=Math.max(E,f)};if(cs(p))w(g,y,Us("default",Ks(p,l)));else{const t=Ds(p,g,s,u),e=t.length;for(let n=0;n<e;n++){const i=Ks(t[n],l);for(const t in g)w(g[t],zs(y,t),Us(t,i),n,e)}}h=d,d+=v}return l.forEach((t,e)=>{for(const s in t){const r=t[s];r.sort($s);const o=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:i}=r[t];o.push(n),l.push(p(0,f,e)),u.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),o.unshift(o[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),o.push(null)),a.has(e)||a.set(e,{keyframes:{},transition:{}});const c=a.get(e);c.keyframes[s]=o,c.transition[s]={...n,duration:f,ease:u,times:l,...i}}}),a}(e,n,i,{spring:we});return r.forEach(({keyframes:t,transition:e},n)=>{s.push(...Ur(n,t,e))}),s}function zr(t){return function(e,i,s){let r,o=[];if(a=e,Array.isArray(a)&&a.some(Array.isArray))o=Yr(e,i,t);else{const{onComplete:n,...a}=s||{};"function"==typeof n&&(r=n),o=Ur(e,i,a,t)}var a;const l=new Bn(o);return r&&l.finished.then(r),t&&(t.animations.push(l),l.finished.then(()=>{n(t.animations,l)})),l}}const Xr=zr();const Hr=e=>function(n,i,s){return new Bn(function(e,n,i,s){const r=ai(e,s),o=r.length;t.invariant(Boolean(o),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;t<o;t++){const e=r[t],s={...i};"function"==typeof s.delay&&(s.delay=s.delay(t,o));for(const t in n){let i=n[t];Array.isArray(i)||(i=[i]);const r={...Nn(s,t)};r.duration&&(r.duration=m(r.duration)),r.delay&&(r.delay=m(r.delay));const o=In(e),l=Fn(t,r.pseudoElement||""),u=o.get(l);u&&u.stop(),a.push({map:o,key:l,unresolvedKeyframes:i,options:{...r,element:e,name:t,allowFlatten:!s.type&&!s.ease}})}}for(let t=0;t<a.length;t++){const{unresolvedKeyframes:e,options:n}=a[t],{element:i,name:s,pseudoElement:r}=n;r||null!==e[0]||(e[0]=Ni(i,s)),Fe(e),si(e,s),!r&&e.length<2&&e.unshift(Ni(i,s)),n.keyframes=e}const l=[];for(let t=0;t<a.length;t++){const{map:e,key:n,options:i}=a[t],s=new wn(i);e.set(n,s),s.finished.finally(()=>e.delete(n)),l.push(s)}return l}(n,i,s,e))},Gr=Hr(),qr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Zr(t,e,n,i){const s=n[e],{length:r,position:o}=qr[e],a=s.current,l=n.time;s.current=t[`scroll${o}`],s.scrollLength=t[`scroll${r}`]-t[`client${r}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=p(0,s.scrollLength,s.current);const u=i-l;s.velocity=u>50?0:y(s.current-a,u)}const _r={start:0,center:.5,end:1};function Jr(t,e,n=0){let i=0;if(t in _r&&(t=_r[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const Qr=[0,0];function to(t,e,n,i){let s=Array.isArray(t)?t:Qr,r=0,o=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,_r[t]?t:"0"]),r=Jr(s[0],n,i),o=Jr(s[1],e),r-o}const eo={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},no={x:0,y:0};function io(t,e,n){const{offset:s=eo.All}=n,{target:r=t,axis:o="y"}=n,a="y"===o?"height":"width",l=r!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(mi(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,r=i.parentNode;for(;!s;)"svg"===r.tagName&&(s=r),r=i.parentNode;i=s}}return n}(r,t):no,u=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),c={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let h=!e[o].interpolate;const d=s.length;for(let t=0;t<d;t++){const n=to(s[t],c[a],u[a],l[o]);h||n===e[o].interpolatorOffsets[t]||(h=!0),e[o].offset[t]=n}h&&(e[o].interpolate=Te(e[o].offset,Se(s),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=i(0,1,e[o].interpolate(e[o].current))}function so(t,e,n,i={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){Zr(t,"x",e,n),Zr(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&io(t,n,i)},notify:()=>e(n)}}const ro=new WeakMap,oo=new WeakMap,ao=new WeakMap,lo=t=>t===document.scrollingElement?window:t;function uo(t,{container:e=document.scrollingElement,...n}={}){if(!e)return c;let i=ao.get(e);i||(i=new Set,ao.set(e,i));const s=so(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(i.add(s),!ro.has(e)){const t=()=>{for(const t of i)t.measure(Y.timestamp);K.preUpdate(n)},n=()=>{for(const t of i)t.notify()},s=()=>K.read(t);ro.set(e,s);const r=lo(e);window.addEventListener("resize",s,{passive:!0}),e!==document.documentElement&&oo.set(e,Ji(e,s)),r.addEventListener("scroll",s,{passive:!0}),s()}const r=ro.get(e);return K.read(r,!1,!0),()=>{U(r);const t=ao.get(e);if(!t)return;if(t.delete(s),t.size)return;const n=ro.get(e);ro.delete(e),n&&(lo(e).removeEventListener("scroll",n),oo.get(e)?.(),window.removeEventListener("resize",n))}}const co=new Map;function ho({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);const s=co.get(e)??new Map;co.set(e,s);const r=n.target??"self",o=s.get(r)??{},a=i+(n.offset??[]).join(",");return o[a]||(o[a]=!n.target&&un()?new ScrollTimeline({source:e,axis:i}):function(t){const e={value:0},n=uo(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}({container:e,...n})),o[a]}const po={some:0,all:1};const fo=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=En,t.DOMKeyframesResolver=ni,t.GroupAnimation=Cn,t.GroupAnimationWithThen=Bn,t.JSAnimation=Re,t.KeyframeResolver=on,t.MotionGlobalConfig=r,t.MotionValue=yi,t.NativeAnimation=wn,t.NativeAnimationExtended=xn,t.NativeAnimationWrapper=On,t.SubscriptionManager=f,t.ViewTransitionBuilder=Os,t.acceleratedValues=oi,t.activeAnimations=q,t.addAttrValue=di,t.addStyleValue=Ti,t.addUniqueItem=e,t.alpha=it,t.analyseComplexValue=At,t.animate=Xr,t.animateMini=Gr,t.animateValue=function(t){return new Re(t)},t.animateView=function(t,e={}){return new Os(t,e)},t.animationMapKey=Fn,t.anticipate=k,t.applyGeneratorOptions=vn,t.applyPxDefaults=si,t.attachSpring=hs,t.attrEffect=pi,t.backIn=V,t.backInOut=A,t.backOut=M,t.calcGeneratorDuration=Zt,t.cancelFrame=U,t.cancelMicrotask=Ai,t.cancelSync=Fs,t.circIn=E,t.circInOut=P,t.circOut=C,t.clamp=i,t.collectMotionValues=gi,t.color=Tt,t.complex=Pt,t.containsCSSVariable=et,t.convertOffsetToTimes=Me,t.createGeneratorEasing=_t,t.createRenderBatcher=$,t.createScopedAnimate=zr,t.cubicBezier=T,t.cubicBezierAsString=pn,t.defaultEasing=Ve,t.defaultOffset=Se,t.defaultTransformValue=Ke,t.defaultValueTypes=Jn,t.degrees=ft,t.delay=function(t,e){return function(t,e){const n=G.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(U(i),t(r-e))};return K.setup(i,!0),()=>U(i)}(t,m(e))},t.dimensionValueTypes=Kn,t.distance=fo,t.distance2D=function(t,e){const n=fo(t.x,e.x),i=fo(t.y,e.y);return Math.sqrt(n**2+i**2)},t.easeIn=B,t.easeInOut=R,t.easeOut=O,t.easingDefinitionToFunction=W,t.fillOffset=xe,t.fillWildcards=Fe,t.findDimensionValueType=Un,t.findValueType=ms,t.flushKeyframeResolvers=rn,t.frame=K,t.frameData=Y,t.frameSteps=z,t.generateLinearEasing=Gt,t.getAnimatableNone=ti,t.getAnimationMap=In,t.getComputedStyle=Ni,t.getDefaultValueType=Qn,t.getEasingForSegment=I,t.getMixer=Kt,t.getOriginIndex=as,t.getValueAsType=ui,t.getValueTransition=Nn,t.getVariableValue=Wn,t.getViewAnimationLayerInfo=xs,t.getViewAnimations=Ms,t.hasWarned=function(t){return v.has(t)},t.hex=dt,t.hover=function(t,e,n={}){const[i,s,r]=Ci(t,n),o=t=>{if(!Pi(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const r=t=>{Pi(t)&&(i(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,s)};return i.forEach(t=>{t.addEventListener("pointerenter",o,s)}),r},t.hsla=bt,t.hslaToRgba=Ot,t.inView=function(t,e,{root:n,margin:i,amount:s="some"}={}){const r=ai(t),o=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:po[s]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=be,t.interpolate=Te,t.invisibleValues=Nt,t.isBezierDefinition=D,t.isCSSVariableName=_,t.isCSSVariableToken=Q,t.isDragActive=Ei,t.isDragging=ki,t.isEasingArray=F,t.isElementKeyboardAccessible=Fi,t.isGenerator=yn,t.isHTMLElement=mi,t.isMotionValue=cs,t.isNodeOrChild=Bi,t.isNumericalString=o,t.isObject=a,t.isPrimaryPointer=Oi,t.isSVGElement=ji,t.isSVGSVGElement=os,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&dn()||!e||"string"==typeof e&&(e in fn||dn())||D(e)||Array.isArray(e)&&e.every(t))},t.isZeroValueString=l,t.keyframes=Ae,t.makeAnimationInstant=Mn,t.mapEasingToNativeEasing=mn,t.mapValue=function(t,e,n,i){const s=ls(e,n,i);return us(()=>s(t.get()))},t.maxGeneratorDuration=qt,t.memo=u,t.microtask=Vi,t.millisecondsToSeconds=g,t.mirrorEasing=x,t.mix=Xt,t.mixArray=Ut,t.mixColor=Wt,t.mixComplex=zt,t.mixImmediate=Rt,t.mixLinearColor=It,t.mixNumber=Ft,t.mixObject=Yt,t.mixVisibility=jt,t.motionValue=vi,t.moveItem=function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[s]=t.splice(e,1);t.splice(i,0,s)}return t},t.noop=c,t.number=nt,t.numberValueTypes=_n,t.observeTimeline=Qi,t.parseCSSVariable=Ln,t.parseValueFromTransform=Ue,t.percent=mt,t.pipe=d,t.positionalKeys=jn,t.press=function(t,e,n={}){const[i,s,r]=Ci(t,n),o=t=>{const i=t.currentTarget;if(!Wi(t))return;Ii.add(i);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Ii.has(i)&&Ii.delete(i),Wi(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||Bi(i,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),mi(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Di(()=>{if(Ii.has(n))return;Li(n,"down");const t=Di(()=>{Li(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Li(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),Fi(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r},t.progress=p,t.progressPercentage=wt,t.propEffect=fi,t.px=gt,t.readTransformValue=Ye,t.recordStats=function(){if(j.value)throw ss(),new Error("Stats are already being measured");const t=j;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},K.postRender(ts,!0),rs},t.removeItem=n,t.resize=Ji,t.resolveElements=ai,t.reverseEasing=S,t.rgbUnit=ct,t.rgba=ht,t.scale=st,t.scroll=function(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return c;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?uo(n=>{t(n[e.axis].progress,n)},e):Qi(t,ho(e))}(t,s):function(t,e){const n=ho(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),Qi(e=>{t.time=t.iterationDuration*e},n))})}(t,s)},t.scrollInfo=uo,t.secondsToMilliseconds=m,t.setDragLock=function(t){return"x"===t||"y"===t?ki[t]?null:(ki[t]=!0,()=>{ki[t]=!1}):ki.x||ki.y?null:(ki.x=ki.y=!0,()=>{ki.x=ki.y=!1})},t.setStyle=ln,t.spring=we,t.springValue=function(t,e){const n=vi(cs(t)?t.get():t);return hs(n,t,e),n},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,r)=>{const o="number"==typeof n?n:as(n,r),a=Math.abs(o-s);let l=t*a;if(i){const e=r*t;l=W(i)(l/e)*e}return e+l}},t.startWaapiAnimation=gn,t.statsBuffer=j,t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(s):Math.ceil(s);return i(0,1,r/t)}},t.styleEffect=xi,t.supportedWaapiEasing=fn,t.supportsBrowserAnimation=kn,t.supportsFlags=cn,t.supportsLinearEasing=dn,t.supportsPartialKeyframes=ri,t.supportsScrollTimeline=un,t.svgEffect=Mi,t.sync=Rs,t.testValueType=$n,t.time=G,t.transform=ls,t.transformPropOrder=Xe,t.transformProps=He,t.transformValue=us,t.transformValueTypes=Zn,t.velocityPerSecond=y,t.vh=yt,t.vw=vt,t.warnOnce=function(t,e,n){t||v.has(e)||(console.warn(s(e,n)),v.add(e))},t.wrap=w});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,function(t){"use strict";function e(t,e){-1===t.indexOf(e)&&t.push(e)}function n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const i=(t,e,n)=>n>e?e:n<t?t:n;function s(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}t.warning=()=>{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(s(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(s(e,n))});const r={},o=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function a(t){return"object"==typeof t&&null!==t}const l=t=>/^0[^.\s]+$/u.test(t);function u(t){let e;return()=>(void 0===e&&(e=t()),e)}const c=t=>t,h=(t,e)=>n=>e(t(n)),d=(...t)=>t.reduce(h),p=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class f{constructor(){this.subscriptions=[]}add(t){return e(this.subscriptions,t),()=>n(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 m=t=>1e3*t,g=t=>t/1e3;function y(t,e){return e?t*(1e3/e):0}const v=new Set;const w=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},b=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function T(t,e,n,i){if(t===e&&n===i)return c;const s=e=>function(t,e,n,i,s){let r,o,a=0;do{o=e+(n-e)/2,r=b(o,i,s)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:b(s(t),e,i)}const x=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,S=t=>e=>1-t(1-e),M=T(.33,1.53,.69,.99),V=S(M),A=x(V),k=t=>(t*=2)<1?.5*V(t):.5*(2-Math.pow(2,-10*(t-1))),E=t=>1-Math.sin(Math.acos(t)),C=S(E),P=x(E),B=T(.42,0,1,1),O=T(0,0,.58,1),R=T(.42,0,.58,1);const F=t=>Array.isArray(t)&&"number"!=typeof t[0];function I(t,e){return F(t)?t[w(0,t.length,e)]:t}const D=t=>Array.isArray(t)&&"number"==typeof t[0],L={linear:c,easeIn:B,easeInOut:R,easeOut:O,circIn:E,circInOut:P,circOut:C,backIn:V,backInOut:A,backOut:M,anticipate:k},W=e=>{if(D(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,s,r]=e;return T(n,i,s,r)}return"string"==typeof e?(t.invariant(void 0!==L[e],`Invalid easing type '${e}'`,"invalid-easing-type"),L[e]):e},N=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],j={value:null,addProjectionMetrics:null};function $(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=N.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){o.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,r=!1)=>{const a=r&&s?n:i;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),o.delete(t)},process:t=>{a=t,s?r=!0:(s=!0,[n,i]=[i,n],n.forEach(u),e&&j.value&&j.value.frameloop[e].push(l),l=0,n.clear(),s=!1,r&&(r=!1,c.process(t)))}};return c}(o,e?n:void 0),t),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:h,update:d,preRender:p,render:f,postRender:m}=a,g=()=>{const o=r.useManualTiming?s.timestamp:performance.now();n=!1,r.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,l.process(s),u.process(s),c.process(s),h.process(s),d.process(s),p.process(s),f.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(g))};return{schedule:N.reduce((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(g)),o.schedule(e,r,a)),e},{}),cancel:t=>{for(let e=0;e<N.length;e++)a[N[e]].cancel(t)},state:s,steps:a}}const{schedule:K,cancel:U,state:Y,steps:z}=$("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);let X;function H(){X=void 0}const G={now:()=>(void 0===X&&G.set(Y.isProcessing||r.useManualTiming?Y.timestamp:performance.now()),X),set:t=>{X=t,queueMicrotask(H)}},q={layout:0,mainThread:0,waapi:0},Z=t=>e=>"string"==typeof e&&e.startsWith(t),_=Z("--"),J=Z("var(--"),Q=t=>!!J(t)&&tt.test(t.split("/*")[0].trim()),tt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function et(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const nt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},it={...nt,transform:t=>i(0,1,t)},st={...nt,default:1},rt=t=>Math.round(1e5*t)/1e5,ot=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const at=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,lt=(t,e)=>n=>Boolean("string"==typeof n&&at.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),ut=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,o,a]=i.match(ot);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ct={...nt,transform:t=>Math.round((t=>i(0,255,t))(t))},ht={test:lt("rgb","red"),parse:ut("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ct.transform(t)+", "+ct.transform(e)+", "+ct.transform(n)+", "+rt(it.transform(i))+")"};const dt={test:lt("#"),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:ht.transform},pt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ft=pt("deg"),mt=pt("%"),gt=pt("px"),yt=pt("vh"),vt=pt("vw"),wt=(()=>({...mt,parse:t=>mt.parse(t)/100,transform:t=>mt.transform(100*t)}))(),bt={test:lt("hsl","hue"),parse:ut("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+mt.transform(rt(e))+", "+mt.transform(rt(n))+", "+rt(it.transform(i))+")"},Tt={test:t=>ht.test(t)||dt.test(t)||bt.test(t),parse:t=>ht.test(t)?ht.parse(t):bt.test(t)?bt.parse(t):dt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ht.transform(t):bt.transform(t),getAnimatableNone:t=>{const e=Tt.parse(t);return e.alpha=0,Tt.transform(e)}},xt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const St="number",Mt="color",Vt=/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 At(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const o=e.replace(Vt,t=>(Tt.test(t)?(i.color.push(r),s.push(Mt),n.push(Tt.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(St),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:i,types:s}}function kt(t){return At(t).values}function Et(t){const{split:e,types:n}=At(t),i=e.length;return t=>{let s="";for(let r=0;r<i;r++)if(s+=e[r],void 0!==t[r]){const e=n[r];s+=e===St?rt(t[r]):e===Mt?Tt.transform(t[r]):t[r]}return s}}const Ct=t=>"number"==typeof t?0:Tt.test(t)?Tt.getAnimatableNone(t):t;const Pt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(ot)?.length||0)+(t.match(xt)?.length||0)>0},parse:kt,createTransformer:Et,getAnimatableNone:function(t){const e=kt(t);return Et(t)(e.map(Ct))}};function Bt(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 Ot({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Bt(a,i,t+1/3),r=Bt(a,i,t),o=Bt(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}function Rt(t,e){return n=>n>0?e:t}const Ft=(t,e,n)=>t+(e-t)*n,It=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Dt=[dt,ht,bt];function Lt(e){const n=(i=e,Dt.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(e);return n===bt&&(s=Ot(s)),s}const Wt=(t,e)=>{const n=Lt(t),i=Lt(e);if(!n||!i)return Rt(t,e);const s={...n};return t=>(s.red=It(n.red,i.red,t),s.green=It(n.green,i.green,t),s.blue=It(n.blue,i.blue,t),s.alpha=Ft(n.alpha,i.alpha,t),ht.transform(s))},Nt=new Set(["none","hidden"]);function jt(t,e){return Nt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function $t(t,e){return n=>Ft(t,e,n)}function Kt(t){return"number"==typeof t?$t:"string"==typeof t?Q(t)?Rt:Tt.test(t)?Wt:zt:Array.isArray(t)?Ut:"object"==typeof t?Tt.test(t)?Wt:Yt:Rt}function Ut(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Kt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Yt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Kt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const zt=(e,n)=>{const i=Pt.createTransformer(n),s=At(e),r=At(n);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Nt.has(e)&&!r.values.length||Nt.has(n)&&!s.values.length?jt(e,n):d(Ut(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(s,r),r.values),i):(t.warning(!0,`Complex values '${e}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Rt(e,n))};function Xt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ft(t,e,n);return Kt(t)(t,e)}const Ht=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>K.update(e,t),stop:()=>U(e),now:()=>Y.isProcessing?Y.timestamp:G.now()}},Gt=(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)})`},qt=2e4;function Zt(t){let e=0;let n=t.next(e);for(;!n.done&&e<qt;)e+=50,n=t.next(e);return e>=qt?1/0:e}function _t(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Zt(i),qt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:g(s)}}function Jt(t,e,n){const i=Math.max(e-5,0);return y(n-t(i),e-i)}const Qt=100,te=10,ee=1,ne=0,ie=800,se=.3,re=.3,oe={granular:.01,default:2},ae={granular:.005,default:.5},le=.01,ue=10,ce=.05,he=1,de=.001;function pe({duration:e=ie,bounce:n=se,velocity:s=ne,mass:r=ee}){let o,a;t.warning(e<=m(ue),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=i(ce,he,l),e=i(le,ue,g(e)),l<1?(o=t=>{const n=t*l,i=n*e,r=n-s,o=me(t,l),a=Math.exp(-i);return de-r/o*a},a=t=>{const n=t*l*e,i=n*s+s,r=Math.pow(l,2)*Math.pow(t,2)*e,a=Math.exp(-n),u=me(Math.pow(t,2),l);return(-o(t)+de>0?-1:1)*((i-r)*a)/u}):(o=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,a=t=>Math.exp(-t*e)*(e*e*(s-t)));const u=function(t,e,n){let i=n;for(let n=1;n<fe;n++)i-=t(i)/e(i);return i}(o,a,5/e);if(e=m(e),isNaN(u))return{stiffness:Qt,damping:te,duration:e};{const t=Math.pow(u,2)*r;return{stiffness:t,damping:2*l*Math.sqrt(r*t),duration:e}}}const fe=12;function me(t,e){return t*Math.sqrt(1-e*e)}const ge=["duration","bounce"],ye=["stiffness","damping","mass"];function ve(t,e){return e.some(e=>void 0!==t[e])}function we(t=re,e=se){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:o},{stiffness:u,damping:c,mass:h,duration:d,velocity:p,isResolvedFromDuration:f}=function(t){let e={velocity:ne,stiffness:Qt,damping:te,mass:ee,isResolvedFromDuration:!1,...t};if(!ve(t,ye)&&ve(t,ge))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),r=s*s,o=2*i(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:ee,stiffness:r,damping:o}}else{const n=pe(t);e={...e,...n,mass:ee},e.isResolvedFromDuration=!0}return e}({...n,velocity:-g(n.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(u*h)),w=a-o,b=g(Math.sqrt(u/h)),T=Math.abs(w)<5;let x;if(s||(s=T?oe.granular:oe.default),r||(r=T?ae.granular:ae.default),v<1){const t=me(b,v);x=e=>{const n=Math.exp(-v*b*e);return a-n*((y+v*b*w)/t*Math.sin(t*e)+w*Math.cos(t*e))}}else if(1===v)x=t=>a-Math.exp(-b*t)*(w+(y+b*w)*t);else{const t=b*Math.sqrt(v*v-1);x=e=>{const n=Math.exp(-v*b*e),i=Math.min(t*e,300);return a-n*((y+v*b*w)*Math.sinh(i)+t*w*Math.cosh(i))/t}}const S={calculatedDuration:f&&d||null,next:t=>{const e=x(t);if(f)l.done=t>=d;else{let n=0===t?y:0;v<1&&(n=0===t?m(y):Jt(x,t,e));const i=Math.abs(n)<=s,o=Math.abs(a-e)<=r;l.done=i&&o}return l.value=l.done?a:e,l},toString:()=>{const t=Math.min(Zt(S),qt),e=Gt(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function be({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/i),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=we({keyframes:[d.value,p(d.value)],velocity:Jt(v,t,d.value),damping:s,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}function Te(e,n,{clamp:s=!0,ease:o,mixer:a}={}){const l=e.length;if(t.invariant(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const u=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),n=[...n].reverse());const h=function(t,e,n){const i=[],s=n||r.mix||Xt,o=t.length-1;for(let n=0;n<o;n++){let r=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||c:e;r=d(t,r)}i.push(r)}return i}(n,o,a),f=h.length,m=t=>{if(u&&t<e[0])return n[0];let i=0;if(f>1)for(;i<e.length-2&&!(t<e[i+1]);i++);const s=p(e[i],e[i+1],t);return h[i](s)};return s?t=>m(i(e[0],e[l-1],t)):m}function xe(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=p(0,e,i);t.push(Ft(n,1,s))}}function Se(t){const e=[0];return xe(e,t.length-1),e}function Me(t,e){return t.map(t=>t*e)}function Ve(t,e){return t.map(()=>e||R).splice(0,t.length-1)}function Ae({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=F(i)?i.map(W):W(i),r={done:!1,value:e[0]},o=Te(Me(n&&n.length===e.length?n:Se(e),t),e,{ease:Array.isArray(s)?s:Ve(e,s)});return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}we.applyToOptions=t=>{const e=_t(t,100,we);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};const ke=t=>null!==t;function Ee(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(ke),o=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==i?i:r[o]}const Ce={decay:be,inertia:be,tween:Ae,keyframes:Ae,spring:we};function Pe(t){"string"==typeof t.type&&(t.type=Ce[t.type])}class Be{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 Oe=t=>t/100;class Re extends Be{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!==G.now()&&this.tick(G.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},q.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Pe(t);const{type:e=Ae,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Ae;a!==Ae&&"number"!=typeof o[0]&&(this.mixKeyframes=d(Oe,Xt(o[0],o[1])),o=[0,100]);const l=a({...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Zt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+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:s,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:p,type:f,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let w=this.currentTime,b=n;if(h){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,h+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(b=o)),w=i(0,1,n)*a}const T=v?{done:!1,value:c[0]}:b.next(w);r&&(T.value=r(T.value));let{done:x}=T;v||null===l||(x=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&f!==be&&(T.value=Ee(c,this.options,g,this.speed)),m&&m(T.value),S&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return g(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+g(t)}get time(){return g(this.currentTime)}set time(t){t=m(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(G.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=g(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Ht,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(G.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,q.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Fe(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ie=t=>180*t/Math.PI,De=t=>{const e=Ie(Math.atan2(t[1],t[0]));return We(e)},Le={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:De,rotateZ:De,skewX:t=>Ie(Math.atan(t[1])),skewY:t=>Ie(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},We=t=>((t%=360)<0&&(t+=360),t),Ne=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),je=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),$e={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ne,scaleY:je,scale:t=>(Ne(t)+je(t))/2,rotateX:t=>We(Ie(Math.atan2(t[6],t[5]))),rotateY:t=>We(Ie(Math.atan2(-t[2],t[0]))),rotateZ:De,rotate:De,skewX:t=>Ie(Math.atan(t[4])),skewY:t=>Ie(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ke(t){return t.includes("scale")?1:0}function Ue(t,e){if(!t||"none"===t)return Ke(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=$e,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Le,s=e}if(!s)return Ke(e);const r=i[e],o=s[1].split(",").map(ze);return"function"==typeof r?r(o):o[r]}const Ye=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ue(n,e)};function ze(t){return parseFloat(t.trim())}const Xe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],He=(()=>new Set(Xe))(),Ge=t=>t===nt||t===gt,qe=new Set(["x","y","z"]),Ze=Xe.filter(t=>!qe.has(t));const _e={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})=>Ue(e,"x"),y:(t,{transform:e})=>Ue(e,"y")};_e.translateX=_e.x,_e.translateY=_e.y;const Je=new Set;let Qe=!1,tn=!1,en=!1;function nn(){if(tn){const t=Array.from(Je).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 Ze.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)})}tn=!1,Qe=!1,Je.forEach(t=>t.complete(en)),Je.clear()}function sn(){Je.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(tn=!0)})}function rn(){en=!0,sn(),nn(),en=!1}class on{constructor(t,e,n,i,s,r=!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=r}scheduleResolve(){this.state="scheduled",this.isAsync?(Je.add(this),Qe||(Qe=!0,K.read(sn),K.resolveKeyframes(nn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}Fe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Je.delete(this)}cancel(){"scheduled"===this.state&&(Je.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const an=t=>t.startsWith("--");function ln(t,e,n){an(e)?t.style.setProperty(e,n):t.style[e]=n}const un=u(()=>void 0!==window.ScrollTimeline),cn={};function hn(t,e){const n=u(t);return()=>cn[e]??n()}const dn=hn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),pn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,fn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pn([0,.65,.55,1]),circOut:pn([.55,0,1,.45]),backIn:pn([.31,.01,.66,-.59]),backOut:pn([.33,1.53,.69,.99])};function mn(t,e){return t?"function"==typeof t?dn()?Gt(t,e):"ease-out":D(t)?pn(t):Array.isArray(t)?t.map(t=>mn(t,e)||fn.easeOut):fn[t]:void 0}function gn(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=mn(a,s);Array.isArray(h)&&(c.easing=h),j.value&&q.waapi++;const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};u&&(d.pseudoElement=u);const p=t.animate(c,d);return j.value&&p.finished.finally(()=>{q.waapi--}),p}function yn(t){return"function"==typeof t&&"applyToOptions"in t}function vn({type:t,...e}){return yn(t)&&dn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class wn extends Be{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(r),this.allowFlatten=o,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=vn(e);this.animation=gn(n,i,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=Ee(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):ln(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return g(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+g(t)}get time(){return g(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(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&&un()?(this.animation.timeline=t,c):e(this)}}const bn={anticipate:k,backInOut:A,circInOut:P};function Tn(t){"string"==typeof t.ease&&t.ease in bn&&(t.ease=bn[t.ease])}class xn extends wn{constructor(t){Tn(t),Pe(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:r,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new Re({...o,autoplay:!1}),l=Math.max(10,G.now()-this.startTime),u=i(0,10,l-10);e.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const Sn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Pt.test(t)&&"0"!==t||t.startsWith("url(")));function Mn(t){t.duration=0,t.type="keyframes"}const Vn=new Set(["opacity","clipPath","filter","transform"]),An=u(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function kn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return An()&&n&&Vn.has(n)&&("transform"!==n||!u)&&!l&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o}class En extends Be{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=G.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:a,motionValue:l,element:u,...c},d=u?.KeyframeResolver||on;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:o,type:a,velocity:l,delay:u,isHandoff:h,onUpdate:d}=i;this.resolvedAt=G.now(),function(e,n,i,s){const r=e[0];if(null===r)return!1;if("display"===n||"visibility"===n)return!0;const o=e[e.length-1],a=Sn(r,n),l=Sn(o,n);return t.warning(a===l,`You are trying to animate ${n} from "${r}" to "${o}". "${a?o:r}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(e)||("spring"===i||yn(i))&&s)}(e,o,a,l)||(!r.instantAnimations&&u||d?.(Ee(e,i,n)),e[0]=e[e.length-1],Mn(i),i.repeat=0);const p={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},f=!h&&kn(p)?new xn({...p,element:p.motionValue.owner.current}):new Re(p);f.finished.then(()=>this.notifyFinished()).catch(c),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),rn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class Cn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Pn(this.animations,"duration")}get iterationDuration(){return Pn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Pn(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class Bn extends Cn{then(t,e){return this.finished.finally(t).then(()=>{})}}class On extends wn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Rn=new WeakMap,Fn=(t,e="")=>`${t}:${e}`;function In(t){const e=Rn.get(t)||new Map;return Rn.set(t,e),e}const Dn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ln(t){const e=Dn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Wn(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=Ln(e);if(!s)return;const a=window.getComputedStyle(n).getPropertyValue(s);if(a){const t=a.trim();return o(t)?parseFloat(t):t}return Q(r)?Wn(r,n,i+1):r}function Nn(t,e){return t?.[e]??t?.default??t}const jn=new Set(["width","height","top","left","right","bottom",...Xe]),$n=t=>e=>e.test(t),Kn=[nt,gt,mt,ft,vt,yt,{test:t=>"auto"===t,parse:t=>t}],Un=t=>Kn.find($n(t));function Yn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||l(t))}const zn=new Set(["brightness","contrast","saturate","opacity"]);function Xn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(ot)||[];if(!i)return t;const s=n.replace(i,"");let r=zn.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const Hn=/\b([a-z-]*)\(.*?\)/gu,Gn={...Pt,getAnimatableNone:t=>{const e=t.match(Hn);return e?e.map(Xn).join(" "):t}},qn={...nt,transform:Math.round},Zn={rotate:ft,rotateX:ft,rotateY:ft,rotateZ:ft,scale:st,scaleX:st,scaleY:st,scaleZ:st,skew:ft,skewX:ft,skewY:ft,distance:gt,translateX:gt,translateY:gt,translateZ:gt,x:gt,y:gt,z:gt,perspective:gt,transformPerspective:gt,opacity:it,originX:wt,originY:wt,originZ:gt},_n={borderWidth:gt,borderTopWidth:gt,borderRightWidth:gt,borderBottomWidth:gt,borderLeftWidth:gt,borderRadius:gt,radius:gt,borderTopLeftRadius:gt,borderTopRightRadius:gt,borderBottomRightRadius:gt,borderBottomLeftRadius:gt,width:gt,maxWidth:gt,height:gt,maxHeight:gt,top:gt,right:gt,bottom:gt,left:gt,inset:gt,insetBlock:gt,insetBlockStart:gt,insetBlockEnd:gt,insetInline:gt,insetInlineStart:gt,insetInlineEnd:gt,padding:gt,paddingTop:gt,paddingRight:gt,paddingBottom:gt,paddingLeft:gt,paddingBlock:gt,paddingBlockStart:gt,paddingBlockEnd:gt,paddingInline:gt,paddingInlineStart:gt,paddingInlineEnd:gt,margin:gt,marginTop:gt,marginRight:gt,marginBottom:gt,marginLeft:gt,marginBlock:gt,marginBlockStart:gt,marginBlockEnd:gt,marginInline:gt,marginInlineStart:gt,marginInlineEnd:gt,backgroundPositionX:gt,backgroundPositionY:gt,...Zn,zIndex:qn,fillOpacity:it,strokeOpacity:it,numOctaves:qn},Jn={..._n,color:Tt,backgroundColor:Tt,outlineColor:Tt,fill:Tt,stroke:Tt,borderColor:Tt,borderTopColor:Tt,borderRightColor:Tt,borderBottomColor:Tt,borderLeftColor:Tt,filter:Gn,WebkitFilter:Gn},Qn=t=>Jn[t];function ti(t,e){let n=Qn(t);return n!==Gn&&(n=Pt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ei=new Set(["auto","none","0"]);class ni extends on{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(),Q(i))){const s=Wn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!jn.has(n)||2!==t.length)return;const[i,s]=t,r=Un(i),o=Un(s);if(et(i)!==et(s)&&_e[n])this.needsMeasurement=!0;else if(r!==o)if(Ge(r)&&Ge(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else _e[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Yn(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!ei.has(e)&&At(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=ti(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_e[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,r=n[s];n[s]=_e[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const ii=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","backgroundPositionX","backgroundPositionY"]);function si(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&ii.has(e)&&(t[n]=t[n]+"px")}const ri=u(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),oi=new Set(["opacity","clipPath","filter","transform"]);function ai(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function li(t){return(e,n)=>{const i=ai(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const ui=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class ci{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const r=this.values.get(t);r&&r.onRemove();const o=()=>{const i=e.get();this.latest[t]=s?ui(i,_n[t]):i,n&&K.render(n)};o();const a=e.on("change",o);i&&e.addDependent(i);const l=()=>{a(),n&&U(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function hi(t){const e=new WeakMap,n=[];return(i,s)=>{const r=e.get(i)??new ci;e.set(i,r);for(const e in s){const o=s[e],a=t(i,r,e,o);n.push(a)}return()=>{for(const t of n)t()}}}const di=(t,e,n,i)=>{const s=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),r=s?n:n.startsWith("data")||n.startsWith("aria")?n.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`):n;const o=s?()=>{t[r]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(r):t.setAttribute(r,String(i))};return e.set(n,i,o)},pi=li(hi(di)),fi=hi((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function mi(t){return a(t)&&"offsetHeight"in t}const gi={current:void 0};class yi{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=G.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=G.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 f);const n=this.events[t].add(e);return"change"===t?()=>{n(),K.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 gi.current&&gi.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=G.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return y(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 vi(t,e){return new yi(t,e)}const wi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const bi=new Set(["originX","originY","originZ"]),Ti=(t,e,n,i)=>{let s,r;return He.has(n)?(e.get("transform")||(mi(t)||e.get("transformBox")||Ti(t,e,"transformBox",new yi("fill-box")),e.set("transform",new yi("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i<Xe.length;i++){const s=Xe[i],r=t.latest[s];if(void 0===r)continue;let o=!0;o="number"==typeof r?r===(s.startsWith("scale")?1:0):0===parseFloat(r),o||(n=!1,e+=`${wi[s]||s}(${t.latest[s]}) `)}return n?"none":e.trim()}(e)})),r=e.get("transform")):bi.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new yi(""),()=>{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),r=e.get("transformOrigin")):s=an(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,r)},xi=li(hi(Ti)),Si=gt.transform;const Mi=li(hi((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return K.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>t.setAttribute("stroke-dashoffset",Si(-e.latest[n]))):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new yi("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${Si(n)} ${Si(i??1-Number(n))}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return di(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?Ti:di)(t,e,n,i)}));const{schedule:Vi,cancel:Ai}=$(queueMicrotask,!1),ki={x:!1,y:!1};function Ei(){return ki.x||ki.y}function Ci(t,e){const n=ai(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Pi(t){return!("touch"===t.pointerType||Ei())}const Bi=(t,e)=>!!e&&(t===e||Bi(t,e.parentElement)),Oi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ri=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Fi(t){return Ri.has(t.tagName)||!0===t.isContentEditable}const Ii=new WeakSet;function Di(t){return e=>{"Enter"===e.key&&t(e)}}function Li(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Wi(t){return Oi(t)&&!Ei()}function Ni(t,e){const n=window.getComputedStyle(t);return an(e)?n.getPropertyValue(e):n[e]}function ji(t){return a(t)&&"ownerSVGElement"in t}const $i=new WeakMap;let Ki;const Ui=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:ji(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Yi=Ui("inline","width","offsetWidth"),zi=Ui("block","height","offsetHeight");function Xi({target:t,borderBoxSize:e}){$i.get(t)?.forEach(n=>{n(t,{get width(){return Yi(t,e)},get height(){return zi(t,e)}})})}function Hi(t){t.forEach(Xi)}function Gi(t,e){Ki||"undefined"!=typeof ResizeObserver&&(Ki=new ResizeObserver(Hi));const n=ai(t);return n.forEach(t=>{let n=$i.get(t);n||(n=new Set,$i.set(t,n)),n.add(e),Ki?.observe(t)}),()=>{n.forEach(t=>{const n=$i.get(t);n?.delete(e),n?.size||Ki?.unobserve(t)})}}const qi=new Set;let Zi;function _i(t){return qi.add(t),Zi||(Zi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};qi.forEach(e=>e(t))},window.addEventListener("resize",Zi)),()=>{qi.delete(t),qi.size||"function"!=typeof Zi||(window.removeEventListener("resize",Zi),Zi=void 0)}}function Ji(t,e){return"function"==typeof t?_i(t):Gi(t,e)}function Qi(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return K.preUpdate(i,!0),()=>U(i)}function ts(){const{value:t}=j;null!==t?(t.frameloop.rate.push(Y.delta),t.animations.mainThread.push(q.mainThread),t.animations.waapi.push(q.waapi),t.animations.layout.push(q.layout)):U(ts)}function es(t){return t.reduce((t,e)=>t+e,0)/t.length}function ns(t,e=es){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const is=t=>Math.round(1e3/t);function ss(){j.value=null,j.addProjectionMetrics=null}function rs(){const{value:t}=j;if(!t)throw new Error("Stats are not being measured");ss(),U(ts);const e={frameloop:{setup:ns(t.frameloop.setup),rate:ns(t.frameloop.rate),read:ns(t.frameloop.read),resolveKeyframes:ns(t.frameloop.resolveKeyframes),preUpdate:ns(t.frameloop.preUpdate),update:ns(t.frameloop.update),preRender:ns(t.frameloop.preRender),render:ns(t.frameloop.render),postRender:ns(t.frameloop.postRender)},animations:{mainThread:ns(t.animations.mainThread),waapi:ns(t.animations.waapi),layout:ns(t.animations.layout)},layoutProjection:{nodes:ns(t.layoutProjection.nodes),calculatedTargetDeltas:ns(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:ns(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=is(n.min),n.max=is(n.max),n.avg=is(n.avg),[n.min,n.max]=[n.max,n.min],e}function os(t){return ji(t)&&"svg"===t.tagName}function as(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function ls(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Te(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function us(t){const e=[];gi.current=e;const n=t();gi.current=void 0;const i=vi(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>K.preRender(i,!1,!0),r=t.map(t=>t.on("change",s));e.on("destroy",()=>{r.forEach(t=>t()),U(i)})}(e,i,t),i}const cs=t=>Boolean(t&&t.getVelocity);function hs(t,e,n){const i=t.get();let s,r=null,o=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{r&&(r.stop(),r=null)};if(t.attach((e,i)=>{o=e,s=t=>i(ds(t,a)),K.postRender(()=>{l(),r=new Re({keyframes:[ps(t.get()),ps(o)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s}),t.events.animationStart?.notify(),r?.then(()=>{t.events.animationComplete?.notify()})})},l),cs(e)){const n=e.on("change",e=>t.set(ds(e,a))),i=t.on("destroy",n);return()=>{n(),i()}}return l}function ds(t,e){return e?t+e:t}function ps(t){return"number"==typeof t?t:parseFloat(t)}const fs=[...Kn,Tt,Pt],ms=t=>fs.find($n(t));function gs(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let ys={},vs=null;const ws=(t,e)=>{ys[t]=e},bs=()=>{vs||(vs=document.createElement("style"),vs.id="motion-view");let t="";for(const e in ys){const n=ys[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}vs.textContent=t,document.head.appendChild(vs),ys={}},Ts=()=>{vs&&vs.parentElement&&vs.parentElement.removeChild(vs)};function xs(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Ss(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function Ms(){return document.getAnimations().filter(Ss)}const Vs=["layout","enter","exit","new","old"];function As(t){const{update:e,targets:n,options:i}=t;if(!document.startViewTransition)return new Promise(async t=>{await e(),t(new Cn([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||ws(":root",{"view-transition-name":"none"}),ws("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),bs();const s=document.startViewTransition(async()=>{await e()});return s.finished.finally(()=>{Ts()}),new Promise(t=>{s.ready.then(()=>{const e=Ms(),s=[];n.forEach((t,e)=>{for(const n of Vs){if(!t[n])continue;const{keyframes:r,options:o}=t[n];for(let[t,a]of Object.entries(r)){if(!a)continue;const r={...Nn(i,t),...Nn(o,t)},l=gs(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===l?0:1,a]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=m(r.duration)),r.delay&&(r.delay=m(r.delay));const u=new wn({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${l}(${e})`,keyframes:a});s.push(u)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:r}=e;if(!r)continue;const o=xs(r);if(!o)continue;const a=n.get(o.layer);if(a)ks(a,"enter")&&ks(a,"exit")&&e.getKeyframes().some(t=>t.mixBlendMode)?s.push(new On(t)):t.cancel();else{const n="group"===o.type?"layout":"";let r={...Nn(i,n)};r.duration&&(r.duration=m(r.duration)),r=vn(r);const a=mn(r.ease,r.duration);e.updateTiming({delay:m(r.delay??0),duration:r.duration,easing:a}),s.push(new On(t))}}t(new Cn(s))})})}function ks(t,e){return t?.[e]?.keyframes.opacity}let Es=[],Cs=null;function Ps(){Cs=null;const[t]=Es;var e;t&&(n(Es,e=t),Cs=e,As(e).then(t=>{e.notifyReady(t),t.finished.finally(Ps)}))}function Bs(){for(let t=Es.length-1;t>=0;t--){const e=Es[t],{interrupt:n}=e.options;if("immediate"===n){const n=Es.slice(0,t+1).map(t=>t.update),i=Es.slice(t+1);e.update=()=>{n.forEach(t=>t())},Es=[e,...i];break}}Cs&&"immediate"!==Es[0]?.options.interrupt||Ps()}class Os{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.notifyReady=c,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...e},n=this,Es.push(n),Vi.render(Bs)}get(t){return this.currentSubject=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const Rs=K,Fs=N.reduce((t,e)=>(t[e]=t=>U(t),t),{});function Is(t){return"object"==typeof t&&!Array.isArray(t)}function Ds(t,e,n,i){return"string"==typeof t&&Is(e)?ai(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function Ls(t,e,n){return t*(e+1)}function Ws(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Ns(t,e,i,s,r,o){!function(t,e,i){for(let s=0;s<t.length;s++){const r=t[s];r.at>e&&r.at<i&&(n(t,r),s--)}}(t,r,o);for(let n=0;n<e.length;n++)t.push({value:e[n],at:Ft(r,o,s[n]),easing:I(i,n)})}function js(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function $s(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Ks(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Us(t,e){return e[t]||(e[t]=[]),e[t]}function Ys(t){return Array.isArray(t)?t:[t]}function zs(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Xs=t=>"number"==typeof t,Hs=t=>t.every(Xs),Gs=new WeakMap;function qs(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Zs(t,e,n,i){if("function"==typeof e){const[s,r]=qs(i);e=e(void 0!==n?n:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,r]=qs(i);e=e(void 0!==n?n:t.custom,s,r)}return e}function _s(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,vi(n))}function Js(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function Qs(t,e){const n=function(t,e){const n=t.getProps();return Zs(n,e,n.custom,t)}(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r){_s(t,e,Js(r[e]))}}function tr(t,e){const n=t.getValue("willChange");if(i=n,Boolean(cs(i)&&i.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}const er=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),nr="data-"+er("framerAppearId");function ir(t){return t.props[nr]}const sr=t=>null!==t;const rr={type:"spring",stiffness:500,damping:25,restSpeed:10},or={type:"keyframes",duration:.8},ar={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},lr=(t,{keyframes:e})=>e.length>2?or:He.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:rr:ar;const ur=(t,e,n,i={},s,o)=>a=>{const l=Nn(i,t)||{},u=l.delay||i.delay||0;let{elapsed:c=0}=i;c-=m(u);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||Object.assign(h,lr(t,h)),h.duration&&(h.duration=m(h.duration)),h.repeatDelay&&(h.repeatDelay=m(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(Mn(h),0===h.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations)&&(d=!0,Mn(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(sr),r=e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}(h.keyframes,l);if(void 0!==t)return void K.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new Re(h):new En(h)};function cr({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function hr(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(r=i);const l=[],u=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||u&&cr(u,e))continue;const o={delay:n,...Nn(r||{},e)},c=i.get();if(void 0!==c&&!i.isAnimating&&!Array.isArray(s)&&s===c&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=ir(t);if(n){const t=window.MotionHandoffAnimation(n,e,K);null!==t&&(o.startTime=t,h=!0)}}tr(t,e),i.start(ur(e,i,s,t.shouldReduceMotion&&jn.has(e)?{type:!1}:o,t,h));const d=i.animation;d&&l.push(d)}return o&&Promise.all(l).then(()=>{K.update(()=>{o&&Qs(t,o)})}),l}const dr={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"]},pr={};for(const t in dr)pr[t]={isEnabled:e=>dr[t].some(t=>!!e[t])};const fr=()=>({x:{min:0,max:0},y:{min:0,max:0}}),mr="undefined"!=typeof window,gr={current:null},yr={current:!1};const vr=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function wr(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||vr.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const br=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Tr{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=on,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=G.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,K.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;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=o,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=wr(e),this.isVariantNode=function(t){return Boolean(wr(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==a[t]&&cs(e)&&e.set(a[t])}}mount(t){this.current=t,Gs.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:(yr.current||function(){if(yr.current=!0,mr)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>gr.current=t.matches;t.addEventListener("change",e),e()}else gr.current=!1}(),this.shouldReduceMotion=gr.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),U(this.notifyUpdate),U(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=He.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&K.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 pr){const e=pr[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<br.length;e++){const n=br[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],r=n[i];if(cs(s))t.addValue(i,s);else if(cs(r))t.addValue(i,vi(s,{owner:t}));else if(r!==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,vi(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=vi(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(o(n)||l(n))?n=parseFloat(n):!ms(n)&&Pt.test(e)&&(n=ti(t,e)),this.setBaseTarget(t,cs(n)?n.get():n)),cs(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=Zs(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||cs(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 f),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Vi.render(this.render)}}class xr extends Tr{constructor(){super(...arguments),this.KeyframeResolver=ni}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;cs(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const Sr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Mr=Xe.length;function Vr(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(He.has(t))o=!0;else if(_(t))s[t]=n;else{const e=ui(n,_n[t]);t.startsWith("origin")?(a=!0,r[t]=e):i[t]=e}}if(e.transform||(o||n?i.transform=function(t,e,n){let i="",s=!0;for(let r=0;r<Mr;r++){const o=Xe[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=ui(a,_n[o]);l||(s=!1,i+=`${Sr[o]||o}(${t}) `),n&&(e[o]=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}=r;i.transformOrigin=`${t} ${e} ${n}`}}function Ar(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}function kr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Er={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!gt.test(t))return t;t=parseFloat(t)}return`${kr(t,e.target.x)}% ${kr(t,e.target.y)}%`}},Cr={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Pt.parse(t);if(s.length>5)return i;const r=Pt.createTransformer(t),o="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=Ft(a,l,.5);return"number"==typeof s[2+o]&&(s[2+o]/=u),"number"==typeof s[3+o]&&(s[3+o]/=u),r(s)}},Pr={borderRadius:{...Er,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Er,borderTopRightRadius:Er,borderBottomLeftRadius:Er,borderBottomRightRadius:Er,boxShadow:Cr};function Br(t,{layout:e,layoutId:n}){return He.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Pr[t]||"opacity"===t)}function Or(t,e,n){const{style:i}=t,s={};for(const r in i)(cs(i[r])||e.style&&cs(e.style[r])||Br(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(s[r]=i[r]);return s}class Rr extends xr{constructor(){super(...arguments),this.type="html",this.renderInstance=Ar}readValueFromInstance(t,e){if(He.has(e))return this.projection?.isProjecting?Ke(e):Ye(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(_(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(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))}(t,e)}build(t,e,n){Vr(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Or(t,e,n)}}class Fr extends Tr{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Ir={offset:"stroke-dashoffset",array:"stroke-dasharray"},Dr={offset:"strokeDashoffset",array:"strokeDasharray"};const Lr=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Wr(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(Vr(t,a,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox);for(const t of Lr)void 0!==h[t]&&(d[t]=h[t],delete h[t]);void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Ir:Dr;t[r.offset]=gt.transform(-i);const o=gt.transform(e),a=gt.transform(n);t[r.array]=`${o} ${a}`}(h,s,r,o,!1)}const Nr=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 jr extends xr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fr}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(He.has(e)){const t=Qn(e);return t&&t.default||0}return e=Nr.has(e)?e:er(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const i=Or(t,e,n);for(const n in t)(cs(t[n])||cs(e[n]))&&(i[-1!==Xe.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return i}(t,e,n)}build(t,e,n){Wr(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Ar(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Nr.has(n)?n:er(n),e.attrs[n])}(t,e,0,i)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function $r(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ji(t)&&!os(t)?new jr(e):new Rr(e);n.mount(t),Gs.set(t,n)}function Kr(t){const e=new Fr({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Gs.set(t,e)}function Ur(e,n,i,s){const r=[];if(function(t,e){return cs(t)||"number"==typeof t||"string"==typeof t&&!Is(e)}(e,n))r.push(function(t,e,n){const i=cs(t)?t:vi(t);return i.start(ur("",i,e,n)),i.animation}(e,Is(n)&&n.default||n,i&&i.default||i));else{const o=Ds(e,n,s),a=o.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let e=0;e<a;e++){const s=o[e];t.invariant(null!==s,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");const l=s instanceof Element?$r:Kr;Gs.has(s)||l(s);const u=Gs.get(s),c={...i};"delay"in c&&"function"==typeof c.delay&&(c.delay=c.delay(e,a)),r.push(...hr(u,{...n,transition:c},{}))}}return r}function Yr(e,n,i){const s=[],r=function(e,{defaultTransition:n={},...i}={},s,r){const o=n.duration||.3,a=new Map,l=new Map,u={},c=new Map;let h=0,d=0,f=0;for(let i=0;i<e.length;i++){const a=e[i];if("string"==typeof a){c.set(a,d);continue}if(!Array.isArray(a)){c.set(a.name,Ws(d,a.at,h,c));continue}let[p,g,y={}]=a;void 0!==y.at&&(d=Ws(d,y.at,h,c));let v=0;const w=(e,i,s,a=0,l=0)=>{const u=Ys(e),{delay:c=0,times:h=Se(u),type:p="keyframes",repeat:g,repeatType:y,repeatDelay:w=0,...b}=i;let{ease:T=n.ease||"easeOut",duration:x}=i;const S="function"==typeof c?c(a,l):c,M=u.length,V=yn(p)?p:r?.[p||"keyframes"];if(M<=2&&V){let t=100;if(2===M&&Hs(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...b};void 0!==x&&(e.duration=m(x));const n=_t(e,t,V);T=n.ease,x=n.duration}x??(x=o);const A=d+S;1===h.length&&0===h[0]&&(h[1]=1);const k=h.length-u.length;if(k>0&&xe(h,k),1===u.length&&u.unshift(null),g){t.invariant(g<20,"Repeat count too high, must be less than 20","repeat-count-high"),x=Ls(x,g);const e=[...u],n=[...h];T=Array.isArray(T)?[...T]:[T];const i=[...T];for(let t=0;t<g;t++){u.push(...e);for(let s=0;s<e.length;s++)h.push(n[s]+(t+1)),T.push(0===s?"linear":I(i,s-1))}js(h,g)}const E=A+x;Ns(s,u,T,h,A,E),v=Math.max(S+x,v),f=Math.max(E,f)};if(cs(p))w(g,y,Us("default",Ks(p,l)));else{const t=Ds(p,g,s,u),e=t.length;for(let n=0;n<e;n++){const i=Ks(t[n],l);for(const t in g)w(g[t],zs(y,t),Us(t,i),n,e)}}h=d,d+=v}return l.forEach((t,e)=>{for(const s in t){const r=t[s];r.sort($s);const o=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:i}=r[t];o.push(n),l.push(p(0,f,e)),u.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),o.unshift(o[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),o.push(null)),a.has(e)||a.set(e,{keyframes:{},transition:{}});const c=a.get(e);c.keyframes[s]=o,c.transition[s]={...n,duration:f,ease:u,times:l,...i}}}),a}(e,n,i,{spring:we});return r.forEach(({keyframes:t,transition:e},n)=>{s.push(...Ur(n,t,e))}),s}function zr(t){return function(e,i,s){let r,o=[];if(a=e,Array.isArray(a)&&a.some(Array.isArray))o=Yr(e,i,t);else{const{onComplete:n,...a}=s||{};"function"==typeof n&&(r=n),o=Ur(e,i,a,t)}var a;const l=new Bn(o);return r&&l.finished.then(r),t&&(t.animations.push(l),l.finished.then(()=>{n(t.animations,l)})),l}}const Xr=zr();const Hr=e=>function(n,i,s){return new Bn(function(e,n,i,s){const r=ai(e,s),o=r.length;t.invariant(Boolean(o),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;t<o;t++){const e=r[t],s={...i};"function"==typeof s.delay&&(s.delay=s.delay(t,o));for(const t in n){let i=n[t];Array.isArray(i)||(i=[i]);const r={...Nn(s,t)};r.duration&&(r.duration=m(r.duration)),r.delay&&(r.delay=m(r.delay));const o=In(e),l=Fn(t,r.pseudoElement||""),u=o.get(l);u&&u.stop(),a.push({map:o,key:l,unresolvedKeyframes:i,options:{...r,element:e,name:t,allowFlatten:!s.type&&!s.ease}})}}for(let t=0;t<a.length;t++){const{unresolvedKeyframes:e,options:n}=a[t],{element:i,name:s,pseudoElement:r}=n;r||null!==e[0]||(e[0]=Ni(i,s)),Fe(e),si(e,s),!r&&e.length<2&&e.unshift(Ni(i,s)),n.keyframes=e}const l=[];for(let t=0;t<a.length;t++){const{map:e,key:n,options:i}=a[t],s=new wn(i);e.set(n,s),s.finished.finally(()=>e.delete(n)),l.push(s)}return l}(n,i,s,e))},Gr=Hr(),qr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Zr(t,e,n,i){const s=n[e],{length:r,position:o}=qr[e],a=s.current,l=n.time;s.current=t[`scroll${o}`],s.scrollLength=t[`scroll${r}`]-t[`client${r}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=p(0,s.scrollLength,s.current);const u=i-l;s.velocity=u>50?0:y(s.current-a,u)}const _r={start:0,center:.5,end:1};function Jr(t,e,n=0){let i=0;if(t in _r&&(t=_r[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const Qr=[0,0];function to(t,e,n,i){let s=Array.isArray(t)?t:Qr,r=0,o=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,_r[t]?t:"0"]),r=Jr(s[0],n,i),o=Jr(s[1],e),r-o}const eo={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},no={x:0,y:0};function io(t,e,n){const{offset:s=eo.All}=n,{target:r=t,axis:o="y"}=n,a="y"===o?"height":"width",l=r!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(mi(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,r=i.parentNode;for(;!s;)"svg"===r.tagName&&(s=r),r=i.parentNode;i=s}}return n}(r,t):no,u=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),c={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let h=!e[o].interpolate;const d=s.length;for(let t=0;t<d;t++){const n=to(s[t],c[a],u[a],l[o]);h||n===e[o].interpolatorOffsets[t]||(h=!0),e[o].offset[t]=n}h&&(e[o].interpolate=Te(e[o].offset,Se(s),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=i(0,1,e[o].interpolate(e[o].current))}function so(t,e,n,i={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){Zr(t,"x",e,n),Zr(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&io(t,n,i)},notify:()=>e(n)}}const ro=new WeakMap,oo=new WeakMap,ao=new WeakMap,lo=t=>t===document.scrollingElement?window:t;function uo(t,{container:e=document.scrollingElement,...n}={}){if(!e)return c;let i=ao.get(e);i||(i=new Set,ao.set(e,i));const s=so(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(i.add(s),!ro.has(e)){const t=()=>{for(const t of i)t.measure(Y.timestamp);K.preUpdate(n)},n=()=>{for(const t of i)t.notify()},s=()=>K.read(t);ro.set(e,s);const r=lo(e);window.addEventListener("resize",s,{passive:!0}),e!==document.documentElement&&oo.set(e,Ji(e,s)),r.addEventListener("scroll",s,{passive:!0}),s()}const r=ro.get(e);return K.read(r,!1,!0),()=>{U(r);const t=ao.get(e);if(!t)return;if(t.delete(s),t.size)return;const n=ro.get(e);ro.delete(e),n&&(lo(e).removeEventListener("scroll",n),oo.get(e)?.(),window.removeEventListener("resize",n))}}const co=new Map;function ho({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);const s=co.get(e)??new Map;co.set(e,s);const r=n.target??"self",o=s.get(r)??{},a=i+(n.offset??[]).join(",");return o[a]||(o[a]=!n.target&&un()?new ScrollTimeline({source:e,axis:i}):function(t){const e={value:0},n=uo(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}({container:e,...n})),o[a]}const po={some:0,all:1};const fo=(t,e)=>Math.abs(t-e);t.AsyncMotionValueAnimation=En,t.DOMKeyframesResolver=ni,t.GroupAnimation=Cn,t.GroupAnimationWithThen=Bn,t.JSAnimation=Re,t.KeyframeResolver=on,t.MotionGlobalConfig=r,t.MotionValue=yi,t.NativeAnimation=wn,t.NativeAnimationExtended=xn,t.NativeAnimationWrapper=On,t.SubscriptionManager=f,t.ViewTransitionBuilder=Os,t.acceleratedValues=oi,t.activeAnimations=q,t.addAttrValue=di,t.addStyleValue=Ti,t.addUniqueItem=e,t.alpha=it,t.analyseComplexValue=At,t.animate=Xr,t.animateMini=Gr,t.animateValue=function(t){return new Re(t)},t.animateView=function(t,e={}){return new Os(t,e)},t.animationMapKey=Fn,t.anticipate=k,t.applyGeneratorOptions=vn,t.applyPxDefaults=si,t.attachSpring=hs,t.attrEffect=pi,t.backIn=V,t.backInOut=A,t.backOut=M,t.calcGeneratorDuration=Zt,t.cancelFrame=U,t.cancelMicrotask=Ai,t.cancelSync=Fs,t.circIn=E,t.circInOut=P,t.circOut=C,t.clamp=i,t.collectMotionValues=gi,t.color=Tt,t.complex=Pt,t.containsCSSVariable=et,t.convertOffsetToTimes=Me,t.createGeneratorEasing=_t,t.createRenderBatcher=$,t.createScopedAnimate=zr,t.cubicBezier=T,t.cubicBezierAsString=pn,t.defaultEasing=Ve,t.defaultOffset=Se,t.defaultTransformValue=Ke,t.defaultValueTypes=Jn,t.degrees=ft,t.delay=function(t,e){return function(t,e){const n=G.now(),i=({timestamp:s})=>{const r=s-n;r>=e&&(U(i),t(r-e))};return K.setup(i,!0),()=>U(i)}(t,m(e))},t.dimensionValueTypes=Kn,t.distance=fo,t.distance2D=function(t,e){const n=fo(t.x,e.x),i=fo(t.y,e.y);return Math.sqrt(n**2+i**2)},t.easeIn=B,t.easeInOut=R,t.easeOut=O,t.easingDefinitionToFunction=W,t.fillOffset=xe,t.fillWildcards=Fe,t.findDimensionValueType=Un,t.findValueType=ms,t.flushKeyframeResolvers=rn,t.frame=K,t.frameData=Y,t.frameSteps=z,t.generateLinearEasing=Gt,t.getAnimatableNone=ti,t.getAnimationMap=In,t.getComputedStyle=Ni,t.getDefaultValueType=Qn,t.getEasingForSegment=I,t.getMixer=Kt,t.getOriginIndex=as,t.getValueAsType=ui,t.getValueTransition=Nn,t.getVariableValue=Wn,t.getViewAnimationLayerInfo=xs,t.getViewAnimations=Ms,t.hasWarned=function(t){return v.has(t)},t.hex=dt,t.hover=function(t,e,n={}){const[i,s,r]=Ci(t,n),o=t=>{if(!Pi(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const r=t=>{Pi(t)&&(i(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,s)};return i.forEach(t=>{t.addEventListener("pointerenter",o,s)}),r},t.hsla=bt,t.hslaToRgba=Ot,t.inView=function(t,e,{root:n,margin:i,amount:s="some"}={}){const r=ai(t),o=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:po[s]});return r.forEach(t=>a.observe(t)),()=>a.disconnect()},t.inertia=be,t.interpolate=Te,t.invisibleValues=Nt,t.isBezierDefinition=D,t.isCSSVariableName=_,t.isCSSVariableToken=Q,t.isDragActive=Ei,t.isDragging=ki,t.isEasingArray=F,t.isElementKeyboardAccessible=Fi,t.isGenerator=yn,t.isHTMLElement=mi,t.isMotionValue=cs,t.isNodeOrChild=Bi,t.isNumericalString=o,t.isObject=a,t.isPrimaryPointer=Oi,t.isSVGElement=ji,t.isSVGSVGElement=os,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&dn()||!e||"string"==typeof e&&(e in fn||dn())||D(e)||Array.isArray(e)&&e.every(t))},t.isZeroValueString=l,t.keyframes=Ae,t.makeAnimationInstant=Mn,t.mapEasingToNativeEasing=mn,t.mapValue=function(t,e,n,i){const s=ls(e,n,i);return us(()=>s(t.get()))},t.maxGeneratorDuration=qt,t.memo=u,t.microtask=Vi,t.millisecondsToSeconds=g,t.mirrorEasing=x,t.mix=Xt,t.mixArray=Ut,t.mixColor=Wt,t.mixComplex=zt,t.mixImmediate=Rt,t.mixLinearColor=It,t.mixNumber=Ft,t.mixObject=Yt,t.mixVisibility=jt,t.motionValue=vi,t.moveItem=function([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[s]=t.splice(e,1);t.splice(i,0,s)}return t},t.noop=c,t.number=nt,t.numberValueTypes=_n,t.observeTimeline=Qi,t.parseCSSVariable=Ln,t.parseValueFromTransform=Ue,t.percent=mt,t.pipe=d,t.positionalKeys=jn,t.press=function(t,e,n={}){const[i,s,r]=Ci(t,n),o=t=>{const i=t.currentTarget;if(!Wi(t))return;Ii.add(i);const r=e(i,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Ii.has(i)&&Ii.delete(i),Wi(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,i===window||i===document||n.useGlobalTarget||Bi(i,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,s),mi(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Di(()=>{if(Ii.has(n))return;Li(n,"down");const t=Di(()=>{Li(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Li(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),Fi(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r},t.progress=p,t.progressPercentage=wt,t.propEffect=fi,t.px=gt,t.readTransformValue=Ye,t.recordStats=function(){if(j.value)throw ss(),new Error("Stats are already being measured");const t=j;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},K.postRender(ts,!0),rs},t.removeItem=n,t.resize=Ji,t.resolveElements=ai,t.reverseEasing=S,t.rgbUnit=ct,t.rgba=ht,t.scale=st,t.scroll=function(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return c;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?uo(n=>{t(n[e.axis].progress,n)},e):Qi(t,ho(e))}(t,s):function(t,e){const n=ho(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),Qi(e=>{t.time=t.iterationDuration*e},n))})}(t,s)},t.scrollInfo=uo,t.secondsToMilliseconds=m,t.setDragLock=function(t){return"x"===t||"y"===t?ki[t]?null:(ki[t]=!0,()=>{ki[t]=!1}):ki.x||ki.y?null:(ki.x=ki.y=!0,()=>{ki.x=ki.y=!1})},t.setStyle=ln,t.spring=we,t.springValue=function(t,e){const n=vi(cs(t)?t.get():t);return hs(n,t,e),n},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,r)=>{const o="number"==typeof n?n:as(n,r),a=Math.abs(o-s);let l=t*a;if(i){const e=r*t;l=W(i)(l/e)*e}return e+l}},t.startWaapiAnimation=gn,t.statsBuffer=j,t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(s):Math.ceil(s);return i(0,1,r/t)}},t.styleEffect=xi,t.supportedWaapiEasing=fn,t.supportsBrowserAnimation=kn,t.supportsFlags=cn,t.supportsLinearEasing=dn,t.supportsPartialKeyframes=ri,t.supportsScrollTimeline=un,t.svgEffect=Mi,t.sync=Rs,t.testValueType=$n,t.time=G,t.transform=ls,t.transformPropOrder=Xe,t.transformProps=He,t.transformValue=us,t.transformValueTypes=Zn,t.velocityPerSecond=y,t.vh=yt,t.vw=vt,t.warnOnce=function(t,e,n){t||v.has(e)||(console.warn(s(e,n)),v.add(e))},t.wrap=w});
@@ -2427,6 +2427,12 @@
2427
2427
  super();
2428
2428
  this.finishedTime = null;
2429
2429
  this.isStopped = false;
2430
+ /**
2431
+ * Tracks a manually-set start time that takes precedence over WAAPI's
2432
+ * dynamic startTime. This is cleared when play() or time setter is called,
2433
+ * allowing WAAPI to take over timing.
2434
+ */
2435
+ this.manualStartTime = null;
2430
2436
  if (!options)
2431
2437
  return;
2432
2438
  const { element, name, keyframes, pseudoElement, allowFlatten = false, finalKeyframe, onComplete, } = options;
@@ -2462,6 +2468,7 @@
2462
2468
  play() {
2463
2469
  if (this.isStopped)
2464
2470
  return;
2471
+ this.manualStartTime = null;
2465
2472
  this.animation.play();
2466
2473
  if (this.state === "finished") {
2467
2474
  this.updateFinished();
@@ -2525,6 +2532,7 @@
2525
2532
  return millisecondsToSeconds(Number(this.animation.currentTime) || 0);
2526
2533
  }
2527
2534
  set time(newTime) {
2535
+ this.manualStartTime = null;
2528
2536
  this.finishedTime = null;
2529
2537
  this.animation.currentTime = secondsToMilliseconds(newTime);
2530
2538
  }
@@ -2547,10 +2555,10 @@
2547
2555
  : this.animation.playState;
2548
2556
  }
2549
2557
  get startTime() {
2550
- return Number(this.animation.startTime);
2558
+ return this.manualStartTime ?? Number(this.animation.startTime);
2551
2559
  }
2552
2560
  set startTime(newStartTime) {
2553
- this.animation.startTime = newStartTime;
2561
+ this.manualStartTime = this.animation.startTime = newStartTime;
2554
2562
  }
2555
2563
  /**
2556
2564
  * Attaches a timeline to the animation, for instance the `ScrollTimeline`.
@@ -2612,7 +2620,7 @@
2612
2620
  */
2613
2621
  replaceTransitionType(options);
2614
2622
  super(options);
2615
- if (options.startTime) {
2623
+ if (options.startTime !== undefined) {
2616
2624
  this.startTime = options.startTime;
2617
2625
  }
2618
2626
  this.options = options;
@@ -2637,8 +2645,14 @@
2637
2645
  ...options,
2638
2646
  autoplay: false,
2639
2647
  });
2640
- const sampleTime = secondsToMilliseconds(this.finishedTime ?? this.time);
2641
- motionValue.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
2648
+ /**
2649
+ * Use wall-clock elapsed time for sampling.
2650
+ * Under CPU load, WAAPI's currentTime may not reflect actual
2651
+ * elapsed time, causing incorrect sampling and visual jumps.
2652
+ */
2653
+ const sampleTime = Math.max(sampleDelta, time.now() - this.startTime);
2654
+ const delta = clamp(0, sampleDelta, sampleTime - sampleDelta);
2655
+ motionValue.setWithVelocity(sampleAnimation.sample(Math.max(0, sampleTime - delta)).value, sampleAnimation.sample(sampleTime).value, delta);
2642
2656
  sampleAnimation.stop();
2643
2657
  }
2644
2658
  }