function t(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const e=(t,e,n)=>n>e?e:n{},i=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(s=(t,e,s)=>{t||"undefined"==typeof console||console.warn(n(e,s))},i=(t,e,s)=>{if(!t)throw new Error(n(e,s))});const r={},a=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);const o=t=>/^0[^.\s]+$/u.test(t);function l(t){let e;return()=>(void 0===e&&(e=t()),e)}const u=t=>t,h=(t,e)=>n=>e(t(n)),c=(...t)=>t.reduce(h),d=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class p{constructor(){this.subscriptions=[]}add(e){var n,s;return n=this.subscriptions,s=e,-1===n.indexOf(s)&&n.push(s),()=>t(this.subscriptions,e)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i1e3*t,f=t=>t/1e3;function g(t,e){return e?t*(1e3/e):0}const y=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function v(t,e,n,s){if(t===e&&n===s)return u;const i=e=>function(t,e,n,s,i){let r,a,o=0;do{a=e+(n-e)/2,r=y(a,s,i)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:y(i(t),e,s)}const b=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,T=t=>e=>1-t(1-e),w=v(.33,1.53,.69,.99),M=T(w),S=b(M),x=t=>t>=1?1:(t*=2)<1?.5*M(t):.5*(2-Math.pow(2,-10*(t-1))),A=t=>1-Math.sin(Math.acos(t)),V=T(A),k=b(A),C=v(.42,0,1,1),F=v(0,0,.58,1),P=v(.42,0,.58,1),E=t=>Array.isArray(t)&&"number"!=typeof t[0];function B(t,e){return E(t)?t[((t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t})(0,t.length,e)]:t}const R=t=>Array.isArray(t)&&"number"==typeof t[0],D={linear:u,easeIn:C,easeInOut:P,easeOut:F,circIn:A,circInOut:k,circOut:V,backIn:M,backInOut:S,backOut:w,anticipate:x},I=t=>{if(R(t)){i(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,r]=t;return v(e,n,s,r)}return"string"==typeof t?(i(void 0!==D[t],`Invalid easing type '${t}'`,"invalid-easing-type"),D[t]):t},O=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function N(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=O.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(e){r.has(e)&&(l.schedule(e),t()),e(a)}const l={schedule:(t,i=!1,a=!1)=>{const o=a&&s?e:n;return i&&r.add(t),o.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{if(a=t,s)return void(i=!0);s=!0;const r=e;e=n,n=r,e.forEach(o),e.clear(),s=!1,i&&(i=!1,l.process(t))}};return l}(a),t),{}),{setup:l,read:u,resolveKeyframes:h,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=o,g=()=>{const a=r.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=s?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,l.process(i),u.process(i),h.process(i),c.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))};return{schedule:O.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(g)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e(void 0===W&&Y.set(j.isProcessing||r.useManualTiming?j.timestamp:performance.now()),W),set:t=>{W=t,queueMicrotask(L)}},U=t=>e=>"string"==typeof e&&e.startsWith(t),X=U("--"),q=U("var(--"),z=t=>!!q(t)&&Z.test(t.split("/*")[0].trim()),Z=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const H={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},G={...H,transform:t=>e(0,1,t)},J={...H,default:1},Q=t=>Math.round(1e5*t)/1e5,tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const et=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,nt=(t,e)=>n=>Boolean("string"==typeof n&&et.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),st=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,a,o]=s.match(tt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},it={...H,transform:t=>Math.round((t=>e(0,255,t))(t))},rt={test:nt("rgb","red"),parse:st("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+it.transform(t)+", "+it.transform(e)+", "+it.transform(n)+", "+Q(G.transform(s))+")"};const at={test:nt("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:rt.transform},ot=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),lt=ot("deg"),ut=ot("%"),ht=ot("px"),ct=ot("vh"),dt=ot("vw"),pt=(()=>({...ut,parse:t=>ut.parse(t)/100,transform:t=>ut.transform(100*t)}))(),mt={test:nt("hsl","hue"),parse:st("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ut.transform(Q(e))+", "+ut.transform(Q(n))+", "+Q(G.transform(s))+")"},ft={test:t=>rt.test(t)||at.test(t)||mt.test(t),parse:t=>rt.test(t)?rt.parse(t):mt.test(t)?mt.parse(t):at.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?rt.transform(t):mt.transform(t),getAnimatableNone:t=>{const e=ft.parse(t);return e.alpha=0,ft.transform(e)}},gt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const yt="number",vt="color",bt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Tt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(bt,t=>(ft.test(t)?(s.color.push(r),i.push(vt),n.push(ft.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(yt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:s,types:i}}function wt({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:ft.test(n)?ft.getAnimatableNone(n):n;var n};const St={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(tt)?.length||0)+(t.match(gt)?.length||0)>0},parse:function(t){return Tt(t).values},createTransformer:function(t){return wt(Tt(t))},getAnimatableNone:function(t){const e=Tt(t);return wt(e)(e.values.map((t,n)=>Mt(t,e.split[n])))}};function xt(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 At(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>t+(e-t)*n,kt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ct=[at,rt,mt];function Ft(t){const e=(n=t,Ct.find(t=>t.test(n)));var n;if(s(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===mt&&(i=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,a=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,o=2*n-s;i=xt(o,s,t+1/3),r=xt(o,s,t),a=xt(o,s,t-1/3)}else i=r=a=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:s}}(i)),i}const Pt=(t,e)=>{const n=Ft(t),s=Ft(e);if(!n||!s)return At(t,e);const i={...n};return t=>(i.red=kt(n.red,s.red,t),i.green=kt(n.green,s.green,t),i.blue=kt(n.blue,s.blue,t),i.alpha=Vt(n.alpha,s.alpha,t),rt.transform(i))},Et=new Set(["none","hidden"]);function Bt(t,e){return n=>Vt(t,e,n)}function Rt(t){return"number"==typeof t?Bt:"string"==typeof t?z(t)?At:ft.test(t)?Pt:Ot:Array.isArray(t)?Dt:"object"==typeof t?ft.test(t)?Pt:It:At}function Dt(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Rt(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const Ot=(t,e)=>{const n=St.createTransformer(e),i=Tt(t),r=Tt(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?Et.has(t)&&!r.values.length||Et.has(e)&&!i.values.length?function(t,e){return Et.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):c(Dt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>$.update(e,t),stop:()=>K(e),now:()=>j.isProcessing?j.timestamp:Y.now()}},Kt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e=jt?1/0:e}function Lt(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Wt(s),jt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:f(i)}}const Yt=100,Ut=10,Xt=1,qt=0,zt=800,Zt=.3,_t=.3,Ht={granular:.01,default:2},Gt={granular:.005,default:.5},Jt=.01,Qt=10,te=.05,ee=1;function ne(t,e){return t*Math.sqrt(1-e*e)}const se=.001;const ie=["duration","bounce"],re=["stiffness","damping","mass"];function ae(t,e){return e.some(e=>void 0!==t[e])}function oe(t){let n={velocity:qt,stiffness:Yt,damping:Ut,mass:Xt,isResolvedFromDuration:!1,...t};if(!ae(t,re)&&ae(t,ie))if(n.velocity=0,t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),r=i*i,a=2*e(.05,1,1-(t.bounce||0))*Math.sqrt(r);n={...n,mass:Xt,stiffness:r,damping:a}}else{const i=function({duration:t=zt,bounce:n=Zt,velocity:i=qt,mass:r=Xt}){let a,o;s(t<=m(Qt),"Spring duration must be 10 seconds or less","spring-duration-limit");let l=1-n;l=e(te,ee,l),t=e(Jt,Qt,f(t)),l<1?(a=e=>{const n=e*l,s=n*t,r=n-i,a=ne(e,l),o=Math.exp(-s);return se-r/a*o},o=e=>{const n=e*l*t,s=n*i+i,r=Math.pow(l,2)*Math.pow(e,2)*t,o=Math.exp(-n),u=ne(Math.pow(e,2),l);return(-a(e)+se>0?-1:1)*((s-r)*o)/u}):(a=e=>Math.exp(-e*t)*((e-i)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(i-e)));const u=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(a,o,5/t);if(t=m(t),isNaN(u))return{stiffness:Yt,damping:Ut,duration:t};{const e=Math.pow(u,2)*r;return{stiffness:e,damping:2*l*Math.sqrt(r*e),duration:t}}}({...t,velocity:0});n={...n,...i,mass:Xt},n.isResolvedFromDuration=!0}return n}function le(t=_t,e=Zt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:u,mass:h,duration:c,velocity:d,isResolvedFromDuration:p}=oe({...n,velocity:-f(n.velocity||0)}),g=d||0,y=u/(2*Math.sqrt(l*h)),v=a-r,b=f(Math.sqrt(l/h)),T=Math.abs(v)<5;let w,M,S,x,A,V;if(s||(s=T?Ht.granular:Ht.default),i||(i=T?Gt.granular:Gt.default),y<1)S=ne(b,y),x=(g+y*b*v)/S,w=t=>{const e=Math.exp(-y*b*t);return a-e*(x*Math.sin(S*t)+v*Math.cos(S*t))},A=y*b*x+v*S,V=y*b*v-x*S,M=t=>Math.exp(-y*b*t)*(A*Math.sin(S*t)+V*Math.cos(S*t));else if(1===y){w=t=>a-Math.exp(-b*t)*(v+(g+b*v)*t);const t=g+b*v;M=e=>Math.exp(-b*e)*(b*t*e-g)}else{const t=b*Math.sqrt(y*y-1);w=e=>{const n=Math.exp(-y*b*e),s=Math.min(t*e,300);return a-n*((g+y*b*v)*Math.sinh(s)+t*v*Math.cosh(s))/t};const e=(g+y*b*v)/t,n=y*b*e-v*t,s=y*b*v-e*t;M=e=>{const i=Math.exp(-y*b*e),r=Math.min(t*e,300);return i*(n*Math.sinh(r)+s*Math.cosh(r))}}const k={calculatedDuration:p&&c||null,velocity:t=>m(M(t)),next:t=>{if(!p&&y<1){const e=Math.exp(-y*b*t),n=Math.sin(S*t),r=Math.cos(S*t),l=a-e*(x*n+v*r),u=m(e*(A*n+V*r));return o.done=Math.abs(u)<=s&&Math.abs(a-l)<=i,o.value=o.done?a:l,o}const e=w(t);if(p)o.done=t>=c;else{const n=m(M(t));o.done=Math.abs(n)<=s&&Math.abs(a-e)<=i}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(Wt(k),jt),e=Kt(e=>k.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return k}le.applyToOptions=t=>{const e=Lt(t,100,le);return t.ease=e.ease,t.duration=m(e.duration),t.type="keyframes",t};function ue(t,e,n){const s=Math.max(e-5,0);return g(n-t(s),e-s)}function he({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)-m*Math.exp(-t/s),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let T,w;const M=t=>{var e;(e=d.value,void 0!==o&&el)&&(T=t,w=le({keyframes:[d.value,p(d.value)],velocity:ue(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:h}))};return M(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,b(t),M(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&b(t),d)}}}function ce(t,n,{clamp:s=!0,ease:a,mixer:o}={}){const l=t.length;if(i(l===n.length,"Both input and output ranges must be the same length","range-length"),1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const h=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const s=[],i=n||r.mix||Nt,a=t.length-1;for(let n=0;n{if(h&&e1)for(;sf(e(t[0],t[l-1],n)):f}function de(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=d(0,e,s);t.push(Vt(n,1,i))}}function pe(t){const e=[0];return de(e,t.length-1),e}function me({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=E(s)?s.map(I):I(s),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:pe(e),t),o=ce(a,e,{ease:Array.isArray(i)?i:(l=e,u=i,l.map(()=>u||P).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const fe=t=>null!==t;function ge(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(fe),a=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==s?s:r[a]}const ye={decay:he,inertia:he,tween:me,keyframes:me,spring:le};function ve(t){"string"==typeof t.type&&(t.type=ye[t.type])}class be{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Te=t=>t/100;class we extends be{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Y.now()&&this.tick(Y.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ve(t);const{type:e=me,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const o=e||me;o!==me&&"number"!=typeof a[0]&&(this.mixKeyframes=c(Te,Nt(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Wt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(null===this.startTime)return s.next(0);const{delay:u=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let b=this.currentTime,T=s;if(c){const t=Math.min(this.currentTime,i)/o;let n=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&n--,n=Math.min(n,c+1);Boolean(n%2)&&("reverse"===d?(s=1-s,p&&(s-=p/o)):"mirror"===d&&(T=a)),b=e(0,1,s)*o}const w=v?{done:!1,value:h[0]}:T.next(b);r&&!v&&(w.value=r(w.value));let{done:M}=w;v||null===l||(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&M);return S&&m!==he&&(w.value=ge(h,this.options,g,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return f(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(this.currentTime)}set time(t){t=m(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return ue(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(Y.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=f(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=$t,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Y.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 Me=t=>180*t/Math.PI,Se=t=>{const e=Me(Math.atan2(t[1],t[0]));return Ae(e)},xe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Se,rotateZ:Se,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},Ae=t=>((t%=360)<0&&(t+=360),t),Ve=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ke=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ce={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ve,scaleY:ke,scale:t=>(Ve(t)+ke(t))/2,rotateX:t=>Ae(Me(Math.atan2(t[6],t[5]))),rotateY:t=>Ae(Me(Math.atan2(-t[2],t[0]))),rotateZ:Se,rotate:Se,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 Fe(t){return t.includes("scale")?1:0}function Pe(t,e){if(!t||"none"===t)return Fe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ce,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=xe,i=e}if(!i)return Fe(e);const r=s[e],a=i[1].split(",").map(Ee);return"function"==typeof r?r(a):a[r]}function Ee(t){return parseFloat(t.trim())}const Be=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Re=(()=>new Set(Be))(),De=t=>t===H||t===ht,Ie=new Set(["x","y","z"]),Oe=Be.filter(t=>!Ie.has(t));const Ne={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return"border-box"===s?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return"border-box"===s?i:i-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Pe(e,"x"),y:(t,{transform:e})=>Pe(e,"y")};Ne.translateX=Ne.x,Ne.translateY=Ne.y;const $e=new Set;let Ke=!1,je=!1,We=!1;function Le(){if(je){const t=Array.from($e).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Oe.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}je=!1,Ke=!1,$e.forEach(t=>t.complete(We)),$e.clear()}function Ye(){$e.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(je=!0)})}class Ue{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?($e.add(this),Ke||(Ke=!0,$.read(Ye),$.resolveKeyframes(Le))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}!function(t){for(let e=1;et.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const qe={};function ze(t,e){const n=l(t);return()=>qe[e]??n()}const Ze=ze(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),_e=ze(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),He=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ge={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 Je(t,e){return t?"function"==typeof t?_e()?Kt(t,e):"ease-out":R(t)?He(t):Array.isArray(t)?t.map(t=>Je(t,e)||Ge.easeOut):Ge[t]:void 0}function Qe(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u=void 0){const h={[e]:n};l&&(h.offset=l);const c=Je(o,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};u&&(d.pseudoElement=u);return t.animate(h,d)}function tn(t){return"function"==typeof t&&"applyToOptions"in t}class en extends be{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=a,this.options=t,i("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=function({type:t,...e}){return tn(t)&&_e()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Qe(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=ge(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Xe(e,n,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return f(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+f(t)}get time(){return f(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=m(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Ze()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),u):s(this)}}const nn={anticipate:x,backInOut:S,circInOut:k};function sn(t){"string"==typeof t.ease&&t.ease in nn&&(t.ease=nn[t.ease])}class rn extends en{constructor(t){sn(t),ve(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const o=new we({...a,autoplay:!1}),l=Math.max(10,Y.now()-this.startTime),u=e(0,10,l-10),h=o.sample(l).value,{name:c}=this.options;r&&c&&Xe(r,c,h),n.setWithVelocity(o.sample(Math.max(0,l-u)).value,h,u),o.stop()}}const an=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!St.test(t)&&"0"!==t||t.startsWith("url(")));function on(t){t.duration=0,t.type="keyframes"}const ln=new Set(["opacity","clipPath","filter","transform"]),un=l(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class hn extends be{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Y.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:o,motionValue:l,element:u,...h},d=u?.KeyframeResolver||Ue;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),o,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:h,isHandoff:c,onUpdate:d}=n;this.resolvedAt=Y.now();let p=!0;(function(t,e,n,i){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const a=t[t.length-1],o=an(r,e),l=an(a,e);return s(o===l,`You are trying to animate ${e} from "${r}" to "${a}". "${o?a:r}" is not an animatable value.`,"value-not-animatable"),!(!o||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},f=p&&!c&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=t,o=e?.owner?.current;if(!(o instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return un()&&n&&ln.has(n)&&("transform"!==n||!u)&&!l&&!s&&"mirror"!==i&&0!==r&&"inertia"!==a}(m),g=m.motionValue?.owner?.current,y=f?new rn({...m,element:g}):new we(m);y.finished.then(()=>{this.notifyFinished()}).catch(u),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),We=!0,Ye(),Le(),We=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class cn{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;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 dn(this.animations,"duration")}get iterationDuration(){return dn(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 dn(t,e){let n=0;for(let s=0;sn&&(n=i)}return n}class pn extends cn{then(t,e){return this.finished.finally(t).then(()=>{})}}const mn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fn(t,e,n=1){i(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=function(t){const e=mn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const t=o.trim();return a(t)?parseFloat(t):t}return z(r)?fn(r,e,n+1):r}const gn={type:"spring",stiffness:500,damping:25,restSpeed:10},yn={type:"keyframes",duration:.8},vn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bn=(t,{keyframes:e})=>e.length>2?yn:Re.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:gn:vn,Tn=t=>null!==t;function wn(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function Mn(t,e){const n=t?.[e]??t?.default??t;return n!==t?wn(n,t):n}const Sn=(t,e,n,s={},i,a)=>o=>{const l=Mn(s,t)||{},u=l.delay||s.delay||0;let{elapsed:h=0}=s;h-=m(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-h,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:a?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:o,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(l)||Object.assign(c,bn(t,c)),c.duration&&(c.duration=m(c.duration)),c.repeatDelay&&(c.repeatDelay=m(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(on(c),0===c.delay&&(d=!0)),(r.instantAnimations||r.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,on(c),c.delay=0),c.allowFlatten=!l.type&&!l.ease,d&&!a&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"}){const s=t.filter(Tn);return s[e&&"loop"!==n&&e%2==1?0:s.length-1]}(c.keyframes,l);if(void 0!==t)return void $.update(()=>{c.onUpdate(t),c.onComplete()})}return l.isSync?new we(c):new hn(c)};function xn(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function An(t,e,n,s){if("function"==typeof e){const[i,r]=xn(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=xn(s);e=e(void 0!==n?n:t.custom,i,r)}return e}const Vn=new Set(["width","height","top","left","right","bottom",...Be]);class kn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=Y.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Y.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new p);const n=this.events[t].add(e);return"change"===t?()=>{n(),$.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Y.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return g(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Cn(t,e){return new kn(t,e)}function Fn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Cn(n))}function Pn(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function En(t,e){const n=function(t,e){const n=t.getProps();return An(n,e,n.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){Fn(t,e,Pn(r[e]))}}const Bn=t=>Boolean(t&&t.getVelocity);function Rn(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Bn(s)&&s.add))return n.add(e);if(!n&&r.WillChange){const n=new r.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}function Dn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const In="data-"+Dn("framerAppearId");function On(t){return t.props[In]}function Nn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function $n(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();r=r?wn(r,l):l;const u=r?.reduceMotion;s&&(r=s);const h=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in o){const s=t.getValue(e,t.latestValues[e]??null),i=o[e];if(void 0===i||c&&Nn(c,e))continue;const a={delay:n,...Mn(r||{},e)},l=s.get();if(void 0!==l&&!s.isAnimating&&!Array.isArray(i)&&i===l&&!a.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=On(t);if(n){const t=window.MotionHandoffAnimation(n,e,$);null!==t&&(a.startTime=t,d=!0)}}Rn(t,e);const p=u??t.shouldReduceMotion;s.start(Sn(e,s,i,p&&Vn.has(e)?{type:!1}:a,t,d));const m=s.animation;m&&h.push(m)}if(a){const e=()=>$.update(()=>{a&&En(t,a)});h.length?Promise.all(h).then(e):e()}return h}const Kn=t=>e=>e.test(t),jn=[H,ht,ut,lt,dt,ct,{test:t=>"auto"===t,parse:t=>t}],Wn=t=>jn.find(Kn(t));function Ln(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||o(t))}const Yn=new Set(["brightness","contrast","saturate","opacity"]);function Un(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(tt)||[];if(!s)return t;const i=n.replace(s,"");let r=Yn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Xn=/\b([a-z-]*)\(.*?\)/gu,qn={...St,getAnimatableNone:t=>{const e=t.match(Xn);return e?e.map(Un).join(" "):t}},zn={...St,getAnimatableNone:t=>{const e=St.parse(t);return St.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Zn={...H,transform:Math.round},_n={borderWidth:ht,borderTopWidth:ht,borderRightWidth:ht,borderBottomWidth:ht,borderLeftWidth:ht,borderRadius:ht,borderTopLeftRadius:ht,borderTopRightRadius:ht,borderBottomRightRadius:ht,borderBottomLeftRadius:ht,width:ht,maxWidth:ht,height:ht,maxHeight:ht,top:ht,right:ht,bottom:ht,left:ht,inset:ht,insetBlock:ht,insetBlockStart:ht,insetBlockEnd:ht,insetInline:ht,insetInlineStart:ht,insetInlineEnd:ht,padding:ht,paddingTop:ht,paddingRight:ht,paddingBottom:ht,paddingLeft:ht,paddingBlock:ht,paddingBlockStart:ht,paddingBlockEnd:ht,paddingInline:ht,paddingInlineStart:ht,paddingInlineEnd:ht,margin:ht,marginTop:ht,marginRight:ht,marginBottom:ht,marginLeft:ht,marginBlock:ht,marginBlockStart:ht,marginBlockEnd:ht,marginInline:ht,marginInlineStart:ht,marginInlineEnd:ht,fontSize:ht,backgroundPositionX:ht,backgroundPositionY:ht,...{rotate:lt,rotateX:lt,rotateY:lt,rotateZ:lt,scale:J,scaleX:J,scaleY:J,scaleZ:J,skew:lt,skewX:lt,skewY:lt,distance:ht,translateX:ht,translateY:ht,translateZ:ht,x:ht,y:ht,z:ht,perspective:ht,transformPerspective:ht,opacity:G,originX:pt,originY:pt,originZ:ht},zIndex:Zn,fillOpacity:G,strokeOpacity:G,numOctaves:Zn},Hn={..._n,color:ft,backgroundColor:ft,outlineColor:ft,fill:ft,stroke:ft,borderColor:ft,borderTopColor:ft,borderRightColor:ft,borderBottomColor:ft,borderLeftColor:ft,filter:qn,WebkitFilter:qn,mask:zn,WebkitMask:zn},Gn=t=>Hn[t],Jn=new Set([qn,zn]);function Qn(t,e){let n=Gn(t);return Jn.has(n)||(n=St),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ts=new Set(["auto","none","0"]);class es extends Ue{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const ns=new Set(["opacity","clipPath","filter","transform"]);const ss=(t,e)=>e&&"number"==typeof t?e.transform(t):t,{schedule:is}=N(queueMicrotask,!1);function rs(t){return"object"==typeof(e=t)&&null!==e&&"ownerSVGElement"in t;var e}const as=[...jn,ft,St],os=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ls=new WeakMap;const us=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function hs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||us.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const cs={current:null},ds={current:!1},ps="undefined"!=typeof window;const ms=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let fs={};class gs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:r,visualState:a},o={}){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=Y.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ds.current||function(){if(ds.current=!0,ps)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>cs.current=t.matches;t.addEventListener("change",e),e()}else cs.current=!1}(),this.shouldReduceMotion=cs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),K(this.notifyUpdate),K(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ns.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:s,times:i,ease:r,duration:a}=e.accelerate,o=new en({element:this.current,name:t,keyframes:s,times:i,ease:r,duration:m(a)}),l=n(o);return void this.valueSubscriptions.set(t,()=>{l(),o.cancel()})}const n=Re.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&$.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in fs){const e=fs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Cn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(a(n)||o(n))?n=parseFloat(n):(s=n,!as.find(Kn(s))&&St.test(e)&&(n=Qn(t,e))),this.setBaseTarget(t,Bn(n)?n.get():n)),Bn(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=An(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Bn(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new p),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){is.render(this.render)}}class ys extends gs{constructor(){super(...arguments),this.KeyframeResolver=es}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Bn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const vs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bs=Be.length;function Ts(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(Re.has(t))a=!0;else if(X(t))i[t]=n;else{const e=ss(n,_n[t]);t.startsWith("origin")?(o=!0,r[t]=e):s[t]=e}}if(e.transform||(a||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r{if(!e.target)return t;if("string"==typeof t){if(!ht.test(t))return t;t=parseFloat(t)}return`${Ms(t,e.target.x)}% ${Ms(t,e.target.y)}%`}},xs={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=St.parse(t);if(i.length>5)return s;const r=St.createTransformer(t),a="number"!=typeof i[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;i[0+a]/=o,i[1+a]/=l;const u=Vt(o,l,.5);return"number"==typeof i[2+a]&&(i[2+a]/=u),"number"==typeof i[3+a]&&(i[3+a]/=u),r(i)}},As={borderRadius:{...Ss,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ss,borderTopRightRadius:Ss,borderBottomLeftRadius:Ss,borderBottomRightRadius:Ss,boxShadow:xs};function Vs(t,{layout:e,layoutId:n}){return Re.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!As[t]||"opacity"===t)}function ks(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const e in s)(Bn(s[e])||i&&Bn(i[e])||Vs(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=s[e]);return r}class Cs extends ys{constructor(){super(...arguments),this.type="html",this.renderInstance=ws}readValueFromInstance(t,e){if(Re.has(e))return this.projection?.isProjecting?Fe(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Pe(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(X(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Ts(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return ks(t,e,n)}}class Fs extends gs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}const Ps={offset:"stroke-dashoffset",array:"stroke-dasharray"},Es={offset:"strokeDashoffset",array:"strokeDasharray"};const Bs=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Rs(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...o},l,u,h){if(Ts(t,o,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=h?.transformBox??"fill-box",delete c.transformBox);for(const t of Bs)void 0!==c[t]&&(d[t]=c[t],delete c[t]);void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==s&&(c.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Ps:Es;t[r.offset]=""+-s,t[r.array]=`${e} ${n}`}(c,i,r,a,!1)}const Ds=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);class Is extends ys{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=os}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Re.has(e)){const t=Gn(e);return t&&t.default||0}return e=Ds.has(e)?e:Dn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=ks(t,e,n);for(const n in t)(Bn(t[n])||Bn(e[n]))&&(s[-1!==Be.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}build(t,e,n){Rs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){ws(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Ds.has(n)?n:Dn(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function Os(t){return"object"==typeof t&&!Array.isArray(t)}function Ns(t,e,n,s){return null==t?[]:"string"==typeof t&&Os(e)?function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function $s(t,e,n){return t*(e+1)}function Ks(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):s.get(e)??t}function js(e,n,s,i,r,a){!function(e,n,s){for(let i=0;in&&r.at"number"==typeof t,Zs=t=>t.every(zs);function _s(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=rs(t)&&!function(t){return rs(t)&&"svg"===t.tagName}(t)?new Is(e):new Cs(e);n.mount(t),ls.set(t,n)}function Hs(t){const e=new Fs({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),ls.set(t,e)}function Gs(t,e,n,s){const r=[];if(function(t,e){return Bn(t)||"number"==typeof t||"string"==typeof t&&!Os(e)}(t,e))r.push(function(t,e,n){const s=Bn(t)?t:Cn(t);return s.start(Sn("",s,e,n)),s.animation}(t,Os(e)&&e.default||e,n&&n.default||n));else{if(null==t)return r;const a=Ns(t,e,s),o=a.length;i(Boolean(o),"No valid elements provided.","no-valid-elements");for(let t=0;t{const u=Xs(t),{delay:h=0,times:c=pe(u),type:d=e.type||"keyframes",repeat:g,repeatType:y,repeatDelay:b=0,...T}=n;let{ease:w=e.ease||"easeOut",duration:M}=n;const S="function"==typeof h?h(o,l):h,x=u.length,A=tn(d)?d:r?.[d||"keyframes"];if(x<=2&&A){let t=100;if(2===x&&Zs(u)){const e=u[1]-u[0];t=Math.abs(e)}const n={...e,...T};void 0!==M&&(n.duration=m(M));const s=Lt(n,t,A);w=s.ease,M=s.duration}M??(M=a);const V=p+S;1===c.length&&0===c[0]&&(c[1]=1);const k=c.length-u.length;if(k>0&&de(c,k),1===u.length&&u.unshift(null),g){i(g<20,"Repeat count too high, must be less than 20","repeat-count-high"),M=$s(M,g);const t=[...u],e=[...c];w=Array.isArray(w)?[...w]:[w];const n=[...w];for(let s=0;s{for(const i in t){const r=t[i];r.sort(Ls);const a=[],l=[],u=[];for(let t=0;t{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=Cn(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:le});return r.forEach(({keyframes:t,transition:e},n)=>{s.push(...Gs(n,t,e))}),s}function Qs(e={}){const{scope:n,reduceMotion:s}=e;return function(e,i,r){let a,o=[];if(l=e,Array.isArray(l)&&l.some(Array.isArray)){const{onComplete:t,...r}=i||{};"function"==typeof t&&(a=t),o=Js(e,void 0!==s?{reduceMotion:s,...r}:r,n)}else{const{onComplete:t,...l}=r||{};"function"==typeof t&&(a=t),o=Gs(e,i,void 0!==s?{reduceMotion:s,...l}:l,n)}var l;const u=new pn(o);return a&&u.finished.then(a),n&&(n.animations.push(u),u.finished.then(()=>{t(n.animations,u)})),u}}const ti=Qs();export{ti as animate,Qs as createScopedAnimate}; //# sourceMappingURL=size-rollup-animate.js.map