2 lines
113 KiB
JavaScript
2 lines
113 KiB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],i={value:null,addProjectionMetrics:null};function s(t,s){let o=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>o=!0,c=n.reduce((t,e)=>(t[e]=function(t,e){let n=new Set,s=new Set,o=!1,r=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(e){a.has(e)&&(h.schedule(e),t()),c++,e(l)}const h={schedule:(t,e=!1,i=!1)=>{const r=i&&o?n:s;return e&&a.add(t),r.has(t)||r.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{l=t,o?r=!0:(o=!0,[n,s]=[s,n],n.forEach(u),e&&i.value&&i.value.frameloop[e].push(c),c=0,n.clear(),o=!1,r&&(r=!1,h.process(t)))}};return h}(l,s?e:void 0),t),{}),{setup:u,read:h,resolveKeyframes:d,preUpdate:p,update:m,preRender:f,render:y,postRender:g}=c,v=()=>{const n=e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now();o=!1,e.MotionGlobalConfig.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(n-a.timestamp,40),1)),a.timestamp=n,a.isProcessing=!0,u.process(a),h.process(a),d.process(a),p.process(a),m.process(a),f.process(a),y.process(a),g.process(a),a.isProcessing=!1,o&&s&&(r=!1,t(v))};return{schedule:n.reduce((e,n)=>{const i=c[n];return e[n]=(e,n=!1,s=!1)=>(o||(o=!0,r=!0,a.isProcessing||t(v)),i.schedule(e,n,s)),e},{}),cancel:t=>{for(let e=0;e<n.length;e++)c[n[e]].cancel(t)},state:a,steps:c}}const{schedule:o,cancel:r,state:a,steps:l}=s("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0);let c;function u(){c=void 0}const h={now:()=>(void 0===c&&h.set(a.isProcessing||e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now()),c),set:t=>{c=t,queueMicrotask(u)}},d={layout:0,mainThread:0,waapi:0},p=t=>e=>"string"==typeof e&&e.startsWith(t),m=p("--"),f=p("var(--"),y=t=>!!f(t)&&g.test(t.split("/*")[0].trim()),g=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function v(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const x={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},T={...x,transform:t=>e.clamp(0,1,t)},w={...x,default:1},b=t=>Math.round(1e5*t)/1e5,S=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const V=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,A=(t,e)=>n=>Boolean("string"==typeof n&&V.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),P=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(S);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},M={...x,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},E={test:A("rgb","red"),parse:P("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+M.transform(t)+", "+M.transform(e)+", "+M.transform(n)+", "+b(T.transform(i))+")"};const D={test:A("#"),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:E.transform},k=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),R=k("deg"),C=k("%"),B=k("px"),j=k("vh"),L=k("vw"),F=(()=>({...C,parse:t=>C.parse(t)/100,transform:t=>C.transform(100*t)}))(),O={test:A("hsl","hue"),parse:P("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+C.transform(b(e))+", "+C.transform(b(n))+", "+b(T.transform(i))+")"},I={test:t=>E.test(t)||D.test(t)||O.test(t),parse:t=>E.test(t)?E.parse(t):O.test(t)?O.parse(t):D.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?E.transform(t):O.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},U=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const N="number",$="color",W=/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 K(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(W,t=>(I.test(t)?(i.color.push(o),s.push($),n.push(I.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(N),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function z(t){return K(t).values}function Y(t){const{split:e,types:n}=K(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+=e===N?b(t[o]):e===$?I.transform(t[o]):t[o]}return s}}const X=t=>"number"==typeof t?0:I.test(t)?I.getAnimatableNone(t):t;const G={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(S)?.length||0)+(t.match(U)?.length||0)>0},parse:z,createTransformer:Y,getAnimatableNone:function(t){const e=z(t);return Y(t)(e.map(X))}};function q(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 H({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=q(a,i,t+1/3),o=q(a,i,t),r=q(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}function Z(t,e){return n=>n>0?e:t}const _=(t,e,n)=>t+(e-t)*n,J=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Q=[D,E,O];function tt(t){const n=(i=t,Q.find(t=>t.test(i)));var i;if(e.warning(Boolean(n),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let s=n.parse(t);return n===O&&(s=H(s)),s}const et=(t,e)=>{const n=tt(t),i=tt(e);if(!n||!i)return Z(t,e);const s={...n};return t=>(s.red=J(n.red,i.red,t),s.green=J(n.green,i.green,t),s.blue=J(n.blue,i.blue,t),s.alpha=_(n.alpha,i.alpha,t),E.transform(s))},nt=new Set(["none","hidden"]);function it(t,e){return nt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function st(t,e){return n=>_(t,e,n)}function ot(t){return"number"==typeof t?st:"string"==typeof t?y(t)?Z:I.test(t)?et:lt:Array.isArray(t)?rt:"object"==typeof t?I.test(t)?et:at:Z}function rt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>ot(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function at(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=ot(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const lt=(t,n)=>{const i=G.createTransformer(n),s=K(t),o=K(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?nt.has(t)&&!o.values.length||nt.has(n)&&!s.values.length?it(t,n):e.pipe(rt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(s,o),o.values),i):(e.warning(!0,`Complex values '${t}' 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"),Z(t,n))};function ct(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return _(t,e,n);return ot(t)(t,e)}const ut=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>o.update(e,t),stop:()=>r(e),now:()=>a.isProcessing?a.timestamp:h.now()}},ht=(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)})`},dt=2e4;function pt(t){let e=0;let n=t.next(e);for(;!n.done&&e<dt;)e+=50,n=t.next(e);return e>=dt?1/0:e}function mt(t,n=100,i){const s=i({...t,keyframes:[0,n]}),o=Math.min(pt(s),dt);return{type:"keyframes",ease:t=>s.next(o*t).value/n,duration:e.millisecondsToSeconds(o)}}function ft(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}const yt=100,gt=10,vt=1,xt=0,Tt=800,wt=.3,bt=.3,St={granular:.01,default:2},Vt={granular:.005,default:.5},At=.01,Pt=10,Mt=.05,Et=1,Dt=.001;function kt({duration:t=Tt,bounce:n=wt,velocity:i=xt,mass:s=vt}){let o,r;e.warning(t<=e.secondsToMilliseconds(Pt),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=e.clamp(Mt,Et,a),t=e.clamp(At,Pt,e.millisecondsToSeconds(t)),a<1?(o=e=>{const n=e*a,s=n*t,o=n-i,r=Ct(e,a),l=Math.exp(-s);return Dt-o/r*l},r=e=>{const n=e*a*t,s=n*i+i,r=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-n),c=Ct(Math.pow(e,2),a);return(-o(e)+Dt>0?-1:1)*((s-r)*l)/c}):(o=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(i-e)));const l=function(t,e,n){let i=n;for(let n=1;n<Rt;n++)i-=t(i)/e(i);return i}(o,r,5/t);if(t=e.secondsToMilliseconds(t),isNaN(l))return{stiffness:yt,damping:gt,duration:t};{const e=Math.pow(l,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const Rt=12;function Ct(t,e){return t*Math.sqrt(1-e*e)}const Bt=["duration","bounce"],jt=["stiffness","damping","mass"];function Lt(t,e){return e.some(e=>void 0!==t[e])}function Ft(t=bt,n=wt){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t;let{restSpeed:s,restDelta:o}=i;const r=i.keyframes[0],a=i.keyframes[i.keyframes.length-1],l={done:!1,value:r},{stiffness:c,damping:u,mass:h,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let n={velocity:xt,stiffness:yt,damping:gt,mass:vt,isResolvedFromDuration:!1,...t};if(!Lt(t,jt)&&Lt(t,Bt))if(t.visualDuration){const i=t.visualDuration,s=2*Math.PI/(1.2*i),o=s*s,r=2*e.clamp(.05,1,1-(t.bounce||0))*Math.sqrt(o);n={...n,mass:vt,stiffness:o,damping:r}}else{const e=kt(t);n={...n,...e,mass:vt},n.isResolvedFromDuration=!0}return n}({...i,velocity:-e.millisecondsToSeconds(i.velocity||0)}),f=p||0,y=u/(2*Math.sqrt(c*h)),g=a-r,v=e.millisecondsToSeconds(Math.sqrt(c/h)),x=Math.abs(g)<5;let T;if(s||(s=x?St.granular:St.default),o||(o=x?Vt.granular:Vt.default),y<1){const t=Ct(v,y);T=e=>{const n=Math.exp(-y*v*e);return a-n*((f+y*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===y)T=t=>a-Math.exp(-v*t)*(g+(f+v*g)*t);else{const t=v*Math.sqrt(y*y-1);T=e=>{const n=Math.exp(-y*v*e),i=Math.min(t*e,300);return a-n*((f+y*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const w={calculatedDuration:m&&d||null,next:t=>{const n=T(t);if(m)l.done=t>=d;else{let i=0===t?f:0;y<1&&(i=0===t?e.secondsToMilliseconds(f):ft(T,t,n));const r=Math.abs(i)<=s,c=Math.abs(a-n)<=o;l.done=r&&c}return l.value=l.done?a:n,l},toString:()=>{const t=Math.min(pt(w),dt),e=ht(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function Ot({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,y=void 0===r?f:r(f);y!==f&&(m=y-h);const g=t=>-m*Math.exp(-t/i),v=t=>y+g(t),x=t=>{const e=g(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?y:n};let T,w;const b=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(T=t,w=Ft({keyframes:[d.value,p(d.value)],velocity:ft(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,x(t),b(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&x(t),d)}}}function It(t,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=t.length;if(e.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],o=i||e.MotionGlobalConfig.mix||ct,r=t.length-1;for(let i=0;i<r;i++){let r=o(t[i],t[i+1]);if(n){const t=Array.isArray(n)?n[i]||e.noop:n;r=e.pipe(t,r)}s.push(r)}return s}(n,s,o),c=l.length,u=i=>{if(a&&i<t[0])return n[0];let s=0;if(c>1)for(;s<t.length-2&&!(i<t[s+1]);s++);const o=e.progress(t[s],t[s+1],i);return l[s](o)};return i?n=>u(e.clamp(t[0],t[r-1],n)):u}function Ut(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const o=e.progress(0,n,s);t.push(_(i,1,o))}}function Nt(t){const e=[0];return Ut(e,t.length-1),e}function $t(t,e){return t.map(t=>t*e)}function Wt(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function Kt({duration:t=300,keyframes:n,times:i,ease:s="easeInOut"}){const o=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s),r={done:!1,value:n[0]},a=It($t(i&&i.length===n.length?i:Nt(n),t),n,{ease:Array.isArray(o)?o:Wt(n,o)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Ft.applyToOptions=t=>{const n=mt(t,100,Ft);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t};const zt=t=>null!==t;function Yt(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(zt),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Xt={decay:Ot,inertia:Ot,tween:Kt,keyframes:Kt,spring:Ft};function Gt(t){"string"==typeof t.type&&(t.type=Xt[t.type])}class qt{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 Ht=t=>t/100;class Zt extends qt{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!==h.now()&&this.tick(h.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},d.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Gt(t);const{type:n=Kt,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=n||Kt;l!==Kt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe(Ht,ct(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=pt(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(null===this.startTime)return i.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:y}=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)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let x=this.currentTime,T=i;if(h){const t=Math.min(this.currentTime,s)/a;let n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&n--,n=Math.min(n,h+1);Boolean(n%2)&&("reverse"===d?(i=1-i,p&&(i-=p/a)):"mirror"===d&&(T=r)),x=e.clamp(0,1,i)*a}const w=v?{done:!1,value:u[0]}:T.next(x);o&&(w.value=o(w.value));let{done:b}=w;v||null===l||(b=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&b);return S&&m!==Ot&&(w.value=Yt(u,this.options,y,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){t=e.secondsToMilliseconds(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(h.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ut,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(h.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,d.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 _t(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Jt=t=>180*t/Math.PI,Qt=t=>{const e=Jt(Math.atan2(t[1],t[0]));return ee(e)},te={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qt,rotateZ:Qt,skewX:t=>Jt(Math.atan(t[1])),skewY:t=>Jt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ee=t=>((t%=360)<0&&(t+=360),t),ne=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ie=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),se={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ne,scaleY:ie,scale:t=>(ne(t)+ie(t))/2,rotateX:t=>ee(Jt(Math.atan2(t[6],t[5]))),rotateY:t=>ee(Jt(Math.atan2(-t[2],t[0]))),rotateZ:Qt,rotate:Qt,skewX:t=>Jt(Math.atan(t[4])),skewY:t=>Jt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function oe(t){return t.includes("scale")?1:0}function re(t,e){if(!t||"none"===t)return oe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=se,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=te,s=e}if(!s)return oe(e);const o=i[e],r=s[1].split(",").map(le);return"function"==typeof o?o(r):r[o]}const ae=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return re(n,e)};function le(t){return parseFloat(t.trim())}const ce=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ue=(()=>new Set(ce))(),he=t=>t===x||t===B,de=new Set(["x","y","z"]),pe=ce.filter(t=>!de.has(t));const me={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})=>re(e,"x"),y:(t,{transform:e})=>re(e,"y")};me.translateX=me.x,me.translateY=me.y;const fe=new Set;let ye=!1,ge=!1,ve=!1;function xe(){if(ge){const t=Array.from(fe).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 pe.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)})}ge=!1,ye=!1,fe.forEach(t=>t.complete(ve)),fe.clear()}function Te(){fe.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ge=!0)})}function we(){ve=!0,Te(),xe(),ve=!1}class be{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(fe.add(this),ye||(ye=!0,o.read(Te),o.resolveKeyframes(xe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}_t(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),fe.delete(this)}cancel(){"scheduled"===this.state&&(fe.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Se=t=>t.startsWith("--");function Ve(t,e,n){Se(e)?t.style.setProperty(e,n):t.style[e]=n}const Ae={};function Pe(t,n){const i=e.memo(t);return()=>Ae[n]??i()}const Me=Pe(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ee=Pe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),De=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,ke={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:De([0,.65,.55,1]),circOut:De([.55,0,1,.45]),backIn:De([.31,.01,.66,-.59]),backOut:De([.33,1.53,.69,.99])};function Re(t,n){return t?"function"==typeof t?Ee()?ht(t,n):"ease-out":e.isBezierDefinition(t)?De(t):Array.isArray(t)?t.map(t=>Re(t,n)||ke.easeOut):ke[t]:void 0}function Ce(t,e,n,{delay:s=0,duration:o=300,repeat:r=0,repeatType:a="loop",ease:l="easeOut",times:c}={},u=void 0){const h={[e]:n};c&&(h.offset=c);const p=Re(l,o);Array.isArray(p)&&(h.easing=p),i.value&&d.waapi++;const m={delay:s,duration:o,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};u&&(m.pseudoElement=u);const f=t.animate(h,m);return i.value&&f.finished.finally(()=>{d.waapi--}),f}function Be(t){return"function"==typeof t&&"applyToOptions"in t}function je({type:t,...e}){return Be(t)&&Ee()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Le extends qt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=t,e.invariant("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=je(t);this.animation=Ce(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Yt(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):Ve(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(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:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Me()?(this.animation.timeline=t,e.noop):n(this)}}const Fe={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function Oe(t){"string"==typeof t.ease&&t.ease in Fe&&(t.ease=Fe[t.ease])}class Ie extends Le{constructor(t){Oe(t),Gt(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:o,...r}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const a=new Zt({...r,autoplay:!1}),l=Math.max(10,h.now()-this.startTime),c=e.clamp(0,10,l-10);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const Ue=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!G.test(t)&&"0"!==t||t.startsWith("url(")));function Ne(t){t.duration=0,t.type="keyframes"}const $e=new Set(["opacity","clipPath","filter","transform"]),We=e.memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ke(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return We()&&n&&$e.has(n)&&("transform"!==n||!c)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class ze extends qt{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=h.now();const d={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},p=c?.KeyframeResolver||be;this.keyframeResolver=new p(r,(t,e,n)=>this.onKeyframesResolved(t,e,d,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=h.now(),function(t,n,i,s){const o=t[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=t[t.length-1],a=Ue(o,n),l=Ue(r,n);return e.warning(a===l,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" 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}(t)||("spring"===i||Be(i))&&s)}(t,o,r,a)||(!e.MotionGlobalConfig.instantAnimations&&l||u?.(Yt(t,i,n)),t[0]=t[t.length-1],Ne(i),i.repeat=0);const d={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},p=!c&&Ke(d),m=d.motionValue?.owner?.current,f=p?new Ie({...d,element:m}):new Zt(d);f.finished.then(()=>{this.notifyFinished()}).catch(e.noop),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(),we()),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 Ye{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 Xe(this.animations,"duration")}get iterationDuration(){return Xe(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 Xe(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 Ge extends Le{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const qe=new WeakMap;function He(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const Ze=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _e(t){const e=Ze.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Je(t,n,i=1){e.invariant(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=_e(t);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return y(o)?Je(o,n,i+1):o}const Qe={type:"spring",stiffness:500,damping:25,restSpeed:10},tn={type:"keyframes",duration:.8},en={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nn=(t,{keyframes:e})=>e.length>2?tn:ue.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Qe:en,sn=t=>null!==t;function on(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(sn),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}function rn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function an(t,e){const n=t?.[e]??t?.default??t;return n!==t?rn(n,t):n}function ln({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const cn=(t,n,i,s={},r,a)=>l=>{const c=an(s,t)||{},u=c.delay||s.delay||0;let{elapsed:h=0}=s;h-=e.secondsToMilliseconds(u);const d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...c,delay:-h,onUpdate:t=>{n.set(t),c.onUpdate&&c.onUpdate(t)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:t,motionValue:n,element:a?void 0:r};ln(c)||Object.assign(d,nn(t,d)),d.duration&&(d.duration=e.secondsToMilliseconds(d.duration)),d.repeatDelay&&(d.repeatDelay=e.secondsToMilliseconds(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(Ne(d),0===d.delay&&(p=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations||r?.shouldSkipAnimations)&&(p=!0,Ne(d),d.delay=0),d.allowFlatten=!c.type&&!c.ease,p&&!a&&void 0!==n.get()){const t=on(d.keyframes,c);if(void 0!==t)return void o.update(()=>{d.onUpdate(t),d.onComplete()})}return c.isSync?new Zt(d):new ze(d)};function un(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function hn(t,e,n,i){if("function"==typeof e){const[s,o]=un(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=un(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function dn(t,e,n){const i=t.getProps();return hn(i,e,void 0!==n?n:i.custom,t)}const pn=new Set(["width","height","top","left","right","bottom",...ce]),mn={current:void 0};class fn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=h.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=h.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,n){this.events[t]||(this.events[t]=new e.SubscriptionManager);const i=this.events[t].add(n);return"change"===t?()=>{i(),o.read(()=>{this.events.change.getSize()||this.stop()})}:i}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 mn.current&&mn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=h.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}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 yn(t,e){return new fn(t,e)}const gn=t=>Array.isArray(t);function vn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yn(n))}function xn(t){return gn(t)?t[t.length-1]||0:t}function Tn(t,e){const n=dn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){vn(t,e,xn(o[e]))}}const wn=t=>Boolean(t&&t.getVelocity);function bn(t){return Boolean(wn(t)&&t.add)}function Sn(t,n){const i=t.getValue("willChange");if(bn(i))return i.add(n);if(!i&&e.MotionGlobalConfig.WillChange){const i=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",i),i.add(n)}}function Vn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const An="framerAppearId",Pn="data-"+Vn(An);function Mn(t){return t.props[Pn]}function En({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Dn(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:a,...l}=e;const c=t.getDefaultTransition();r=r?rn(r,c):c;const u=r?.reduceMotion;i&&(r=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const i=t.getValue(e,t.latestValues[e]??null),s=l[e];if(void 0===s||d&&En(d,e))continue;const a={delay:n,...an(r||{},e)},c=i.get();if(void 0!==c&&!i.isAnimating&&!Array.isArray(s)&&s===c&&!a.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const n=Mn(t);if(n){const t=window.MotionHandoffAnimation(n,e,o);null!==t&&(a.startTime=t,p=!0)}}Sn(t,e);const m=u??t.shouldReduceMotion;i.start(cn(e,i,s,m&&pn.has(e)?{type:!1}:a,t,p));const f=i.animation;f&&h.push(f)}if(a){const e=()=>o.update(()=>{a&&Tn(t,a)});h.length?Promise.all(h).then(e):e()}return h}function kn(t,e,n={}){const i=dn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(Dn(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(kn(l,e,{...r,delay:n+("function"==typeof i?0:i)+He(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function Rn(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>kn(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=kn(t,e,n);else{const s="function"==typeof e?dn(t,e,n.custom):e;i=Promise.all(Dn(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Cn=t=>e=>e.test(t),Bn=[x,B,C,R,L,j,{test:t=>"auto"===t,parse:t=>t}],jn=t=>Bn.find(Cn(t));function Ln(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const Fn=new Set(["brightness","contrast","saturate","opacity"]);function On(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(S)||[];if(!i)return t;const s=n.replace(i,"");let o=Fn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const In=/\b([a-z-]*)\(.*?\)/gu,Un={...G,getAnimatableNone:t=>{const e=t.match(In);return e?e.map(On).join(" "):t}},Nn={...G,getAnimatableNone:t=>{const e=G.parse(t);return G.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},$n={...x,transform:Math.round},Wn={rotate:R,rotateX:R,rotateY:R,rotateZ:R,scale:w,scaleX:w,scaleY:w,scaleZ:w,skew:R,skewX:R,skewY:R,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:T,originX:F,originY:F,originZ:B},Kn={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,inset:B,insetBlock:B,insetBlockStart:B,insetBlockEnd:B,insetInline:B,insetInlineStart:B,insetInlineEnd:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,paddingBlock:B,paddingBlockStart:B,paddingBlockEnd:B,paddingInline:B,paddingInlineStart:B,paddingInlineEnd:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,marginBlock:B,marginBlockStart:B,marginBlockEnd:B,marginInline:B,marginInlineStart:B,marginInlineEnd:B,fontSize:B,backgroundPositionX:B,backgroundPositionY:B,...Wn,zIndex:$n,fillOpacity:T,strokeOpacity:T,numOctaves:$n},zn={...Kn,color:I,backgroundColor:I,outlineColor:I,fill:I,stroke:I,borderColor:I,borderTopColor:I,borderRightColor:I,borderBottomColor:I,borderLeftColor:I,filter:Un,WebkitFilter:Un,mask:Nn,WebkitMask:Nn},Yn=t=>zn[t],Xn=new Set([Un,Nn]);function Gn(t,e){let n=Yn(t);return Xn.has(n)||(n=G),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const qn=new Set(["auto","none","0"]);class Hn extends be{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(),y(i))){const s=Je(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!pn.has(n)||2!==t.length)return;const[i,s]=t,o=jn(i),r=jn(s);if(v(i)!==v(s)&&me[n])this.needsMeasurement=!0;else if(o!==r)if(he(o)&&he(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else me[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Ln(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&&!qn.has(e)&&K(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=Gn(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=me[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=me[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Zn=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);const _n=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Jn=new Set(["opacity","clipPath","filter","transform"]);function Qn(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function ti(t){return(e,n)=>{const i=Qn(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}}}const ei=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class ni{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,s=!0){const a=this.values.get(t);a&&a.onRemove();const l=()=>{const i=e.get();this.latest[t]=s?ei(i,Kn[t]):i,n&&o.render(n)};l();const c=e.on("change",l);i&&e.addDependent(i);const u=()=>{c(),n&&r(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:u}),u}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function ii(t){const e=new WeakMap,n=[];return(i,s)=>{const o=e.get(i)??new ni;e.set(i,o);for(const e in s){const r=s[e],a=t(i,o,e,r);n.push(a)}return()=>{for(const t of n)t()}}}const si=(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),o=s?n:n.startsWith("data")||n.startsWith("aria")?Vn(n):n,r=s?()=>{t[o]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(o):t.setAttribute(o,String(i))};return e.set(n,i,r)},oi=ti(ii(si)),ri=ii((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function ai(t){return e.isObject(t)&&"offsetHeight"in t}const li={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const ci=new Set(["originX","originY","originZ"]),ui=(t,e,n,i)=>{let s,o;return ue.has(n)?(e.get("transform")||(ai(t)||e.get("transformBox")||ui(t,e,"transformBox",new fn("fill-box")),e.set("transform",new fn("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i<ce.length;i++){const s=ce[i],o=t.latest[s];if(void 0===o)continue;let r=!0;if("number"==typeof o)r=o===(s.startsWith("scale")?1:0);else{const t=parseFloat(o);r=s.startsWith("scale")?1===t:0===t}r||(n=!1,e+=`${li[s]||s}(${t.latest[s]}) `)}return n?"none":e.trim()}(e)})),o=e.get("transform")):ci.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new fn(""),()=>{const n=e.latest.originX??"50%",i=e.latest.originY??"50%",s=e.latest.originZ??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Se(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,i,s,o)},hi=ti(ii(ui));const di=ti(ii((t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return o.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const i=e.latest[n];t.setAttribute("stroke-dashoffset",""+-i)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new fn("1 1"),()=>{const{pathLength:n=1,pathSpacing:i}=e.latest;t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return si(t,e,function(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}(n),i);return(n in t.style?ui:si)(t,e,n,i)}));const{schedule:pi,cancel:mi}=s(queueMicrotask,!1),fi={x:!1,y:!1};function yi(){return fi.x||fi.y}function gi(t,e){const n=Qn(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}const vi=(t,e)=>!!e&&(t===e||vi(t,e.parentElement)),xi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Ti=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function wi(t){return Ti.has(t.tagName)||!0===t.isContentEditable}const bi=new Set(["INPUT","SELECT","TEXTAREA"]);const Si=new WeakSet;function Vi(t){return e=>{"Enter"===e.key&&t(e)}}function Ai(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Pi(t){return xi(t)&&!yi()}const Mi=new WeakSet;function Ei(t){return e.isObject(t)&&"ownerSVGElement"in t}const Di=new WeakMap;let ki;const Ri=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ei(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ci=Ri("inline","width","offsetWidth"),Bi=Ri("block","height","offsetHeight");function ji({target:t,borderBoxSize:e}){Di.get(t)?.forEach(n=>{n(t,{get width(){return Ci(t,e)},get height(){return Bi(t,e)}})})}function Li(t){t.forEach(ji)}function Fi(t,e){ki||"undefined"!=typeof ResizeObserver&&(ki=new ResizeObserver(Li));const n=Qn(t);return n.forEach(t=>{let n=Di.get(t);n||(n=new Set,Di.set(t,n)),n.add(e),ki?.observe(t)}),()=>{n.forEach(t=>{const n=Di.get(t);n?.delete(e),n?.size||ki?.unobserve(t)})}}const Oi=new Set;let Ii;function Ui(t){return Oi.add(t),Ii||(Ii=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Oi.forEach(e=>e(t))},window.addEventListener("resize",Ii)),()=>{Oi.delete(t),Oi.size||"function"!=typeof Ii||(window.removeEventListener("resize",Ii),Ii=void 0)}}function Ni(){const{value:t}=i;null!==t?(t.frameloop.rate.push(a.delta),t.animations.mainThread.push(d.mainThread),t.animations.waapi.push(d.waapi),t.animations.layout.push(d.layout)):r(Ni)}function $i(t){return t.reduce((t,e)=>t+e,0)/t.length}function Wi(t,e=$i){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Ki=t=>Math.round(1e3/t);function zi(){i.value=null,i.addProjectionMetrics=null}function Yi(){const{value:t}=i;if(!t)throw new Error("Stats are not being measured");zi(),r(Ni);const e={frameloop:{setup:Wi(t.frameloop.setup),rate:Wi(t.frameloop.rate),read:Wi(t.frameloop.read),resolveKeyframes:Wi(t.frameloop.resolveKeyframes),preUpdate:Wi(t.frameloop.preUpdate),update:Wi(t.frameloop.update),preRender:Wi(t.frameloop.preRender),render:Wi(t.frameloop.render),postRender:Wi(t.frameloop.postRender)},animations:{mainThread:Wi(t.animations.mainThread),waapi:Wi(t.animations.waapi),layout:Wi(t.animations.layout)},layoutProjection:{nodes:Wi(t.layoutProjection.nodes),calculatedTargetDeltas:Wi(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:Wi(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=Ki(n.min),n.max=Ki(n.max),n.avg=Ki(n.avg),[n.min,n.max]=[n.max,n.min],e}function Xi(t){return Ei(t)&&"svg"===t.tagName}function Gi(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function qi(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=It(t[1+n],t[2+n],t[3+n]);return e?s(i):s}function Hi(t,e){const n=yn(wn(t)?t.get():t);return Zi(n,t,e),n}function Zi(t,e,n={}){const i=t.get();let s,r=null,a=i;const l="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,c=()=>{r&&(r.stop(),r=null)};if(t.attach((e,i)=>{a=e,s=t=>i(_i(t,l)),o.postRender(()=>{(()=>{c();const e=Ji(t.get()),i=Ji(a);e!==i&&(r=new Zt({keyframes:[e,i],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s}))})(),t.events.animationStart?.notify(),r?.then(()=>{t.events.animationComplete?.notify()})})},c),wn(e)){const n=e.on("change",e=>t.set(_i(e,l))),i=t.on("destroy",n);return()=>{n(),i()}}return c}function _i(t,e){return e?t+e:t}function Ji(t){return"number"==typeof t?t:parseFloat(t)}function Qi(t){const e=[];mn.current=e;const n=t();mn.current=void 0;const i=yn(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>o.preRender(i,!1,!0),a=t.map(t=>t.on("change",s));e.on("destroy",()=>{a.forEach(t=>t()),r(i)})}(e,i,t),i}const ts=[...Bn,I,G],es=t=>ts.find(Cn(t));function ns(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let is={},ss=null;const os=(t,e)=>{is[t]=e},rs=()=>{ss||(ss=document.createElement("style"),ss.id="motion-view");let t="";for(const e in is){const n=is[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}ss.textContent=t,document.head.appendChild(ss),is={}},as=()=>{ss&&ss.parentElement&&ss.parentElement.removeChild(ss)};function ls(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function cs(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}function us(){return document.getAnimations().filter(cs)}const hs=["layout","enter","exit","new","old"];function ds(t){const{update:n,targets:i,options:s}=t;if(!document.startViewTransition)return new Promise(async t=>{await n(),t(new Ye([]))});(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||os(":root",{"view-transition-name":"none"}),os("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),rs();const o=document.startViewTransition(async()=>{await n()});return o.finished.finally(()=>{as()}),new Promise(t=>{o.ready.then(()=>{const n=us(),o=[];i.forEach((t,n)=>{for(const i of hs){if(!t[i])continue;const{keyframes:r,options:a}=t[i];for(let[t,l]of Object.entries(r)){if(!l)continue;const r={...an(s,t),...an(a,t)},c=ns(i);if("opacity"===t&&!Array.isArray(l)){l=["new"===c?0:1,l]}"function"==typeof r.delay&&(r.delay=r.delay(0,1)),r.duration&&(r.duration=e.secondsToMilliseconds(r.duration)),r.delay&&(r.delay=e.secondsToMilliseconds(r.delay));const u=new Le({...r,element:document.documentElement,name:t,pseudoElement:`::view-transition-${c}(${n})`,keyframes:l});o.push(u)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:r}=n;if(!r)continue;const a=ls(r);if(!a)continue;const l=i.get(a.layer);if(l)ps(l,"enter")&&ps(l,"exit")&&n.getKeyframes().some(t=>t.mixBlendMode)?o.push(new Ge(t)):t.cancel();else{const i="group"===a.type?"layout":"";let r={...an(s,i)};r.duration&&(r.duration=e.secondsToMilliseconds(r.duration)),r=je(r);const l=Re(r.ease,r.duration);n.updateTiming({delay:e.secondsToMilliseconds(r.delay??0),duration:r.duration,easing:l}),o.push(new Ge(t))}}t(new Ye(o))})})}function ps(t,e){return t?.[e]?.keyframes.opacity}let ms=[],fs=null;function ys(){fs=null;const[t]=ms;var n;t&&(n=t,e.removeItem(ms,n),fs=n,ds(n).then(t=>{n.notifyReady(t),t.finished.finally(ys)}))}function gs(){for(let t=ms.length-1;t>=0;t--){const e=ms[t],{interrupt:n}=e.options;if("immediate"===n){const n=ms.slice(0,t+1).map(t=>t.update),i=ms.slice(t+1);e.update=()=>{n.forEach(t=>t())},ms=[e,...i];break}}fs&&"immediate"!==ms[0]?.options.interrupt||ys()}class vs{constructor(t,n={}){var i;this.currentSubject="root",this.targets=new Map,this.notifyReady=e.noop,this.readyPromise=new Promise(t=>{this.notifyReady=t}),this.update=t,this.options={interrupt:"wait",...n},i=this,ms.push(i),pi.render(gs)}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 xs=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ts=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),ws=()=>({min:0,max:0}),bs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ss=new WeakMap;function Vs(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function As(t){return"string"==typeof t||Array.isArray(t)}const Ps=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ms=["initial",...Ps];function Es(t){return Vs(t.animate)||Ms.some(e=>As(t[e]))}function Ds(t){return Boolean(Es(t)||t.variants)}function ks(t,e,n){for(const i in e){const s=e[i],o=n[i];if(wn(s))t.addValue(i,s);else if(wn(o))t.addValue(i,yn(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,yn(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Rs={current:null},Cs={current:!1},Bs="undefined"!=typeof window;function js(){if(Cs.current=!0,Bs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Rs.current=t.matches;t.addEventListener("change",e),e()}else Rs.current=!1}const Ls=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Fs={};class Os{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=be,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=h.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,o.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=e.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=Es(e),this.isVariantNode=Ds(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:d,...p}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in p){const e=p[t];void 0!==c[t]&&wn(e)&&e.set(c[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Ss.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:(Cs.current||js(),this.shouldReduceMotion=Rs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),r(this.notifyUpdate),r(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,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Jn.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:s,times:o,ease:r,duration:a}=n.accelerate,l=new Le({element:this.current,name:t,keyframes:s,times:o,ease:r,duration:e.secondsToMilliseconds(a)}),c=i(l);return void this.valueSubscriptions.set(t,()=>{c(),l.cancel()})}const i=ue.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&o.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),r&&r(),n.owner&&n.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 Fs){const e=Fs[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<Ls.length;e++){const n=Ls[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=ks(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=yn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,n){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(e.isNumericalString(i)||e.isZeroValueString(i))?i=parseFloat(i):!es(i)&&G.test(n)&&(i=Gn(t,n)),this.setBaseTarget(t,wn(i)?i.get():i)),wn(i)?i.get():i}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=hn(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||wn(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,n){return this.events[t]||(this.events[t]=new e.SubscriptionManager),this.events[t].add(n)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){pi.render(this.render)}}class Is extends Os{constructor(){super(...arguments),this.KeyframeResolver=Hn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;wn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Us({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Ns(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function $s(t){return void 0===t||1===t}function Ws({scale:t,scaleX:e,scaleY:n}){return!$s(t)||!$s(e)||!$s(n)}function Ks(t){return Ws(t)||zs(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function zs(t){return Ys(t.x)||Ys(t.y)}function Ys(t){return t&&"0%"!==t}function Xs(t,e,n){return n+e*(t-n)}function Gs(t,e,n,i,s){return void 0!==s&&(t=Xs(t,s,i)),Xs(t,n,i)+e}function qs(t,e=0,n=1,i,s){t.min=Gs(t.min,e,n,i,s),t.max=Gs(t.max,e,n,i,s)}function Hs(t,{x:e,y:n}){qs(t.x,e.translate,e.scale,e.originPoint),qs(t.y,n.translate,n.scale,n.originPoint)}const Zs=.999999999999,_s=1.0000000000001;function Js(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&eo(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Hs(t,r)),i&&Ks(o.latestValues)&&eo(t,o.latestValues))}e.x<_s&&e.x>Zs&&(e.x=1),e.y<_s&&e.y>Zs&&(e.y=1)}function Qs(t,e){t.min=t.min+e,t.max=t.max+e}function to(t,e,n,i,s=.5){qs(t,e,n,_(t.min,t.max,s),i)}function eo(t,e){to(t.x,e.x,e.scaleX,e.scale,e.originX),to(t.y,e.y,e.scaleY,e.scale,e.originY)}function no(t,e){return Us(Ns(t.getBoundingClientRect(),e))}const io={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},so=ce.length;function oo(t,e,n){let i="",s=!0;for(let o=0;o<so;o++){const r=ce[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=ei(a,Kn[r]);if(!l){s=!1;i+=`${io[r]||r}(${t}) `}n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function ro(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(ue.has(t))r=!0;else if(m(t))s[t]=n;else{const e=ei(n,Kn[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=oo(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}function ao(t,{style:e,vars:n},i,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}function lo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const co={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!B.test(t))return t;t=parseFloat(t)}return`${lo(t,e.target.x)}% ${lo(t,e.target.y)}%`}},uo={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=G.parse(t);if(s.length>5)return i;const o=G.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=_(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},ho={borderRadius:{...co,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:co,borderTopRightRadius:co,borderBottomLeftRadius:co,borderBottomRightRadius:co,boxShadow:uo};function po(t,{layout:e,layoutId:n}){return ue.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!ho[t]||"opacity"===t)}function mo(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(wn(i[e])||s&&wn(s[e])||po(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class fo extends Is{constructor(){super(...arguments),this.type="html",this.renderInstance=ao}readValueFromInstance(t,e){if(ue.has(e))return this.projection?.isProjecting?oe(e):ae(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(m(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return no(t,e)}build(t,e,n){ro(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return mo(t,e,n)}}const yo={offset:"stroke-dashoffset",array:"stroke-dasharray"},go={offset:"strokeDashoffset",array:"strokeDasharray"};function vo(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?yo:go;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const xo=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function To(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(ro(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const t of xo)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&&vo(h,s,o,r,!1)}const wo=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"]),bo=t=>"string"==typeof t&&"svg"===t.toLowerCase();function So(t,e,n,i){ao(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(wo.has(n)?n:Vn(n),e.attrs[n])}function Vo(t,e,n){const i=mo(t,e,n);for(const n in t)if(wn(t[n])||wn(e[n])){i[-1!==ce.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const Ao=Ms.length;function Po(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Po(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Ao;n++){const i=Ms[n],s=t.props[i];(As(s)||!1===s)&&(e[i]=s)}return e}function Mo(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const Eo=[...Ps].reverse(),Do=Ps.length;function ko(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Mo(e,t)}function Ro(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Co(){return{animate:Ro(!0),whileInView:Ro(),whileHover:Ro(),whileTap:Ro(),whileDrag:Ro(),whileFocus:Ro(),exit:Ro()}}function Bo(t,e){t.min=e.min,t.max=e.max}function jo(t,e){Bo(t.x,e.x),Bo(t.y,e.y)}function Lo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Fo(t){return t.max-t.min}function Oo(t,e,n){return Math.abs(t-e)<=n}function Io(t,e,n,i=.5){t.origin=i,t.originPoint=_(e.min,e.max,t.origin),t.scale=Fo(n)/Fo(e),t.translate=_(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Uo(t,e,n,i){Io(t.x,e.x,n.x,i?i.originX:void 0),Io(t.y,e.y,n.y,i?i.originY:void 0)}function No(t,e,n){t.min=n.min+e.min,t.max=t.min+Fo(e)}function $o(t,e,n){No(t.x,e.x,n.x),No(t.y,e.y,n.y)}function Wo(t,e,n){t.min=e.min-n.min,t.max=t.min+Fo(e)}function Ko(t,e,n){Wo(t.x,e.x,n.x),Wo(t.y,e.y,n.y)}function zo(t,e,n,i,s){return t=Xs(t-=e,1/n,i),void 0!==s&&(t=Xs(t,1/s,i)),t}function Yo(t,e=0,n=1,i=.5,s,o=t,r=t){if(C.test(e)){e=parseFloat(e);e=_(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=_(o.min,o.max,i);t===o&&(a-=e),t.min=zo(t.min,e,n,a,s),t.max=zo(t.max,e,n,a,s)}function Xo(t,e,[n,i,s],o,r){Yo(t,e[n],e[i],e[s],e.scale,o,r)}const Go=["x","scaleX","originX"],qo=["y","scaleY","originY"];function Ho(t,e,n,i){Xo(t.x,e,Go,n?n.x:void 0,i?i.x:void 0),Xo(t.y,e,qo,n?n.y:void 0,i?i.y:void 0)}function Zo(t){return 0===t.translate&&1===t.scale}function _o(t){return Zo(t.x)&&Zo(t.y)}function Jo(t,e){return t.min===e.min&&t.max===e.max}function Qo(t,e){return Jo(t.x,e.x)&&Jo(t.y,e.y)}function tr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function er(t,e){return tr(t.x,e.x)&&tr(t.y,e.y)}function nr(t){return Fo(t.x)/Fo(t.y)}function ir(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function sr(t){return[t("x"),t("y")]}function or(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const rr=["TopLeft","TopRight","BottomLeft","BottomRight"],ar=rr.length,lr=t=>"string"==typeof t?parseFloat(t):t,cr=t=>"number"==typeof t||B.test(t);function ur(t,e,n,i,s,o){s?(t.opacity=_(0,n.opacity??1,dr(i)),t.opacityExit=_(e.opacity??1,0,pr(i))):o&&(t.opacity=_(e.opacity??1,n.opacity??1,i));for(let s=0;s<ar;s++){const o=`border${rr[s]}Radius`;let r=hr(e,o),a=hr(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||cr(r)===cr(a)?(t[o]=Math.max(_(lr(r),lr(a),i),0),(C.test(a)||C.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=_(e.rotate||0,n.rotate||0,i))}function hr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const dr=mr(0,.5,e.circOut),pr=mr(.5,.95,e.noop);function mr(t,n,i){return s=>s<t?0:s>n?1:i(e.progress(t,n,s))}function fr(t,e,n){const i=wn(t)?t:yn(t);return i.start(cn("",i,e,n)),i.animation}function yr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}const gr=(t,e)=>t.depth-e.depth;class vr{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(gr),this.isDirty=!1,this.children.forEach(t)}}function xr(t,e){const n=h.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(r(i),t(o-e))};return o.setup(i,!0),()=>r(i)}function Tr(t){return wn(t)?t.get():t}class wr{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1===s.isConnected&&!1!==i.isPresent&&!i.snapshot&&e.removeItem(this.members,i)}t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t],i=e.instance;if(!1!==e.isPresent&&(!i||!1!==i.isConnected)){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender();const i=n.options.layoutDependency,s=t.options.layoutDependency;if(!(void 0!==i&&void 0!==s&&i===s)){const i=n.instance;i&&!1===i.isConnected&&!n.snapshot||(t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:o}=t.options;!1===o&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const br={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Sr={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Vr=["","X","Y","Z"];let Ar=0;function Pr(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Mr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Mn(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",o,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Mr(i)}function Er({attachResizeListener:t,defaultParent:n,measureScroll:s,checkIsScrollRoot:c,resetTransform:u}){return class{constructor(t={},e=n?.()){this.id=Ar++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,i.value&&(Sr.nodes=Sr.calculatedTargetDeltas=Sr.calculatedProjections=0),this.nodes.forEach(Rr),this.nodes.forEach(Ir),this.nodes.forEach(Ur),this.nodes.forEach(Cr),i.addProjectionMetrics&&i.addProjectionMetrics(Sr)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new vr)}addEventListener(t,n){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new e.SubscriptionManager),this.eventHandlers.get(t).add(n)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=Ei(e)&&!Xi(e),this.instance=e;const{layoutId:n,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;o.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=xr(s,250),br.hasAnimatedSinceResize&&(br.hasAnimatedSinceResize=!1,this.nodes.forEach(Or)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Yr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!er(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...an(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||Or(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),r(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Nr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Mr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(jr);if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Lr);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Fr),this.nodes.forEach(Dr),this.nodes.forEach(kr)):this.nodes.forEach(Lr),this.clearAllSnapshots();const t=h.now();a.delta=e.clamp(0,1e3/60,t-a.timestamp),a.timestamp=t,a.isProcessing=!0,l.update.process(a),l.preRender.process(a),l.render.process(a),a.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Br),this.sharedNodes.forEach($r)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,o.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){o.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Fo(this.snapshot.measuredBox.x)||Fo(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=c(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!u)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!_o(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Ks(this.latestValues)||s)&&(u(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),qr((i=n).x),qr(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Zr))){const{scroll:t}=this.root;t&&(Qs(e.x,t.offset.x),Qs(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(jo(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&jo(e,t),Qs(e.x,s.offset.x),Qs(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};jo(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&eo(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Ks(i.latestValues)&&eo(n,i.latestValues)}return Ks(this.latestValues)&&eo(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};jo(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Ks(n.latestValues))continue;Ws(n.latestValues)&&n.updateSnapshot();const i=bs();jo(i,n.measurePageBox()),Ho(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Ks(this.latestValues)&&Ho(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==a.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(!this.layout||!s&&!o)return;this.resolvedRelativeTargetAt=a.timestamp;const r=this.getClosestProjectingParent();r&&this.linkedParentVersion!==r.layoutVersion&&!r.options.layoutRoot&&this.removeRelativeTarget(),this.targetDelta||this.relativeTarget||(r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$o(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):jo(this.target,this.layout.layoutBox),Hs(this.target,this.targetDelta)):jo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,r&&Boolean(r.resumingFrom)===Boolean(this.resumingFrom)&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0),i.value&&Sr.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!Ws(this.parent.latestValues)&&!zs(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.linkedParentVersion=t.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ko(this.relativeTargetOrigin,e,n),jo(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===a.timestamp&&(n=!1),n)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;jo(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,l=this.treeScale.y;Js(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:c}=t;c?(this.projectionDelta&&this.prevProjectionDelta?(Lo(this.prevProjectionDelta.x,this.projectionDelta.x),Lo(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Uo(this.projectionDelta,this.layoutCorrected,c,this.latestValues),this.treeScale.x===r&&this.treeScale.y===l&&ir(this.projectionDelta.x,this.prevProjectionDelta.x)&&ir(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",c)),i.value&&Sr.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(zr));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m;Wr(o.x,t.x,n),Wr(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ko(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,d=this.relativeTargetOrigin,p=r,m=n,Kr(l.x,d.x,p.x,m),Kr(l.y,d.y,p.y,m),h&&Qo(this.relativeTarget,h)&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),jo(h,this.relativeTarget)),a&&(this.animationValues=s,ur(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(r(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=o.update(()=>{br.hasAnimatedSinceResize=!0,d.layout++,this.motionValue||(this.motionValue=yn(0)),this.motionValue.jump(0,!1),this.currentAnimation=fr(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{d.layout--},onComplete:()=>{d.layout--,t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Hr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Fo(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Fo(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}jo(e,n),eo(e,s),Uo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new wr);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Pr("z",t,i,this.animationValues);for(let e=0;e<Vr.length;e++)Pr(`rotate${Vr[e]}`,t,i,this.animationValues),Pr(`skew${Vr[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=Tr(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Tr(e?.pointerEvents)||""),void(this.hasProjected&&!Ks(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=or(this.projectionDeltaWithTransform,this.treeScale,s);n&&(o=n(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in ho){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=ho[e],l="none"===o?s[e]:n(s[e],i);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=i===this?Tr(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(jr),this.root.sharedNodes.clear()}}}function Dr(t){t.updateLayout()}function kr(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?sr(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Fo(i);i.min=n[t].min,i.max=i.min+s}):Hr(s,e.layoutBox,n)&&sr(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Fo(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Uo(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Uo(a,t.applyTransform(i,!0),e.measuredBox):Uo(a,n,e.layoutBox);const l=!_o(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Ko(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ko(a,n,o.layoutBox),er(r,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Rr(t){i.value&&Sr.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Cr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Br(t){t.clearSnapshot()}function jr(t){t.clearMeasurements()}function Lr(t){t.isLayoutDirty=!1}function Fr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Or(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ir(t){t.resolveTargetDelta()}function Ur(t){t.calcProjection()}function Nr(t){t.resetSkewAndRotation()}function $r(t){t.removeLeadSnapshot()}function Wr(t,e,n){t.translate=_(e.translate,0,n),t.scale=_(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Kr(t,e,n,i){t.min=_(e.min,n.min,i),t.max=_(e.max,n.max,i)}function zr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Yr={duration:.45,ease:[.4,0,.1,1]},Xr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Gr=Xr("applewebkit/")&&!Xr("chrome/")?Math.round:e.noop;function qr(t){t.min=Gr(t.min),t.max=Gr(t.max)}function Hr(t,e,n){return"position"===t||"preserve-aspect"===t&&!Oo(nr(e),nr(n),.2)}function Zr(t){return t!==t.root&&t.scroll?.wasRoot}const _r=Er({attachResizeListener:(t,e)=>yr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Jr=t=>!t.isLayoutDirty&&t.willUpdate(!1);const Qr={current:void 0},ta=Er({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Qr.current){const t=new _r({});t.mount(window),t.setOptions({layoutScroll:!0}),Qr.current=t}return Qr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ea="[data-layout], [data-layout-id]",na=()=>{};function ia(t){const e=Array.from(t.querySelectorAll(ea));return t instanceof Element&&t.matches(ea)&&(e.includes(t)||e.unshift(t)),e}function sa(t){const e=t.getAttribute("data-layout-id")||void 0,n=t.getAttribute("data-layout");let i;return""===n||"true"===n?i=!0:n&&(i=n),{layout:i,layoutId:e}}function oa(t,e,n){const i=Ss.get(t),s=i??new fo({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0});return i&&s.projection||(s.projection=new ta(s.latestValues,e)),s.projection.setOptions({...n,visualElement:s}),s.current?s.projection.instance||s.projection.mount(t):s.mount(t),i||Ss.set(t,s),{element:t,visualElement:s,projection:s.projection}}function ra(t,e,n){let i=t.parentElement;for(;i;){const t=e.get(i);if(t)return t;if(i===n)break;i=i.parentElement}}const aa=o,la=n.reduce((t,e)=>(t[e]=t=>r(t),t),{});t.AsyncMotionValueAnimation=ze,t.DOMKeyframesResolver=Hn,t.DOMVisualElement=Is,t.DocumentProjectionNode=_r,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=vr,t.GroupAnimation=Ye,t.GroupAnimationWithThen=class extends Ye{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=ta,t.HTMLVisualElement=fo,t.JSAnimation=Zt,t.KeyframeResolver=be,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.sharedTransitions=new Map,this.notifyReady=na,this.rejectReady=na,this.scope=t,this.updateDom=e,this.defaultOptions=n,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),o.postRender(()=>{this.start().then(this.notifyReady).catch(this.rejectReady)})}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}async start(){const t=ia(this.scope),e=this.buildRecords(t);e.forEach(({projection:t})=>{const e=Boolean(t.currentAnimation),n=Boolean(t.options.layoutId);if(e&&n){const e=function(t){const e=t.targetWithTransforms||t.target;if(!e)return;const n={x:{min:0,max:0},y:{min:0,max:0}},i={x:{min:0,max:0},y:{min:0,max:0}};return jo(n,e),jo(i,e),{animationId:t.root?.animationId??0,measuredBox:n,layoutBox:i,latestValues:t.animationValues||t.latestValues||{},source:t.id}}(t);e?t.snapshot=e:t.snapshot&&(t.snapshot=void 0)}else t.snapshot&&(t.currentAnimation||t.isProjecting())&&(t.snapshot=void 0);t.isPresent=!0,t.willUpdate()}),await this.updateDom();const n=ia(this.scope),i=this.buildRecords(n);this.handleExitingElements(e,i),i.forEach(({projection:t})=>{const e=t.instance,n=t.resumeFrom?.instance;if(!e||!n)return;if(!("style"in e))return;const i=e.style.transform,s=n.style.transform;i&&s&&i===s&&(e.style.transform="",e.style.transformOrigin="")}),i.forEach(({projection:t})=>{t.isPresent=!0});const s=function(t,e){const n=t[0]||e[0];return n?.projection.root}(i,e);s?.didUpdate(),await new Promise(t=>{o.postRender(()=>t())});const r=function(t){const e=new Set;return t.forEach(t=>{const n=t.projection.currentAnimation;n&&e.add(n)}),Array.from(e)}(i);return new Ye(r)}buildRecords(t){const e=[],n=new Map;for(const i of t){const t=ra(i,n,this.scope),{layout:s,layoutId:o}=sa(i),r=(o?this.sharedTransitions.get(o):void 0)||this.defaultOptions,a=oa(i,t?.projection,{layout:s,layoutId:o,animationType:"string"==typeof s?s:"both",transition:r});n.set(i,a),e.push(a)}return e}handleExitingElements(t,e){const n=new Set(e.map(t=>t.element));t.forEach(t=>{n.has(t.element)||(t.projection.options.layoutId&&(t.projection.isPresent=!1,t.projection.relegate()),t.visualElement.unmount(),Ss.delete(t.element))});const i=new Set(t.map(t=>t.element));e.forEach(({element:t,projection:e})=>{i.has(t)&&e.resumeFrom&&!e.resumeFrom.instance&&!e.isLead()&&(e.resumeFrom=void 0,e.snapshot=void 0)})}},t.MotionValue=fn,t.NativeAnimation=Le,t.NativeAnimationExtended=Ie,t.NativeAnimationWrapper=Ge,t.NodeStack=wr,t.ObjectVisualElement=class extends Os{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}},t.SVGVisualElement=class extends Is{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bs}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ue.has(e)){const t=Yn(e);return t&&t.default||0}return e=wo.has(e)?e:Vn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Vo(t,e,n)}build(t,e,n){To(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){So(t,e,0,i)}mount(t){this.isSVGTag=bo(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=vs,t.VisualElement=Os,t.acceleratedValues=Jn,t.activeAnimations=d,t.addAttrValue=si,t.addDomEvent=yr,t.addScaleCorrector=function(t){for(const e in t)ho[e]=t[e],m(e)&&(ho[e].isCSSVariable=!0)},t.addStyleValue=ui,t.addValueToWillChange=Sn,t.alpha=T,t.analyseComplexValue=K,t.animateMotionValue=cn,t.animateSingleValue=fr,t.animateTarget=Dn,t.animateValue=function(t){return new Zt(t)},t.animateVariant=kn,t.animateView=function(t,e={}){return new vs(t,e)},t.animateVisualElement=Rn,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=qs,t.applyBoxDelta=Hs,t.applyGeneratorOptions=je,t.applyPointDelta=Gs,t.applyPxDefaults=function(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&Zn.has(e)&&(t[n]=t[n]+"px")},t.applyTreeDeltas=Js,t.aspectRatio=nr,t.attachFollow=Zi,t.attachSpring=function(t,e,n){return Zi(t,e,{type:"spring",...n})},t.attrEffect=oi,t.axisDeltaEquals=ir,t.axisEquals=Jo,t.axisEqualsRounded=tr,t.boxEquals=Qo,t.boxEqualsRounded=er,t.buildHTMLStyles=ro,t.buildProjectionTransform=or,t.buildSVGAttrs=To,t.buildSVGPath=vo,t.buildTransform=oo,t.calcAxisDelta=Io,t.calcBoxDelta=Uo,t.calcChildStagger=He,t.calcGeneratorDuration=pt,t.calcLength=Fo,t.calcRelativeAxis=No,t.calcRelativeAxisPosition=Wo,t.calcRelativeBox=$o,t.calcRelativePosition=Ko,t.camelCaseAttributes=wo,t.camelToDash=Vn,t.cancelFrame=r,t.cancelMicrotask=mi,t.cancelSync=la,t.checkVariantsDidChange=ko,t.cleanDirtyNodes=Cr,t.collectMotionValues=mn,t.color=I,t.compareByDepth=gr,t.complex=G,t.containsCSSVariable=v,t.convertBoundingBoxToBox=Us,t.convertBoxToBoundingBox=function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}},t.convertOffsetToTimes=$t,t.copyAxisDeltaInto=Lo,t.copyAxisInto=Bo,t.copyBoxInto=jo,t.correctBorderRadius=co,t.correctBoxShadow=uo,t.createAnimationState=function(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>Rn(t,e,n)))}(t),n=Co(),i=!0;const s=e=>(n,i)=>{const s=dn(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=Po(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;e<Do;e++){const d=Eo[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],f=As(m),y=d===o?p.isActive:null;!1===y&&(h=e);let g=m===a[d]&&m!==r[d]&&f;if(g&&i&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...u},!p.isActive&&null===y||!m&&!p.prevProp||Vs(m)||"boolean"==typeof m)continue;if("exit"===d&&p.isActive&&!0!==y){p.prevResolvedValues&&(u={...u,...p.prevResolvedValues});continue}const v=ko(p.prevProp,m);let x=v||d===o&&p.isActive&&!g&&f||e>h&&f,T=!1;const w=Array.isArray(m)?m:[m];let b=w.reduce(s(d),{});!1===y&&(b={});const{prevResolvedValues:S={}}=p,V={...S,...b},A=e=>{x=!0,c.has(e)&&(T=!0,c.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in V){const e=b[t],n=S[t];if(u.hasOwnProperty(t))continue;let i=!1;i=gn(e)&&gn(n)?!Mo(e,n):e!==n,i?null!=e?A(t):c.add(t):void 0!==e&&c.has(t)?A(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=b,p.isActive&&(u={...u,...b}),i&&t.blockInitialAnimation&&(x=!1);const P=g&&v;x&&(!P||T)&&l.push(...w.map(e=>{const n={type:d};if("string"==typeof e&&i&&!P&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=dn(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=He(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(c.size){const e={};if("boolean"!=typeof r.initial){const n=dn(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Co()}}},t.createAxis=ws,t.createAxisDelta=xs,t.createBox=bs,t.createDelta=Ts,t.createGeneratorEasing=mt,t.createProjectionNode=Er,t.createRenderBatcher=s,t.cubicBezierAsString=De,t.defaultEasing=Wt,t.defaultOffset=Nt,t.defaultTransformValue=oe,t.defaultValueTypes=zn,t.degrees=R,t.delay=xr,t.delayInSeconds=function(t,n){return xr(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=Bn,t.eachAxis=sr,t.fillOffset=Ut,t.fillWildcards=_t,t.findDimensionValueType=jn,t.findValueType=es,t.flushKeyframeResolvers=we,t.followValue=Hi,t.frame=o,t.frameData=a,t.frameSteps=l,t.generateLinearEasing=ht,t.getAnimatableNone=Gn,t.getAnimationMap=function(t){const e=qe.get(t)||new Map;return qe.set(t,e),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return Se(e)?n.getPropertyValue(e):n[e]},t.getDefaultTransition=nn,t.getDefaultValueType=Yn,t.getFeatureDefinitions=function(){return Fs},t.getFinalKeyframe=on,t.getMixer=ot,t.getOptimisedAppearId=Mn,t.getOriginIndex=Gi,t.getValueAsType=ei,t.getValueTransition=an,t.getVariableValue=Je,t.getVariantContext=Po,t.getViewAnimationLayerInfo=ls,t.getViewAnimations=us,t.globalProjectionState=br,t.has2DTranslate=zs,t.hasReducedMotionListener=Cs,t.hasScale=Ws,t.hasTransform=Ks,t.hex=D,t.hover=function(t,e,n={}){const[i,s,o]=gi(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||yi())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o},t.hsla=O,t.hslaToRgba=H,t.inertia=Ot,t.initPrefersReducedMotion=js,t.interpolate=It,t.invisibleValues=nt,t.isAnimationControls=Vs,t.isCSSVariableName=m,t.isCSSVariableToken=y,t.isControllingVariants=Es,t.isDeltaZero=_o,t.isDragActive=yi,t.isDragging=fi,t.isElementKeyboardAccessible=wi,t.isElementTextInput=function(t){return bi.has(t.tagName)||!0===t.isContentEditable},t.isForcedMotionValue=po,t.isGenerator=Be,t.isHTMLElement=ai,t.isKeyframesTarget=gn,t.isMotionValue=wn,t.isNear=Oo,t.isNodeOrChild=vi,t.isPrimaryPointer=xi,t.isSVGElement=Ei,t.isSVGSVGElement=Xi,t.isSVGTag=bo,t.isTransitionDefined=ln,t.isVariantLabel=As,t.isVariantNode=Ds,t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&Ee()||!n||"string"==typeof n&&(n in ke||Ee())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.isWillChangeMotionValue=bn,t.keyframes=Kt,t.makeAnimationInstant=Ne,t.mapEasingToNativeEasing=Re,t.mapValue=function(t,e,n,i){const s=qi(e,n,i);return Qi(()=>s(t.get()))},t.maxGeneratorDuration=dt,t.measurePageBox=function(t,e,n){const i=no(t,n),{scroll:s}=e;return s&&(Qs(i.x,s.offset.x),Qs(i.y,s.offset.y)),i},t.measureViewportBox=no,t.microtask=pi,t.mix=ct,t.mixArray=rt,t.mixColor=et,t.mixComplex=lt,t.mixImmediate=Z,t.mixLinearColor=J,t.mixNumber=_,t.mixObject=at,t.mixValues=ur,t.mixVisibility=it,t.motionValue=yn,t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Jr);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}},t.number=x,t.numberValueTypes=Kn,t.observeTimeline=function(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return o.preUpdate(i,!0),()=>r(i)},t.optimizedAppearDataAttribute=Pn,t.optimizedAppearDataId=An,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:Qn(t)[0]||document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=_e,t.parseValueFromTransform=re,t.percent=C,t.pixelsToPercent=lo,t.positionalKeys=pn,t.prefersReducedMotion=Rs,t.press=function(t,e,n={}){const[i,s,o]=gi(t,n),r=t=>{const i=t.currentTarget;if(!Pi(t))return;if(Mi.has(t))return;Si.add(i),n.stopPropagation&&Mi.add(t);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Si.has(i)&&Si.delete(i),Pi(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||vi(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),ai(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Vi(()=>{if(Si.has(n))return;Ai(n,"down");const t=Vi(()=>{Ai(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ai(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),wi(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o},t.progressPercentage=F,t.propEffect=ri,t.propagateDirtyNodes=Rr,t.px=B,t.readTransformValue=ae,t.recordStats=function(){if(i.value)throw zi(),new Error("Stats are already being measured");const t=i;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)},o.postRender(Ni,!0),Yi},t.removeAxisDelta=Yo,t.removeAxisTransforms=Xo,t.removeBoxTransforms=Ho,t.removePointDelta=zo,t.renderHTML=ao,t.renderSVG=So,t.resize=function(t,e){return"function"==typeof t?Ui(t):Fi(t,e)},t.resolveElements=Qn,t.resolveMotionValue=Tr,t.resolveTransition=rn,t.resolveVariant=dn,t.resolveVariantFromProps=hn,t.rgbUnit=M,t.rgba=E,t.rootProjectionNode=Qr,t.scale=w,t.scaleCorrectors=ho,t.scalePoint=Xs,t.scrapeHTMLMotionValuesFromProps=mo,t.scrapeSVGMotionValuesFromProps=Vo,t.setDragLock=function(t){return"x"===t||"y"===t?fi[t]?null:(fi[t]=!0,()=>{fi[t]=!1}):fi.x||fi.y?null:(fi.x=fi.y=!0,()=>{fi.x=fi.y=!1})},t.setFeatureDefinitions=function(t){Fs=t},t.setStyle=Ve,t.setTarget=Tn,t.spring=Ft,t.springValue=function(t,e){return Hi(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s}={}){return(o,r)=>{const a="number"==typeof i?i:Gi(i,r),l=Math.abs(a-o);let c=t*l;if(s){const n=r*t;c=e.easingDefinitionToFunction(s)(c/n)*n}return n+c}},t.startWaapiAnimation=Ce,t.statsBuffer=i,t.styleEffect=hi,t.supportedWaapiEasing=ke,t.supportsBrowserAnimation=Ke,t.supportsFlags=Ae,t.supportsLinearEasing=Ee,t.supportsPartialKeyframes=_n,t.supportsScrollTimeline=Me,t.svgEffect=di,t.sync=aa,t.testValueType=Cn,t.time=h,t.transform=qi,t.transformAxis=to,t.transformBox=eo,t.transformBoxPoints=Ns,t.transformPropOrder=ce,t.transformProps=ue,t.transformValue=Qi,t.transformValueTypes=Wn,t.translateAxis=Qs,t.updateMotionValuesFromProps=ks,t.variantPriorityOrder=Ps,t.variantProps=Ms,t.vh=j,t.visualElementStore=Ss,t.vw=L});
|