Viewing File: /home/ubuntu/misabloom-frontend-base/node_modules/@motionone/dom/dist/size-timeline.js
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=>"object"==typeof t&&Boolean(t.createAnimation),r=t=>Array.isArray(t)&&!a(t[0]);function o(t,e){return r(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}const l=(t,e,n)=>-n*t+n*e+t,c=()=>{},u=t=>t,h=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function f(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const a=h(0,e,i);t.push(l(n,1,a))}}function d(t){const e=[0];return f(e,t-1),e}const p=t=>1e3*t,m=t=>t/1e3,y=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function g(t,e,n,i){if(t===e&&n===i)return u;const a=e=>function(t,e,n,i,a){let s,r,o=0;do{r=e+(n-e)/2,s=y(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:y(a(t),e,i)}const v={ease:g(.25,.1,.25,1),"ease-in":g(.42,0,1,1),"ease-in-out":g(.42,0,.58,1),"ease-out":g(0,0,.58,1)},O=/\((.*?)\)/;function w(t){if("function"==typeof t)return t;if(Array.isArray(t))return g(...t);if(v[t])return v[t];if(t.startsWith("steps")){const e=O.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 u}class b{constructor(t,e=[0,1],{easing:a,duration:c=i.duration,delay:p=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=u,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,s(a)){const t=a.createAnimation(e,(()=>"0"),!0);a=t.easing,void 0!==t.keyframes&&(e=t.keyframes),void 0!==t.duration&&(c=t.duration)}this.repeat=y,this.easing=r(a)?u:w(a),this.updateDuration(c);const O=function(t,e=d(t.length),i=u){const a=t.length,s=a-e.length;return s>0&&f(e,s),s=>{let r=0;for(;r<a-2&&!(s<e[r+1]);r++);let c=n(0,1,h(e[r],e[r+1],s));return c=o(i,r)(c),l(t[r],t[r+1],c)}}(e,g,r(a)?a.map(w):u);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-p,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 S(t,e,n){return"function"==typeof t?t(e,n):t}class T{setAnimation(t){this.animation=t,null==t||t.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const A=new WeakMap;function x(t){return A.has(t)||A.set(t,{transforms:[],values:new Map}),A.get(t)}const D=["","X","Y","Z"],k={x:"translateX",y:"translateY",z:"translateZ"},M={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},j={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:M,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:u},skew:M},E=new Map,P=t=>`--motion-${t}`,R=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{D.forEach((e=>{R.push(t+e),E.set(P(t+e),j[t])}))}));const V=(t,e)=>R.indexOf(t)-R.indexOf(e),q=new Set(R),$=t=>q.has(t),F=t=>t.sort(V).reduce(I,"").trim(),I=(t,e)=>`${t} ${e}(var(${P(e)}))`,U=t=>t.startsWith("--"),W=new Set;const _=t=>(t=>Array.isArray(t)&&a(t[0]))(t)?C(t):t,C=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,B=t=>document.createElement("div").animate(t,{duration:.001}),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]}).finished)},z={},K={};for(const t in N)K[t]=()=>(void 0===z[t]&&(z[t]=N[t]()),z[t]);const X=t=>Array.isArray(t)?t:[t];function Y(t){return k[t]&&(t=k[t]),$(t)?P(t):t}const Z=(t,e)=>{e=Y(e);let n=U(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=E.get(e);t&&(n=t.initialValue)}return n},L=(t,e,n)=>{e=Y(e),U(e)?t.style.setProperty(e,n):t.style[e]=n};function G(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}function H(t,e,n,o={}){const l=window.__MOTION_DEV_TOOLS_RECORD,u=!1!==o.record&&l;let h,{duration:f=i.duration,delay:d=i.delay,endDelay:m=i.endDelay,repeat:y=i.repeat,easing:g=i.easing,direction:v,offset:O,allowWebkitAcceleration:w=!1}=o;const S=x(t);let A=K.waapi();const D=$(e);D&&((t,e)=>{k[e]&&(e=k[e]);const{transforms:n}=x(t);var i,a;a=e,-1===(i=n).indexOf(a)&&i.push(a),t.style.transform=F(n)})(t,e);const M=Y(e),j=function(t,e){return t.has(e)||t.set(e,new T),t.get(e)}(S.values,M),P=E.get(M);return G(j.animation,!(s(g)&&j.generator)&&!1!==o.record),()=>{const i=()=>{var e,n;return null!==(n=null!==(e=Z(t,M))&&void 0!==e?e:null==P?void 0:P.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}(X(n),i);if(s(g)){const t=g.createAnimation(S,i,D,M,j);g=t.easing,void 0!==t.keyframes&&(S=t.keyframes),void 0!==t.duration&&(f=t.duration)}if(U(M)&&(K.cssRegisterProperty()?function(t){if(!W.has(t)){W.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){}}}(M):A=!1),A){P&&(S=S.map((t=>a(t)?P.toDefaultUnit(t):t))),1!==S.length||K.partialKeyframes()&&!u||S.unshift(i());const e={delay:p(d),duration:p(f),endDelay:p(m),easing:r(g)?void 0:_(g),direction:v,iterations:y+1,fill:"both"};h=t.animate({[M]:S,offset:O,easing:r(g)?g.map(_):void 0},e),h.finished||(h.finished=new Promise(((t,e)=>{h.onfinish=t,h.oncancel=e})));const n=S[S.length-1];h.finished.then((()=>{L(t,M,n),h.cancel()})).catch(c),w||(h.playbackRate=1.000001)}else if(D){S=S.map((t=>"string"==typeof t?parseFloat(t):t)),1===S.length&&S.unshift(parseFloat(i()));h=new b((e=>{P&&(e=P.toDefaultUnit(e)),L(t,M,e)}),S,Object.assign(Object.assign({},o),{duration:f,easing:g}))}else{const e=S[S.length-1];L(t,M,P&&a(e)?P.toDefaultUnit(e):e)}return u&&l(t,e,S,{duration:f,delay:d,easing:g,repeat:y,offset:O},"motion-one"),j.setAnimation(h),h}}const J=t=>t(),Q={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(tt)).catch(c)),t.finished;case"stop":return()=>{t.animations.forEach((t=>G(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=p(n);case"currentTime":case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}},tt=t=>t.finished,et=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function nt(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 it(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 at(t,n,i,a,s,r){!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,r);for(let e=0;e<n.length;e++)t.push({value:n[e],at:l(s,r,a[e]),easing:o(i,e)})}function st(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function rt(t,e={}){var n;const a=ot(t,e),s=a.map((t=>H(...t))).filter(Boolean);return((t,e,n=i.duration)=>new Proxy({animations:t.map(J).filter(Boolean),duration:n,options:e},Q))(s,e,null===(n=a[0])||void 0===n?void 0:n[3].duration)}function ot(e,n={}){var{defaultOptions:a={}}=n,r=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 o=[],l=new Map,c={},u=new Map;let p=0,m=0,y=0;for(let n=0;n<e.length;n++){const r=e[n];if("string"==typeof r){u.set(r,m);continue}if(!Array.isArray(r)){u.set(r.name,it(m,r.at,p,u));continue}const[o,h,g={}]=r;void 0!==g.at&&(m=it(m,g.at,p,u));let v=0;const O=nt(o,c),w=O.length;for(let e=0;e<w;e++){const n=lt(O[e],l);for(const r in h){const o=ct(r,n);let l=X(h[r]);const c=et(g,r);let{duration:u=a.duration||i.duration,easing:p=a.easing||i.easing}=c;if(s(p)){const e=$(r);t(2===l.length||!e,"spring must be provided 2 keyframes within timeline");const n=p.createAnimation(l,(()=>"0"),e);p=n.easing,void 0!==n.keyframes&&(l=n.keyframes),void 0!==n.duration&&(u=n.duration)}const O=S(g.delay,e,w)||0,b=m+O,T=b+u;let{offset:A=d(l.length)}=c;1===A.length&&0===A[0]&&(A[1]=1);const x=length-l.length;x>0&&f(A,x),1===l.length&&l.unshift(null),at(o,l,p,A,b,T),v=Math.max(O+u,v),y=Math.max(T,y)}}p=m,m+=v}return l.forEach(((t,e)=>{for(const n in t){const s=t[n];s.sort(st);const l=[],c=[],u=[];for(let t=0;t<s.length;t++){const{at:e,value:n,easing:a}=s[t];l.push(n),c.push(h(0,y,e)),u.push(a||i.easing)}0!==c[0]&&(c.unshift(0),l.unshift(l[0]),u.unshift("linear")),1!==c[c.length-1]&&(c.push(1),l.push(null)),o.push([e,n,l,Object.assign(Object.assign(Object.assign({},a),{duration:y,easing:u,offset:c}),r)])}})),o}function lt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ct(t,e){return e[t]||(e[t]=[]),e[t]}export{ot as createAnimationsFromTimeline,rt as timeline};
Back to Directory
File Manager