framer-motion 12.4.12 → 12.4.13

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