UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

1 lines • 55.6 kB
function t(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const e={skipAnimations:!1,useManualTiming:!1};function s(t){let e;return()=>(void 0===e&&(e=t()),e)}const n=t=>t,r=(t,e,s)=>{const n=e-t;return 0===n?1:(s-t)/n};class i{constructor(){this.subscriptions=[]}add(e){var s,n;return s=this.subscriptions,n=e,-1===s.indexOf(n)&&s.push(n),()=>t(this.subscriptions,e)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let r=0;r<n;r++){const n=this.subscriptions[r];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const o=t=>1e3*t,a=t=>t/1e3;function l(t,e){return e?t*(1e3/e):0}const u=s((()=>void 0!==window.ScrollTimeline));class h{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=e}attachTimeline(t,e){const s=this.animations.map((s=>u()&&s.attachTimeline?s.attachTimeline(t):"function"==typeof e?e(s):void 0));return()=>{s.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")}}class c extends h{then(t,e){return this.finished.finally(t).then((()=>{}))}}const d={value:null,addProjectionMetrics:null},p=t=>Array.isArray(t)&&"number"==typeof t[0],f={};function m(t,e){const n=s(t);return()=>f[e]??n()}const y=m((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),g=(t,e,s=10)=>{let n="";const r=Math.max(Math.round(e/s),2);for(let e=0;e<r;e++)n+=t(e/(r-1))+", ";return`linear(${n.substring(0,n.length-2)})`},v=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,b={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:v([0,.65,.55,1]),circOut:v([.55,0,1,.45]),backIn:v([.31,.01,.66,-.59]),backOut:v([.33,1.53,.69,.99])};function w(t,e){return t?"function"==typeof t&&y()?g(t,e):p(t)?v(t):Array.isArray(t)?t.map((t=>w(t,e)||b.easeOut)):b[t]:void 0}function T(t,e,s,{delay:n=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},u=void 0){const h={[e]:s};l&&(h.offset=l);const c=w(a,r);Array.isArray(c)&&(h.easing=c);return t.animate(h,{delay:n,duration:r,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal",pseudoElement:u})}function S(t){return"function"==typeof t&&"applyToOptions"in t}function M(t,e){return t?.[e]??t?.default??t}const V=2e4;function A(t){let e=0;let s=t.next(e);for(;!s.done&&e<V;)e+=50,s=t.next(e);return e>=V?1/0:e}function x(t,e=100,s){const n=s({...t,keyframes:[0,e]}),r=Math.min(A(n),V);return{type:"keyframes",ease:t=>n.next(r*t).value/e,duration:a(r)}}function k(t){return Boolean("function"==typeof t&&y()||!t||"string"==typeof t&&(t in b||y())||p(t)||Array.isArray(t)&&t.every(k))}function P(t,e){t.timeline=e,t.onfinish=null}const C=["read","resolveKeyframes","update","preRender","render","postRender"];function F(t,e){let s=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>s=!0,o=C.reduce(((t,s)=>(t[s]=function(t,e){let s=new Set,n=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?s:n;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{a=t,r?i=!0:(r=!0,[s,n]=[n,s],s.forEach(u),e&&d.value&&d.value.frameloop[e].push(l),l=0,s.clear(),r=!1,i&&(i=!1,h.process(t)))}};return h}(i,e?s:void 0),t)),{}),{read:a,resolveKeyframes:l,update:u,preRender:h,render:c,postRender:p}=o,f=()=>{const i=performance.now();s=!1,r.delta=n?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),p.process(r),r.isProcessing=!1,s&&e&&(n=!1,t(f))};return{schedule:C.reduce(((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(s||(s=!0,n=!0,r.isProcessing||t(f)),a.schedule(e,i,o)),e}),{}),cancel:t=>{for(let e=0;e<C.length;e++)o[C[e]].cancel(t)},state:r,steps:o}}const{schedule:R,cancel:O,state:E,steps:I}=F("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:n,!0);let B;function D(){B=void 0}const K={now:()=>(void 0===B&&K.set(E.isProcessing||e.useManualTiming?E.timestamp:performance.now()),B),set:t=>{B=t,queueMicrotask(D)}};class N{constructor(t,e={}){this.version="12.7.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const s=K.now();this.updatedAt!==s&&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=K.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 i);const s=this.events[t].add(e);return"change"===t?()=>{s(),R.read((()=>{this.events.change.getSize()||this.stop()}))}:s}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,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}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=K.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return l(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 j(t,e){return new N(t,e)}const $=(t,e,s)=>s>e?e:s<t?t:s;function Y(t,e,s){const n=Math.max(e-5,0);return l(s-t(n),e-n)}const W=100,U=10,L=1,X=0,q=800,z=.3,Z=.3,H={granular:.01,default:2},G={granular:.005,default:.5},_=.01,J=10,Q=.05,tt=1,et=.001;function st({duration:t=q,bounce:e=z,velocity:s=X,mass:n=L}){let r,i,l=1-e;l=$(Q,tt,l),t=$(_,J,a(t)),l<1?(r=e=>{const n=e*l,r=n*t,i=n-s,o=rt(e,l),a=Math.exp(-r);return et-i/o*a},i=e=>{const n=e*l*t,i=n*s+s,o=Math.pow(l,2)*Math.pow(e,2)*t,a=Math.exp(-n),u=rt(Math.pow(e,2),l);return(-r(e)+et>0?-1:1)*((i-o)*a)/u}):(r=e=>Math.exp(-e*t)*((e-s)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(s-e)));const u=function(t,e,s){let n=s;for(let s=1;s<nt;s++)n-=t(n)/e(n);return n}(r,i,5/t);if(t=o(t),isNaN(u))return{stiffness:W,damping:U,duration:t};{const e=Math.pow(u,2)*n;return{stiffness:e,damping:2*l*Math.sqrt(n*e),duration:t}}}const nt=12;function rt(t,e){return t*Math.sqrt(1-e*e)}const it=["duration","bounce"],ot=["stiffness","damping","mass"];function at(t,e){return e.some((e=>void 0!==t[e]))}function lt(t=Z,e=z){const s="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:r}=s;const i=s.keyframes[0],l=s.keyframes[s.keyframes.length-1],u={done:!1,value:i},{stiffness:h,damping:c,mass:d,duration:p,velocity:f,isResolvedFromDuration:m}=function(t){let e={velocity:X,stiffness:W,damping:U,mass:L,isResolvedFromDuration:!1,...t};if(!at(t,ot)&&at(t,it))if(t.visualDuration){const s=t.visualDuration,n=2*Math.PI/(1.2*s),r=n*n,i=2*$(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:L,stiffness:r,damping:i}}else{const s=st(t);e={...e,...s,mass:L},e.isResolvedFromDuration=!0}return e}({...s,velocity:-a(s.velocity||0)}),y=f||0,v=c/(2*Math.sqrt(h*d)),b=l-i,w=a(Math.sqrt(h/d)),T=Math.abs(b)<5;let S;if(n||(n=T?H.granular:H.default),r||(r=T?G.granular:G.default),v<1){const t=rt(w,v);S=e=>{const s=Math.exp(-v*w*e);return l-s*((y+v*w*b)/t*Math.sin(t*e)+b*Math.cos(t*e))}}else if(1===v)S=t=>l-Math.exp(-w*t)*(b+(y+w*b)*t);else{const t=w*Math.sqrt(v*v-1);S=e=>{const s=Math.exp(-v*w*e),n=Math.min(t*e,300);return l-s*((y+v*w*b)*Math.sinh(n)+t*b*Math.cosh(n))/t}}const M={calculatedDuration:m&&p||null,next:t=>{const e=S(t);if(m)u.done=t>=p;else{let s=0;v<1&&(s=0===t?o(y):Y(S,t,e));const i=Math.abs(s)<=n,a=Math.abs(l-e)<=r;u.done=i&&a}return u.value=u.done?l:e,u},toString:()=>{const t=Math.min(A(M),V),e=g((e=>M.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return M}lt.applyToOptions=t=>{const e=x(t,100,lt);return t.ease=y()?e.ease:"easeOut",t.duration=o(e.duration),t.type="keyframes",t};const ut=t=>Array.isArray(t)&&"number"!=typeof t[0];function ht(t,e){return ut(t)?t[((t,e,s)=>{const n=e-t;return((s-t)%n+n)%n+t})(0,t.length,e)]:t}const ct=(t,e,s)=>t+(e-t)*s;function dt(t,e){const s=t[t.length-1];for(let n=1;n<=e;n++){const i=r(0,e,n);t.push(ct(s,1,i))}}function pt(t){const e=[0];return dt(e,t.length-1),e}const ft=t=>Boolean(t&&t.getVelocity);function mt(t){return"object"==typeof t&&!Array.isArray(t)}function yt(t,e,s,n){return"string"==typeof t&&mt(e)?function(t,e,s){if(t instanceof EventTarget)return[t];if("string"==typeof t){let n=document;e&&(n=e.current);const r=s?.[t]??n.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}(t,s,n):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function gt(t,e,s){return t*(e+1)}function vt(t,e,s,n){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?s:n.get(e)??t}function bt(e,s,n,r,i,o){!function(e,s,n){for(let r=0;r<e.length;r++){const i=e[r];i.at>s&&i.at<n&&(t(e,i),r--)}}(e,i,o);for(let t=0;t<s.length;t++)e.push({value:s[t],at:ct(i,o,r[t]),easing:ht(n,t)})}function wt(t,e){for(let s=0;s<t.length;s++)t[s]=t[s]/(e+1)}function Tt(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 Mt(t,e){return e[t]||(e[t]=[]),e[t]}function Vt(t){return Array.isArray(t)?t:[t]}function At(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const xt=t=>"number"==typeof t,kt=t=>t.every(xt),Pt=new WeakMap,Ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ft=new Set(Ct),Rt=new Set(["width","height","top","left","right","bottom",...Ct]),Ot=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function Et(t){const e=[{},{}];return t?.values.forEach(((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()})),e}function It(t,e,s,n){if("function"==typeof e){const[r,i]=Et(n);e=e(void 0!==s?s:t.custom,r,i)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[r,i]=Et(n);e=e(void 0!==s?s:t.custom,r,i)}return e}function Bt(t,e,s){t.hasValue(e)?t.getValue(e).set(s):t.addValue(e,j(s))}function Dt(t,e){const s=function(t,e,s){const n=t.getProps();return It(n,e,void 0!==s?s:n.custom,t)}(t,e);let{transitionEnd:n={},transition:r={},...i}=s||{};i={...i,...n};for(const e in i){Bt(t,e,Ot(i[e]))}}function Kt(t,s){const n=t.getValue("willChange");if(r=n,Boolean(ft(r)&&r.add))return n.add(s);if(!n&&e.WillChange){const n=new e.WillChange("auto");t.addValue("willChange",n),n.add(s)}var r}const Nt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),jt="data-"+Nt("framerAppearId");function $t(t){return t.props[jt]}const Yt=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t;function Wt(t,e,s,r){if(t===e&&s===r)return n;const i=e=>function(t,e,s,n,r){let i,o,a=0;do{o=e+(s-e)/2,i=Yt(o,n,r)-t,i>0?s=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:Yt(i(t),e,r)}const Ut=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Lt=t=>e=>1-t(1-e),Xt=Wt(.33,1.53,.69,.99),qt=Lt(Xt),zt=Ut(qt),Zt=t=>(t*=2)<1?.5*qt(t):.5*(2-Math.pow(2,-10*(t-1))),Ht=t=>1-Math.sin(Math.acos(t)),Gt=Lt(Ht),_t=Ut(Ht),Jt=t=>/^0[^.\s]+$/u.test(t);const Qt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},te={...Qt,transform:t=>$(0,1,t)},ee={...Qt,default:1},se=t=>Math.round(1e5*t)/1e5,ne=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const re=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ie=(t,e)=>s=>Boolean("string"==typeof s&&re.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),oe=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[r,i,o,a]=n.match(ne);return{[t]:parseFloat(r),[e]:parseFloat(i),[s]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ae={...Qt,transform:t=>Math.round((t=>$(0,255,t))(t))},le={test:ie("rgb","red"),parse:oe("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+ae.transform(t)+", "+ae.transform(e)+", "+ae.transform(s)+", "+se(te.transform(n))+")"};const ue={test:ie("#"),parse:function(t){let e="",s="",n="",r="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),r=t.substring(4,5),e+=e,s+=s,n+=n,r+=r),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:r?parseInt(r,16)/255:1}},transform:le.transform},he=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ce=he("deg"),de=he("%"),pe=he("px"),fe=he("vh"),me=he("vw"),ye={...de,parse:t=>de.parse(t)/100,transform:t=>de.transform(100*t)},ge={test:ie("hsl","hue"),parse:oe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+de.transform(se(e))+", "+de.transform(se(s))+", "+se(te.transform(n))+")"},ve={test:t=>le.test(t)||ue.test(t)||ge.test(t),parse:t=>le.test(t)?le.parse(t):ge.test(t)?ge.parse(t):ue.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?le.transform(t):ge.transform(t)},be=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const we="number",Te="color",Se=/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(),s=[],n={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Se,(t=>(ve.test(t)?(n.color.push(i),r.push(Te),s.push(ve.parse(t))):t.startsWith("var(")?(n.var.push(i),r.push("var"),s.push(t)):(n.number.push(i),r.push(we),s.push(parseFloat(t))),++i,"${}"))).split("${}");return{values:s,split:o,indexes:n,types:r}}function Ve(t){return Me(t).values}function Ae(t){const{split:e,types:s}=Me(t),n=e.length;return t=>{let r="";for(let i=0;i<n;i++)if(r+=e[i],void 0!==t[i]){const e=s[i];r+=e===we?se(t[i]):e===Te?ve.transform(t[i]):t[i]}return r}}const xe=t=>"number"==typeof t?0:t;const ke={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(ne)?.length||0)+(t.match(be)?.length||0)>0},parse:Ve,createTransformer:Ae,getAnimatableNone:function(t){const e=Ve(t);return Ae(t)(e.map(xe))}},Pe=new Set(["brightness","contrast","saturate","opacity"]);function Ce(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match(ne)||[];if(!n)return t;const r=s.replace(n,"");let i=Pe.has(e)?1:0;return n!==s&&(i*=100),e+"("+i+r+")"}const Fe=/\b([a-z-]*)\(.*?\)/gu,Re={...ke,getAnimatableNone:t=>{const e=t.match(Fe);return e?e.map(Ce).join(" "):t}},Oe={borderWidth:pe,borderTopWidth:pe,borderRightWidth:pe,borderBottomWidth:pe,borderLeftWidth:pe,borderRadius:pe,radius:pe,borderTopLeftRadius:pe,borderTopRightRadius:pe,borderBottomRightRadius:pe,borderBottomLeftRadius:pe,width:pe,maxWidth:pe,height:pe,maxHeight:pe,top:pe,right:pe,bottom:pe,left:pe,padding:pe,paddingTop:pe,paddingRight:pe,paddingBottom:pe,paddingLeft:pe,margin:pe,marginTop:pe,marginRight:pe,marginBottom:pe,marginLeft:pe,backgroundPositionX:pe,backgroundPositionY:pe},Ee={rotate:ce,rotateX:ce,rotateY:ce,rotateZ:ce,scale:ee,scaleX:ee,scaleY:ee,scaleZ:ee,skew:ce,skewX:ce,skewY:ce,distance:pe,translateX:pe,translateY:pe,translateZ:pe,x:pe,y:pe,z:pe,perspective:pe,transformPerspective:pe,opacity:te,originX:ye,originY:ye,originZ:pe},Ie={...Qt,transform:Math.round},Be={...Oe,...Ee,zIndex:Ie,size:pe,fillOpacity:te,strokeOpacity:te,numOctaves:Ie},De={...Be,color:ve,backgroundColor:ve,outlineColor:ve,fill:ve,stroke:ve,borderColor:ve,borderTopColor:ve,borderRightColor:ve,borderBottomColor:ve,borderLeftColor:ve,filter:Re,WebkitFilter:Re},Ke=t=>De[t];function Ne(t,e){let s=Ke(t);return s!==Re&&(s=ke),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const je=new Set(["auto","none","0"]);const $e=t=>180*t/Math.PI,Ye=t=>{const e=$e(Math.atan2(t[1],t[0]));return Ue(e)},We={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ye,rotateZ:Ye,skewX:t=>$e(Math.atan(t[1])),skewY:t=>$e(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ue=t=>((t%=360)<0&&(t+=360),t),Le=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Xe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),qe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Le,scaleY:Xe,scale:t=>(Le(t)+Xe(t))/2,rotateX:t=>Ue($e(Math.atan2(t[6],t[5]))),rotateY:t=>Ue($e(Math.atan2(-t[2],t[0]))),rotateZ:Ye,rotate:Ye,skewX:t=>$e(Math.atan(t[4])),skewY:t=>$e(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ze(t){return t.includes("scale")?1:0}function Ze(t,e){if(!t||"none"===t)return ze(e);const s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,r;if(s)n=qe,r=s;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=We,r=e}if(!r)return ze(e);const i=n[e],o=r[1].split(",").map(He);return"function"==typeof i?i(o):o[i]}function He(t){return parseFloat(t.trim())}const Ge=t=>t===Qt||t===pe,_e=new Set(["x","y","z"]),Je=Ct.filter((t=>!_e.has(t)));const Qe={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),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})=>Ze(e,"x"),y:(t,{transform:e})=>Ze(e,"y")};Qe.translateX=Qe.x,Qe.translateY=Qe.y;const ts=new Set;let es=!1,ss=!1;function ns(){if(ss){const t=Array.from(ts).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),s=new Map;e.forEach((t=>{const e=function(t){const e=[];return Je.forEach((s=>{const n=t.getValue(s);void 0!==n&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))})),e}(t);e.length&&(s.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=s.get(t);e&&e.forEach((([e,s])=>{t.getValue(e)?.set(s)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}ss=!1,es=!1,ts.forEach((t=>t.complete())),ts.clear()}function rs(){ts.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(ss=!0)}))}class is{constructor(t,e,s,n,r,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=r,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ts.add(this),es||(es=!0,R.read(rs),R.resolveKeyframes(ns))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:n}=this;for(let r=0;r<t.length;r++)if(null===t[r])if(0===r){const r=n?.get(),i=t[t.length-1];if(void 0!==r)t[0]=r;else if(s&&e){const n=s.readValue(e,i);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=i),n&&void 0===r&&n.set(t[0])}else t[r]=t[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ts.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ts.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const os=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),as=t=>e=>"string"==typeof e&&e.startsWith(t),ls=as("--"),us=as("var(--"),hs=t=>!!us(t)&&cs.test(t.split("/*")[0].trim()),cs=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ds=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ps(t,e,s=1){const[n,r]=function(t){const e=ds.exec(t);if(!e)return[,];const[,s,n,r]=e;return[`--${s??n}`,r]}(t);if(!n)return;const i=window.getComputedStyle(e).getPropertyValue(n);if(i){const t=i.trim();return os(t)?parseFloat(t):t}return hs(r)?ps(r,e,s+1):r}const fs=t=>e=>e.test(t),ms=[Qt,pe,de,ce,me,fe,{test:t=>"auto"===t,parse:t=>t}],ys=t=>ms.find(fs(t));class gs extends is{constructor(t,e,s,n,r){super(t,e,s,n,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:s}=this;if(!e||!e.current)return;super.readKeyframes();for(let s=0;s<t.length;s++){let n=t[s];if("string"==typeof n&&(n=n.trim(),hs(n))){const r=ps(n,e.current);void 0!==r&&(t[s]=r),s===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!Rt.has(s)||2!==t.length)return;const[n,r]=t,i=ys(n),o=ys(r);if(i!==o)if(Ge(i)&&Ge(o))for(let e=0;e<t.length;e++){const s=t[e];"string"==typeof s&&(t[e]=parseFloat(s))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,s=[];for(let e=0;e<t.length;e++)("number"==typeof(n=t[e])?0===n:null===n||"none"===n||"0"===n||Jt(n))&&s.push(e);var n;s.length&&function(t,e,s){let n,r=0;for(;r<t.length&&!n;){const e=t[r];"string"==typeof e&&!je.has(e)&&Me(e).values.length&&(n=t[r]),r++}if(n&&s)for(const r of e)t[r]=Ne(s,n)}(t,s,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:s}=this;if(!t||!t.current)return;"height"===s&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qe[s](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const n=e[e.length-1];void 0!==n&&t.getValue(s,n).jump(n,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const n=t.getValue(e);n&&n.jump(this.measuredOrigin,!1);const r=s.length-1,i=s[r];s[r]=Qe[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,s])=>{t.getValue(e).set(s)})),this.resolveNoneKeyframes()}}const vs=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!ke.test(t)&&"0"!==t||t.startsWith("url(")));function bs(t,e,s,n){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const i=t[t.length-1],o=vs(r,e),a=vs(i,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let s=0;s<t.length;s++)if(t[s]!==e)return!0}(t)||("spring"===s||S(s))&&n)}const ws=t=>null!==t;function Ts(t,{repeat:e,repeatType:s="loop"},n){const r=t.filter(ws),i=e&&"loop"!==s&&e%2==1?0:r.length-1;return i&&void 0!==n?n:r[i]}class Ss{constructor({autoplay:t=!0,delay:e=0,type:s="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:i="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=K.now(),this.options={autoplay:t,delay:e,type:s,repeat:n,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||(rs(),ns()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=K.now(),this.hasAttemptedResolve=!0;const{name:s,type:n,velocity:r,delay:i,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!bs(t,s,n,r)){if(!i)return a&&a(Ts(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 Ms(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+6*(e-t)*s:s<.5?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function Vs(t,e){return s=>s>0?e:t}const As=(t,e,s)=>{const n=t*t,r=s*(e*e-n)+n;return r<0?0:Math.sqrt(r)},xs=[ue,le,ge];function ks(t){const e=(s=t,xs.find((t=>t.test(s))));var s;if(!Boolean(e))return!1;let n=e.parse(t);return e===ge&&(n=function({hue:t,saturation:e,lightness:s,alpha:n}){t/=360,s/=100;let r=0,i=0,o=0;if(e/=100){const n=s<.5?s*(1+e):s+e-s*e,a=2*s-n;r=Ms(a,n,t+1/3),i=Ms(a,n,t),o=Ms(a,n,t-1/3)}else r=i=o=s;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*o),alpha:n}}(n)),n}const Ps=(t,e)=>{const s=ks(t),n=ks(e);if(!s||!n)return Vs(t,e);const r={...s};return t=>(r.red=As(s.red,n.red,t),r.green=As(s.green,n.green,t),r.blue=As(s.blue,n.blue,t),r.alpha=ct(s.alpha,n.alpha,t),le.transform(r))},Cs=(t,e)=>s=>e(t(s)),Fs=(...t)=>t.reduce(Cs),Rs=new Set(["none","hidden"]);function Os(t,e){return s=>ct(t,e,s)}function Es(t){return"number"==typeof t?Os:"string"==typeof t?hs(t)?Vs:ve.test(t)?Ps:Ds:Array.isArray(t)?Is:"object"==typeof t?ve.test(t)?Ps:Bs:Vs}function Is(t,e){const s=[...t],n=s.length,r=t.map(((t,s)=>Es(t)(t,e[s])));return t=>{for(let e=0;e<n;e++)s[e]=r[e](t);return s}}function Bs(t,e){const s={...t,...e},n={};for(const r in s)void 0!==t[r]&&void 0!==e[r]&&(n[r]=Es(t[r])(t[r],e[r]));return t=>{for(const e in n)s[e]=n[e](t);return s}}const Ds=(t,e)=>{const s=ke.createTransformer(e),n=Me(t),r=Me(e);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?Rs.has(t)&&!r.values.length||Rs.has(e)&&!n.values.length?function(t,e){return Rs.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}(t,e):Fs(Is(function(t,e){const s=[],n={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const i=e.types[r],o=t.indexes[i][n[i]],a=t.values[o]??0;s[r]=a,n[i]++}return s}(n,r),r.values),s):Vs(t,e)};function Ks(t,e,s){if("number"==typeof t&&"number"==typeof e&&"number"==typeof s)return ct(t,e,s);return Es(t)(t,e)}function Ns({keyframes:t,velocity:e=0,power:s=.8,timeConstant:n=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=s*e;const m=c+f,y=void 0===o?m:o(m);y!==m&&(f=y-c);const g=t=>-f*Math.exp(-t/n),v=t=>y+g(t),b=t=>{const e=g(t),s=v(t);d.done=Math.abs(e)<=u,d.value=d.done?y:s};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,T=lt({keyframes:[d.value,p(d.value)],velocity:Y(v,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 js=Wt(.42,0,1,1),$s=Wt(0,0,.58,1),Ys=Wt(.42,0,.58,1),Ws={linear:n,easeIn:js,easeInOut:Ys,easeOut:$s,circIn:Ht,circInOut:_t,circOut:Gt,backIn:qt,backInOut:zt,backOut:Xt,anticipate:Zt},Us=t=>{if(p(t)){t.length;const[e,s,n,r]=t;return Wt(e,s,n,r)}return"string"==typeof t?Ws[t]:t};function Ls(t,e,{clamp:s=!0,ease:i,mixer:o}={}){const a=t.length;if(e.length,1===a)return()=>e[0];if(2===a&&e[0]===e[1])return()=>e[1];const l=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const u=function(t,e,s){const r=[],i=s||Ks,o=t.length-1;for(let s=0;s<o;s++){let o=i(t[s],t[s+1]);if(e){const t=Array.isArray(e)?e[s]||n:e;o=Fs(t,o)}r.push(o)}return r}(e,i,o),h=u.length,c=s=>{if(l&&s<t[0])return e[0];let n=0;if(h>1)for(;n<t.length-2&&!(s<t[n+1]);n++);const i=r(t[n],t[n+1],s);return u[n](i)};return s?e=>c($(t[0],t[a-1],e)):c}function Xs({duration:t=300,keyframes:e,times:s,ease:n="easeInOut"}){const r=ut(n)?n.map(Us):Us(n),i={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(s&&s.length===e.length?s:pt(e),t),a=Ls(o,e,{ease:Array.isArray(r)?r:(l=e,u=r,l.map((()=>u||Ys)).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(i.value=a(e),i.done=e>=t,i)}}const qs=t=>{const e=({timestamp:e})=>t(e);return{start:()=>R.update(e,!0),stop:()=>O(e),now:()=>E.isProcessing?E.timestamp:K.now()}},zs={decay:Ns,inertia:Ns,tween:Xs,keyframes:Xs,spring:lt},Zs=t=>t/100;class Hs extends Ss{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:s,element:n,keyframes:r}=this.options,i=n?.KeyframeResolver||is;this.resolver=new i(r,((t,e)=>this.onKeyframesResolved(t,e)),e,s,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:r,velocity:i=0}=this.options,o=S(e)?e:zs[e]||Xs;let a,l;o!==Xs&&"number"!=typeof t[0]&&(a=Fs(Zs,Ks(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===r&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-i})),null===u.calculatedDuration&&(u.calculatedDuration=A(u));const{calculatedDuration:h}=u,c=h+n;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:h,resolvedDuration:c,totalDuration:c*(s+1)-n}}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:s}=this;if(!s){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:n,generator:r,mirroredGenerator:i,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:h}=s;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 y=this.currentTime-c*(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 v=this.currentTime,b=r;if(d){const t=Math.min(this.currentTime,u)/h;let e=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(s=1-s,f&&(s-=f/h)):"mirror"===p&&(b=i)),v=$(0,1,s)*h}const w=g?{done:!1,value:a[0]}:b.next(v);o&&(w.value=o(w.value));let{done:T}=w;g||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return S&&void 0!==n&&(w.value=Ts(a,this.options,n)),m&&m(w.value),S&&this.finish(),w}get duration(){const{resolved:t}=this;return t?a(t.calculatedDuration):0}get time(){return a(this.currentTime)}set time(t){t=o(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=a(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=qs,onPlay:e,startTime:s}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=s??this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){this._resolved?(this.state="paused",this.holdTime=this.currentTime??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)}get finished(){return this.currentFinishedPromise}}const Gs=new Set(["opacity","clipPath","filter","transform"]),_s=s((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const Js={anticipate:Zt,backInOut:zt,circInOut:_t};class Qs extends Ss{constructor(t){super(t);const{name:e,motionValue:s,element:n,keyframes:r}=this.options;this.resolver=new gs(r,((t,e)=>this.onKeyframesResolved(t,e)),e,s,n),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:s=300,times:n,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&&y()&&r in Js&&(r=Js[r]),S((u=this.options).type)||"spring"===u.type||!k(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,h=function(t,e){const s=new Hs({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:t[0]};const r=[];let i=0;for(;!n.done&&i<2e4;)n=s.sample(i),r.push(n.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]),s=h.duration,n=h.times,r=h.ease,i="keyframes"}const h=T(o.owner.current,a,t,{...this.options,duration:s,times:n,ease:r});return h.startTime=l??this.calcStartTime(),this.pendingTimeline?(P(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:s}=this.options;o.set(Ts(t,this.options,e)),s&&s(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:s,times:n,type:i,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return a(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return a(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.currentTime=o(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.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(t){if(this._resolved){const{resolved:e}=this;if(!e)return n;const{animation:s}=e;P(s,t)}else this.pendingTimeline=t;return n}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:s,duration:n,type:r,ease:i,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 Hs({...h,keyframes:s,duration:n,type:r,ease:i,times:a,isGenerator:!0}),d=o(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:s,repeatDelay:n,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 _s()&&s&&Gs.has(s)&&("transform"!==s||!l)&&!a&&!n&&"mirror"!==r&&0!==i&&"inertia"!==o}}const tn={type:"spring",stiffness:500,damping:25,restSpeed:10},en={type:"keyframes",duration:.8},sn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nn=(t,{keyframes:e})=>e.length>2?en:Ft.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:tn:sn;const rn=(t,e,s,n={},r,i)=>a=>{const l=M(n,t)||{},u=l.delay||n.delay||0;let{elapsed:h=0}=n;h-=o(u);let d={keyframes:Array.isArray(s)?s:[null,s],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:i?void 0:r};(function({when:t,delay:e,delayChildren:s,staggerChildren:n,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(l)||(d={...d,...nn(t,d)}),d.duration&&(d.duration=o(d.duration)),d.repeatDelay&&(d.repeatDelay=o(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(p=!0)),d.allowFlatten=!l.type&&!l.ease,p&&!i&&void 0!==e.get()){const t=Ts(d.keyframes,l);if(void 0!==t)return R.update((()=>{d.onUpdate(t),d.onComplete()})),new c([])}return!i&&Qs.supports(d)?new Qs(d):new Hs(d)};function on({protectedKeys:t,needsAnimating:e},s){const n=t.hasOwnProperty(s)&&!0!==e[s];return e[s]=!1,n}function an(t,e,{delay:s=0,transitionOverride:n,type:r}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:o,...a}=e;n&&(i=n);const l=[],u=r&&t.animationState&&t.animationState.getState()[r];for(const e in a){const n=t.getValue(e,t.latestValues[e]??null),r=a[e];if(void 0===r||u&&on(u,e))continue;const o={delay:s,...M(i||{},e)};let h=!1;if(window.MotionHandoffAnimation){const s=$t(t);if(s){const t=window.MotionHandoffAnimation(s,e,R);null!==t&&(o.startTime=t,h=!0)}}Kt(t,e),n.start(rn(e,n,r,t.shouldReduceMotion&&Rt.has(e)?{type:!1}:o,t,h));const c=n.animation;c&&l.push(c)}return o&&Promise.all(l).then((()=>{R.update((()=>{o&&Dt(t,o)}))})),l}const ln=()=>({x:{min:0,max:0},y:{min:0,max:0}}),un={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"]},hn={};for(const t in un)hn[t]={isEnabled:e=>un[t].some((t=>!!e[t]))};const cn="undefined"!=typeof window,dn={current:null},pn={current:!1};const fn=[...ms,ve,ke];const mn=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function yn(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||mn.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const gn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class vn{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:n,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=is,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=K.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,R.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=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=yn(e),this.isVariantNode=function(t){return Boolean(yn(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]&&ft(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Pt.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))),pn.current||function(){if(pn.current=!0,cn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>dn.current=t.matches;t.addListener(e),e()}else dn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||dn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),O(this.notifyUpdate),O(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 s=Ft.has(t);s&&this.onBindTransform&&this.onBindTransform();const n=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&R.preRender(this.notifyUpdate),s&&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,(()=>{n(),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 hn){const e=hn[t];if(!e)continue;const{isEnabled:s,Feature:n}=e;if(!this.features[t]&&n&&s(this.props)&&(this.features[t]=new n(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<gn.length;e++){const s=gn[e];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const n=t["on"+s];n&&(this.propEventSubscriptions[s]=this.on(s,n))}this.prevMotionValues=function(t,e,s){for(const n in e){const r=e[n],i=s[n];if(ft(r))t.addValue(n,r);else if(ft(i))t.addValue(n,j(r,{owner:t}));else if(i!==r)if(t.hasValue(n)){const e=t.getValue(n);!0===e.liveStyle?e.jump(r):e.hasAnimated||e.set(r)}else{const e=t.getStaticValue(n);t.addValue(n,j(void 0!==e?e:r,{owner:t}))}}for(const n in s)void 0===e[n]&&t.removeValue(n);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 s=this.values.get(t);e!==s&&(s&&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 s=this.values.get(t);return void 0===s&&void 0!==e&&(s=j(null===e?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){let s=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var n;return null!=s&&("string"==typeof s&&(os(s)||Jt(s))?s=parseFloat(s):(n=s,!fn.find(fs(n))&&ke.test(e)&&(s=Ne(t,e))),this.setBaseTarget(t,ft(s)?s.get():s)),ft(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let s;if("string"==typeof e||"object"==typeof e){const n=It(this.props,e,this.presenceContext?.custom);n&&(s=n[t])}if(e&&void 0!==s)return s;const n=this.getBaseTargetFromProps(this.props,t);return void 0===n||ft(n)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new i),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class bn extends vn{constructor(){super(...arguments),this.KeyframeResolver=gs}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:s}){delete e[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ft(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const wn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Tn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Sn=Ct.length;function Mn(t,e,s){const{style:n,vars:r,transformOrigin:i}=t;let o=!1,a=!1;for(const t in e){const s=e[t];if(Ft.has(t))o=!0;else if(ls(t))r[t]=s;else{const e=wn(s,Be[t]);t.startsWith("origin")?(a=!0,i[t]=e):n[t]=e}}if(e.transform||(o||s?n.transform=function(t,e,s){let n="",r=!0;for(let i=0;i<Sn;i++){const o=Ct[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||s){const t=wn(a,Be[o]);l||(r=!1,n+=`${Tn[o]||o}(${t}) `),s&&(e[o]=t)}}return n=n.trim(),s?n=s(e,r?"":n):r&&(n="none"),n}(e,t.transform,s):n.transform&&(n.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:s=0}=i;n.transformOrigin=`${t} ${e} ${s}`}}const Vn={offset:"stroke-dashoffset",array:"stroke-dasharray"},An={offset:"strokeDashoffset",array:"strokeDasharray"};function xn(t,e,s){return"string"==typeof t?t:pe.transform(e+s*t)}function kn(t,{attrX:e,attrY:s,attrScale:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},h,c){if(Mn(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,s){return`${xn(e,t.x,t.width)} ${xn(s,t.y,t.height)}`}(f,void 0!==r?r:.5,void 0!==i?i:.5)),void 0!==e&&(d.x=e),void 0!==s&&(d.y=s),void 0!==n&&(d.scale=n),void 0!==o&&function(t,e,s=1,n=0,r=!0){t.pathLength=1;const i=r?Vn:An;t[i.offset]=pe.transform(-n);const o=pe.transform(e),a=pe.transform(s);t[i.array]=`${o} ${a}`}(d,o,a,l,!1)}const Pn=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 Cn(t,{style:e,vars:s},n,r){Object.assign(t.style,e,r&&r.getProjectionStyles(n));for(const e in s)t.style.setProperty(e,s[e])}const Fn={};function Rn(t,{layout:e,layo