framer-motion 12.7.5-alpha.1 → 12.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/{create-D5a67TOR.js → create-RWnxg4Sz.js} +1 -1
- package/dist/cjs/dom.js +2 -2
- package/dist/cjs/index.js +2 -2
- package/dist/dom.js +1 -1
- package/dist/es/render/dom/scroll/track.mjs +1 -1
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/framer-motion.dev.js +11 -9
- package/dist/framer-motion.js +1 -1
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-scroll.js +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as t,x as e,M as n,y as s,z as i,A as r,B as o,C as a,q as u,D as l,E as h,F as c,G as d,H as p,I as m,J as f,r as v,K as y,d as g,o as b,t as w,a as T,L as S,n as V,N as A,O as M,b as x,i as C,m as E,f as k,P,Q as F,g as I,s as O,u as D,R,S as N,p as K,h as B,v as L,j as U,k as j}from"./size-rollup-dom-animation-assets.js";import{Fragment as q}from"react";const W=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),$=t=>/^0[^.\s]+$/u.test(t);function z(t){let e;return()=>(void 0===e&&(e=t()),e)}const Y=(t,e)=>n=>e(t(n)),H=(...t)=>t.reduce(Y),X=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class _{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}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;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const G=t=>1e3*t,Z=t=>t/1e3;function J(t,e){return e?t*(1e3/e):0}const Q=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function tt(e,n,s,i){if(e===n&&s===i)return t;const r=t=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=Q(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,s);return t=>0===t||1===t?t:Q(r(t),n,i)}const et=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,nt=t=>e=>1-t(1-e),st=tt(.33,1.53,.69,.99),it=nt(st),rt=et(it),ot=t=>(t*=2)<1?.5*it(t):.5*(2-Math.pow(2,-10*(t-1))),at=t=>1-Math.sin(Math.acos(t)),ut=nt(at),lt=et(at),ht=tt(.42,0,1,1),ct=tt(0,0,.58,1),dt=tt(.42,0,.58,1),pt=t=>Array.isArray(t)&&"number"==typeof t[0],mt={linear:t,easeIn:ht,easeInOut:dt,easeOut:ct,circIn:at,circInOut:lt,circOut:ut,backIn:it,backInOut:rt,backOut:st,anticipate:ot},ft=t=>{if(pt(t)){t.length;const[e,n,s,i]=t;return tt(e,n,s,i)}return"string"==typeof t?mt[t]:t};let vt;function yt(){vt=void 0}const gt={now:()=>(void 0===vt&>.set(e.isProcessing||n.useManualTiming?e.timestamp:performance.now()),vt),set:t=>{vt=t,queueMicrotask(yt)}},bt=t=>Math.round(1e5*t)/1e5,wt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,St=(t,e)=>n=>Boolean("string"==typeof n&&Tt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Vt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(wt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},At={...s,transform:t=>Math.round((t=>r(0,255,t))(t))},Mt={test:St("rgb","red"),parse:Vt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+At.transform(t)+", "+At.transform(e)+", "+At.transform(n)+", "+bt(i.transform(s))+")"};const xt={test:St("#"),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:Mt.transform},Ct={test:St("hsl","hue"),parse:Vt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+o.transform(bt(e))+", "+o.transform(bt(n))+", "+bt(i.transform(s))+")"},Et={test:t=>Mt.test(t)||xt.test(t)||Ct.test(t),parse:t=>Mt.test(t)?Mt.parse(t):Ct.test(t)?Ct.parse(t):xt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Mt.transform(t):Ct.transform(t)},kt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Pt="number",Ft="color",It=/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 Ot(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(It,(t=>(Et.test(t)?(s.color.push(r),i.push(Ft),n.push(Et.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Pt),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function Dt(t){return Ot(t).values}function Rt(t){const{split:e,types:n}=Ot(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===Pt?bt(t[r]):e===Ft?Et.transform(t[r]):t[r]}return i}}const Nt=t=>"number"==typeof t?0:t;const Kt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(wt)?.length||0)+(t.match(kt)?.length||0)>0},parse:Dt,createTransformer:Rt,getAnimatableNone:function(t){const e=Dt(t);return Rt(t)(e.map(Nt))}};function Bt(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 Lt(t,e){return n=>n>0?e:t}const Ut=(t,e,n)=>t+(e-t)*n,jt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},qt=[xt,Mt,Ct];function Wt(t){const e=(n=t,qt.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Ct&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Bt(a,s,t+1/3),r=Bt(a,s,t),o=Bt(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const $t=(t,e)=>{const n=Wt(t),s=Wt(e);if(!n||!s)return Lt(t,e);const i={...n};return t=>(i.red=jt(n.red,s.red,t),i.green=jt(n.green,s.green,t),i.blue=jt(n.blue,s.blue,t),i.alpha=Ut(n.alpha,s.alpha,t),Mt.transform(i))},zt=new Set(["none","hidden"]);function Yt(t,e){return n=>Ut(t,e,n)}function Ht(t){return"number"==typeof t?Yt:"string"==typeof t?a(t)?Lt:Et.test(t)?$t:Gt:Array.isArray(t)?Xt:"object"==typeof t?Et.test(t)?$t:_t:Lt}function Xt(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>Ht(t)(t,e[n])));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function _t(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Ht(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Gt=(t,e)=>{const n=Kt.createTransformer(e),s=Ot(t),i=Ot(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?zt.has(t)&&!i.values.length||zt.has(e)&&!s.values.length?function(t,e){return zt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):H(Xt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}(s,i),i.values),n):Lt(t,e)};function Zt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ut(t,e,n);return Ht(t)(t,e)}const Jt=t=>{const n=({timestamp:e})=>t(e);return{start:()=>u.update(n,!0),stop:()=>l(n),now:()=>e.isProcessing?e.timestamp:gt.now()}},Qt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(e/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},te=2e4;function ee(t){let e=0;let n=t.next(e);for(;!n.done&&e<te;)e+=50,n=t.next(e);return e>=te?1/0:e}function ne(t,e,n){const s=Math.max(e-5,0);return J(n-t(s),e-s)}const se=100,ie=10,re=1,oe=0,ae=800,ue=.3,le=.3,he={granular:.01,default:2},ce={granular:.005,default:.5},de=.01,pe=10,me=.05,fe=1,ve=.001;function ye({duration:t=ae,bounce:e=ue,velocity:n=oe,mass:s=re}){let i,o,a=1-e;a=r(me,fe,a),t=r(de,pe,Z(t)),a<1?(i=e=>{const s=e*a,i=s*t,r=s-n,o=be(e,a),u=Math.exp(-i);return ve-r/o*u},o=e=>{const s=e*a*t,r=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,u=Math.exp(-s),l=be(Math.pow(e,2),a);return(-i(e)+ve>0?-1:1)*((r-o)*u)/l}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<ge;n++)s-=t(s)/e(s);return s}(i,o,5/t);if(t=G(t),isNaN(u))return{stiffness:se,damping:ie,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const ge=12;function be(t,e){return t*Math.sqrt(1-e*e)}const we=["duration","bounce"],Te=["stiffness","damping","mass"];function Se(t,e){return e.some((e=>void 0!==t[e]))}function Ve(t=le,e=ue){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:l,damping:h,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:oe,stiffness:se,damping:ie,mass:re,isResolvedFromDuration:!1,...t};if(!Se(t,Te)&&Se(t,we))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,o=2*r(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:re,stiffness:i,damping:o}}else{const n=ye(t);e={...e,...n,mass:re},e.isResolvedFromDuration=!0}return e}({...n,velocity:-Z(n.velocity||0)}),f=p||0,v=h/(2*Math.sqrt(l*c)),y=a-o,g=Z(Math.sqrt(l/c)),b=Math.abs(y)<5;let w;if(s||(s=b?he.granular:he.default),i||(i=b?ce.granular:ce.default),v<1){const t=be(g,v);w=e=>{const n=Math.exp(-v*g*e);return a-n*((f+v*g*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===v)w=t=>a-Math.exp(-g*t)*(y+(f+g*y)*t);else{const t=g*Math.sqrt(v*v-1);w=e=>{const n=Math.exp(-v*g*e),s=Math.min(t*e,300);return a-n*((f+v*g*y)*Math.sinh(s)+t*y*Math.cosh(s))/t}}const T={calculatedDuration:m&&d||null,next:t=>{const e=w(t);if(m)u.done=t>=d;else{let n=0;v<1&&(n=0===t?G(f):ne(w,t,e));const r=Math.abs(n)<=s,o=Math.abs(a-e)<=i;u.done=r&&o}return u.value=u.done?a:e,u},toString:()=>{const t=Math.min(ee(T),te),e=Qt((e=>T.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return T}function Ae({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=c+m,v=void 0===o?f:o(f);v!==f&&(m=v-c);const y=t=>-m*Math.exp(-t/s),g=t=>v+y(t),b=t=>{const e=y(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?v:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(w=t,T=Ve({keyframes:[d.value,p(d.value)],velocity:ne(g,t,d.value),damping:i,stiffness:r,restDelta:l,restSpeed:h}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}function Me(e,s,{clamp:i=!0,ease:o,mixer:a}={}){const u=e.length;if(s.length,1===u)return()=>s[0];if(2===u&&s[0]===s[1])return()=>s[1];const l=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),s=[...s].reverse());const h=function(e,s,i){const r=[],o=i||n.mix||Zt,a=e.length-1;for(let n=0;n<a;n++){let i=o(e[n],e[n+1]);if(s){const e=Array.isArray(s)?s[n]||t:s;i=H(e,i)}r.push(i)}return r}(s,o,a),c=h.length,d=t=>{if(l&&t<e[0])return s[0];let n=0;if(c>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const i=X(e[n],e[n+1],t);return h[n](i)};return i?t=>d(r(e[0],e[u-1],t)):d}function xe(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=X(0,e,s);t.push(Ut(n,1,i))}}(e,t.length-1),e}function Ce({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(ft):ft(s),r={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:xe(e),t),a=Me(o,e,{ease:Array.isArray(i)?i:(u=e,l=i,u.map((()=>l||dt)).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Ve.applyToOptions=t=>{const e=function(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ee(s),te);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:Z(i)}}(t,100,Ve);return t.ease=e.ease,t.duration=G(e.duration),t.type="keyframes",t};const Ee=t=>null!==t;function ke(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ee),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const Pe={decay:Ae,inertia:Ae,tween:Ce,keyframes:Ce,spring:Ve};function Fe(t){"string"==typeof t.type&&(t.type=Pe[t.type])}class Ie{constructor(){this.count=0,this.updateFinished()}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Oe=t=>t/100;class De extends Ie{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;if(t&&t.updatedAt!==gt.now()&&this.tick(gt.now()),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Fe(t);const{type:e=Ce,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Ce;a!==Ce&&"number"!=typeof o[0]&&(this.mixKeyframes=H(Oe,Zt(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=ee(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}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:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let b=this.currentTime,w=n;if(c){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(w=o)),b=r(0,1,n)*a}const T=g?{done:!1,value:h[0]}:w.next(b);i&&(T.value=i(T.value));let{done:S}=T;g||null===u||(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const V=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return V&&m!==Ae&&(T.value=ke(h,this.options,v,this.speed)),f&&f(T.value),V&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return Z(this.calculatedDuration)}get time(){return Z(this.currentTime)}set time(t){t=G(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)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(gt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=Z(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Jt,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:"finished"===this.state?(console.log("JSAnimation updateFinished"),this.updateFinished(),this.startTime=s):this.startTime||(this.startTime=n??s),"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(gt.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";const{onComplete:t}=this.options;t&&t()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown()}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()),t.observe(this)}}const Re=t=>180*t/Math.PI,Ne=t=>{const e=Re(Math.atan2(t[1],t[0]));return Be(e)},Ke={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ne,rotateZ:Ne,skewX:t=>Re(Math.atan(t[1])),skewY:t=>Re(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Be=t=>((t%=360)<0&&(t+=360),t),Le=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ue=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),je={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Le,scaleY:Ue,scale:t=>(Le(t)+Ue(t))/2,rotateX:t=>Be(Re(Math.atan2(t[6],t[5]))),rotateY:t=>Be(Re(Math.atan2(-t[2],t[0]))),rotateZ:Ne,rotate:Ne,skewX:t=>Re(Math.atan(t[4])),skewY:t=>Re(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function qe(t){return t.includes("scale")?1:0}function We(t,e){if(!t||"none"===t)return qe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=je,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ke,i=e}if(!i)return qe(e);const r=s[e],o=i[1].split(",").map($e);return"function"==typeof r?r(o):o[r]}function $e(t){return parseFloat(t.trim())}const ze=t=>t===s||t===h,Ye=new Set(["x","y","z"]),He=c.filter((t=>!Ye.has(t)));const Xe={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>We(e,"x"),y:(t,{transform:e})=>We(e,"y")};Xe.translateX=Xe.x,Xe.translateY=Xe.y;const _e=new Set;let Ge=!1,Ze=!1,Je=!1;function Qe(){if(Ze){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 He.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)}))}Ze=!1,Ge=!1,_e.forEach((t=>t.complete(Je))),_e.clear()}function tn(){_e.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Ze=!0)}))}class en{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(_e.add(this),Ge||(Ge=!0,u.read(tn),u.resolveKeyframes(Qe))):(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;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_e.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,_e.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const nn=z((()=>void 0!==window.ScrollTimeline)),sn={};function rn(t,e){const n=z(t);return()=>sn[e]??n()}const on=rn((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),an=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,un={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:an([0,.65,.55,1]),circOut:an([.55,0,1,.45]),backIn:an([.31,.01,.66,-.59]),backOut:an([.33,1.53,.69,.99])};function ln(t,e){return t?"function"==typeof t?on()?Qt(t,e):"ease-out":pt(t)?an(t):Array.isArray(t)?t.map((t=>ln(t,e)||un.easeOut)):un[t]:void 0}function hn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const h={[e]:n};u&&(h.offset=u);const c=ln(a,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"===o?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(h,d)}function cn(t){return"function"==typeof t&&"applyToOptions"in t}class dn extends Ie{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const a=function({type:t,...e}){return cn(t)&&on()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=hn(e,n,s,a,i),!1===a.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ke(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}this.notifyFinished()}}play(){this.isStopped||(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(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Z(Number(t))}get time(){return Z(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=G(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&nn()?(this.animation.timeline=e,t):n(this)}}const pn={anticipate:ot,backInOut:rt,circInOut:lt};function mn(t){"string"==typeof t.ease&&t.ease in pn&&(t.ease=pn[t.ease])}class fn extends dn{constructor(t){mn(t),Fe(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new De({...r,autoplay:!1}),a=G(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const vn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Kt.test(t)&&"0"!==t||t.startsWith("url(")));const yn=new Set(["opacity","clipPath","filter","transform"]),gn=z((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class bn extends Ie{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:l,...h}){super(),this.stop=()=>{this._animation?(this._animation.stop(),this.stopTimeline?.()):this.keyframeResolver?.cancel()},this.createdAt=gt.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:a,motionValue:u,element:l,...h},d=l?.KeyframeResolver||en;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,c,!n)),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,s,i,r){this.keyframeResolver=void 0;const{name:o,type:a,velocity:u,delay:l,isHandoff:h,onUpdate:c,onComplete:d}=i;this.resolvedAt=gt.now(),function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=vn(i,e),a=vn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||cn(n))&&s)}(e,o,a,u)||(!n.instantAnimations&&l||c?.(ke(e,i,s)),e[0]=e[e.length-1],i.duration=0,i.repeat=0);const p={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:s,...i,keyframes:e},m=!h&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:u}=e.owner.getProps();return gn()&&n&&yn.has(n)&&("transform"!==n||!u)&&!a&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}(p)?new fn({...p,element:p.motionValue.owner.current}):new De(p);m.finished.then((()=>{d?.(),this.notifyFinished()})).catch(t),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(Je=!0,tn(),Qe(),Je=!1),this._animation}get duration(){return this.animation.duration}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(){console.log("async animation complete"),this.animation.complete()}cancel(){this.animation.cancel()}}const wn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Tn(t,e,n=1){const[s,i]=function(t){const e=wn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return W(t)?parseFloat(t):t}return a(i)?Tn(i,e,n+1):i}function Sn(t,e){return t?.[e]??t?.default??t}const Vn=new Set(["width","height","top","left","right","bottom",...c]),An=t=>e=>e.test(t),Mn=[s,h,o,d,p,m,{test:t=>"auto"===t,parse:t=>t}],xn=t=>Mn.find(An(t));const Cn=new Set(["brightness","contrast","saturate","opacity"]);function En(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(wt)||[];if(!s)return t;const i=n.replace(s,"");let r=Cn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const kn=/\b([a-z-]*)\(.*?\)/gu,Pn={...Kt,getAnimatableNone:t=>{const e=t.match(kn);return e?e.map(En).join(" "):t}},Fn={...f,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:Pn,WebkitFilter:Pn},In=t=>Fn[t];function On(t,e){let n=In(t);return n!==Pn&&(n=Kt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Dn=new Set(["auto","none","0"]);class Rn extends en{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.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),a(s))){const i=Tn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Vn.has(n)||2!==t.length)return;const[s,i]=t,r=xn(s),o=xn(i);if(r!==o)if(ze(r)&&ze(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||$(s)))&&n.push(e);var s;n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Dn.has(e)&&Ot(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=On(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Xe[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Xe[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Nn=!1;function Kn(){return Nn}function Bn(t,e){const n=function(t,e,n){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)}(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function Ln(t){return!("touch"===t.pointerType||Kn())}const Un=(t,e)=>!!e&&(t===e||Un(t,e.parentElement)),jn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const qn=new WeakSet;function Wn(t){return e=>{"Enter"===e.key&&t(e)}}function $n(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function zn(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!Kn()}function Yn(t,e,n={}){const[s,i,r]=Bn(t,n),o=t=>{const s=t.currentTarget;if(!zn(t)||qn.has(s))return;qn.add(s);const r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),zn(t)&&qn.has(s)&&(qn.delete(s),"function"==typeof r&&r(t,{success:e}))},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||Un(s,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",u,i)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=Wn((()=>{if(qn.has(n))return;$n(n,"down");const t=Wn((()=>{$n(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>$n(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,i))),e=t,jn.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),r}class Hn{constructor(t,e={}){this.version="12.7.5-alpha.1",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=gt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=gt.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 _);const n=this.events[t].add(e);return"change"===t?()=>{n(),u.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,e=!0){"none"===t&&console.trace(),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}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()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=gt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return J(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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Xn(t,e){return new Hn(t,e)}const _n=[...Mn,Et,Kt];function Gn(t,e,n){const s=t.getProps();return v(s,e,void 0!==n?n:s.custom,t)}function Zn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Xn(n))}function Jn(t,e){const s=t.getValue("willChange");if(i=s,Boolean(g(i)&&i.add))return s.add(e);if(!s&&n.WillChange){const s=new n.WillChange("auto");t.addValue("willChange",s),s.add(e)}var i}function Qn(t){return t.props[b]}const ts=t=>null!==t;const es={type:"spring",stiffness:500,damping:25,restSpeed:10},ns={type:"keyframes",duration:.8},ss={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},is=(t,{keyframes:e})=>e.length>2?ns:w.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:es:ss;const rs=(t,e,s,i={},r,o)=>a=>{const l=Sn(i,t)||{},h=l.delay||i.delay||0;let{elapsed:c=0}=i;c-=G(h);const d={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:o?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:l,...h}){return!!Object.keys(h).length})(l)||Object.assign(d,is(t,d)),d.duration&&(d.duration=G(d.duration)),d.repeatDelay&&(d.repeatDelay=G(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(p=!0)),(n.instantAnimations||n.skipAnimations)&&(p=!0,d.duration=0,d.delay=0),d.allowFlatten=!l.type&&!l.ease,p&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ts),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(d.keyframes,l);if(void 0!==t)return void u.update((()=>{d.onUpdate(t),d.onComplete()}))}return new bn(d)};function os({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function as(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const l=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||h&&os(h,e))continue;const o={delay:n,...Sn(r||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=Qn(t);if(n){const t=window.MotionHandoffAnimation(n,e,u);null!==t&&(o.startTime=t,c=!0)}}Jn(t,e),s.start(rs(e,s,i,t.shouldReduceMotion&&Vn.has(e)?{type:!1}:o,t,c));const d=s.animation;d&&l.push(d)}return o&&Promise.all(l).then((()=>{u.update((()=>{o&&function(t,e){const n=Gn(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r)Zn(t,e,y(r[e]))}(t,o)}))})),l}function us(t,e,n={}){const s=Gn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(as(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,u=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(ls).forEach(((t,s)=>{t.notify("AnimationStart",e),o.push(us(t,e,{...r,delay:n+u(s)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(o)}(t,e,r+s,o,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then((()=>e()))}return Promise.all([r(),o(n.delay)])}function ls(t,e){return t.sortNodePosition(e)}function hs(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const cs=S.length;function ds(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&ds(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<cs;n++){const s=S[n],i=t.props[s];(T(i)||!1===i)&&(e[s]=i)}return e}const ps=[...M].reverse(),ms=M.length;function fs(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map((e=>us(t,e,n)));s=Promise.all(i)}else if("string"==typeof e)s=us(t,e,n);else{const i="function"==typeof e?Gn(t,e,n.custom):e;s=Promise.all(as(t,i,n))}return s.then((()=>{t.notify("AnimationComplete",e)}))}(t,e,n))))}function vs(t){let e=fs(t),n=bs(),s=!0;const i=e=>(n,s)=>{const i=Gn(t,s,"exit"===e?t.presenceContext?.custom:void 0);if(i){const{transition:t,transitionEnd:e,...s}=i;n={...n,...s,...e}}return n};function r(r){const{props:o}=t,a=ds(t.parent)||{},u=[],l=new Set;let h={},c=1/0;for(let e=0;e<ms;e++){const d=ps[e],p=n[d],m=void 0!==o[d]?o[d]:a[d],f=T(m),v=d===r?p.isActive:null;!1===v&&(c=e);let y=m===a[d]&&m!==o[d]&&f;if(y&&s&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...h},!p.isActive&&null===v||!m&&!p.prevProp||V(m)||"boolean"==typeof m)continue;const g=ys(p.prevProp,m);let b=g||d===r&&p.isActive&&!y&&f||e>c&&f,w=!1;const S=Array.isArray(m)?m:[m];let M=S.reduce(i(d),{});!1===v&&(M={});const{prevResolvedValues:x={}}=p,C={...x,...M},E=e=>{b=!0,l.has(e)&&(w=!0,l.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in C){const e=M[t],n=x[t];if(h.hasOwnProperty(t))continue;let s=!1;s=A(e)&&A(n)?!hs(e,n):e!==n,s?null!=e?E(t):l.add(t):void 0!==e&&l.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=M,p.isActive&&(h={...h,...M}),s&&t.blockInitialAnimation&&(b=!1);b&&(!(y&&g)||w)&&u.push(...S.map((t=>({animation:t,options:{type:d}}))))}if(l.size){const e={};if("boolean"!=typeof o.initial){const n=Gn(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}l.forEach((n=>{const s=t.getBaseTarget(n),i=t.getValue(n);i&&(i.liveStyle=!0),e[n]=s??null})),u.push({animation:e})}let d=Boolean(u.length);return!s||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),s=!1,d?e(u):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){if(n[e].isActive===s)return Promise.resolve();t.variantChildren?.forEach((t=>t.animationState?.setActive(e,s))),n[e].isActive=s;const i=r(e);for(const t in n)n[t].protectedKeys={};return i},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=bs(),s=!0}}}function ys(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!hs(e,t)}function gs(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bs(){return{animate:gs(!0),whileInView:gs(),whileHover:gs(),whileTap:gs(),whileDrag:gs(),whileFocus:gs(),exit:gs()}}class ws{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Ts=0;const Ss={animation:{Feature:class extends ws{constructor(t){super(t),t.animationState||(t.animationState=vs(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();V(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ws{constructor(){super(...arguments),this.id=Ts++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then((()=>{e(this.id)}))}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Vs(t){return{point:{x:t.pageX,y:t.pageY}}}function As(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===n);const i=s["onHover"+n];i&&u.postRender((()=>i(e,Vs(e))))}function Ms(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function xs(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===n);const i=s["onTap"+("End"===n?"":n)];i&&u.postRender((()=>i(e,Vs(e))))}const Cs=new WeakMap,Es=new WeakMap,ks=t=>{const e=Cs.get(t.target);e&&e(t)},Ps=t=>{t.forEach(ks)};function Fs(t,e,n){const s=function({root:t,...e}){const n=t||document;Es.has(n)||Es.set(n,{});const s=Es.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ps,{root:t,...e})),s[i]}(e);return Cs.set(t,n),s.observe(t),()=>{Cs.delete(t),s.unobserve(t)}}const Is={some:0,all:1};const Os={inView:{Feature:class extends ws{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Is[s]};return Fs(this.node.current,r,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),r=e?n:s;r&&r(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ws{mount(){const{current:t}=this.node;t&&(this.unmount=Yn(t,((t,e)=>(xs(this.node,e,"Start"),(t,{success:e})=>xs(this.node,t,e?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends ws{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=H(Ms(this.node.current,"focus",(()=>this.onFocus())),Ms(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends ws{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[s,i,r]=Bn(t,n),o=t=>{if(!Ln(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{Ln(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach((t=>{t.addEventListener("pointerenter",o,i)})),r}(t,((t,e)=>(As(this.node,e,"Start"),t=>As(this.node,t,"End")))))}unmount(){}}}};const Ds=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Rs={current:null},Ns={current:!1};const Ks=new WeakMap;const Bs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ls{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=en,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=gt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,u.render(this.render,!1,!0))};const{latestValues:a,renderState:l,onUpdate:h}=r;this.onUpdate=h,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=C(e),this.isVariantNode=E(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==a[t]&&g(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Ks.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),Ns.current||function(){if(Ns.current=!0,x)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Rs.current=t.matches;t.addListener(e),e()}else Rs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Rs.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),l(this.notifyUpdate),l(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(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}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=w.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&u.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),i(),r&&r(),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 k){const e=k[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;e<Bs.length;e++){const n=Bs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(g(i))t.addValue(s,i);else if(g(r))t.addValue(s,Xn(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Xn(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Xn(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&&(W(n)||$(n))?n=parseFloat(n):(s=n,!_n.find(An(s))&&Kt.test(e)&&(n=On(t,e))),this.setBaseTarget(t,g(n)?n.get():n)),g(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=v(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||g(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 _),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Us extends Ls{constructor(){super(...arguments),this.KeyframeResolver=Rn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[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;g(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}class js extends Us{constructor(){super(...arguments),this.type="html",this.renderInstance=P}readValueFromInstance(t,e){if(w.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return We(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(F(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){I(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return O(t,e,n)}}class qs extends Us{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ds,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&D(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(w.has(e)){const t=In(e);return t&&t.default||0}return e=R.has(e)?e:N(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return K(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&u.postRender(this.updateDimensions)}build(t,e,n){B(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){L(t,e,n,s)}mount(t){this.isSVGTag=U(t.tagName),super.mount(t)}}const Ws={renderer:(t,e)=>j(t)?new qs(e):new js(e,{allowProjection:t!==q}),...Ss,...Os};export{Ws as domAnimation};
|
|
1
|
+
import{w as t,x as e,M as n,y as s,z as i,A as r,B as o,C as a,q as u,D as h,E as l,F as c,G as d,H as p,I as m,J as f,r as v,K as y,d as g,o as b,t as w,a as T,L as S,n as V,N as A,O as M,b as x,i as C,m as E,f as k,P,Q as F,g as I,s as O,u as D,R,S as N,p as K,h as B,v as L,j as U,k as j}from"./size-rollup-dom-animation-assets.js";import{Fragment as q}from"react";const W=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),$=t=>/^0[^.\s]+$/u.test(t);function z(t){let e;return()=>(void 0===e&&(e=t()),e)}const Y=(t,e)=>n=>e(t(n)),H=(...t)=>t.reduce(Y),X=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class _{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}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;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const G=t=>1e3*t,Z=t=>t/1e3;function J(t,e){return e?t*(1e3/e):0}const Q=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function tt(e,n,s,i){if(e===n&&s===i)return t;const r=t=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=Q(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,s);return t=>0===t||1===t?t:Q(r(t),n,i)}const et=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,nt=t=>e=>1-t(1-e),st=tt(.33,1.53,.69,.99),it=nt(st),rt=et(it),ot=t=>(t*=2)<1?.5*it(t):.5*(2-Math.pow(2,-10*(t-1))),at=t=>1-Math.sin(Math.acos(t)),ut=nt(at),ht=et(at),lt=tt(.42,0,1,1),ct=tt(0,0,.58,1),dt=tt(.42,0,.58,1),pt=t=>Array.isArray(t)&&"number"==typeof t[0],mt={linear:t,easeIn:lt,easeInOut:dt,easeOut:ct,circIn:at,circInOut:ht,circOut:ut,backIn:it,backInOut:rt,backOut:st,anticipate:ot},ft=t=>{if(pt(t)){t.length;const[e,n,s,i]=t;return tt(e,n,s,i)}return"string"==typeof t?mt[t]:t};let vt;function yt(){vt=void 0}const gt={now:()=>(void 0===vt&>.set(e.isProcessing||n.useManualTiming?e.timestamp:performance.now()),vt),set:t=>{vt=t,queueMicrotask(yt)}},bt=t=>Math.round(1e5*t)/1e5,wt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Tt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,St=(t,e)=>n=>Boolean("string"==typeof n&&Tt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Vt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(wt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},At={...s,transform:t=>Math.round((t=>r(0,255,t))(t))},Mt={test:St("rgb","red"),parse:Vt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+At.transform(t)+", "+At.transform(e)+", "+At.transform(n)+", "+bt(i.transform(s))+")"};const xt={test:St("#"),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:Mt.transform},Ct={test:St("hsl","hue"),parse:Vt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+o.transform(bt(e))+", "+o.transform(bt(n))+", "+bt(i.transform(s))+")"},Et={test:t=>Mt.test(t)||xt.test(t)||Ct.test(t),parse:t=>Mt.test(t)?Mt.parse(t):Ct.test(t)?Ct.parse(t):xt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Mt.transform(t):Ct.transform(t)},kt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Pt="number",Ft="color",It=/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 Ot(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(It,(t=>(Et.test(t)?(s.color.push(r),i.push(Ft),n.push(Et.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Pt),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function Dt(t){return Ot(t).values}function Rt(t){const{split:e,types:n}=Ot(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===Pt?bt(t[r]):e===Ft?Et.transform(t[r]):t[r]}return i}}const Nt=t=>"number"==typeof t?0:t;const Kt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(wt)?.length||0)+(t.match(kt)?.length||0)>0},parse:Dt,createTransformer:Rt,getAnimatableNone:function(t){const e=Dt(t);return Rt(t)(e.map(Nt))}};function Bt(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 Lt(t,e){return n=>n>0?e:t}const Ut=(t,e,n)=>t+(e-t)*n,jt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},qt=[xt,Mt,Ct];function Wt(t){const e=(n=t,qt.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Ct&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Bt(a,s,t+1/3),r=Bt(a,s,t),o=Bt(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const $t=(t,e)=>{const n=Wt(t),s=Wt(e);if(!n||!s)return Lt(t,e);const i={...n};return t=>(i.red=jt(n.red,s.red,t),i.green=jt(n.green,s.green,t),i.blue=jt(n.blue,s.blue,t),i.alpha=Ut(n.alpha,s.alpha,t),Mt.transform(i))},zt=new Set(["none","hidden"]);function Yt(t,e){return n=>Ut(t,e,n)}function Ht(t){return"number"==typeof t?Yt:"string"==typeof t?a(t)?Lt:Et.test(t)?$t:Gt:Array.isArray(t)?Xt:"object"==typeof t?Et.test(t)?$t:_t:Lt}function Xt(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>Ht(t)(t,e[n])));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function _t(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Ht(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Gt=(t,e)=>{const n=Kt.createTransformer(e),s=Ot(t),i=Ot(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?zt.has(t)&&!i.values.length||zt.has(e)&&!s.values.length?function(t,e){return zt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):H(Xt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}(s,i),i.values),n):Lt(t,e)};function Zt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ut(t,e,n);return Ht(t)(t,e)}const Jt=t=>{const n=({timestamp:e})=>t(e);return{start:()=>u.update(n,!0),stop:()=>h(n),now:()=>e.isProcessing?e.timestamp:gt.now()}},Qt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(e/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},te=2e4;function ee(t){let e=0;let n=t.next(e);for(;!n.done&&e<te;)e+=50,n=t.next(e);return e>=te?1/0:e}function ne(t,e,n){const s=Math.max(e-5,0);return J(n-t(s),e-s)}const se=100,ie=10,re=1,oe=0,ae=800,ue=.3,he=.3,le={granular:.01,default:2},ce={granular:.005,default:.5},de=.01,pe=10,me=.05,fe=1,ve=.001;function ye({duration:t=ae,bounce:e=ue,velocity:n=oe,mass:s=re}){let i,o,a=1-e;a=r(me,fe,a),t=r(de,pe,Z(t)),a<1?(i=e=>{const s=e*a,i=s*t,r=s-n,o=be(e,a),u=Math.exp(-i);return ve-r/o*u},o=e=>{const s=e*a*t,r=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,u=Math.exp(-s),h=be(Math.pow(e,2),a);return(-i(e)+ve>0?-1:1)*((r-o)*u)/h}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<ge;n++)s-=t(s)/e(s);return s}(i,o,5/t);if(t=G(t),isNaN(u))return{stiffness:se,damping:ie,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const ge=12;function be(t,e){return t*Math.sqrt(1-e*e)}const we=["duration","bounce"],Te=["stiffness","damping","mass"];function Se(t,e){return e.some((e=>void 0!==t[e]))}function Ve(t=he,e=ue){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:h,damping:l,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:oe,stiffness:se,damping:ie,mass:re,isResolvedFromDuration:!1,...t};if(!Se(t,Te)&&Se(t,we))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,o=2*r(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:re,stiffness:i,damping:o}}else{const n=ye(t);e={...e,...n,mass:re},e.isResolvedFromDuration=!0}return e}({...n,velocity:-Z(n.velocity||0)}),f=p||0,v=l/(2*Math.sqrt(h*c)),y=a-o,g=Z(Math.sqrt(h/c)),b=Math.abs(y)<5;let w;if(s||(s=b?le.granular:le.default),i||(i=b?ce.granular:ce.default),v<1){const t=be(g,v);w=e=>{const n=Math.exp(-v*g*e);return a-n*((f+v*g*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===v)w=t=>a-Math.exp(-g*t)*(y+(f+g*y)*t);else{const t=g*Math.sqrt(v*v-1);w=e=>{const n=Math.exp(-v*g*e),s=Math.min(t*e,300);return a-n*((f+v*g*y)*Math.sinh(s)+t*y*Math.cosh(s))/t}}const T={calculatedDuration:m&&d||null,next:t=>{const e=w(t);if(m)u.done=t>=d;else{let n=0===t?f:0;v<1&&(n=0===t?G(f):ne(w,t,e));const r=Math.abs(n)<=s,o=Math.abs(a-e)<=i;u.done=r&&o}return u.value=u.done?a:e,u},toString:()=>{const t=Math.min(ee(T),te),e=Qt((e=>T.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return T}function Ae({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:h=.5,restSpeed:l}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=c+m,v=void 0===o?f:o(f);v!==f&&(m=v-c);const y=t=>-m*Math.exp(-t/s),g=t=>v+y(t),b=t=>{const e=y(t),n=g(t);d.done=Math.abs(e)<=h,d.value=d.done?v:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(w=t,T=Ve({keyframes:[d.value,p(d.value)],velocity:ne(g,t,d.value),damping:i,stiffness:r,restDelta:h,restSpeed:l}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}function Me(e,s,{clamp:i=!0,ease:o,mixer:a}={}){const u=e.length;if(s.length,1===u)return()=>s[0];if(2===u&&s[0]===s[1])return()=>s[1];const h=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),s=[...s].reverse());const l=function(e,s,i){const r=[],o=i||n.mix||Zt,a=e.length-1;for(let n=0;n<a;n++){let i=o(e[n],e[n+1]);if(s){const e=Array.isArray(s)?s[n]||t:s;i=H(e,i)}r.push(i)}return r}(s,o,a),c=l.length,d=t=>{if(h&&t<e[0])return s[0];let n=0;if(c>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const i=X(e[n],e[n+1],t);return l[n](i)};return i?t=>d(r(e[0],e[u-1],t)):d}function xe(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=X(0,e,s);t.push(Ut(n,1,i))}}(e,t.length-1),e}function Ce({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(ft):ft(s),r={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:xe(e),t),a=Me(o,e,{ease:Array.isArray(i)?i:(u=e,h=i,u.map((()=>h||dt)).splice(0,u.length-1))});var u,h;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Ve.applyToOptions=t=>{const e=function(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ee(s),te);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:Z(i)}}(t,100,Ve);return t.ease=e.ease,t.duration=G(e.duration),t.type="keyframes",t};const Ee=t=>null!==t;function ke(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ee),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const Pe={decay:Ae,inertia:Ae,tween:Ce,keyframes:Ce,spring:Ve};function Fe(t){"string"==typeof t.type&&(t.type=Pe[t.type])}class Ie{constructor(){this.count=0,this.updateFinished()}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Oe=t=>t/100;class De extends Ie{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;if(t&&t.updatedAt!==gt.now()&&this.tick(gt.now()),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Fe(t);const{type:e=Ce,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Ce;a!==Ce&&"number"!=typeof o[0]&&(this.mixKeyframes=H(Oe,Zt(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=ee(u));const{calculatedDuration:h}=u;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}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:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(null===this.startTime)return n.next(0);const{delay:h=0,keyframes:l,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-h*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let b=this.currentTime,w=n;if(c){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(w=o)),b=r(0,1,n)*a}const T=g?{done:!1,value:l[0]}:w.next(b);i&&(T.value=i(T.value));let{done:S}=T;g||null===u||(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const V=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return V&&m!==Ae&&(T.value=ke(l,this.options,v,this.speed)),f&&f(T.value),V&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return Z(this.calculatedDuration)}get time(){return Z(this.currentTime)}set time(t){t=G(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)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(gt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=Z(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Jt,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:"finished"===this.state?(this.updateFinished(),this.startTime=s):this.startTime||(this.startTime=n??s),"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(gt.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";const{onComplete:t}=this.options;t&&t()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown()}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()),t.observe(this)}}const Re=t=>180*t/Math.PI,Ne=t=>{const e=Re(Math.atan2(t[1],t[0]));return Be(e)},Ke={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ne,rotateZ:Ne,skewX:t=>Re(Math.atan(t[1])),skewY:t=>Re(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Be=t=>((t%=360)<0&&(t+=360),t),Le=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ue=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),je={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Le,scaleY:Ue,scale:t=>(Le(t)+Ue(t))/2,rotateX:t=>Be(Re(Math.atan2(t[6],t[5]))),rotateY:t=>Be(Re(Math.atan2(-t[2],t[0]))),rotateZ:Ne,rotate:Ne,skewX:t=>Re(Math.atan(t[4])),skewY:t=>Re(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function qe(t){return t.includes("scale")?1:0}function We(t,e){if(!t||"none"===t)return qe(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=je,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ke,i=e}if(!i)return qe(e);const r=s[e],o=i[1].split(",").map($e);return"function"==typeof r?r(o):o[r]}function $e(t){return parseFloat(t.trim())}const ze=t=>t===s||t===l,Ye=new Set(["x","y","z"]),He=c.filter((t=>!Ye.has(t)));const Xe={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>We(e,"x"),y:(t,{transform:e})=>We(e,"y")};Xe.translateX=Xe.x,Xe.translateY=Xe.y;const _e=new Set;let Ge=!1,Ze=!1,Je=!1;function Qe(){if(Ze){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 He.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)}))}Ze=!1,Ge=!1,_e.forEach((t=>t.complete(Je))),_e.clear()}function tn(){_e.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Ze=!0)}))}class en{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(_e.add(this),Ge||(Ge=!0,u.read(tn),u.resolveKeyframes(Qe))):(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;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_e.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,_e.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const nn=z((()=>void 0!==window.ScrollTimeline)),sn={};function rn(t,e){const n=z(t);return()=>sn[e]??n()}const on=rn((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),an=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,un={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:an([0,.65,.55,1]),circOut:an([.55,0,1,.45]),backIn:an([.31,.01,.66,-.59]),backOut:an([.33,1.53,.69,.99])};function hn(t,e){return t?"function"==typeof t?on()?Qt(t,e):"ease-out":pt(t)?an(t):Array.isArray(t)?t.map((t=>hn(t,e)||un.easeOut)):un[t]:void 0}function ln(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},h=void 0){const l={[e]:n};u&&(l.offset=u);const c=hn(a,i);Array.isArray(c)&&(l.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};h&&(d.pseudoElement=h);return t.animate(l,d)}function cn(t){return"function"==typeof t&&"applyToOptions"in t}class dn extends Ie{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const a=function({type:t,...e}){return cn(t)&&on()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=ln(e,n,s,a,i),!1===a.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=ke(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}this.notifyFinished()}}play(){this.isStopped||(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(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Z(Number(t))}get time(){return Z(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=G(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&nn()?(this.animation.timeline=e,t):n(this)}}const pn={anticipate:ot,backInOut:rt,circInOut:ht};function mn(t){"string"==typeof t.ease&&t.ease in pn&&(t.ease=pn[t.ease])}class fn extends dn{constructor(t){mn(t),Fe(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new De({...r,autoplay:!1}),a=G(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const vn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Kt.test(t)&&"0"!==t||t.startsWith("url(")));const yn=new Set(["opacity","clipPath","filter","transform"]),gn=z((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class bn extends Ie{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:h,...l}){super(),this.stop=()=>{this._animation?(this._animation.stop(),this.stopTimeline?.()):this.keyframeResolver?.cancel()},this.createdAt=gt.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:a,motionValue:u,element:h,...l},d=h?.KeyframeResolver||en;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,c,!n)),a,u,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,s,i,r){this.keyframeResolver=void 0;const{name:o,type:a,velocity:u,delay:h,isHandoff:l,onUpdate:c,onComplete:d}=i;this.resolvedAt=gt.now(),function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=vn(i,e),a=vn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||cn(n))&&s)}(e,o,a,u)||(!n.instantAnimations&&h||c?.(ke(e,i,s)),e[0]=e[e.length-1],i.duration=0,i.repeat=0);const p={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:s,...i,keyframes:e},m=!l&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:u}=e.owner.getProps();return gn()&&n&&yn.has(n)&&("transform"!==n||!u)&&!a&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}(p)?new fn({...p,element:p.motionValue.owner.current}):new De(p);m.finished.then((()=>{d?.(),this.notifyFinished()})).catch(t),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(Je=!0,tn(),Qe(),Je=!1),this._animation}get duration(){return this.animation.duration}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.cancel()}}const wn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Tn(t,e,n=1){const[s,i]=function(t){const e=wn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return W(t)?parseFloat(t):t}return a(i)?Tn(i,e,n+1):i}function Sn(t,e){return t?.[e]??t?.default??t}const Vn=new Set(["width","height","top","left","right","bottom",...c]),An=t=>e=>e.test(t),Mn=[s,l,o,d,p,m,{test:t=>"auto"===t,parse:t=>t}],xn=t=>Mn.find(An(t));const Cn=new Set(["brightness","contrast","saturate","opacity"]);function En(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(wt)||[];if(!s)return t;const i=n.replace(s,"");let r=Cn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const kn=/\b([a-z-]*)\(.*?\)/gu,Pn={...Kt,getAnimatableNone:t=>{const e=t.match(kn);return e?e.map(En).join(" "):t}},Fn={...f,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:Pn,WebkitFilter:Pn},In=t=>Fn[t];function On(t,e){let n=In(t);return n!==Pn&&(n=Kt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Dn=new Set(["auto","none","0"]);class Rn extends en{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.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),a(s))){const i=Tn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Vn.has(n)||2!==t.length)return;const[s,i]=t,r=xn(s),o=xn(i);if(r!==o)if(ze(r)&&ze(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||$(s)))&&n.push(e);var s;n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Dn.has(e)&&Ot(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=On(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Xe[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Xe[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Nn=!1;function Kn(){return Nn}function Bn(t,e){const n=function(t,e,n){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)}(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function Ln(t){return!("touch"===t.pointerType||Kn())}const Un=(t,e)=>!!e&&(t===e||Un(t,e.parentElement)),jn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const qn=new WeakSet;function Wn(t){return e=>{"Enter"===e.key&&t(e)}}function $n(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function zn(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!Kn()}function Yn(t,e,n={}){const[s,i,r]=Bn(t,n),o=t=>{const s=t.currentTarget;if(!zn(t)||qn.has(s))return;qn.add(s);const r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),zn(t)&&qn.has(s)&&(qn.delete(s),"function"==typeof r&&r(t,{success:e}))},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||Un(s,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",u,i)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=Wn((()=>{if(qn.has(n))return;$n(n,"down");const t=Wn((()=>{$n(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>$n(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,i))),e=t,jn.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),r}class Hn{constructor(t,e={}){this.version="12.7.5",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=gt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=gt.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 _);const n=this.events[t].add(e);return"change"===t?()=>{n(),u.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,e=!0){"none"===t&&console.trace(),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}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()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=gt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return J(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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Xn(t,e){return new Hn(t,e)}const _n=[...Mn,Et,Kt];function Gn(t,e,n){const s=t.getProps();return v(s,e,void 0!==n?n:s.custom,t)}function Zn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Xn(n))}function Jn(t,e){const s=t.getValue("willChange");if(i=s,Boolean(g(i)&&i.add))return s.add(e);if(!s&&n.WillChange){const s=new n.WillChange("auto");t.addValue("willChange",s),s.add(e)}var i}function Qn(t){return t.props[b]}const ts=t=>null!==t;const es={type:"spring",stiffness:500,damping:25,restSpeed:10},ns={type:"keyframes",duration:.8},ss={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},is=(t,{keyframes:e})=>e.length>2?ns:w.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:es:ss;const rs=(t,e,s,i={},r,o)=>a=>{const h=Sn(i,t)||{},l=h.delay||i.delay||0;let{elapsed:c=0}=i;c-=G(l);const d={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...h,delay:-c,onUpdate:t=>{e.set(t),h.onUpdate&&h.onUpdate(t)},onComplete:()=>{a(),h.onComplete&&h.onComplete()},name:t,motionValue:e,element:o?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:h,...l}){return!!Object.keys(l).length})(h)||Object.assign(d,is(t,d)),d.duration&&(d.duration=G(d.duration)),d.repeatDelay&&(d.repeatDelay=G(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(p=!0)),(n.instantAnimations||n.skipAnimations)&&(p=!0,d.duration=0,d.delay=0),d.allowFlatten=!h.type&&!h.ease,p&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ts),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(d.keyframes,h);if(void 0!==t)return void u.update((()=>{d.onUpdate(t),d.onComplete()}))}return new bn(d)};function os({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function as(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const h=[],l=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||l&&os(l,e))continue;const o={delay:n,...Sn(r||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=Qn(t);if(n){const t=window.MotionHandoffAnimation(n,e,u);null!==t&&(o.startTime=t,c=!0)}}Jn(t,e),s.start(rs(e,s,i,t.shouldReduceMotion&&Vn.has(e)?{type:!1}:o,t,c));const d=s.animation;d&&h.push(d)}return o&&Promise.all(h).then((()=>{u.update((()=>{o&&function(t,e){const n=Gn(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r)Zn(t,e,y(r[e]))}(t,o)}))})),h}function us(t,e,n={}){const s=Gn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(as(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,u=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(hs).forEach(((t,s)=>{t.notify("AnimationStart",e),o.push(us(t,e,{...r,delay:n+u(s)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(o)}(t,e,r+s,o,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then((()=>e()))}return Promise.all([r(),o(n.delay)])}function hs(t,e){return t.sortNodePosition(e)}function ls(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const cs=S.length;function ds(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&ds(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<cs;n++){const s=S[n],i=t.props[s];(T(i)||!1===i)&&(e[s]=i)}return e}const ps=[...M].reverse(),ms=M.length;function fs(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map((e=>us(t,e,n)));s=Promise.all(i)}else if("string"==typeof e)s=us(t,e,n);else{const i="function"==typeof e?Gn(t,e,n.custom):e;s=Promise.all(as(t,i,n))}return s.then((()=>{t.notify("AnimationComplete",e)}))}(t,e,n))))}function vs(t){let e=fs(t),n=bs(),s=!0;const i=e=>(n,s)=>{const i=Gn(t,s,"exit"===e?t.presenceContext?.custom:void 0);if(i){const{transition:t,transitionEnd:e,...s}=i;n={...n,...s,...e}}return n};function r(r){const{props:o}=t,a=ds(t.parent)||{},u=[],h=new Set;let l={},c=1/0;for(let e=0;e<ms;e++){const d=ps[e],p=n[d],m=void 0!==o[d]?o[d]:a[d],f=T(m),v=d===r?p.isActive:null;!1===v&&(c=e);let y=m===a[d]&&m!==o[d]&&f;if(y&&s&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...l},!p.isActive&&null===v||!m&&!p.prevProp||V(m)||"boolean"==typeof m)continue;const g=ys(p.prevProp,m);let b=g||d===r&&p.isActive&&!y&&f||e>c&&f,w=!1;const S=Array.isArray(m)?m:[m];let M=S.reduce(i(d),{});!1===v&&(M={});const{prevResolvedValues:x={}}=p,C={...x,...M},E=e=>{b=!0,h.has(e)&&(w=!0,h.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in C){const e=M[t],n=x[t];if(l.hasOwnProperty(t))continue;let s=!1;s=A(e)&&A(n)?!ls(e,n):e!==n,s?null!=e?E(t):h.add(t):void 0!==e&&h.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=M,p.isActive&&(l={...l,...M}),s&&t.blockInitialAnimation&&(b=!1);b&&(!(y&&g)||w)&&u.push(...S.map((t=>({animation:t,options:{type:d}}))))}if(h.size){const e={};if("boolean"!=typeof o.initial){const n=Gn(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}h.forEach((n=>{const s=t.getBaseTarget(n),i=t.getValue(n);i&&(i.liveStyle=!0),e[n]=s??null})),u.push({animation:e})}let d=Boolean(u.length);return!s||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),s=!1,d?e(u):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){if(n[e].isActive===s)return Promise.resolve();t.variantChildren?.forEach((t=>t.animationState?.setActive(e,s))),n[e].isActive=s;const i=r(e);for(const t in n)n[t].protectedKeys={};return i},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=bs(),s=!0}}}function ys(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!ls(e,t)}function gs(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function bs(){return{animate:gs(!0),whileInView:gs(),whileHover:gs(),whileTap:gs(),whileDrag:gs(),whileFocus:gs(),exit:gs()}}class ws{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Ts=0;const Ss={animation:{Feature:class extends ws{constructor(t){super(t),t.animationState||(t.animationState=vs(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();V(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ws{constructor(){super(...arguments),this.id=Ts++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then((()=>{e(this.id)}))}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Vs(t){return{point:{x:t.pageX,y:t.pageY}}}function As(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===n);const i=s["onHover"+n];i&&u.postRender((()=>i(e,Vs(e))))}function Ms(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function xs(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===n);const i=s["onTap"+("End"===n?"":n)];i&&u.postRender((()=>i(e,Vs(e))))}const Cs=new WeakMap,Es=new WeakMap,ks=t=>{const e=Cs.get(t.target);e&&e(t)},Ps=t=>{t.forEach(ks)};function Fs(t,e,n){const s=function({root:t,...e}){const n=t||document;Es.has(n)||Es.set(n,{});const s=Es.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ps,{root:t,...e})),s[i]}(e);return Cs.set(t,n),s.observe(t),()=>{Cs.delete(t),s.unobserve(t)}}const Is={some:0,all:1};const Os={inView:{Feature:class extends ws{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Is[s]};return Fs(this.node.current,r,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),r=e?n:s;r&&r(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ws{mount(){const{current:t}=this.node;t&&(this.unmount=Yn(t,((t,e)=>(xs(this.node,e,"Start"),(t,{success:e})=>xs(this.node,t,e?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends ws{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=H(Ms(this.node.current,"focus",(()=>this.onFocus())),Ms(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends ws{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[s,i,r]=Bn(t,n),o=t=>{if(!Ln(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{Ln(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach((t=>{t.addEventListener("pointerenter",o,i)})),r}(t,((t,e)=>(As(this.node,e,"Start"),t=>As(this.node,t,"End")))))}unmount(){}}}};const Ds=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Rs={current:null},Ns={current:!1};const Ks=new WeakMap;const Bs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ls{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=en,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=gt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,u.render(this.render,!1,!0))};const{latestValues:a,renderState:h,onUpdate:l}=r;this.onUpdate=l,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=C(e),this.isVariantNode=E(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==a[t]&&g(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Ks.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),Ns.current||function(){if(Ns.current=!0,x)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Rs.current=t.matches;t.addListener(e),e()}else Rs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Rs.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),h(this.notifyUpdate),h(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(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}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=w.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&u.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),i(),r&&r(),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 k){const e=k[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;e<Bs.length;e++){const n=Bs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(g(i))t.addValue(s,i);else if(g(r))t.addValue(s,Xn(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Xn(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Xn(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&&(W(n)||$(n))?n=parseFloat(n):(s=n,!_n.find(An(s))&&Kt.test(e)&&(n=On(t,e))),this.setBaseTarget(t,g(n)?n.get():n)),g(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=v(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||g(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 _),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Us extends Ls{constructor(){super(...arguments),this.KeyframeResolver=Rn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[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;g(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}class js extends Us{constructor(){super(...arguments),this.type="html",this.renderInstance=P}readValueFromInstance(t,e){if(w.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return We(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(F(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){I(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return O(t,e,n)}}class qs extends Us{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ds,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&D(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(w.has(e)){const t=In(e);return t&&t.default||0}return e=R.has(e)?e:N(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return K(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&u.postRender(this.updateDimensions)}build(t,e,n){B(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){L(t,e,n,s)}mount(t){this.isSVGTag=U(t.tagName),super.mount(t)}}const Ws={renderer:(t,e)=>j(t)?new qs(e):new js(e,{allowProjection:t!==q}),...Ss,...Os};export{Ws as domAnimation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as t}from"react";const e=(t,e,s)=>s>e?e:s<t?t:s,s={},a=t=>t,r=t({});function n(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function o(t){return"string"==typeof t||Array.isArray(t)}const i=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],c=["initial",...i];function l(t){return n(t.animate)||c.some((e=>o(t[e])))}function f(t){return Boolean(l(t)||t.variants)}const u="undefined"!=typeof window,d={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},p={};for(const t in d)p[t]={isEnabled:e=>d[t].some((t=>!!e[t]))};function m(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const g=["setup","read","resolveKeyframes","update","preRender","render","postRender"],h={value:null,addProjectionMetrics:null};function y(t,e){let a=!1,r=!0;const n={delta:0,timestamp:0,isProcessing:!1},o=()=>a=!0,i=g.reduce(((t,s)=>(t[s]=function(t,e){let s=new Set,a=new Set,r=!1,n=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1},c=0;function l(e){o.has(e)&&(f.schedule(e),t()),c++,e(i)}const f={schedule:(t,e=!1,n=!1)=>{const i=n&&r?s:a;return e&&o.add(t),i.has(t)||i.add(t),t},cancel:t=>{a.delete(t),o.delete(t)},process:t=>{i=t,r?n=!0:(r=!0,[s,a]=[a,s],s.forEach(l),e&&h.value&&h.value.frameloop[e].push(c),c=0,s.clear(),r=!1,n&&(n=!1,f.process(t)))}};return f}(o,e?s:void 0),t)),{}),{setup:c,read:l,resolveKeyframes:f,
|
|
1
|
+
import{createContext as t}from"react";const e=(t,e,s)=>s>e?e:s<t?t:s,s={},a=t=>t,r=t({});function n(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function o(t){return"string"==typeof t||Array.isArray(t)}const i=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],c=["initial",...i];function l(t){return n(t.animate)||c.some((e=>o(t[e])))}function f(t){return Boolean(l(t)||t.variants)}const u="undefined"!=typeof window,d={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},p={};for(const t in d)p[t]={isEnabled:e=>d[t].some((t=>!!e[t]))};function m(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const g=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],h={value:null,addProjectionMetrics:null};function y(t,e){let a=!1,r=!0;const n={delta:0,timestamp:0,isProcessing:!1},o=()=>a=!0,i=g.reduce(((t,s)=>(t[s]=function(t,e){let s=new Set,a=new Set,r=!1,n=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1},c=0;function l(e){o.has(e)&&(f.schedule(e),t()),c++,e(i)}const f={schedule:(t,e=!1,n=!1)=>{const i=n&&r?s:a;return e&&o.add(t),i.has(t)||i.add(t),t},cancel:t=>{a.delete(t),o.delete(t)},process:t=>{i=t,r?n=!0:(r=!0,[s,a]=[a,s],s.forEach(l),e&&h.value&&h.value.frameloop[e].push(c),c=0,s.clear(),r=!1,n&&(n=!1,f.process(t)))}};return f}(o,e?s:void 0),t)),{}),{setup:c,read:l,resolveKeyframes:f,preUpdate:u,update:d,preRender:p,render:m,postRender:y}=i,v=()=>{const o=s.useManualTiming?n.timestamp:performance.now();a=!1,s.useManualTiming||(n.delta=r?1e3/60:Math.max(Math.min(o-n.timestamp,40),1)),n.timestamp=o,n.isProcessing=!0,c.process(n),l.process(n),f.process(n),u.process(n),d.process(n),p.process(n),m.process(n),y.process(n),n.isProcessing=!1,a&&e&&(r=!1,t(v))};return{schedule:g.reduce(((e,s)=>{const o=i[s];return e[s]=(e,s=!1,i=!1)=>(a||(a=!0,r=!0,n.isProcessing||t(v)),o.schedule(e,s,i)),e}),{}),cancel:t=>{for(let e=0;e<g.length;e++)i[g[e]].cancel(t)},state:n,steps:i}}const{schedule:v,cancel:w,state:x,steps:b}=y("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:a,!0),k=t=>e=>"string"==typeof e&&e.startsWith(t),P=k("--"),S=k("var(--"),B=t=>!!S(t)&&R.test(t.split("/*")[0].trim()),R=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,T={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},X={...T,transform:t=>e(0,1,t)},Y={...T,default:1},O=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),A=O("deg"),L=O("%"),V=O("px"),W=O("vh"),$=O("vw"),C=(()=>({...L,parse:t=>L.parse(t)/100,transform:t=>L.transform(100*t)}))(),Z=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],F=(()=>new Set(Z))(),j={...T,transform:Math.round},M={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,backgroundPositionX:V,backgroundPositionY:V,...{rotate:A,rotateX:A,rotateY:A,rotateZ:A,scale:Y,scaleX:Y,scaleY:Y,scaleZ:Y,skew:A,skewX:A,skewY:A,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:X,originX:C,originY:C,originZ:V},zIndex:j,size:V,fillOpacity:X,strokeOpacity:X,numOctaves:j},{schedule:E,cancel:H}=y(queueMicrotask,!1),I=(t,e)=>e&&"number"==typeof t?e.transform(t):t,z=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),D="data-"+z("framerAppearId"),q=t(null),U=t({}),K={};function G(t){for(const e in t)K[e]=t[e],P(e)&&(K[e].isCSSVariable=!0)}function J(t,{layout:e,layoutId:s}){return F.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!K[t]||"opacity"===t)}const N=t=>Boolean(t&&t.getVelocity),Q={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_=Z.length;function tt(t,e,s){const{style:a,vars:r,transformOrigin:n}=t;let o=!1,i=!1;for(const t in e){const s=e[t];if(F.has(t))o=!0;else if(P(t))r[t]=s;else{const e=I(s,M[t]);t.startsWith("origin")?(i=!0,n[t]=e):a[t]=e}}if(e.transform||(o||s?a.transform=function(t,e,s){let a="",r=!0;for(let n=0;n<_;n++){const o=Z[n],i=t[o];if(void 0===i)continue;let c=!0;if(c="number"==typeof i?i===(o.startsWith("scale")?1:0):0===parseFloat(i),!c||s){const t=I(i,M[o]);c||(r=!1,a+=`${Q[o]||o}(${t}) `),s&&(e[o]=t)}}return a=a.trim(),s?a=s(e,r?"":a):r&&(a="none"),a}(e,t.transform,s):a.transform&&(a.transform="none")),i){const{originX:t="50%",originY:e="50%",originZ:s=0}=n;a.transformOrigin=`${t} ${e} ${s}`}}const et=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function st(t){return"string"==typeof t&&!t.includes("-")&&!!(et.indexOf(t)>-1||/[A-Z]/u.test(t))}const at={offset:"stroke-dashoffset",array:"stroke-dasharray"},rt={offset:"strokeDashoffset",array:"strokeDasharray"};function nt(t,e,s){return"string"==typeof t?t:V.transform(e+s*t)}function ot(t,{attrX:e,attrY:s,attrScale:a,originX:r,originY:n,pathLength:o,pathSpacing:i=1,pathOffset:c=0,...l},f,u){if(tt(t,l,u),f)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:m}=t;d.transform&&(m&&(p.transform=d.transform),delete d.transform),m&&(void 0!==r||void 0!==n||p.transform)&&(p.transformOrigin=function(t,e,s){return`${nt(e,t.x,t.width)} ${nt(s,t.y,t.height)}`}(m,void 0!==r?r:.5,void 0!==n?n:.5)),void 0!==e&&(d.x=e),void 0!==s&&(d.y=s),void 0!==a&&(d.scale=a),void 0!==o&&function(t,e,s=1,a=0,r=!0){t.pathLength=1;const n=r?at:rt;t[n.offset]=V.transform(-a);const o=V.transform(e),i=V.transform(s);t[n.array]=`${o} ${i}`}(d,o,i,c,!1)}const it=t=>"string"==typeof t&&"svg"===t.toLowerCase();function ct(t){const e=[{},{}];return t?.values.forEach(((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()})),e}function lt(t,e,s,a){if("function"==typeof e){const[r,n]=ct(a);e=e(void 0!==s?s:t.custom,r,n)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[r,n]=ct(a);e=e(void 0!==s?s:t.custom,r,n)}return e}const ft=t=>Array.isArray(t),ut=t=>ft(t)?t[t.length-1]||0:t;function dt(t){const e=N(t)?t.get():t;return s=e,Boolean(s&&"object"==typeof s&&s.mix&&s.toValue)?e.toValue():e;var s}function pt(t,e,s){const{style:a}=t,r={};for(const n in a)(N(a[n])||e.style&&N(e.style[n])||J(n,t)||void 0!==s?.getValue(n)?.liveStyle)&&(r[n]=a[n]);return r}function mt(t,e){try{e.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(t){e.dimensions={x:0,y:0,width:0,height:0}}}function gt(t,{style:e,vars:s},a,r){Object.assign(t.style,e,r&&r.getProjectionStyles(a));for(const e in s)t.style.setProperty(e,s[e])}const ht=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"]);function yt(t,e,s,a){gt(t,e,void 0,a);for(const s in e.attrs)t.setAttribute(ht.has(s)?s:z(s),e.attrs[s])}function vt(t,e,s){const a=pt(t,e,s);for(const s in t)if(N(t[s])||N(e[s])){a[-1!==Z.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return a}export{X as A,e as B,L as C,B as D,w as E,V as F,Z as G,A as H,$ as I,W as J,M as K,r as L,s as M,b as N,K as O,q as P,gt as Q,P as R,U as S,G as T,ut as U,c as V,ft as W,i as X,ht as Y,z as Z,o as a,m as b,u as c,N as d,J as e,p as f,tt as g,ot as h,l as i,it as j,st as k,f as l,E as m,n,D as o,lt as p,vt as q,dt as r,pt as s,F as t,v as u,mt as v,yt as w,a as x,x as y,T as z};
|