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