Socket
Socket
Sign inDemoInstall

@motionone/dom

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@motionone/dom - npm Package Compare versions

Comparing version 10.16.2 to 10.16.3

2

dist/animate/utils/controls.cjs.js

@@ -60,3 +60,3 @@ 'use strict';

value = utils.time.ms(value);
case "currentTime":
// Fall-through
case "playbackRate":

@@ -63,0 +63,0 @@ for (let i = 0; i < target.animations.length; i++) {

@@ -56,3 +56,3 @@ import { defaults, noop, time } from '@motionone/utils';

value = time.ms(value);
case "currentTime":
// Fall-through
case "playbackRate":

@@ -59,0 +59,0 @@ for (let i = 0; i < target.animations.length; i++) {

@@ -1,1 +0,1 @@

const t=(t,e,n)=>Math.min(Math.max(n,t),e),e={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},n=t=>"number"==typeof t,i=t=>Array.isArray(t)&&!n(t[0]);const a=(t,e,n)=>-n*t+n*e+t,s=()=>{},r=t=>t,o=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function l(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=o(0,e,i);t.push(a(n,1,s))}}function c(e,n=function(t){const e=[0];return l(e,t-1),e}(e.length),s=r){const c=e.length,u=c-n.length;return u>0&&l(n,u),r=>{let l=0;for(;l<c-2&&!(r<n[l+1]);l++);let u=t(0,1,o(n[l],n[l+1],r));const h=function(t,e){return i(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}(s,l);return u=h(u),a(e[l],e[l+1],u)}}const u=t=>Array.isArray(t)&&n(t[0]),h=t=>"object"==typeof t&&Boolean(t.createAnimation),d=t=>"function"==typeof t,f=t=>1e3*t,m=t=>t/1e3,p=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function y(t,e,n,i){if(t===e&&n===i)return r;const a=e=>function(t,e,n,i,a){let s,r,o=0;do{r=e+(n-e)/2,s=p(r,i,a)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:p(a(t),e,i)}const g={ease:y(.25,.1,.25,1),"ease-in":y(.42,0,1,1),"ease-in-out":y(.42,0,.58,1),"ease-out":y(0,0,.58,1)},v=/\((.*?)\)/;function T(e){if(d(e))return e;if(u(e))return y(...e);if(g[e])return g[e];if(e.startsWith("steps")){const n=v.exec(e);if(n){const e=n[1].split(",");return((e,n="end")=>i=>{const a=(i="end"===n?Math.min(i,.999):Math.max(i,.001))*e,s="end"===n?Math.floor(a):Math.ceil(a);return t(0,1,s/e)})(parseFloat(e[0]),e[1].trim())}}return r}var w=function(){};"production"!==process.env.NODE_ENV&&(w=function(t,e){if(!t)throw new Error(e)});class S{setAnimation(t){this.animation=t,null==t||t.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const D=new WeakMap;function b(t){return D.has(t)||D.set(t,{transforms:[],values:new Map}),D.get(t)}const A=["","X","Y","Z"],x={x:"translateX",y:"translateY",z:"translateZ"},O={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},k={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:O,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:r},skew:O},E=new Map,M=t=>`--motion-${t}`,R=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{A.forEach((e=>{R.push(t+e),E.set(M(t+e),k[t])}))}));const P=(t,e)=>R.indexOf(t)-R.indexOf(e),j=new Set(R),V=t=>j.has(t),$=t=>t.sort(P).reduce(q,"").trim(),q=(t,e)=>`${t} ${e}(var(${M(e)}))`,F=t=>t.startsWith("--"),N=new Set;const U=(t,e)=>document.createElement("div").animate(t,e),_={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{U({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(U({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{U({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}},B={},C={};for(const t in _)C[t]=()=>(void 0===B[t]&&(B[t]=_[t]()),B[t]);const I=(t,n)=>d(t)?C.linearEasing()?`linear(${((t,e)=>{let n="";const i=Math.round(e/.015);for(let e=0;e<i;e++)n+=t(o(0,i-1,e))+", ";return n.substring(0,n.length-2)})(t,n)})`:e.easing:u(t)?z(t):t,z=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`;function W(t){return x[t]&&(t=x[t]),V(t)?M(t):t}const K=(t,e)=>{e=W(e);let n=F(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=E.get(e);t&&(n=t.initialValue)}return n},X=(t,e,n)=>{e=W(e),F(e)?t.style.setProperty(e,n):t.style[e]=n};function Y(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}function Z(t,a,o,l={},c){const u=window.__MOTION_DEV_TOOLS_RECORD,m=!1!==l.record&&u;let p,{duration:y=e.duration,delay:g=e.delay,endDelay:v=e.endDelay,repeat:T=e.repeat,easing:w=e.easing,persist:D=!1,direction:A,offset:O,allowWebkitAcceleration:k=!1}=l;const M=b(t),R=V(a);let P=C.waapi();R&&((t,e)=>{x[e]&&(e=x[e]);const{transforms:n}=b(t);var i,a;a=e,-1===(i=n).indexOf(a)&&i.push(a),t.style.transform=$(n)})(t,a);const j=W(a),q=function(t,e){return t.has(e)||t.set(e,new S),t.get(e)}(M.values,j),U=E.get(j);return Y(q.animation,!(h(w)&&q.generator)&&!1!==l.record),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=K(t,j))&&void 0!==e?e:null==U?void 0:U.initialValue)&&void 0!==n?n:0};let S=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}((t=>Array.isArray(t)?t:[t])(o),e);const b=function(t,e){var n;let i=(null==e?void 0:e.toDefaultUnit)||r;const a=t[t.length-1];if("string"==typeof a){const t=(null===(n=a.match(/(-?[\d.]+)([a-z%]*)/))||void 0===n?void 0:n[2])||"";t&&(i=e=>e+t)}return i}(S,U);if(h(w)){const t=w.createAnimation(S,"opacity"!==a,e,j,q);w=t.easing,S=t.keyframes||S,y=t.duration||y}if(F(j)&&(C.cssRegisterProperty()?function(t){if(!N.has(t)){N.add(t);try{const{syntax:e,initialValue:n}=E.has(t)?E.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(j):P=!1),R&&!C.linearEasing()&&(d(w)||i(w)&&w.some(d))&&(P=!1),P){U&&(S=S.map((t=>n(t)?U.toDefaultUnit(t):t))),1!==S.length||C.partialKeyframes()&&!m||S.unshift(e());const a={delay:f(g),duration:f(y),endDelay:f(v),easing:i(w)?void 0:I(w,y),direction:A,iterations:T+1,fill:"both"};p=t.animate({[j]:S,offset:O,easing:i(w)?w.map((t=>I(t,y))):void 0},a),p.finished||(p.finished=new Promise(((t,e)=>{p.onfinish=t,p.oncancel=e})));const r=S[S.length-1];p.finished.then((()=>{D||(X(t,j,r),p.cancel())})).catch(s),k||(p.playbackRate=1.000001)}else if(c&&R)S=S.map((t=>"string"==typeof t?parseFloat(t):t)),1===S.length&&S.unshift(parseFloat(e())),p=new c((e=>{X(t,j,b?b(e):e)}),S,Object.assign(Object.assign({},l),{duration:y,easing:w}));else{const e=S[S.length-1];X(t,j,U&&n(e)?U.toDefaultUnit(e):e)}return m&&u(t,a,S,{duration:y,delay:g,easing:w,repeat:T,offset:O},"motion-one"),q.setAnimation(p),p}}const L=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);const G=t=>t(),H={get:(t,e)=>{const n=t.animations[0];switch(e){case"duration":return t.duration;case"currentTime":return m((null==n?void 0:n[e])||0);case"playbackRate":case"playState":return null==n?void 0:n[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(J)).catch(s)),t.finished;case"stop":return()=>{t.animations.forEach((t=>Y(t)))};case"forEachNative":return e=>{t.animations.forEach((n=>e(n,t)))};default:return void 0===(null==n?void 0:n[e])?void 0:()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=f(n);case"currentTime":case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}},J=t=>t.finished;function Q(t,e,n){return d(t)?t(e,n):t}const tt=(et=class{constructor(t,n=[0,1],{easing:a,duration:s=e.duration,delay:o=e.delay,endDelay:l=e.endDelay,repeat:u=e.repeat,offset:d,direction:f="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=r,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e})),a=a||e.easing,h(a)){const t=a.createAnimation(n);a=t.easing,n=t.keyframes||n,s=t.duration||s}this.repeat=u,this.easing=i(a)?r:T(a),this.updateDuration(s);const m=c(n,d,i(a)?a.map(T):r);this.tick=e=>{var n;let i=0;i=void 0!==this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate,this.t=i,i/=1e3,i=Math.max(i-o,0),"finished"===this.playState&&void 0===this.pauseTime&&(i=this.totalDuration);const a=i/this.duration;let s=Math.floor(a),r=a%1;!r&&a>=1&&(r=1),1===r&&s--;const c=s%2;("reverse"===f||"alternate"===f&&c||"alternate-reverse"===f&&!c)&&(r=1-r);const u=i>=this.totalDuration?1:Math.min(r,1),h=m(this.easing(u));t(h),void 0===this.pauseTime&&("finished"===this.playState||i>=this.totalDuration+l)?(this.playState="finished",null===(n=this.resolve)||void 0===n||n.call(this,h)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(t=this.reject)||void 0===t||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){void 0!==this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}},function(t,n,i={}){const a=(t=function(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}(t)).length;w(Boolean(a),"No valid element provided."),w(Boolean(n),"No keyframes defined.");const s=[];for(let e=0;e<a;e++){const r=t[e];for(const t in n){const o=L(i,t);o.delay=Q(o.delay,e,a);const l=Z(r,t,n[t],o,et);s.push(l)}}return((t,n,i=e.duration)=>new Proxy({animations:t.map(G).filter(Boolean),duration:i,options:n},H))(s,i,i.duration)});var et;export{tt as animate};
const t=(t,e,n)=>Math.min(Math.max(n,t),e),e={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},n=t=>"number"==typeof t,i=t=>Array.isArray(t)&&!n(t[0]);const a=(t,e,n)=>-n*t+n*e+t,s=()=>{},r=t=>t,o=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function l(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=o(0,e,i);t.push(a(n,1,s))}}function c(e,n=function(t){const e=[0];return l(e,t-1),e}(e.length),s=r){const c=e.length,u=c-n.length;return u>0&&l(n,u),r=>{let l=0;for(;l<c-2&&!(r<n[l+1]);l++);let u=t(0,1,o(n[l],n[l+1],r));const h=function(t,e){return i(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}(s,l);return u=h(u),a(e[l],e[l+1],u)}}const u=t=>Array.isArray(t)&&n(t[0]),h=t=>"object"==typeof t&&Boolean(t.createAnimation),d=t=>"function"==typeof t,f=t=>1e3*t,m=t=>t/1e3,p=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function y(t,e,n,i){if(t===e&&n===i)return r;const a=e=>function(t,e,n,i,a){let s,r,o=0;do{r=e+(n-e)/2,s=p(r,i,a)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:p(a(t),e,i)}const g={ease:y(.25,.1,.25,1),"ease-in":y(.42,0,1,1),"ease-in-out":y(.42,0,.58,1),"ease-out":y(0,0,.58,1)},v=/\((.*?)\)/;function w(e){if(d(e))return e;if(u(e))return y(...e);if(g[e])return g[e];if(e.startsWith("steps")){const n=v.exec(e);if(n){const e=n[1].split(",");return((e,n="end")=>i=>{const a=(i="end"===n?Math.min(i,.999):Math.max(i,.001))*e,s="end"===n?Math.floor(a):Math.ceil(a);return t(0,1,s/e)})(parseFloat(e[0]),e[1].trim())}}return r}var T=function(){};"production"!==process.env.NODE_ENV&&(T=function(t,e){if(!t)throw new Error(e)});class S{setAnimation(t){this.animation=t,null==t||t.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const D=new WeakMap;function b(t){return D.has(t)||D.set(t,{transforms:[],values:new Map}),D.get(t)}const A=["","X","Y","Z"],x={x:"translateX",y:"translateY",z:"translateZ"},O={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},k={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:O,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:r},skew:O},E=new Map,M=t=>`--motion-${t}`,R=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{A.forEach((e=>{R.push(t+e),E.set(M(t+e),k[t])}))}));const P=(t,e)=>R.indexOf(t)-R.indexOf(e),j=new Set(R),V=t=>j.has(t),$=t=>t.sort(P).reduce(q,"").trim(),q=(t,e)=>`${t} ${e}(var(${M(e)}))`,F=t=>t.startsWith("--"),N=new Set;const U=(t,e)=>document.createElement("div").animate(t,e),_={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{U({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(U({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{U({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}},B={},C={};for(const t in _)C[t]=()=>(void 0===B[t]&&(B[t]=_[t]()),B[t]);const I=(t,n)=>d(t)?C.linearEasing()?`linear(${((t,e)=>{let n="";const i=Math.round(e/.015);for(let e=0;e<i;e++)n+=t(o(0,i-1,e))+", ";return n.substring(0,n.length-2)})(t,n)})`:e.easing:u(t)?z(t):t,z=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`;function W(t){return x[t]&&(t=x[t]),V(t)?M(t):t}const K=(t,e)=>{e=W(e);let n=F(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=E.get(e);t&&(n=t.initialValue)}return n},X=(t,e,n)=>{e=W(e),F(e)?t.style.setProperty(e,n):t.style[e]=n};function Y(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}function Z(t,a,o,l={},c){const u=window.__MOTION_DEV_TOOLS_RECORD,m=!1!==l.record&&u;let p,{duration:y=e.duration,delay:g=e.delay,endDelay:v=e.endDelay,repeat:w=e.repeat,easing:T=e.easing,persist:D=!1,direction:A,offset:O,allowWebkitAcceleration:k=!1}=l;const M=b(t),R=V(a);let P=C.waapi();R&&((t,e)=>{x[e]&&(e=x[e]);const{transforms:n}=b(t);var i,a;a=e,-1===(i=n).indexOf(a)&&i.push(a),t.style.transform=$(n)})(t,a);const j=W(a),q=function(t,e){return t.has(e)||t.set(e,new S),t.get(e)}(M.values,j),U=E.get(j);return Y(q.animation,!(h(T)&&q.generator)&&!1!==l.record),()=>{const e=()=>{var e,n;return null!==(n=null!==(e=K(t,j))&&void 0!==e?e:null==U?void 0:U.initialValue)&&void 0!==n?n:0};let S=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}((t=>Array.isArray(t)?t:[t])(o),e);const b=function(t,e){var n;let i=(null==e?void 0:e.toDefaultUnit)||r;const a=t[t.length-1];if("string"==typeof a){const t=(null===(n=a.match(/(-?[\d.]+)([a-z%]*)/))||void 0===n?void 0:n[2])||"";t&&(i=e=>e+t)}return i}(S,U);if(h(T)){const t=T.createAnimation(S,"opacity"!==a,e,j,q);T=t.easing,S=t.keyframes||S,y=t.duration||y}if(F(j)&&(C.cssRegisterProperty()?function(t){if(!N.has(t)){N.add(t);try{const{syntax:e,initialValue:n}=E.has(t)?E.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(j):P=!1),R&&!C.linearEasing()&&(d(T)||i(T)&&T.some(d))&&(P=!1),P){U&&(S=S.map((t=>n(t)?U.toDefaultUnit(t):t))),1!==S.length||C.partialKeyframes()&&!m||S.unshift(e());const a={delay:f(g),duration:f(y),endDelay:f(v),easing:i(T)?void 0:I(T,y),direction:A,iterations:w+1,fill:"both"};p=t.animate({[j]:S,offset:O,easing:i(T)?T.map((t=>I(t,y))):void 0},a),p.finished||(p.finished=new Promise(((t,e)=>{p.onfinish=t,p.oncancel=e})));const r=S[S.length-1];p.finished.then((()=>{D||(X(t,j,r),p.cancel())})).catch(s),k||(p.playbackRate=1.000001)}else if(c&&R)S=S.map((t=>"string"==typeof t?parseFloat(t):t)),1===S.length&&S.unshift(parseFloat(e())),p=new c((e=>{X(t,j,b?b(e):e)}),S,Object.assign(Object.assign({},l),{duration:y,easing:T}));else{const e=S[S.length-1];X(t,j,U&&n(e)?U.toDefaultUnit(e):e)}return m&&u(t,a,S,{duration:y,delay:g,easing:T,repeat:w,offset:O},"motion-one"),q.setAnimation(p),p}}const L=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);const G=t=>t(),H={get:(t,e)=>{const n=t.animations[0];switch(e){case"duration":return t.duration;case"currentTime":return m((null==n?void 0:n[e])||0);case"playbackRate":case"playState":return null==n?void 0:n[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(J)).catch(s)),t.finished;case"stop":return()=>{t.animations.forEach((t=>Y(t)))};case"forEachNative":return e=>{t.animations.forEach((n=>e(n,t)))};default:return void 0===(null==n?void 0:n[e])?void 0:()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=f(n);case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}},J=t=>t.finished;function Q(t,e,n){return d(t)?t(e,n):t}const tt=(et=class{constructor(t,n=[0,1],{easing:a,duration:s=e.duration,delay:o=e.delay,endDelay:l=e.endDelay,repeat:u=e.repeat,offset:d,direction:f="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=r,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e})),a=a||e.easing,h(a)){const t=a.createAnimation(n);a=t.easing,n=t.keyframes||n,s=t.duration||s}this.repeat=u,this.easing=i(a)?r:w(a),this.updateDuration(s);const m=c(n,d,i(a)?a.map(w):r);this.tick=e=>{var n;let i=0;i=void 0!==this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate,this.t=i,i/=1e3,i=Math.max(i-o,0),"finished"===this.playState&&void 0===this.pauseTime&&(i=this.totalDuration);const a=i/this.duration;let s=Math.floor(a),r=a%1;!r&&a>=1&&(r=1),1===r&&s--;const c=s%2;("reverse"===f||"alternate"===f&&c||"alternate-reverse"===f&&!c)&&(r=1-r);const u=i>=this.totalDuration?1:Math.min(r,1),h=m(this.easing(u));t(h),void 0===this.pauseTime&&("finished"===this.playState||i>=this.totalDuration+l)?(this.playState="finished",null===(n=this.resolve)||void 0===n||n.call(this,h)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(t=this.reject)||void 0===t||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){void 0!==this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}},function(t,n,i={}){const a=(t=function(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}(t)).length;T(Boolean(a),"No valid element provided."),T(Boolean(n),"No keyframes defined.");const s=[];for(let e=0;e<a;e++){const r=t[e];for(const t in n){const o=L(i,t);o.delay=Q(o.delay,e,a);const l=Z(r,t,n[t],o,et);s.push(l)}}return((t,n,i=e.duration)=>new Proxy({animations:t.map(G).filter(Boolean),duration:i,options:n},H))(s,i,i.duration)});var et;export{tt as animate};

@@ -1,1 +0,1 @@

var t=function(){};function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}"production"!==process.env.NODE_ENV&&(t=function(t,e){if(!t)throw new Error(e)});const n=(t,e,n)=>Math.min(Math.max(n,t),e),i={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},a=t=>"number"==typeof t,s=t=>Array.isArray(t)&&!a(t[0]);function r(t,e){return s(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}const o=(t,e,n)=>-n*t+n*e+t,l=()=>{},c=t=>t,u=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function h(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const a=u(0,e,i);t.push(o(n,1,a))}}function f(t){const e=[0];return h(e,t-1),e}const d=t=>Array.isArray(t)&&a(t[0]),p=t=>"object"==typeof t&&Boolean(t.createAnimation),m=t=>"function"==typeof t,y=t=>"string"==typeof t,g=t=>1e3*t,v=t=>t/1e3,O=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function b(t,e,n,i){if(t===e&&n===i)return c;const a=e=>function(t,e,n,i,a){let s,r,o=0;do{r=e+(n-e)/2,s=O(r,i,a)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:O(a(t),e,i)}const w={ease:b(.25,.1,.25,1),"ease-in":b(.42,0,1,1),"ease-in-out":b(.42,0,.58,1),"ease-out":b(0,0,.58,1)},S=/\((.*?)\)/;function T(t){if(m(t))return t;if(d(t))return b(...t);if(w[t])return w[t];if(t.startsWith("steps")){const e=S.exec(t);if(e){const t=e[1].split(",");return((t,e="end")=>i=>{const a=(i="end"===e?Math.min(i,.999):Math.max(i,.001))*t,s="end"===e?Math.floor(a):Math.ceil(a);return n(0,1,s/t)})(parseFloat(t[0]),t[1].trim())}}return c}class x{constructor(t,e=[0,1],{easing:a,duration:l=i.duration,delay:d=i.delay,endDelay:m=i.endDelay,repeat:y=i.repeat,offset:g,direction:v="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=c,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e})),a=a||i.easing,p(a)){const t=a.createAnimation(e);a=t.easing,e=t.keyframes||e,l=t.duration||l}this.repeat=y,this.easing=s(a)?c:T(a),this.updateDuration(l);const O=function(t,e=f(t.length),i=c){const a=t.length,s=a-e.length;return s>0&&h(e,s),s=>{let l=0;for(;l<a-2&&!(s<e[l+1]);l++);let c=n(0,1,u(e[l],e[l+1],s));return c=r(i,l)(c),o(t[l],t[l+1],c)}}(e,g,s(a)?a.map(T):c);this.tick=e=>{var n;let i=0;i=void 0!==this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate,this.t=i,i/=1e3,i=Math.max(i-d,0),"finished"===this.playState&&void 0===this.pauseTime&&(i=this.totalDuration);const a=i/this.duration;let s=Math.floor(a),r=a%1;!r&&a>=1&&(r=1),1===r&&s--;const o=s%2;("reverse"===v||"alternate"===v&&o||"alternate-reverse"===v&&!o)&&(r=1-r);const l=i>=this.totalDuration?1:Math.min(r,1),c=O(this.easing(l));t(c);void 0===this.pauseTime&&("finished"===this.playState||i>=this.totalDuration+m)?(this.playState="finished",null===(n=this.resolve)||void 0===n||n.call(this,c)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(t=this.reject)||void 0===t||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){void 0!==this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}function A(t,e,n){return m(t)?t(e,n):t}class D{setAnimation(t){this.animation=t,null==t||t.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const M=new WeakMap;function E(t){return M.has(t)||M.set(t,{transforms:[],values:new Map}),M.get(t)}const k=["","X","Y","Z"],j={x:"translateX",y:"translateY",z:"translateZ"},P={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},R={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:P,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:c},skew:P},V=new Map,$=t=>`--motion-${t}`,q=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{k.forEach((e=>{q.push(t+e),V.set($(t+e),R[t])}))}));const F=(t,e)=>q.indexOf(t)-q.indexOf(e),I=new Set(q),U=t=>I.has(t),W=t=>t.sort(F).reduce(_,"").trim(),_=(t,e)=>`${t} ${e}(var(${$(e)}))`,C=t=>t.startsWith("--"),z=new Set;const B=(t,e)=>document.createElement("div").animate(t,e),N={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{B({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(B({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{B({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}},K={},X={};for(const t in N)X[t]=()=>(void 0===K[t]&&(K[t]=N[t]()),K[t]);const Y=(t,e)=>m(t)?X.linearEasing()?`linear(${((t,e)=>{let n="";const i=Math.round(e/.015);for(let e=0;e<i;e++)n+=t(u(0,i-1,e))+", ";return n.substring(0,n.length-2)})(t,e)})`:i.easing:d(t)?Z(t):t,Z=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`;const L=t=>Array.isArray(t)?t:[t];function G(t){return j[t]&&(t=j[t]),U(t)?$(t):t}const H=(t,e)=>{e=G(e);let n=C(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=V.get(e);t&&(n=t.initialValue)}return n},J=(t,e,n)=>{e=G(e),C(e)?t.style.setProperty(e,n):t.style[e]=n};function Q(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}function tt(t,e,n,r={},o){const u=window.__MOTION_DEV_TOOLS_RECORD,h=!1!==r.record&&u;let f,{duration:d=i.duration,delay:v=i.delay,endDelay:O=i.endDelay,repeat:b=i.repeat,easing:w=i.easing,persist:S=!1,direction:T,offset:x,allowWebkitAcceleration:A=!1}=r;const M=E(t),k=U(e);let P=X.waapi();k&&((t,e)=>{j[e]&&(e=j[e]);const{transforms:n}=E(t);var i,a;a=e,-1===(i=n).indexOf(a)&&i.push(a),t.style.transform=W(n)})(t,e);const R=G(e),$=function(t,e){return t.has(e)||t.set(e,new D),t.get(e)}(M.values,R),q=V.get(R);return Q($.animation,!(p(w)&&$.generator)&&!1!==r.record),()=>{const i=()=>{var e,n;return null!==(n=null!==(e=H(t,R))&&void 0!==e?e:null==q?void 0:q.initialValue)&&void 0!==n?n:0};let D=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}(L(n),i);const M=function(t,e){var n;let i=(null==e?void 0:e.toDefaultUnit)||c;const a=t[t.length-1];if(y(a)){const t=(null===(n=a.match(/(-?[\d.]+)([a-z%]*)/))||void 0===n?void 0:n[2])||"";t&&(i=e=>e+t)}return i}(D,q);if(p(w)){const t=w.createAnimation(D,"opacity"!==e,i,R,$);w=t.easing,D=t.keyframes||D,d=t.duration||d}if(C(R)&&(X.cssRegisterProperty()?function(t){if(!z.has(t)){z.add(t);try{const{syntax:e,initialValue:n}=V.has(t)?V.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(R):P=!1),k&&!X.linearEasing()&&(m(w)||s(w)&&w.some(m))&&(P=!1),P){q&&(D=D.map((t=>a(t)?q.toDefaultUnit(t):t))),1!==D.length||X.partialKeyframes()&&!h||D.unshift(i());const e={delay:g(v),duration:g(d),endDelay:g(O),easing:s(w)?void 0:Y(w,d),direction:T,iterations:b+1,fill:"both"};f=t.animate({[R]:D,offset:x,easing:s(w)?w.map((t=>Y(t,d))):void 0},e),f.finished||(f.finished=new Promise(((t,e)=>{f.onfinish=t,f.oncancel=e})));const n=D[D.length-1];f.finished.then((()=>{S||(J(t,R,n),f.cancel())})).catch(l),A||(f.playbackRate=1.000001)}else if(o&&k)D=D.map((t=>"string"==typeof t?parseFloat(t):t)),1===D.length&&D.unshift(parseFloat(i())),f=new o((e=>{J(t,R,M?M(e):e)}),D,Object.assign(Object.assign({},r),{duration:d,easing:w}));else{const e=D[D.length-1];J(t,R,q&&a(e)?q.toDefaultUnit(e):e)}return h&&u(t,e,D,{duration:d,delay:v,easing:w,repeat:b,offset:x},"motion-one"),$.setAnimation(f),f}}const et=t=>t(),nt={get:(t,e)=>{const n=t.animations[0];switch(e){case"duration":return t.duration;case"currentTime":return v((null==n?void 0:n[e])||0);case"playbackRate":case"playState":return null==n?void 0:n[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(it)).catch(l)),t.finished;case"stop":return()=>{t.animations.forEach((t=>Q(t)))};case"forEachNative":return e=>{t.animations.forEach((n=>e(n,t)))};default:return void 0===(null==n?void 0:n[e])?void 0:()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=g(n);case"currentTime":case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}},it=t=>t.finished,at=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function st(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}function rt(t,e,n,i){var s;return a(e)?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(s=i.get(e))&&void 0!==s?s:t}function ot(t,n,i,a,s,l){!function(t,n,i){for(let a=0;a<t.length;a++){const s=t[a];s.at>n&&s.at<i&&(e(t,s),a--)}}(t,s,l);for(let e=0;e<n.length;e++)t.push({value:n[e],at:o(s,l,a[e]),easing:r(i,e)})}function lt(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function ct(t,e={}){var n;const a=ut(t,e),s=a.map((t=>tt(...t,x))).filter(Boolean);return((t,e,n=i.duration)=>new Proxy({animations:t.map(et).filter(Boolean),duration:n,options:e},nt))(s,e,null===(n=a[0])||void 0===n?void 0:n[3].duration)}function ut(e,n={}){var{defaultOptions:a={}}=n,s=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)e.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(n[i[a]]=t[i[a]])}return n}(n,["defaultOptions"]);const r=[],o=new Map,l={},c=new Map;let d=0,m=0,g=0;for(let n=0;n<e.length;n++){const s=e[n];if(y(s)){c.set(s,m);continue}if(!Array.isArray(s)){c.set(s.name,rt(m,s.at,d,c));continue}const[r,u,v={}]=s;void 0!==v.at&&(m=rt(m,v.at,d,c));let O=0;const b=st(r,l),w=b.length;for(let e=0;e<w;e++){const n=ht(b[e],o);for(const s in u){const r=ft(s,n);let o=L(u[s]);const l=at(v,s);let{duration:c=a.duration||i.duration,easing:d=a.easing||i.easing}=l;if(p(d)){t("opacity"===s||o.length>1,"spring must be provided 2 keyframes within timeline()");const e=d.createAnimation(o,"opacity"!==s,(()=>0),s);d=e.easing,o=e.keyframes||o,c=e.duration||c}const y=A(v.delay,e,w)||0,b=m+y,S=b+c;let{offset:T=f(o.length)}=l;1===T.length&&0===T[0]&&(T[1]=1);const x=T.length-o.length;x>0&&h(T,x),1===o.length&&o.unshift(null),ot(r,o,d,T,b,S),O=Math.max(y+c,O),g=Math.max(S,g)}}d=m,m+=O}return o.forEach(((t,e)=>{for(const n in t){const o=t[n];o.sort(lt);const l=[],c=[],h=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:a}=o[t];l.push(n),c.push(u(0,g,e)),h.push(a||i.easing)}0!==c[0]&&(c.unshift(0),l.unshift(l[0]),h.unshift("linear")),1!==c[c.length-1]&&(c.push(1),l.push(null)),r.push([e,n,l,Object.assign(Object.assign(Object.assign({},a),{duration:g,easing:h,offset:c}),s)])}})),r}function ht(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ft(t,e){return e[t]||(e[t]=[]),e[t]}export{ut as createAnimationsFromTimeline,ct as timeline};
var t=function(){};function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}"production"!==process.env.NODE_ENV&&(t=function(t,e){if(!t)throw new Error(e)});const n=(t,e,n)=>Math.min(Math.max(n,t),e),i={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},a=t=>"number"==typeof t,s=t=>Array.isArray(t)&&!a(t[0]);function r(t,e){return s(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}const o=(t,e,n)=>-n*t+n*e+t,l=()=>{},c=t=>t,u=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function h(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const a=u(0,e,i);t.push(o(n,1,a))}}function f(t){const e=[0];return h(e,t-1),e}const d=t=>Array.isArray(t)&&a(t[0]),p=t=>"object"==typeof t&&Boolean(t.createAnimation),m=t=>"function"==typeof t,y=t=>"string"==typeof t,g=t=>1e3*t,v=t=>t/1e3,O=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function b(t,e,n,i){if(t===e&&n===i)return c;const a=e=>function(t,e,n,i,a){let s,r,o=0;do{r=e+(n-e)/2,s=O(r,i,a)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:O(a(t),e,i)}const w={ease:b(.25,.1,.25,1),"ease-in":b(.42,0,1,1),"ease-in-out":b(.42,0,.58,1),"ease-out":b(0,0,.58,1)},S=/\((.*?)\)/;function T(t){if(m(t))return t;if(d(t))return b(...t);if(w[t])return w[t];if(t.startsWith("steps")){const e=S.exec(t);if(e){const t=e[1].split(",");return((t,e="end")=>i=>{const a=(i="end"===e?Math.min(i,.999):Math.max(i,.001))*t,s="end"===e?Math.floor(a):Math.ceil(a);return n(0,1,s/t)})(parseFloat(t[0]),t[1].trim())}}return c}class x{constructor(t,e=[0,1],{easing:a,duration:l=i.duration,delay:d=i.delay,endDelay:m=i.endDelay,repeat:y=i.repeat,offset:g,direction:v="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=c,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e})),a=a||i.easing,p(a)){const t=a.createAnimation(e);a=t.easing,e=t.keyframes||e,l=t.duration||l}this.repeat=y,this.easing=s(a)?c:T(a),this.updateDuration(l);const O=function(t,e=f(t.length),i=c){const a=t.length,s=a-e.length;return s>0&&h(e,s),s=>{let l=0;for(;l<a-2&&!(s<e[l+1]);l++);let c=n(0,1,u(e[l],e[l+1],s));return c=r(i,l)(c),o(t[l],t[l+1],c)}}(e,g,s(a)?a.map(T):c);this.tick=e=>{var n;let i=0;i=void 0!==this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate,this.t=i,i/=1e3,i=Math.max(i-d,0),"finished"===this.playState&&void 0===this.pauseTime&&(i=this.totalDuration);const a=i/this.duration;let s=Math.floor(a),r=a%1;!r&&a>=1&&(r=1),1===r&&s--;const o=s%2;("reverse"===v||"alternate"===v&&o||"alternate-reverse"===v&&!o)&&(r=1-r);const l=i>=this.totalDuration?1:Math.min(r,1),c=O(this.easing(l));t(c);void 0===this.pauseTime&&("finished"===this.playState||i>=this.totalDuration+m)?(this.playState="finished",null===(n=this.resolve)||void 0===n||n.call(this,c)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(t=this.reject)||void 0===t||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){void 0!==this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}function A(t,e,n){return m(t)?t(e,n):t}class D{setAnimation(t){this.animation=t,null==t||t.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const M=new WeakMap;function E(t){return M.has(t)||M.set(t,{transforms:[],values:new Map}),M.get(t)}const k=["","X","Y","Z"],j={x:"translateX",y:"translateY",z:"translateZ"},P={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},R={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:P,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:c},skew:P},V=new Map,$=t=>`--motion-${t}`,q=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{k.forEach((e=>{q.push(t+e),V.set($(t+e),R[t])}))}));const F=(t,e)=>q.indexOf(t)-q.indexOf(e),I=new Set(q),U=t=>I.has(t),W=t=>t.sort(F).reduce(_,"").trim(),_=(t,e)=>`${t} ${e}(var(${$(e)}))`,C=t=>t.startsWith("--"),z=new Set;const B=(t,e)=>document.createElement("div").animate(t,e),N={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{B({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(B({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{B({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}},K={},X={};for(const t in N)X[t]=()=>(void 0===K[t]&&(K[t]=N[t]()),K[t]);const Y=(t,e)=>m(t)?X.linearEasing()?`linear(${((t,e)=>{let n="";const i=Math.round(e/.015);for(let e=0;e<i;e++)n+=t(u(0,i-1,e))+", ";return n.substring(0,n.length-2)})(t,e)})`:i.easing:d(t)?Z(t):t,Z=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`;const L=t=>Array.isArray(t)?t:[t];function G(t){return j[t]&&(t=j[t]),U(t)?$(t):t}const H=(t,e)=>{e=G(e);let n=C(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=V.get(e);t&&(n=t.initialValue)}return n},J=(t,e,n)=>{e=G(e),C(e)?t.style.setProperty(e,n):t.style[e]=n};function Q(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}function tt(t,e,n,r={},o){const u=window.__MOTION_DEV_TOOLS_RECORD,h=!1!==r.record&&u;let f,{duration:d=i.duration,delay:v=i.delay,endDelay:O=i.endDelay,repeat:b=i.repeat,easing:w=i.easing,persist:S=!1,direction:T,offset:x,allowWebkitAcceleration:A=!1}=r;const M=E(t),k=U(e);let P=X.waapi();k&&((t,e)=>{j[e]&&(e=j[e]);const{transforms:n}=E(t);var i,a;a=e,-1===(i=n).indexOf(a)&&i.push(a),t.style.transform=W(n)})(t,e);const R=G(e),$=function(t,e){return t.has(e)||t.set(e,new D),t.get(e)}(M.values,R),q=V.get(R);return Q($.animation,!(p(w)&&$.generator)&&!1!==r.record),()=>{const i=()=>{var e,n;return null!==(n=null!==(e=H(t,R))&&void 0!==e?e:null==q?void 0:q.initialValue)&&void 0!==n?n:0};let D=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}(L(n),i);const M=function(t,e){var n;let i=(null==e?void 0:e.toDefaultUnit)||c;const a=t[t.length-1];if(y(a)){const t=(null===(n=a.match(/(-?[\d.]+)([a-z%]*)/))||void 0===n?void 0:n[2])||"";t&&(i=e=>e+t)}return i}(D,q);if(p(w)){const t=w.createAnimation(D,"opacity"!==e,i,R,$);w=t.easing,D=t.keyframes||D,d=t.duration||d}if(C(R)&&(X.cssRegisterProperty()?function(t){if(!z.has(t)){z.add(t);try{const{syntax:e,initialValue:n}=V.has(t)?V.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(R):P=!1),k&&!X.linearEasing()&&(m(w)||s(w)&&w.some(m))&&(P=!1),P){q&&(D=D.map((t=>a(t)?q.toDefaultUnit(t):t))),1!==D.length||X.partialKeyframes()&&!h||D.unshift(i());const e={delay:g(v),duration:g(d),endDelay:g(O),easing:s(w)?void 0:Y(w,d),direction:T,iterations:b+1,fill:"both"};f=t.animate({[R]:D,offset:x,easing:s(w)?w.map((t=>Y(t,d))):void 0},e),f.finished||(f.finished=new Promise(((t,e)=>{f.onfinish=t,f.oncancel=e})));const n=D[D.length-1];f.finished.then((()=>{S||(J(t,R,n),f.cancel())})).catch(l),A||(f.playbackRate=1.000001)}else if(o&&k)D=D.map((t=>"string"==typeof t?parseFloat(t):t)),1===D.length&&D.unshift(parseFloat(i())),f=new o((e=>{J(t,R,M?M(e):e)}),D,Object.assign(Object.assign({},r),{duration:d,easing:w}));else{const e=D[D.length-1];J(t,R,q&&a(e)?q.toDefaultUnit(e):e)}return h&&u(t,e,D,{duration:d,delay:v,easing:w,repeat:b,offset:x},"motion-one"),$.setAnimation(f),f}}const et=t=>t(),nt={get:(t,e)=>{const n=t.animations[0];switch(e){case"duration":return t.duration;case"currentTime":return v((null==n?void 0:n[e])||0);case"playbackRate":case"playState":return null==n?void 0:n[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(it)).catch(l)),t.finished;case"stop":return()=>{t.animations.forEach((t=>Q(t)))};case"forEachNative":return e=>{t.animations.forEach((n=>e(n,t)))};default:return void 0===(null==n?void 0:n[e])?void 0:()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=g(n);case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}},it=t=>t.finished,at=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function st(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}function rt(t,e,n,i){var s;return a(e)?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(s=i.get(e))&&void 0!==s?s:t}function ot(t,n,i,a,s,l){!function(t,n,i){for(let a=0;a<t.length;a++){const s=t[a];s.at>n&&s.at<i&&(e(t,s),a--)}}(t,s,l);for(let e=0;e<n.length;e++)t.push({value:n[e],at:o(s,l,a[e]),easing:r(i,e)})}function lt(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function ct(t,e={}){var n;const a=ut(t,e),s=a.map((t=>tt(...t,x))).filter(Boolean);return((t,e,n=i.duration)=>new Proxy({animations:t.map(et).filter(Boolean),duration:n,options:e},nt))(s,e,null===(n=a[0])||void 0===n?void 0:n[3].duration)}function ut(e,n={}){var{defaultOptions:a={}}=n,s=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)e.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(n[i[a]]=t[i[a]])}return n}(n,["defaultOptions"]);const r=[],o=new Map,l={},c=new Map;let d=0,m=0,g=0;for(let n=0;n<e.length;n++){const s=e[n];if(y(s)){c.set(s,m);continue}if(!Array.isArray(s)){c.set(s.name,rt(m,s.at,d,c));continue}const[r,u,v={}]=s;void 0!==v.at&&(m=rt(m,v.at,d,c));let O=0;const b=st(r,l),w=b.length;for(let e=0;e<w;e++){const n=ht(b[e],o);for(const s in u){const r=ft(s,n);let o=L(u[s]);const l=at(v,s);let{duration:c=a.duration||i.duration,easing:d=a.easing||i.easing}=l;if(p(d)){t("opacity"===s||o.length>1,"spring must be provided 2 keyframes within timeline()");const e=d.createAnimation(o,"opacity"!==s,(()=>0),s);d=e.easing,o=e.keyframes||o,c=e.duration||c}const y=A(v.delay,e,w)||0,b=m+y,S=b+c;let{offset:T=f(o.length)}=l;1===T.length&&0===T[0]&&(T[1]=1);const x=T.length-o.length;x>0&&h(T,x),1===o.length&&o.unshift(null),ot(r,o,d,T,b,S),O=Math.max(y+c,O),g=Math.max(S,g)}}d=m,m+=O}return o.forEach(((t,e)=>{for(const n in t){const o=t[n];o.sort(lt);const l=[],c=[],h=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:a}=o[t];l.push(n),c.push(u(0,g,e)),h.push(a||i.easing)}0!==c[0]&&(c.unshift(0),l.unshift(l[0]),h.unshift("linear")),1!==c[c.length-1]&&(c.push(1),l.push(null)),r.push([e,n,l,Object.assign(Object.assign(Object.assign({},a),{duration:g,easing:h,offset:c}),s)])}})),r}function ht(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ft(t,e){return e[t]||(e[t]=[]),e[t]}export{ut as createAnimationsFromTimeline,ct as timeline};

@@ -1,1 +0,1 @@

var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{j:()=>H});const i={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},n=()=>{},a=t=>t,s=t=>"object"==typeof t&&Boolean(t.createAnimation),r=t=>"number"==typeof t,o=t=>Array.isArray(t)&&!r(t[0]),l=(t,e,i)=>-i*t+i*e+t,c=(t,e,i)=>e-t==0?1:(i-t)/(e-t);function u(t,e){const i=t[t.length-1];for(let n=1;n<=e;n++){const a=c(0,e,n);t.push(l(i,1,a))}}const h=(t,e,i)=>Math.min(Math.max(i,t),e);const d=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function f(t,e,i,n){if(t===e&&i===n)return a;return a=>0===a||1===a?a:d(function(t,e,i,n,a){let s,r,o=0;do{r=e+(i-e)/2,s=d(r,n,a)-t,s>0?i=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(a,0,1,t,i),e,n)}const m=t=>"function"==typeof t,p=t=>Array.isArray(t)&&r(t[0]),y={ease:f(.25,.1,.25,1),"ease-in":f(.42,0,1,1),"ease-in-out":f(.42,0,.58,1),"ease-out":f(0,0,.58,1)},g=/\((.*?)\)/;function v(t){if(m(t))return t;if(p(t))return f(...t);if(y[t])return y[t];if(t.startsWith("steps")){const e=g.exec(t);if(e){const t=e[1].split(",");return((t,e="end")=>i=>{const n=(i="end"===e?Math.min(i,.999):Math.max(i,.001))*t,a="end"===e?Math.floor(n):Math.ceil(n);return h(0,1,a/t)})(parseFloat(t[0]),t[1].trim())}}return a}class T{setAnimation(t){this.animation=t,null==t||t.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const w=new WeakMap;function b(t){return w.has(t)||w.set(t,{transforms:[],values:new Map}),w.get(t)}const S=["","X","Y","Z"],D={x:"translateX",y:"translateY",z:"translateZ"},O={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},A={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:O,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:a},skew:O},x=new Map,k=t=>`--motion-${t}`,M=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{S.forEach((e=>{M.push(t+e),x.set(k(t+e),A[t])}))}));const j=(t,e)=>M.indexOf(t)-M.indexOf(e),E=new Set(M),P=t=>E.has(t),R=(t,e)=>`${t} ${e}(var(${k(e)}))`,V=t=>t.startsWith("--"),$=new Set,q=t=>1e3*t,F=(t,e)=>document.createElement("div").animate(t,e),U={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{F({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(F({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{F({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}},B={},C={};for(const t in U)C[t]=()=>(void 0===B[t]&&(B[t]=U[t]()),B[t]);const I=(t,e)=>m(t)?C.linearEasing()?`linear(${((t,e)=>{let i="";const n=Math.round(e/.015);for(let e=0;e<n;e++)i+=t(c(0,n-1,e))+", ";return i.substring(0,i.length-2)})(t,e)})`:i.easing:p(t)?_(t):t,_=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`;function z(t){return D[t]&&(t=D[t]),P(t)?k(t):t}const W=(t,e,i)=>{e=z(e),V(e)?t.style.setProperty(e,i):t.style[e]=i};function K(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}function N(t,e,l,c={},u){const h=window.__MOTION_DEV_TOOLS_RECORD,d=!1!==c.record&&h;let f,{duration:p=i.duration,delay:y=i.delay,endDelay:g=i.endDelay,repeat:v=i.repeat,easing:w=i.easing,persist:S=!1,direction:O,offset:A,allowWebkitAcceleration:k=!1}=c;const M=b(t),E=P(e);let F=C.waapi();E&&((t,e)=>{D[e]&&(e=D[e]);const{transforms:i}=b(t);var n,a;a=e,-1===(n=i).indexOf(a)&&n.push(a),t.style.transform=(t=>t.sort(j).reduce(R,"").trim())(i)})(t,e);const U=z(e),B=function(t,e){return t.has(e)||t.set(e,new T),t.get(e)}(M.values,U),_=x.get(U);return K(B.animation,!(s(w)&&B.generator)&&!1!==c.record),()=>{const i=()=>{var e,i;return null!==(i=null!==(e=((t,e)=>{e=z(e);let i=V(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!i&&0!==i){const t=x.get(e);t&&(i=t.initialValue)}return i})(t,U))&&void 0!==e?e:null==_?void 0:_.initialValue)&&void 0!==i?i:0};let T=function(t,e){for(let i=0;i<t.length;i++)null===t[i]&&(t[i]=i?t[i-1]:e());return t}((t=>Array.isArray(t)?t:[t])(l),i);const b=function(t,e){var i;let n=(null==e?void 0:e.toDefaultUnit)||a;const s=t[t.length-1];if("string"==typeof s){const t=(null===(i=s.match(/(-?[\d.]+)([a-z%]*)/))||void 0===i?void 0:i[2])||"";t&&(n=e=>e+t)}return n}(T,_);if(s(w)){const t=w.createAnimation(T,"opacity"!==e,i,U,B);w=t.easing,T=t.keyframes||T,p=t.duration||p}if(V(U)&&(C.cssRegisterProperty()?function(t){if(!$.has(t)){$.add(t);try{const{syntax:e,initialValue:i}=x.has(t)?x.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:i})}catch(t){}}}(U):F=!1),E&&!C.linearEasing()&&(m(w)||o(w)&&w.some(m))&&(F=!1),F){_&&(T=T.map((t=>r(t)?_.toDefaultUnit(t):t))),1!==T.length||C.partialKeyframes()&&!d||T.unshift(i());const e={delay:q(y),duration:q(p),endDelay:q(g),easing:o(w)?void 0:I(w,p),direction:O,iterations:v+1,fill:"both"};f=t.animate({[U]:T,offset:A,easing:o(w)?w.map((t=>I(t,p))):void 0},e),f.finished||(f.finished=new Promise(((t,e)=>{f.onfinish=t,f.oncancel=e})));const a=T[T.length-1];f.finished.then((()=>{S||(W(t,U,a),f.cancel())})).catch(n),k||(f.playbackRate=1.000001)}else if(u&&E)T=T.map((t=>"string"==typeof t?parseFloat(t):t)),1===T.length&&T.unshift(parseFloat(i())),f=new u((e=>{W(t,U,b?b(e):e)}),T,Object.assign(Object.assign({},c),{duration:p,easing:w}));else{const e=T[T.length-1];W(t,U,_&&r(e)?_.toDefaultUnit(e):e)}return d&&h(t,e,T,{duration:p,delay:y,easing:w,repeat:v,offset:A},"motion-one"),B.setAnimation(f),f}}const X=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t),Y=t=>t(),Z={get:(t,e)=>{const i=t.animations[0];switch(e){case"duration":return t.duration;case"currentTime":return((null==i?void 0:i[e])||0)/1e3;case"playbackRate":case"playState":return null==i?void 0:i[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(L)).catch(n)),t.finished;case"stop":return()=>{t.animations.forEach((t=>K(t)))};case"forEachNative":return e=>{t.animations.forEach((i=>e(i,t)))};default:return void 0===(null==i?void 0:i[e])?void 0:()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,i)=>{switch(e){case"currentTime":i=q(i);case"currentTime":case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=i;return!0}return!1}},L=t=>t.finished;function G(t,e,i){return m(t)?t(e,i):t}const H=(J=class{constructor(t,e=[0,1],{easing:n,duration:r=i.duration,delay:d=i.delay,endDelay:f=i.endDelay,repeat:m=i.repeat,offset:p,direction:y="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=a,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e})),n=n||i.easing,s(n)){const t=n.createAnimation(e);n=t.easing,e=t.keyframes||e,r=t.duration||r}this.repeat=m,this.easing=o(n)?a:v(n),this.updateDuration(r);const g=function(t,e=function(t){const e=[0];return u(e,t-1),e}(t.length),i=a){const n=t.length,s=n-e.length;return s>0&&u(e,s),a=>{let s=0;for(;s<n-2&&!(a<e[s+1]);s++);let r=h(0,1,c(e[s],e[s+1],a));const u=function(t,e){return o(t)?t[((t,e,i)=>{const n=e-0;return((i-0)%n+n)%n+0})(0,t.length,e)]:t}(i,s);return r=u(r),l(t[s],t[s+1],r)}}(e,p,o(n)?n.map(v):a);this.tick=e=>{var i;let n=0;n=void 0!==this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate,this.t=n,n/=1e3,n=Math.max(n-d,0),"finished"===this.playState&&void 0===this.pauseTime&&(n=this.totalDuration);const a=n/this.duration;let s=Math.floor(a),r=a%1;!r&&a>=1&&(r=1),1===r&&s--;const o=s%2;("reverse"===y||"alternate"===y&&o||"alternate-reverse"===y&&!o)&&(r=1-r);const l=n>=this.totalDuration?1:Math.min(r,1),c=g(this.easing(l));t(c),void 0===this.pauseTime&&("finished"===this.playState||n>=this.totalDuration+f)?(this.playState="finished",null===(i=this.resolve)||void 0===i||i.call(this,c)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(t=this.reject)||void 0===t||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){void 0!==this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}},function(t,e,n={}){const a=(t=function(t,e){return"string"==typeof t?t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}(t)).length;Boolean(a),Boolean(e);const s=[];for(let i=0;i<a;i++){const r=t[i];for(const t in e){const o=X(n,t);o.delay=G(o.delay,i,a);const l=N(r,t,e[t],o,J);s.push(l)}}return((t,e,n=i.duration)=>new Proxy({animations:t.map(Y).filter(Boolean),duration:n,options:e},Z))(s,n,n.duration)});var J,Q=e.j;export{Q as animate};
var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{j:()=>H});const i={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},n=()=>{},a=t=>t,s=t=>"object"==typeof t&&Boolean(t.createAnimation),r=t=>"number"==typeof t,o=t=>Array.isArray(t)&&!r(t[0]),l=(t,e,i)=>-i*t+i*e+t,c=(t,e,i)=>e-t==0?1:(i-t)/(e-t);function u(t,e){const i=t[t.length-1];for(let n=1;n<=e;n++){const a=c(0,e,n);t.push(l(i,1,a))}}const h=(t,e,i)=>Math.min(Math.max(i,t),e);const d=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function f(t,e,i,n){if(t===e&&i===n)return a;return a=>0===a||1===a?a:d(function(t,e,i,n,a){let s,r,o=0;do{r=e+(i-e)/2,s=d(r,n,a)-t,s>0?i=r:e=r}while(Math.abs(s)>1e-7&&++o<12);return r}(a,0,1,t,i),e,n)}const m=t=>"function"==typeof t,p=t=>Array.isArray(t)&&r(t[0]),y={ease:f(.25,.1,.25,1),"ease-in":f(.42,0,1,1),"ease-in-out":f(.42,0,.58,1),"ease-out":f(0,0,.58,1)},g=/\((.*?)\)/;function v(t){if(m(t))return t;if(p(t))return f(...t);if(y[t])return y[t];if(t.startsWith("steps")){const e=g.exec(t);if(e){const t=e[1].split(",");return((t,e="end")=>i=>{const n=(i="end"===e?Math.min(i,.999):Math.max(i,.001))*t,a="end"===e?Math.floor(n):Math.ceil(n);return h(0,1,a/t)})(parseFloat(t[0]),t[1].trim())}}return a}class T{setAnimation(t){this.animation=t,null==t||t.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const w=new WeakMap;function b(t){return w.has(t)||w.set(t,{transforms:[],values:new Map}),w.get(t)}const S=["","X","Y","Z"],D={x:"translateX",y:"translateY",z:"translateZ"},O={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},A={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:O,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:a},skew:O},x=new Map,k=t=>`--motion-${t}`,M=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{S.forEach((e=>{M.push(t+e),x.set(k(t+e),A[t])}))}));const j=(t,e)=>M.indexOf(t)-M.indexOf(e),E=new Set(M),P=t=>E.has(t),R=(t,e)=>`${t} ${e}(var(${k(e)}))`,V=t=>t.startsWith("--"),$=new Set,q=t=>1e3*t,F=(t,e)=>document.createElement("div").animate(t,e),U={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{F({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(F({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{F({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}},B={},C={};for(const t in U)C[t]=()=>(void 0===B[t]&&(B[t]=U[t]()),B[t]);const I=(t,e)=>m(t)?C.linearEasing()?`linear(${((t,e)=>{let i="";const n=Math.round(e/.015);for(let e=0;e<n;e++)i+=t(c(0,n-1,e))+", ";return i.substring(0,i.length-2)})(t,e)})`:i.easing:p(t)?_(t):t,_=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`;function z(t){return D[t]&&(t=D[t]),P(t)?k(t):t}const W=(t,e,i)=>{e=z(e),V(e)?t.style.setProperty(e,i):t.style[e]=i};function K(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}function N(t,e,l,c={},u){const h=window.__MOTION_DEV_TOOLS_RECORD,d=!1!==c.record&&h;let f,{duration:p=i.duration,delay:y=i.delay,endDelay:g=i.endDelay,repeat:v=i.repeat,easing:w=i.easing,persist:S=!1,direction:O,offset:A,allowWebkitAcceleration:k=!1}=c;const M=b(t),E=P(e);let F=C.waapi();E&&((t,e)=>{D[e]&&(e=D[e]);const{transforms:i}=b(t);var n,a;a=e,-1===(n=i).indexOf(a)&&n.push(a),t.style.transform=(t=>t.sort(j).reduce(R,"").trim())(i)})(t,e);const U=z(e),B=function(t,e){return t.has(e)||t.set(e,new T),t.get(e)}(M.values,U),_=x.get(U);return K(B.animation,!(s(w)&&B.generator)&&!1!==c.record),()=>{const i=()=>{var e,i;return null!==(i=null!==(e=((t,e)=>{e=z(e);let i=V(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!i&&0!==i){const t=x.get(e);t&&(i=t.initialValue)}return i})(t,U))&&void 0!==e?e:null==_?void 0:_.initialValue)&&void 0!==i?i:0};let T=function(t,e){for(let i=0;i<t.length;i++)null===t[i]&&(t[i]=i?t[i-1]:e());return t}((t=>Array.isArray(t)?t:[t])(l),i);const b=function(t,e){var i;let n=(null==e?void 0:e.toDefaultUnit)||a;const s=t[t.length-1];if("string"==typeof s){const t=(null===(i=s.match(/(-?[\d.]+)([a-z%]*)/))||void 0===i?void 0:i[2])||"";t&&(n=e=>e+t)}return n}(T,_);if(s(w)){const t=w.createAnimation(T,"opacity"!==e,i,U,B);w=t.easing,T=t.keyframes||T,p=t.duration||p}if(V(U)&&(C.cssRegisterProperty()?function(t){if(!$.has(t)){$.add(t);try{const{syntax:e,initialValue:i}=x.has(t)?x.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:i})}catch(t){}}}(U):F=!1),E&&!C.linearEasing()&&(m(w)||o(w)&&w.some(m))&&(F=!1),F){_&&(T=T.map((t=>r(t)?_.toDefaultUnit(t):t))),1!==T.length||C.partialKeyframes()&&!d||T.unshift(i());const e={delay:q(y),duration:q(p),endDelay:q(g),easing:o(w)?void 0:I(w,p),direction:O,iterations:v+1,fill:"both"};f=t.animate({[U]:T,offset:A,easing:o(w)?w.map((t=>I(t,p))):void 0},e),f.finished||(f.finished=new Promise(((t,e)=>{f.onfinish=t,f.oncancel=e})));const a=T[T.length-1];f.finished.then((()=>{S||(W(t,U,a),f.cancel())})).catch(n),k||(f.playbackRate=1.000001)}else if(u&&E)T=T.map((t=>"string"==typeof t?parseFloat(t):t)),1===T.length&&T.unshift(parseFloat(i())),f=new u((e=>{W(t,U,b?b(e):e)}),T,Object.assign(Object.assign({},c),{duration:p,easing:w}));else{const e=T[T.length-1];W(t,U,_&&r(e)?_.toDefaultUnit(e):e)}return d&&h(t,e,T,{duration:p,delay:y,easing:w,repeat:v,offset:A},"motion-one"),B.setAnimation(f),f}}const X=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t),Y=t=>t(),Z={get:(t,e)=>{const i=t.animations[0];switch(e){case"duration":return t.duration;case"currentTime":return((null==i?void 0:i[e])||0)/1e3;case"playbackRate":case"playState":return null==i?void 0:i[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(L)).catch(n)),t.finished;case"stop":return()=>{t.animations.forEach((t=>K(t)))};case"forEachNative":return e=>{t.animations.forEach((i=>e(i,t)))};default:return void 0===(null==i?void 0:i[e])?void 0:()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,i)=>{switch(e){case"currentTime":i=q(i);case"playbackRate":for(let n=0;n<t.animations.length;n++)t.animations[n][e]=i;return!0}return!1}},L=t=>t.finished;function G(t,e,i){return m(t)?t(e,i):t}const H=(J=class{constructor(t,e=[0,1],{easing:n,duration:r=i.duration,delay:d=i.delay,endDelay:f=i.endDelay,repeat:m=i.repeat,offset:p,direction:y="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=a,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e})),n=n||i.easing,s(n)){const t=n.createAnimation(e);n=t.easing,e=t.keyframes||e,r=t.duration||r}this.repeat=m,this.easing=o(n)?a:v(n),this.updateDuration(r);const g=function(t,e=function(t){const e=[0];return u(e,t-1),e}(t.length),i=a){const n=t.length,s=n-e.length;return s>0&&u(e,s),a=>{let s=0;for(;s<n-2&&!(a<e[s+1]);s++);let r=h(0,1,c(e[s],e[s+1],a));const u=function(t,e){return o(t)?t[((t,e,i)=>{const n=e-0;return((i-0)%n+n)%n+0})(0,t.length,e)]:t}(i,s);return r=u(r),l(t[s],t[s+1],r)}}(e,p,o(n)?n.map(v):a);this.tick=e=>{var i;let n=0;n=void 0!==this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate,this.t=n,n/=1e3,n=Math.max(n-d,0),"finished"===this.playState&&void 0===this.pauseTime&&(n=this.totalDuration);const a=n/this.duration;let s=Math.floor(a),r=a%1;!r&&a>=1&&(r=1),1===r&&s--;const o=s%2;("reverse"===y||"alternate"===y&&o||"alternate-reverse"===y&&!o)&&(r=1-r);const l=n>=this.totalDuration?1:Math.min(r,1),c=g(this.easing(l));t(c),void 0===this.pauseTime&&("finished"===this.playState||n>=this.totalDuration+f)?(this.playState="finished",null===(i=this.resolve)||void 0===i||i.call(this,c)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(t=this.reject)||void 0===t||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){void 0!==this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}},function(t,e,n={}){const a=(t=function(t,e){return"string"==typeof t?t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}(t)).length;Boolean(a),Boolean(e);const s=[];for(let i=0;i<a;i++){const r=t[i];for(const t in e){const o=X(n,t);o.delay=G(o.delay,i,a);const l=N(r,t,e[t],o,J);s.push(l)}}return((t,e,n=i.duration)=>new Proxy({animations:t.map(Y).filter(Boolean),duration:n,options:e},Z))(s,n,n.duration)});var J,Q=e.j;export{Q as animate};

@@ -82,3 +82,3 @@ 'use strict';

* A generator that will be processed by the global animation scheduler.
* This yeilds when it switches from reading the DOM to writing to it
* This yields when it switches from reading the DOM to writing to it
* to prevent layout thrashing.

@@ -85,0 +85,0 @@ */

@@ -78,3 +78,3 @@ import { __rest } from 'tslib';

* A generator that will be processed by the global animation scheduler.
* This yeilds when it switches from reading the DOM to writing to it
* This yields when it switches from reading the DOM to writing to it
* to prevent layout thrashing.

@@ -81,0 +81,0 @@ */

@@ -55,3 +55,3 @@ import { defaults, noop, time } from "@motionone/utils";

value = time.ms(value);
case "currentTime":
// Fall-through
case "playbackRate":

@@ -58,0 +58,0 @@ for (let i = 0; i < target.animations.length; i++) {

@@ -77,3 +77,3 @@ import { __rest } from "tslib";

* A generator that will be processed by the global animation scheduler.
* This yeilds when it switches from reading the DOM to writing to it
* This yields when it switches from reading the DOM to writing to it
* to prevent layout thrashing.

@@ -80,0 +80,0 @@ */

{
"name": "@motionone/dom",
"version": "10.16.2",
"version": "10.16.3",
"description": "A tiny, performant animation library for the DOM",

@@ -12,3 +12,3 @@ "license": "MIT",

"scripts": {
"build": "rm -rf lib dist types && tsc -p . && webpack --config webpack.config.js && rollup -c",
"build": "rimraf lib dist types && tsc -p . && webpack --config webpack.config.js && rollup -c",
"test": "jest --coverage --config jest.config.js",

@@ -19,6 +19,6 @@ "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --c --watch --no-watch.clearScreen\"",

"dependencies": {
"@motionone/animation": "^10.15.1",
"@motionone/generators": "^10.15.1",
"@motionone/types": "^10.15.1",
"@motionone/utils": "^10.15.1",
"@motionone/animation": "^10.16.3",
"@motionone/generators": "^10.16.3",
"@motionone/types": "^10.16.3",
"@motionone/utils": "^10.16.3",
"hey-listen": "^1.0.8",

@@ -61,3 +61,3 @@ "tslib": "^2.3.1"

],
"gitHead": "d1e80e79b00779a8319c015929f7d8f4fba7612d"
"gitHead": "f4721014f749ce528145c09386af8584eced4e2a"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc