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