UNPKG

motion-dom

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