// KUTE.js Base v2.1.1-alpha1 | thednp © 2021 | MIT-License !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=n()}(this,(function(){"use strict";var t={},n=[],e="undefined"!=typeof global?global:void 0!==window.self?window.self:"undefined"!=typeof window?window:{},i={},o={},r={},a=window.self||window||{};r.now=a.performance.now.bind(a.performance);var s=0,c=function(t){for(var e=0;e>0)/1e3;return i}T.prototype.start=function(n){return g(this),this.playing=!0,this._startTime=void 0!==n?n:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),j.call(this),this._startFired=!0),s||c(),this},T.prototype.stop=function(){return this.playing&&(E(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},T.prototype.close=function(){var t=this;Object.keys(p).forEach((function(n){Object.keys(p[n]).forEach((function(e){p[n][e].call(t,e)}))})),this._startFired=!1,u.call(this)},T.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},T.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.stop()}))},T.prototype.update=function(n){var e,i=this,o=void 0!==n?n:t.Time();if(o1?1:e;var r=this._easing(e);return Object.keys(this.valuesEnd).forEach((function(n){t[n](i.element,i.valuesStart[n],i.valuesEnd[n],r)})),this._onUpdate&&this._onUpdate.call(this),1!==e||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((function(t){return t.start()})),!1)},v.tween=T;var C="undefined"!=typeof DOMMatrix?DOMMatrix:null,M={component:"transformMatrixBase",property:"transform",functions:{onStart:{transform:function(n){C&&this.valuesEnd[n]&&!t[n]&&(t[n]=function(t,e,i,o){var r=new C,a={};Object.keys(i).forEach((function(t){a[t]="perspective"===t?S(e[t],i[t],o):I(e[t],i[t],o)})),a.perspective&&(r.m34=-1/a.perspective),r=a.translate3d?r.translate(a.translate3d[0],a.translate3d[1],a.translate3d[2]):r,r=a.rotate3d?r.rotate(a.rotate3d[0],a.rotate3d[1],a.rotate3d[2]):r,a.skew&&(r=a.skew[0]?r.skewX(a.skew[0]):r,r=a.skew[1]?r.skewY(a.skew[1]):r),r=a.scale3d?r.scale(a.scale3d[0],a.scale3d[1],a.scale3d[2]):r,t.style[n]=r.toString()})},CSS3Matrix:function(n){C&&this.valuesEnd.transform&&(t[n]||(t[n]=C))}}},Interpolate:{perspective:S,translate3d:I,rotate3d:I,skew:I,scale3d:I}};function x(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,o){t.style[n]=(o>.99||o<.01?(10*S(e,i,o)>>0)/10:S(e,i,o)>>0)+"px"})}var U=["top","left","width","height"],A={};U.forEach((function(t){A[t]=x}));var q={component:"baseBoxModel",category:"boxModel",properties:U,Interpolate:{numbers:S},functions:{onStart:A}};var B={component:"baseOpacity",property:"opacity",Interpolate:{numbers:S},functions:{onStart:function(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,o){t.style[n]=(1e3*S(e,i,o)>>0)/1e3})}}},F=new w(M),K=new w(q),Q=new w(B);return{Animation:w,Components:{Transform:F,BoxModel:K,Opacity:Q},Tween:T,fromTo:function(t,n,e,i){var o=i||{};return new(0,v.tween)(k(t),n,e,o)},Objects:d,Easing:m,Util:y,Render:f,Interpolate:i,Internals:_,Selector:k,Version:"2.1.1-alpha1"}}));