diff --git a/demo/src/kute-base.js b/demo/src/kute-base.js index 95d8f71..74abc1d 100644 --- a/demo/src/kute-base.js +++ b/demo/src/kute-base.js @@ -29,12 +29,41 @@ // link property update function to KUTE.js execution context var onStart = {}; - // import now from '../objects/now.js'; + var now; + + // Include a performance.now polyfill. + // source https://github.com/tweenjs/tween.js/blob/master/src/Now.ts + // In node.js, use process.hrtime. + // eslint-disable-next-line + // @ts-ignore + if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) { + now = function () { + // eslint-disable-next-line + // @ts-ignore + var time = process.hrtime(); + + // Convert [seconds, nanoseconds] to milliseconds. + return time[0] * 1000 + time[1] / 1000000; + }; + } else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) { + // In a browser, use self.performance.now if it is available. + // This must be bound, because directly assigning this function + // leads to an invocation exception in Chrome. + now = self.performance.now.bind(self.performance); + } else if (typeof Date !== 'undefined' && Date.now) { + // Use Date.now if it is available. + now = Date.now; + } else { + // Otherwise, use 'new Date().getTime()'. + now = function () { return new Date().getTime(); }; + } + + var now$1 = now; var Time = {}; - // Time.now = now; - var that = window.self || window || {}; - Time.now = that.performance.now.bind(that.performance); + Time.now = now$1; + // const that = window.self || window || {}; + // Time.now = that.performance.now.bind(that.performance); var Tick = 0; diff --git a/demo/src/kute-base.min.js b/demo/src/kute-base.min.js index 839bf5e..c79dff0 100644 --- a/demo/src/kute-base.min.js +++ b/demo/src/kute-base.min.js @@ -1,2 +1,2 @@ // KUTE.js Base v2.1.3 | 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:"undefined"!=typeof window?window.self:{},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+e+")"}function T(t,n,e,i){for(var o=[],r=0;r<3;r+=1)o[r]=(t[r]||n[r]?(1e3*(t[r]+(n[r]-t[r])*i)>>0)/1e3:0)+e;return"translate3d("+o.join(",")+")"}function I(t,n,e,i){var o="";return o+=t[0]||n[0]?"rotateX("+(1e3*(t[0]+(n[0]-t[0])*i)>>0)/1e3+e+")":"",o+=t[1]||n[1]?"rotateY("+(1e3*(t[1]+(n[1]-t[1])*i)>>0)/1e3+e+")":"",o+=t[2]||n[2]?"rotateZ("+(1e3*(t[2]+(n[2]-t[2])*i)>>0)/1e3+e+")":""}function S(t,n,e){return"scale("+(1e3*(t+(n-t)*e)>>0)/1e3+")"}function C(t,n,e,i){var o=[];return o[0]=(t[0]===n[0]?n[0]:(1e3*(t[0]+(n[0]-t[0])*i)>>0)/1e3)+e,o[1]=t[1]||n[1]?(t[1]===n[1]?n[1]:(1e3*(t[1]+(n[1]-t[1])*i)>>0)/1e3)+e:"0","skew("+o.join(",")+")"}j.prototype.setComponent=function(t){var n=t.component,e={onStart:o,onComplete:p},r=t.category,a=t.property;return this._=0,b[n]=t.properties||t.subProperties||t.property,t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(n){l[n]=t.defaultOptions[n]})),t.functions&&Object.keys(e).forEach((function(i){i in t.functions&&("function"==typeof t.functions[i]?(e[i][n]||(e[i][n]={}),e[i][n][r||a]||(e[i][n][r||a]=t.functions[i])):Object.keys(t.functions[i]).forEach((function(o){e[i][n]||(e[i][n]={}),e[i][n][o]||(e[i][n][o]=t.functions[i][o])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(n){var e=t.Interpolate[n];"function"!=typeof e||i[n]?Object.keys(e).forEach((function(t){"function"!=typeof e[t]||i[n]||(i[n]=e[t])})):i[n]=e})),h[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(n){y[n]||(y[n]=t.Util[n])})),{name:n}};var x={component:"baseTransform",property:"transform",functions:{onStart:function(n){!t[n]&&this.valuesEnd[n]&&(t[n]=function(t,e,i,o){t.style[n]=(e.perspective||i.perspective?w(e.perspective,i.perspective,"px",o):"")+(e.translate3d?T(e.translate3d,i.translate3d,"px",o):"")+(e.rotate3d?I(e.rotate3d,i.rotate3d,"deg",o):"")+(e.skew?C(e.skew,i.skew,"deg",o):"")+(e.scale||i.scale?S(e.scale,i.scale,o):"")})}},Interpolate:{perspective:w,translate3d:T,rotate3d:I,translate:function(t,n,e,i){var o=[];return o[0]=(t[0]===n[0]?n[0]:(1e3*(t[0]+(n[0]-t[0])*i)>>0)/1e3)+e,o[1]=t[1]||n[1]?(t[1]===n[1]?n[1]:(1e3*(t[1]+(n[1]-t[1])*i)>>0)/1e3)+e:"0","translate("+o.join(",")+")"},rotate:function(t,n,e,i){return"rotate("+(1e3*(t+(n-t)*i)>>0)/1e3+e+")"},scale:S,skew:C}};function U(t,n,e){return+t+(n-t)*e}function M(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,o){t.style[n]=(o>.99||o<.01?(10*U(e,i,o)>>0)/10:U(e,i,o)>>0)+"px"})}var q=["top","left","width","height"],A={};q.forEach((function(t){A[t]=M}));var F={component:"baseBoxModel",category:"boxModel",properties:q,Interpolate:{numbers:U},functions:{onStart:A}};var B={component:"baseOpacity",property:"opacity",Interpolate:{numbers:U},functions:{onStart:function(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,o){t.style[n]=(1e3*U(e,i,o)>>0)/1e3})}}},K={Transform:new j(x),BoxModel:new j(F),Opacity:new j(B)};function Q(){var t=this;Object.keys(o).forEach((function(n){"function"==typeof o[n]?o[n].call(t,n):Object.keys(o[n]).forEach((function(e){o[n][e].call(t,e)}))})),O.call(this)}var L=function(n,e,i,r){var a=this;this.element=n,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=i,this.valuesStart=e;var s=r||{};this._resetStart=s.resetStart||0,this._easing="function"==typeof s.easing?s.easing:v.processEasing(s.easing),this._duration=s.duration||l.duration,this._delay=s.delay||l.delay,Object.keys(s).forEach((function(t){var n="_"+t;n in a||(a[n]=s[t])}));var c=this._easing.name;return o[c]||(o[c]=function(n){t[n]||n!==this._easing.name||(t[n]=this._easing)}),this};L.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),Q.call(this),this._startFired=!0),s||c(),this},L.prototype.stop=function(){return this.playing&&(E(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},L.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)},L.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},L.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.stop()}))},L.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=L;return{Animation:j,Components:K,Tween:L,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.3"}})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{},i={},o={},r="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):"undefined"!=typeof Date&&Date.now?Date.now:function(){return(new Date).getTime()},a={};a.now=r;var s=0,c=function(t){for(var n=0;n>0)/1e3+n+")"}function T(t,e,n,i){for(var o=[],r=0;r<3;r+=1)o[r]=(t[r]||e[r]?(1e3*(t[r]+(e[r]-t[r])*i)>>0)/1e3:0)+n;return"translate3d("+o.join(",")+")"}function I(t,e,n,i){var o="";return o+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*i)>>0)/1e3+n+")":"",o+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*i)>>0)/1e3+n+")":"",o+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*i)>>0)/1e3+n+")":""}function S(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function C(t,e,n,i){var o=[];return o[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*i)>>0)/1e3)+n,o[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*i)>>0)/1e3)+n:"0","skew("+o.join(",")+")"}j.prototype.setComponent=function(t){var e=t.component,n={onStart:o,onComplete:p},r=t.category,a=t.property;return this._=0,b[e]=t.properties||t.subProperties||t.property,t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){l[e]=t.defaultOptions[e]})),t.functions&&Object.keys(n).forEach((function(i){i in t.functions&&("function"==typeof t.functions[i]?(n[i][e]||(n[i][e]={}),n[i][e][r||a]||(n[i][e][r||a]=t.functions[i])):Object.keys(t.functions[i]).forEach((function(o){n[i][e]||(n[i][e]={}),n[i][e][o]||(n[i][e][o]=t.functions[i][o])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||i[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||i[e]||(i[e]=n[t])})):i[e]=n})),h[e]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){y[e]||(y[e]=t.Util[e])})),{name:e}};var x={component:"baseTransform",property:"transform",functions:{onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,n,i,o){t.style[e]=(n.perspective||i.perspective?w(n.perspective,i.perspective,"px",o):"")+(n.translate3d?T(n.translate3d,i.translate3d,"px",o):"")+(n.rotate3d?I(n.rotate3d,i.rotate3d,"deg",o):"")+(n.skew?C(n.skew,i.skew,"deg",o):"")+(n.scale||i.scale?S(n.scale,i.scale,o):"")})}},Interpolate:{perspective:w,translate3d:T,rotate3d:I,translate:function(t,e,n,i){var o=[];return o[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*i)>>0)/1e3)+n,o[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*i)>>0)/1e3)+n:"0","translate("+o.join(",")+")"},rotate:function(t,e,n,i){return"rotate("+(1e3*(t+(e-t)*i)>>0)/1e3+n+")"},scale:S,skew:C}};function U(t,e,n){return+t+(e-t)*n}function M(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,i,o){t.style[e]=(o>.99||o<.01?(10*U(n,i,o)>>0)/10:U(n,i,o)>>0)+"px"})}var q=["top","left","width","height"],A={};q.forEach((function(t){A[t]=M}));var F={component:"baseBoxModel",category:"boxModel",properties:q,Interpolate:{numbers:U},functions:{onStart:A}};var B={component:"baseOpacity",property:"opacity",Interpolate:{numbers:U},functions:{onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,i,o){t.style[e]=(1e3*U(n,i,o)>>0)/1e3})}}},D={Transform:new j(x),BoxModel:new j(F),Opacity:new j(B)};function K(){var t=this;Object.keys(o).forEach((function(e){"function"==typeof o[e]?o[e].call(t,e):Object.keys(o[e]).forEach((function(n){o[e][n].call(t,n)}))})),O.call(this)}var Q=function(e,n,i,r){var a=this;this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=i,this.valuesStart=n;var s=r||{};this._resetStart=s.resetStart||0,this._easing="function"==typeof s.easing?s.easing:v.processEasing(s.easing),this._duration=s.duration||l.duration,this._delay=s.delay||l.delay,Object.keys(s).forEach((function(t){var e="_"+t;e in a||(a[e]=s[t])}));var c=this._easing.name;return o[c]||(o[c]=function(e){t[e]||e!==this._easing.name||(t[e]=this._easing)}),this};Q.prototype.start=function(e){return g(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),K.call(this),this._startFired=!0),s||c(),this},Q.prototype.stop=function(){return this.playing&&(E(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},Q.prototype.close=function(){var t=this;Object.keys(p).forEach((function(e){Object.keys(p[e]).forEach((function(n){p[e][n].call(t,n)}))})),this._startFired=!1,u.call(this)},Q.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},Q.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.stop()}))},Q.prototype.update=function(e){var n,i=this,o=void 0!==e?e:t.Time();if(o1?1:n;var r=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(e){t[e](i.element,i.valuesStart[e],i.valuesEnd[e],r)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(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=Q;return{Animation:j,Components:D,Tween:Q,fromTo:function(t,e,n,i){var o=i||{};return new(0,v.tween)(k(t),e,n,o)},Objects:d,Easing:m,Util:y,Render:f,Interpolate:i,Internals:_,Selector:k,Version:"2.1.3"}})); diff --git a/demo/src/kute-extra.js b/demo/src/kute-extra.js index c68564c..39d05a2 100644 --- a/demo/src/kute-extra.js +++ b/demo/src/kute-extra.js @@ -102,12 +102,41 @@ // link property update function to KUTE.js execution context var onStart = {}; - // import now from '../objects/now.js'; + var now; + + // Include a performance.now polyfill. + // source https://github.com/tweenjs/tween.js/blob/master/src/Now.ts + // In node.js, use process.hrtime. + // eslint-disable-next-line + // @ts-ignore + if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) { + now = function () { + // eslint-disable-next-line + // @ts-ignore + var time = process.hrtime(); + + // Convert [seconds, nanoseconds] to milliseconds. + return time[0] * 1000 + time[1] / 1000000; + }; + } else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) { + // In a browser, use self.performance.now if it is available. + // This must be bound, because directly assigning this function + // leads to an invocation exception in Chrome. + now = self.performance.now.bind(self.performance); + } else if (typeof Date !== 'undefined' && Date.now) { + // Use Date.now if it is available. + now = Date.now; + } else { + // Otherwise, use 'new Date().getTime()'. + now = function () { return new Date().getTime(); }; + } + + var now$1 = now; var Time = {}; - // Time.now = now; - var that = window.self || window || {}; - Time.now = that.performance.now.bind(that.performance); + Time.now = now$1; + // const that = window.self || window || {}; + // Time.now = that.performance.now.bind(that.performance); var Tick = 0; diff --git a/demo/src/kute-extra.min.js b/demo/src/kute-extra.min.js index 83c60d4..2a5caf1 100644 --- a/demo/src/kute-extra.min.js +++ b/demo/src/kute-extra.min.js @@ -1,2 +1,2 @@ // KUTE.js Extra v2.1.3 | thednp © 2021 | MIT-License -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var o=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(o,"name",{writable:!0}),o.name=a||"cubic-bezier("+[t,e,n,r]+")",o};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,o,s=1e-5;for(r=t,o=0;o<32;o+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{},a={},i={},o={},s=window.self||window||{};o.now=s.performance.now.bind(s.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},I.tween=V,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var N=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];C.call(this,i,"end"),this._resetStart?this.valuesStart=a:C.call(this,a,"start"),this._resetStart||Object.keys(m).forEach((function(t){Object.keys(m[t]).forEach((function(n){m[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var o=n[3];return this._repeat=o.repeat||d.repeat,this._repeatDelay=o.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,_.call(this),Object.keys(m).forEach((function(t){Object.keys(m[t]).forEach((function(e){m[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),L.call(this),this._startTime+=e.Time()-this._pauseTime,x(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.start()})),!1))},n}(V);I.tween=N;var R=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t.apply(this,e),this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.on=function(t,e){["start","stop","update","complete","pause","resume"].indexOf(t)>-1&&(this["_on"+(t.charAt(0).toUpperCase()+t.slice(1))]=e)},e.prototype.option=function(t,e){this["_"+t]=e},e}(N);I.tween=R;var U=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var o=[];return Array.from(t).forEach((function(t,r){var s=I.tween;if(o[r]=i||{},o[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new s(t,e,n,o[r]))})),this.length=this.tweens.length,this};U.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},U.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},U.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},U.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},U.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof U)e.chain(t.tweens);else{if(!(t instanceof I.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},U.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},U.prototype.removeTweens=function(){this.tweens=[]},U.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var q=function(t,e){var n;if(this.element=P(t),this.element.tween=e,this.element.tween.toolbar=this.element,this.element.toolbar=this,n=this.element.parentNode.getElementsByTagName("OUTPUT"),this.element.output=n[0],!(this.element instanceof HTMLInputElement))throw TypeError("Target element is not [HTMLInputElement]");if("range"!==this.element.type)throw TypeError("Target element is not a range input");if(!(e instanceof I.tween))throw TypeError("tween parameter is not ["+I.tween+"]");this.element.setAttribute("value",0),this.element.setAttribute("min",0),this.element.setAttribute("max",1),this.element.setAttribute("step",1e-4),this.element.tween._onUpdate=this.updateBar,this.element.addEventListener("mousedown",this.downAction,!1)};q.prototype.updateBar=function(){var t,n=this.toolbar.output;(t=this.paused?this.toolbar.value:(e.Time()-this._startTime)/this._duration)>.9999&&(t=1),t<.01&&(t=0);var r=this._reversed?1-t:t;this.toolbar.value=r,n&&(n.value=(1e4*r>>0)/100+"%")},q.prototype.toggleEvents=function(t){this.element[t+"EventListener"]("mousemove",this.moveAction,!1),this.element[t+"EventListener"]("mouseup",this.upAction,!1)},q.prototype.updateTween=function(){var t=(this.tween._reversed?1-this.value:this.value)*this.tween._duration-1e-4;this.tween._startTime=0,this.tween.update(t)},q.prototype.moveAction=function(){this.toolbar.updateTween.call(this)},q.prototype.downAction=function(){this.tween.playing||this.tween.start(),this.tween.paused||(this.tween.pause(),this.toolbar.toggleEvents("add"),e.Tick=cancelAnimationFrame(e.Ticker))},q.prototype.upAction=function(){this.tween.paused&&(this.tween.paused&&this.tween.resume(),this.tween._startTime=e.Time()-(this.tween._reversed?1-this.value:this.value)*this.tween._duration,this.toolbar.toggleEvents("remove"),e.Tick=requestAnimationFrame(e.Ticker))};var F=function(t){try{if(t.component in h)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};F.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:g,onStart:i,onComplete:y,crossCheck:m},o=t.category,s=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return h[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[s]=t.defaultValue,e.supports=s+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||s)+" "+(s||o)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][o||s]||(r[e][n][o||s]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){E[e]||(E[e]=t.Util[e])})),e};var H=function(t){function e(){for(var e,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),(e=this).setComponent.apply(e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setComponent=function(e){t.prototype.setComponent.call(this,e);var n=this,r={prepareProperty:v,prepareStart:g,onStart:i,onComplete:y,crossCheck:m},o=e.category,s=e.property,u=e.properties&&e.properties.length||e.subProperties&&e.subProperties.length;return"defaultValue"in e?(n.supports=s+" property",n.defaultValue=(""+e.defaultValue).length?"YES":"not set or incorrect"):e.defaultValues&&(n.supports=(u||s)+" "+(s||o)+" properties",n.defaultValues=Object.keys(e.defaultValues).length===u?"YES":"Not set or incomplete"),e.defaultOptions&&(n.extends=[],Object.keys(e.defaultOptions).forEach((function(t){n.extends.push(t)})),n.extends.length?n.extends="with <"+n.extends.join(", ")+"> new option(s)":delete n.extends),e.functions&&(n.interface=[],n.render=[],n.warning=[],Object.keys(r).forEach((function(t){t in e.functions?("prepareProperty"===t&&n.interface.push("fromTo()"),"prepareStart"===t&&n.interface.push("to()"),"onStart"===t&&(n.render="can render update")):("prepareProperty"===t&&n.warning.push("fromTo()"),"prepareStart"===t&&n.warning.push("to()"),"onStart"===t&&(n.render="no function to render update"))})),n.interface.length?n.interface=(o||s)+" can use ["+n.interface.join(", ")+"] method(s)":delete n.uses,n.warning.length?n.warning=(o||s)+" can't use ["+n.warning.join(", ")+"] method(s) because values aren't processed":delete n.warning),e.Interpolate?(n.uses=[],n.adds=[],Object.keys(e.Interpolate).forEach((function(t){var r=e.Interpolate[t];"function"==typeof r?(a[t]||n.adds.push(""+t),n.uses.push(""+t)):Object.keys(r).forEach((function(e){"function"!=typeof r[e]||a[t]||n.adds.push(""+e),n.uses.push(""+e)}))})),n.uses.length?n.uses="["+n.uses.join(", ")+"] interpolation function(s)":delete n.uses,n.adds.length?n.adds="new ["+n.adds.join(", ")+"] interpolation function(s)":delete n.adds):n.critical="For "+(s||o)+" no interpolation function[s] is set",e.Util&&(n.hasUtil=Object.keys(e.Util).join(",")),n},e}(F);function D(t,e,n){return+t+(e-t)*n}function B(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i>0)/100+"% "+(100*D(n[1],r[1],a)>>0)/100+"%"})}},z={component:"backgroundPositionProp",property:"backgroundPosition",defaultValue:[50,50],Interpolate:{numbers:D},functions:Q,Util:{trueDimension:B}};function X(t,e,n,r){return+t+(e-t)*r+n}function Y(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=X(n.v,r.v,r.u,a)})}var W={};["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"].forEach((function(t){W[t]=Y}));var $=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],G={};$.forEach((function(t){G[t]=0}));var Z={};$.forEach((function(t){Z[t]=Y}));var K={component:"borderRadiusProperties",category:"borderRadius",properties:$,defaultValues:G,Interpolate:{units:X},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:Z},Util:{trueDimension:B}};function J(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(a>.99||a<.01?(10*D(n,r,a)>>0)/10:D(n,r,a)>>0)+"px"})}var tt={};["top","left","width","height"].forEach((function(t){tt[t]=J}));var et=["top","left","width","height","right","bottom","minWidth","minHeight","maxWidth","maxHeight","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","margin","marginTop","marginBottom","marginLeft","marginRight","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","outlineWidth"],nt={};et.forEach((function(t){nt[t]=0}));var rt={};et.forEach((function(t){rt[t]=J}));var at={component:"boxModelProperties",category:"boxModel",properties:et,defaultValues:nt,Interpolate:{numbers:D},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){var n=B(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:rt}};var it={prepareStart:function(t){var e=M(this.element,t),n=M(this.element,"width"),r=M(this.element,"height");return/rect/.test(e)?e:[0,n,r,0]},prepareProperty:function(t,e){if(e instanceof Array)return e.map((function(t){return B(t)}));var n=e.replace(/rect|\(|\)/g,"");return(n=/,/g.test(n)?n.split(","):n.split(/\s/)).map((function(t){return B(t)}))},onStart:function(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(t,e,n,r){for(var a=0,i=[];a<4;a+=1){var o=e[a].v,s=n[a].v,u=n[a].u||"px";i[a]=(100*D(o,s,r)>>0)/100+u}t.style.clip="rect("+i+")"})}},ot={component:"clipProperty",property:"clip",defaultValue:[0,0,0,0],Interpolate:{numbers:D},functions:it,Util:{trueDimension:B}};function st(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var o=getComputedStyle(i,null).color;o=/rgb/.test(o)?o.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(o[0],10),g:parseInt(o[1],10),b:parseInt(o[2],10)}}return e}function ut(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=D(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*D(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function ct(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=ut(n,r,a)})}var lt={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach((function(t){lt[t]=ct}));var pt=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],ht={};pt.forEach((function(t){ht[t]="#000"}));var ft={};pt.forEach((function(t){ft[t]=ct}));var dt={component:"colorProperties",category:"colors",properties:pt,defaultValues:ht,Interpolate:{numbers:D,colors:ut},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return st(e)},onStart:ft},Util:{trueColor:st}};function vt(t,e,n){for(var r=[],a=0;a<3;a+=1)r[a]=(100*D(t[a],e[a],n)>>0)/100+"px";return"drop-shadow("+r.concat(ut(t[3],e[3],n)).join(" ")+")"}function gt(t){return t.replace("-r","R").replace("-s","S")}function mt(t){var e;3===t.length?e=[t[0],t[1],0,t[2]]:4===t.length&&(e=[t[0],t[1],t[2],t[3]]);for(var n=0;n<3;n+=1)e[n]=parseFloat(e[n]);return e[3]=st(e[3]),e}function yt(t){var e={},n=t.match(/(([a-z].*?)\(.*?\))(?=\s([a-z].*?)\(.*?\)|\s*$)/g),r="none"!==t?n:"none";if(r instanceof Array)for(var a=0,i=r.length;a>0)/100+"%)":"")+(n.blur||r.blur?"blur("+(100*D(n.blur,r.blur,a)>>0)/100+"em)":"")+(n.saturate||r.saturate?"saturate("+(100*D(n.saturate,r.saturate,a)>>0)/100+"%)":"")+(n.invert||r.invert?"invert("+(100*D(n.invert,r.invert,a)>>0)/100+"%)":"")+(n.grayscale||r.grayscale?"grayscale("+(100*D(n.grayscale,r.grayscale,a)>>0)/100+"%)":"")+(n.hueRotate||r.hueRotate?"hue-rotate("+(100*D(n.hueRotate,r.hueRotate,a)>>0)/100+"deg)":"")+(n.sepia||r.sepia?"sepia("+(100*D(n.sepia,r.sepia,a)>>0)/100+"%)":"")+(n.brightness||r.brightness?"brightness("+(100*D(n.brightness,r.brightness,a)>>0)/100+"%)":"")+(n.contrast||r.contrast?"contrast("+(100*D(n.contrast,r.contrast,a)>>0)/100+"%)":"")+(n.dropShadow||r.dropShadow?vt(n.dropShadow,r.dropShadow,a):"")})},crossCheck:function(t){var e=this;this.valuesEnd[t]&&Object.keys(this.valuesStart[t]).forEach((function(n){e.valuesEnd[t][n]||(e.valuesEnd[t][n]=e.valuesStart[t][n])}))}},wt={component:"filterEffects",property:"filter",defaultValue:{opacity:100,blur:0,saturate:100,grayscale:0,brightness:100,contrast:100,sepia:0,invert:0,hueRotate:0,dropShadow:[0,0,0,{r:0,g:0,b:0}],url:""},Interpolate:{opacity:D,blur:D,saturate:D,grayscale:D,brightness:D,contrast:D,sepia:D,invert:D,hueRotate:D,dropShadow:{numbers:D,colors:ut,dropShadow:vt}},functions:bt,Util:{parseDropShadow:mt,parseFilterString:yt,replaceDashNamespace:gt,trueColor:st}},Et={},xt="htmlAttributes",St=["fill","stroke","stop-color"];function kt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var Ot={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=kt(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=St.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var o=kt(a),s=/(%|[a-z]+)$/,u=n.element.getAttribute(o.replace(/_+[a-z]+/,""));if(St.includes(o))i.htmlAttributes[o]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in Et)&&(Et[e]=function(t,e,n,r,a){t.setAttribute(e,ut(n,r,a))})},r[o]=st(e[a])||f.htmlAttributes[a];else if(null!==u&&s.test(u)){var c=B(u).u||B(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[o+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in Et)&&(Et[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*D(n.v,r.v,a)>>0)/1e3+r.u)})},r[o+l]=B(e[a])}else s.test(e[a])&&null!==u&&(null===u||s.test(u))||(i.htmlAttributes[o]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in Et)&&(Et[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*D(n,r,a)>>0)/1e3)})},r[o]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=Et)}}},Tt={component:xt,property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:D,colors:ut},functions:Ot,Util:{replaceUppercase:kt,trueColor:st,trueDimension:B}};var Mt={prepareStart:function(t){return M(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*D(n,r,a)>>0)/1e3})}},Ct={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:D},functions:Mt};function _t(t,e){return parseFloat(t)/100*e}function jt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function It(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*D(e.s,n.s,r)>>0)/100,o=(100*D(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(o<1?0:o)>>0)/100+"px, "+a+"px"})}},Ut={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:D},functions:Rt,Util:{getRectLength:jt,getPolyLength:It,getLineLength:At,getCircleLength:Pt,getEllipseLength:Lt,getTotalLength:Vt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Nt,percent:_t}};function qt(t){return t.map((function(t){return Array.isArray(t)?qt(t):Number.isNaN(+t)?t:+t}))}var Ft=4;function Ht(t,e){var n=Number.isNaN(+e)?Ft:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):qt(t)}var Dt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Bt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Dt[n]&&(t.segments.push([e].concat(r.splice(0,Dt[n]))),Dt[n]););}var Qt="Invalid path value";function zt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Qt+": invalid Arc flag "+e)}function Xt(t){return t>=48&&t<=57}function Yt(t){var e,n=t.index,r=t.max,a=n,i=!1,o=!1,s=!1,u=!1;if(a>=r)t.err=Qt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function $t(t){return t>=48&&t<=57||43===t||45===t||46===t}function Gt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Dt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(n))if(t.index+=1,Wt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Yt(t):zt(t),t.err.length)return;t.data.push(t.param),Wt(t),t.index=t.max)break;if(!$t(t.pathValue.charCodeAt(t.index)))break}Bt(t)}else Bt(t);else t.err=Qt+": "+t.pathValue[t.index]+" not a path command"}function Zt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Kt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Dt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Jt(t,e){if(Kt(t))return qt(t);var n=new Zt(t);for(Wt(n);n.index7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function ne(t,e,n){var r=t[0],a=t.slice(1),i=t;if("TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null),"H"===r)i=["L",t[1],e.y1];else if("V"===r)i=["L",e.x1,t[1]];else if("S"===r){var o=function(t,e,n,r,a){return"CS".indexOf(a)>-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),s=o.x1,u=o.y1;e.x1=s,e.y1=u,i=["C",s,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,p=c.qy;e.qx=l,e.qy=p,i=["Q",l,p].concat(a)}else if("Q"===r){var h=a[0],f=a[1];e.qx=h,e.qy=f}return i}function re(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Dt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return qt(t);for(var n,r,a=te(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},o=[],s=a.length,u="",c=0;c1&&(x*=T=Math.sqrt(T),S*=T);var M=Math.pow(x,2),C=Math.pow(S,2),_=(i===o?-1:1)*Math.sqrt(Math.abs((M*C-M*O*O-C*k*k)/(M*O*O+C*k*k)));f=_*x*O/S+(y+b)/2,d=_*-S*k/x+(w+E)/2,p=Math.asin(((w-d)/S*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((E-d)/S*Math.pow(10,9)>>0)/Math.pow(10,9)),p=yh&&(p-=2*Math.PI),!o&&h>p&&(h-=2*Math.PI)}var j=h-p;if(Math.abs(j)>v){var I=h,A=b,P=E;h=p+v*(o&&h>p?1:-1),b=f+x*Math.cos(h),E=d+S*Math.sin(h),m=ie(b,E,x,S,a,0,o,A,P,[h,I,f,d])}j=h-p;var L=Math.cos(p),V=Math.sin(p),N=Math.cos(h),R=Math.sin(h),U=Math.tan(j/4),q=4/3*x*U,F=4/3*S*U,H=[y,w],D=[y+q*V,w-F*L],B=[b+q*R,E-F*N],Q=[b,E];return D[0]=2*H[0]-D[0],D[1]=2*H[1]-D[1],c?[D,B,Q].concat(m):(m=[D,B,Q].concat(m).join().split(",")).map((function(t,e){return e%2?ae(m[e-1],t,g).y:ae(t,m[e+1],g).x}))}function oe(t,e,n,r,a,i){var o=1/3,s=2/3;return[o*t+s*n,o*e+s*r,o*a+s*n,o*i+s*r,a,i]}function se(t,e,n,r,a,i,o,s,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*o,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*s}}function ue(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function ce(t,e,n,r){var a=.5,i=[t,e],o=[n,r],s=ue(i,o,a),u=ue(o,s,a),c=ue(s,u,a),l=ue(u,c,a),p=ue(c,l,a),h=se.apply(0,i.concat(s,c,p,a)),f=se.apply(0,p.concat(l,u,o,0));return[h.x,h.y,f.x,f.y,n,r]}function le(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(ie.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(oe.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ce(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ce(e.x1,e.y1,e.x,e.y))}return t}function pe(t,e){if(function(t){return Kt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return qt(t);for(var n,r,a=re(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},o=[],s="",u=a.length,c=0;c=0}function ge(t,e){var n=e||.5,r=t.slice(0,2),a=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),s=ue(r,a,n),u=ue(a,i,n),c=ue(i,o,n),l=ue(s,u,n),p=ue(u,c,n),h=ue(l,p,n);return[["C"].concat(s,l,h),["C"].concat(p,c,o)]}function me(t,e,n,r,a){return a*(a*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function ye(t,e,n,r,a,i,o,s,u){var c;(null===u||Number.isNaN(+u))&&(c=1),c>1&&(c=1),c<0&&(c=0);var l=c/2,p=0,h=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){h=me(t,n,a,o,p=l*u+l),f=me(e,r,i,s,p),d+=v[c]*Math.sqrt(h*h+f*f)})),l*d}function be(t){return pe((e=he(te(t)),he(te(e,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0]).map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),a=e?ye.apply(0,r):0;return{s:t,ss:e?a?ge(r):[t,t]:[t],l:a}}));var e}function we(t,e,n){var r=be(t),a=be(e),i=r.length,o=a.length,s=r.filter((function(t){return t.l})).length,u=a.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=a.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,p=n||Math.max(i,o),h=[c,l],f=[p-i,p-o],d=0,v=[r,a].map((function(t,e){return t.l===p?t.map((function(t){return t.s})):t.map((function(t,n){return d=n&&f[e]&&t.l>=h[e],f[e]-=d?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:we(v[0],v[1],p)}function Ee(t){var e=t.length,n=e-1;return t.map((function(r,a){return t.map((function(r,i){var o,s=a+i;return 0===i||t[s]&&"M"===t[s][0]?(o=t[s],["M"].concat(o.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}function xe(t,e){var n=t.length-1,r=[],a=0,i=Ee(t);return i.forEach((function(i,o){t.slice(1).forEach((function(r,i){a+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(o+i)%n].slice(-2),e[i%n].slice(-2))})),r[o]=a,a=0})),i[r.indexOf(Math.min.apply(null,r))]}var Se={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=P(e)),"object"==typeof e&&e.curve?e:(a&&/path|glyph/.test(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){for(var a=[],i=e.curve,o=n.curve,s=0,u=o.length;s>0)/1e3)}t.setAttribute("d",1===r?n.original:he(a))})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].curve,n=this.valuesEnd[t].curve;if(!e||!n||e&&n&&"M"===e[0][0]&&e.length!==n.length){var r=we(this.valuesStart[t].original,this.valuesEnd[t].original),a=ve(r[0])!==ve(r[1])?fe(r[0]):qt(r[0]);this.valuesStart[t].curve=a,this.valuesEnd[t].curve=xe(r[1],a)}}}},ke={component:"svgCubicMorph",property:"path",defaultValue:[],Interpolate:{numbers:D,pathToString:he},functions:Se,Util:{pathToCurve:pe,pathToAbsolute:te,pathToString:he,parsePathString:Jt,getRotatedCurve:xe,getRotations:Ee,equalizeSegments:we,reverseCurve:fe,clonePath:qt,getDrawDirection:ve,splitCubic:ge,getCurveArray:be}};function Oe(t,e){var n=e.x,r=e.width;return/[a-z]/i.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?n+parseFloat(t)*r/100:parseFloat(t)}function Te(t){var e={},n=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none";if(n instanceof Array)for(var r=0,a=n.length;r>0)/1e3+(i?","+(1e3*i>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(p?"skewX("+(1e3*p>>0)/1e3+")":"")+(h?"skewY("+(1e3*h>>0)/1e3+")":"")+(1!==s?"scale("+(1e3*s>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],n=this.valuesEnd[t],r=Me.call(this,t,Te(this.element.getAttribute("transform")));Object.keys(r).forEach((function(t){e[t]=r[t]}));var a=this.element.ownerSVGElement,i=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));e.translate=[i.matrix.e,i.matrix.f],Object.keys(e).forEach((function(t){t in n&&"origin"!==t||(n[t]=e[t])}))}}},_e={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:D},functions:Ce,Util:{parseStringOrigin:Oe,parseTransformString:Te,parseTransformSVG:Me}},je=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){return t=!0}});document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t,e)}),e)}catch(t){throw Error("Passive events are not supported")}return t}(),Ie="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Ae="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Pe=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Le=!!je&&{passive:!1};function Ve(t){this.scrolling&&t.preventDefault()}function Ne(){var t=this.element;return t===Pe?{el:document,st:document.body}:{el:t,st:t}}function Re(t,e){e[t](Ie[0],Ve,Le),e[t](Ae,Ve,Le)}function Ue(){var t=Ne.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,Re("addEventListener",t.el),t.st.style.pointerEvents="none")}function qe(){var t=Ne.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,Re("removeEventListener",t.el),t.st.style.pointerEvents="")}var Fe={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Pe,this.element===Pe?window.pageYOffset||Pe.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e,10)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Pe,Ue.call(this),e[t]=function(t,e,n,r){t.scrollTop=D(e,n,r)>>0})},onComplete:function(){qe.call(this)}},He={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:D},functions:Fe,Util:{preventScroll:Ve,scrollIn:Ue,scrollOut:qe,getScrollTargets:Ne,toggleScrollEvents:Re,supportPassive:je}};function De(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){for(var i=[],o="textShadow"===t?3:4,s=3===o?n[3]:n[4],u=3===o?r[3]:r[4],c=!!(n[5]&&"none"!==n[5]||r[5]&&"none"!==r[5])&&" inset",l=0;l>0)/1e3+"px");e.style[t]=c?ut(s,u,a)+i.join(" ")+c:ut(s,u,a)+i.join(" ")})}var Be={};["boxShadow","textShadow"].forEach((function(t){Be[t]=De}));var Qe=["boxShadow","textShadow"];function ze(t,e){var n;3===t.length?n=[t[0],t[1],0,0,t[2],"none"]:4===t.length?n=/inset|none/.test(t[3])?[t[0],t[1],0,0,t[2],t[3]]:[t[0],t[1],t[2],0,t[3],"none"]:5===t.length?n=/inset|none/.test(t[4])?[t[0],t[1],t[2],0,t[3],t[4]]:[t[0],t[1],t[2],t[3],t[4],"none"]:6===t.length&&(n=t);for(var r=0;r<4;r+=1)n[r]=parseFloat(n[r]);return n[4]=st(n[4]),n="boxShadow"===e?n:n.filter((function(t,e){return[0,1,2,4].includes(e)})),n}var Xe={};Qe.forEach((function(t){Xe[t]=De}));var Ye={component:"shadowProperties",properties:Qe,defaultValues:{boxShadow:"0px 0px 0px 0px rgb(0,0,0)",textShadow:"0px 0px 0px rgb(0,0,0)"},Interpolate:{numbers:D,colors:ut},functions:{prepareStart:function(t){var e=M(this.element,t);return/^none$|^initial$|^inherit$|^inset$/.test(e)?f[t]:e},prepareProperty:function(t,e){var n=e;if("string"==typeof n){var r="none",a=n.match(/(\s?(?:#(?:[\da-f]{3}){1,2}|rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))\s?)/gi);r=/inset/.test(n)?"inset":r,n=ze(n=(n=/inset/.test(n)?n.replace(/(\s+inset|inset+\s)/g,""):n).replace(a[0],"").split(" ").concat([a[0].replace(/\s/g,"")],[r]),t)}else n instanceof Array&&(n=ze(n,t));return n},onStart:Xe},Util:{processShadowArray:ze,trueColor:st}},We={};function $e(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=X(n.v,r.v,r.u,a)})}["fontSize","lineHeight","letterSpacing","wordSpacing"].forEach((function(t){We[t]=$e}));var Ge=["fontSize","lineHeight","letterSpacing","wordSpacing"],Ze={};Ge.forEach((function(t){Ze[t]=$e}));var Ke={component:"textProperties",category:"textProperties",properties:Ge,defaultValues:{fontSize:0,lineHeight:0,letterSpacing:0,wordSpacing:0},Interpolate:{units:X},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:Ze},Util:{trueDimension:B}},Je=String("abcdefghijklmnopqrstuvwxyz").split(""),tn=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),en=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),nn=String("0123456789").split(""),rn=Je.concat(tn,nn),an=rn.concat(en),on={alpha:Je,upper:tn,symbols:en,numeric:nn,alphanumeric:rn,all:an},sn={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=on[d.textChars];n in on?r=on[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",o="",s=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(o=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?o+l:s):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:s):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),o=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?o+l+i:s)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=D(e,n,r)>>0})}};function un(t,e){var n,r;if("string"==typeof t)return(r=document.createElement("SPAN")).innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){var a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function cn(t,e){var n=[],r=t.children.length;if(r){for(var a,i=[],o=t.innerHTML,s=0,u=void 0,c=void 0,l=void 0;s>0)/1e3;return r}var pn="undefined"!=typeof DOMMatrix?DOMMatrix:null,hn="transformMatrix";var fn={BackgroundPosition:z,BorderRadius:K,BoxModel:at,ClipProperty:ot,ColorProperties:dt,FilterEffects:wt,HTMLAttributes:Tt,OpacityProperty:Ct,SVGDraw:Ut,SVGCubicMorph:ke,SVGTransform:_e,ScrollProperty:He,ShadowProperties:Ye,TextProperties:Ke,TextWriteProperties:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",number:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:D},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:sn},Util:{charSet:on,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=I.tween,i=function(t,e){var n=cn(t,"text-part"),r=cn(un(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),o=i[0],s=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],p=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*o[e].innerHTML.length:r.duration,r.delay=p,r.onComplete=null,p+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*s[i].innerHTML.length:r.duration,r.delay=p,r.onComplete=i===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,p+=r.duration,new a(n,{text:""},{text:s[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},MatrixTransform:{component:hn,property:"transform",defaultValue:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,skew:[0,0],skewX:0,skewY:0,scale3d:[1,1,1],scaleX:1,scaleY:1,scaleZ:1},functions:{prepareStart:function(t,e){var n={},r=this.element.transformMatrix;return r?Object.keys(r).forEach((function(t){n[t]=r[t]})):Object.keys(e).forEach((function(t){n[t]="perspective"===t?e[t]:f.transform[t]})),n},prepareProperty:function(t,e){if("object"==typeof e&&!e.length){var n,r={},a={},i={},o={},s={},u=[{translate3d:a},{rotate3d:i},{skew:s},{scale3d:o}];return Object.keys(e).forEach((function(t){if(/3d/.test(t)&&"object"==typeof e[t]&&e[t].length)n=e[t].map((function(e){return"scale3d"===t?parseFloat(e):parseInt(e,10)})),r[t]="scale3d"===t?[n[0]||1,n[1]||1,n[2]||1]:[n[0]||0,n[1]||0,n[2]||0];else if(/[XYZ]/.test(t)){var u={};/translate/.test(t)?u=a:/rotate/.test(t)?u=i:/scale/.test(t)?u=o:/skew/.test(t)&&(u=s),u[t.replace(/translate|rotate|scale|skew/,"").toLowerCase()]=/scale/.test(t)?parseFloat(e[t]):parseInt(e[t],10)}else"skew"===t?(n=e[t].map((function(t){return parseInt(t,10)||0})),r[t]=[n[0]||0,n[1]||0]):r[t]=parseInt(e[t],10)})),u.forEach((function(t){var e=Object.keys(t)[0],n=t[e];Object.keys(n).length&&!r[e]&&(r[e]="scale3d"===e?[n.x||1,n.y||1,n.z||1]:"skew"===e?[n.x||0,n.y||0]:[n.x||0,n.y||0,n.z||0])})),r}throw Error('KUTE.js - "'+e+'" is not valid/supported transform function')},onStart:{transform:function(t){pn&&this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){var i=new pn,o={};Object.keys(r).forEach((function(t){o[t]="perspective"===t?D(n[t],r[t],a):ln(n[t],r[t],a)})),o.perspective&&(i.m34=-1/o.perspective),i=o.translate3d?i.translate(o.translate3d[0],o.translate3d[1],o.translate3d[2]):i,i=o.rotate3d?i.rotate(o.rotate3d[0],o.rotate3d[1],o.rotate3d[2]):i,o.skew&&(i=o.skew[0]?i.skewX(o.skew[0]):i,i=o.skew[1]?i.skewY(o.skew[1]):i),i=o.scale3d?i.scale(o.scale3d[0],o.scale3d[1],o.scale3d[2]):i,e.style[t]=i.toString()})},CSS3Matrix:function(t){pn&&this.valuesEnd.transform&&(e[t]||(e[t]=pn))}},onComplete:function(t){var e=this;this.valuesEnd[t]&&(this.element.transformMatrix={},Object.keys(this.valuesEnd[t]).forEach((function(n){e.element.transformMatrix[n]=e.valuesEnd[t][n]})))},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:D,translate3d:ln,rotate3d:ln,skew:ln,scale3d:ln}}};Object.keys(fn).forEach((function(t){var e=fn[t];fn[t]=new H(e)}));return{Animation:H,Components:fn,Tween:R,fromTo:function(t,e,n,r){var a=r||{};return new(0,I.tween)(P(t),e,n,a)},to:function(t,e,n){var r=n||{},a=I.tween;return r.resetStart=e,new a(P(t),e,e,r)},TweenCollection:U,ProgressBar:q,allFromTo:function(t,e,n,r){var a=r||{};return new U(P(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new U(P(t,!0),e,e,r)},Objects:w,Util:E,Easing:A,CubicBezier:t,Render:p,Interpolate:a,Process:j,Internals:O,Selector:P,Version:"2.1.3"}})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var o=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(o,"name",{writable:!0}),o.name=a||"cubic-bezier("+[t,e,n,r]+")",o};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,o,s=1e-5;for(r=t,o=0;o<32;o+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{},a={},i={},o="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):"undefined"!=typeof Date&&Date.now?Date.now:function(){return(new Date).getTime()},s={};s.now=o;var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},I.tween=V,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var N=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];C.call(this,i,"end"),this._resetStart?this.valuesStart=a:C.call(this,a,"start"),this._resetStart||Object.keys(m).forEach((function(t){Object.keys(m[t]).forEach((function(n){m[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var o=n[3];return this._repeat=o.repeat||d.repeat,this._repeatDelay=o.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,_.call(this),Object.keys(m).forEach((function(t){Object.keys(m[t]).forEach((function(e){m[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),L.call(this),this._startTime+=e.Time()-this._pauseTime,x(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(S(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.start()})),!1))},n}(V);I.tween=N;var R=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t.apply(this,e),this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.on=function(t,e){["start","stop","update","complete","pause","resume"].indexOf(t)>-1&&(this["_on"+(t.charAt(0).toUpperCase()+t.slice(1))]=e)},e.prototype.option=function(t,e){this["_"+t]=e},e}(N);I.tween=R;var U=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var o=[];return Array.from(t).forEach((function(t,r){var s=I.tween;if(o[r]=i||{},o[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new s(t,e,n,o[r]))})),this.length=this.tweens.length,this};U.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},U.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},U.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},U.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},U.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof U)e.chain(t.tweens);else{if(!(t instanceof I.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},U.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},U.prototype.removeTweens=function(){this.tweens=[]},U.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var q=function(t,e){var n;if(this.element=P(t),this.element.tween=e,this.element.tween.toolbar=this.element,this.element.toolbar=this,n=this.element.parentNode.getElementsByTagName("OUTPUT"),this.element.output=n[0],!(this.element instanceof HTMLInputElement))throw TypeError("Target element is not [HTMLInputElement]");if("range"!==this.element.type)throw TypeError("Target element is not a range input");if(!(e instanceof I.tween))throw TypeError("tween parameter is not ["+I.tween+"]");this.element.setAttribute("value",0),this.element.setAttribute("min",0),this.element.setAttribute("max",1),this.element.setAttribute("step",1e-4),this.element.tween._onUpdate=this.updateBar,this.element.addEventListener("mousedown",this.downAction,!1)};q.prototype.updateBar=function(){var t,n=this.toolbar.output;(t=this.paused?this.toolbar.value:(e.Time()-this._startTime)/this._duration)>.9999&&(t=1),t<.01&&(t=0);var r=this._reversed?1-t:t;this.toolbar.value=r,n&&(n.value=(1e4*r>>0)/100+"%")},q.prototype.toggleEvents=function(t){this.element[t+"EventListener"]("mousemove",this.moveAction,!1),this.element[t+"EventListener"]("mouseup",this.upAction,!1)},q.prototype.updateTween=function(){var t=(this.tween._reversed?1-this.value:this.value)*this.tween._duration-1e-4;this.tween._startTime=0,this.tween.update(t)},q.prototype.moveAction=function(){this.toolbar.updateTween.call(this)},q.prototype.downAction=function(){this.tween.playing||this.tween.start(),this.tween.paused||(this.tween.pause(),this.toolbar.toggleEvents("add"),e.Tick=cancelAnimationFrame(e.Ticker))},q.prototype.upAction=function(){this.tween.paused&&(this.tween.paused&&this.tween.resume(),this.tween._startTime=e.Time()-(this.tween._reversed?1-this.value:this.value)*this.tween._duration,this.toolbar.toggleEvents("remove"),e.Tick=requestAnimationFrame(e.Ticker))};var F=function(t){try{if(t.component in h)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};F.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:g,onStart:i,onComplete:y,crossCheck:m},o=t.category,s=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return h[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[s]=t.defaultValue,e.supports=s+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||s)+" "+(s||o)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][o||s]||(r[e][n][o||s]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){E[e]||(E[e]=t.Util[e])})),e};var D=function(t){function e(){for(var e,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),(e=this).setComponent.apply(e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setComponent=function(e){t.prototype.setComponent.call(this,e);var n=this,r={prepareProperty:v,prepareStart:g,onStart:i,onComplete:y,crossCheck:m},o=e.category,s=e.property,u=e.properties&&e.properties.length||e.subProperties&&e.subProperties.length;return"defaultValue"in e?(n.supports=s+" property",n.defaultValue=(""+e.defaultValue).length?"YES":"not set or incorrect"):e.defaultValues&&(n.supports=(u||s)+" "+(s||o)+" properties",n.defaultValues=Object.keys(e.defaultValues).length===u?"YES":"Not set or incomplete"),e.defaultOptions&&(n.extends=[],Object.keys(e.defaultOptions).forEach((function(t){n.extends.push(t)})),n.extends.length?n.extends="with <"+n.extends.join(", ")+"> new option(s)":delete n.extends),e.functions&&(n.interface=[],n.render=[],n.warning=[],Object.keys(r).forEach((function(t){t in e.functions?("prepareProperty"===t&&n.interface.push("fromTo()"),"prepareStart"===t&&n.interface.push("to()"),"onStart"===t&&(n.render="can render update")):("prepareProperty"===t&&n.warning.push("fromTo()"),"prepareStart"===t&&n.warning.push("to()"),"onStart"===t&&(n.render="no function to render update"))})),n.interface.length?n.interface=(o||s)+" can use ["+n.interface.join(", ")+"] method(s)":delete n.uses,n.warning.length?n.warning=(o||s)+" can't use ["+n.warning.join(", ")+"] method(s) because values aren't processed":delete n.warning),e.Interpolate?(n.uses=[],n.adds=[],Object.keys(e.Interpolate).forEach((function(t){var r=e.Interpolate[t];"function"==typeof r?(a[t]||n.adds.push(""+t),n.uses.push(""+t)):Object.keys(r).forEach((function(e){"function"!=typeof r[e]||a[t]||n.adds.push(""+e),n.uses.push(""+e)}))})),n.uses.length?n.uses="["+n.uses.join(", ")+"] interpolation function(s)":delete n.uses,n.adds.length?n.adds="new ["+n.adds.join(", ")+"] interpolation function(s)":delete n.adds):n.critical="For "+(s||o)+" no interpolation function[s] is set",e.Util&&(n.hasUtil=Object.keys(e.Util).join(",")),n},e}(F);function H(t,e,n){return+t+(e-t)*n}function B(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i>0)/100+"% "+(100*H(n[1],r[1],a)>>0)/100+"%"})}},z={component:"backgroundPositionProp",property:"backgroundPosition",defaultValue:[50,50],Interpolate:{numbers:H},functions:Q,Util:{trueDimension:B}};function X(t,e,n,r){return+t+(e-t)*r+n}function Y(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=X(n.v,r.v,r.u,a)})}var W={};["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"].forEach((function(t){W[t]=Y}));var $=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],G={};$.forEach((function(t){G[t]=0}));var Z={};$.forEach((function(t){Z[t]=Y}));var K={component:"borderRadiusProperties",category:"borderRadius",properties:$,defaultValues:G,Interpolate:{units:X},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:Z},Util:{trueDimension:B}};function J(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(a>.99||a<.01?(10*H(n,r,a)>>0)/10:H(n,r,a)>>0)+"px"})}var tt={};["top","left","width","height"].forEach((function(t){tt[t]=J}));var et=["top","left","width","height","right","bottom","minWidth","minHeight","maxWidth","maxHeight","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","margin","marginTop","marginBottom","marginLeft","marginRight","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","outlineWidth"],nt={};et.forEach((function(t){nt[t]=0}));var rt={};et.forEach((function(t){rt[t]=J}));var at={component:"boxModelProperties",category:"boxModel",properties:et,defaultValues:nt,Interpolate:{numbers:H},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){var n=B(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:rt}};var it={prepareStart:function(t){var e=M(this.element,t),n=M(this.element,"width"),r=M(this.element,"height");return/rect/.test(e)?e:[0,n,r,0]},prepareProperty:function(t,e){if(e instanceof Array)return e.map((function(t){return B(t)}));var n=e.replace(/rect|\(|\)/g,"");return(n=/,/g.test(n)?n.split(","):n.split(/\s/)).map((function(t){return B(t)}))},onStart:function(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(t,e,n,r){for(var a=0,i=[];a<4;a+=1){var o=e[a].v,s=n[a].v,u=n[a].u||"px";i[a]=(100*H(o,s,r)>>0)/100+u}t.style.clip="rect("+i+")"})}},ot={component:"clipProperty",property:"clip",defaultValue:[0,0,0,0],Interpolate:{numbers:H},functions:it,Util:{trueDimension:B}};function st(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var o=getComputedStyle(i,null).color;o=/rgb/.test(o)?o.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(o[0],10),g:parseInt(o[1],10),b:parseInt(o[2],10)}}return e}function ut(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=H(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*H(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function ct(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=ut(n,r,a)})}var lt={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach((function(t){lt[t]=ct}));var pt=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],ht={};pt.forEach((function(t){ht[t]="#000"}));var ft={};pt.forEach((function(t){ft[t]=ct}));var dt={component:"colorProperties",category:"colors",properties:pt,defaultValues:ht,Interpolate:{numbers:H,colors:ut},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return st(e)},onStart:ft},Util:{trueColor:st}};function vt(t,e,n){for(var r=[],a=0;a<3;a+=1)r[a]=(100*H(t[a],e[a],n)>>0)/100+"px";return"drop-shadow("+r.concat(ut(t[3],e[3],n)).join(" ")+")"}function gt(t){return t.replace("-r","R").replace("-s","S")}function mt(t){var e;3===t.length?e=[t[0],t[1],0,t[2]]:4===t.length&&(e=[t[0],t[1],t[2],t[3]]);for(var n=0;n<3;n+=1)e[n]=parseFloat(e[n]);return e[3]=st(e[3]),e}function yt(t){var e={},n=t.match(/(([a-z].*?)\(.*?\))(?=\s([a-z].*?)\(.*?\)|\s*$)/g),r="none"!==t?n:"none";if(r instanceof Array)for(var a=0,i=r.length;a>0)/100+"%)":"")+(n.blur||r.blur?"blur("+(100*H(n.blur,r.blur,a)>>0)/100+"em)":"")+(n.saturate||r.saturate?"saturate("+(100*H(n.saturate,r.saturate,a)>>0)/100+"%)":"")+(n.invert||r.invert?"invert("+(100*H(n.invert,r.invert,a)>>0)/100+"%)":"")+(n.grayscale||r.grayscale?"grayscale("+(100*H(n.grayscale,r.grayscale,a)>>0)/100+"%)":"")+(n.hueRotate||r.hueRotate?"hue-rotate("+(100*H(n.hueRotate,r.hueRotate,a)>>0)/100+"deg)":"")+(n.sepia||r.sepia?"sepia("+(100*H(n.sepia,r.sepia,a)>>0)/100+"%)":"")+(n.brightness||r.brightness?"brightness("+(100*H(n.brightness,r.brightness,a)>>0)/100+"%)":"")+(n.contrast||r.contrast?"contrast("+(100*H(n.contrast,r.contrast,a)>>0)/100+"%)":"")+(n.dropShadow||r.dropShadow?vt(n.dropShadow,r.dropShadow,a):"")})},crossCheck:function(t){var e=this;this.valuesEnd[t]&&Object.keys(this.valuesStart[t]).forEach((function(n){e.valuesEnd[t][n]||(e.valuesEnd[t][n]=e.valuesStart[t][n])}))}},wt={component:"filterEffects",property:"filter",defaultValue:{opacity:100,blur:0,saturate:100,grayscale:0,brightness:100,contrast:100,sepia:0,invert:0,hueRotate:0,dropShadow:[0,0,0,{r:0,g:0,b:0}],url:""},Interpolate:{opacity:H,blur:H,saturate:H,grayscale:H,brightness:H,contrast:H,sepia:H,invert:H,hueRotate:H,dropShadow:{numbers:H,colors:ut,dropShadow:vt}},functions:bt,Util:{parseDropShadow:mt,parseFilterString:yt,replaceDashNamespace:gt,trueColor:st}},Et={},xt="htmlAttributes",St=["fill","stroke","stop-color"];function kt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var Tt={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=kt(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=St.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var o=kt(a),s=/(%|[a-z]+)$/,u=n.element.getAttribute(o.replace(/_+[a-z]+/,""));if(St.includes(o))i.htmlAttributes[o]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in Et)&&(Et[e]=function(t,e,n,r,a){t.setAttribute(e,ut(n,r,a))})},r[o]=st(e[a])||f.htmlAttributes[a];else if(null!==u&&s.test(u)){var c=B(u).u||B(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[o+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in Et)&&(Et[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*H(n.v,r.v,a)>>0)/1e3+r.u)})},r[o+l]=B(e[a])}else s.test(e[a])&&null!==u&&(null===u||s.test(u))||(i.htmlAttributes[o]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in Et)&&(Et[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*H(n,r,a)>>0)/1e3)})},r[o]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=Et)}}},Ot={component:xt,property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:H,colors:ut},functions:Tt,Util:{replaceUppercase:kt,trueColor:st,trueDimension:B}};var Mt={prepareStart:function(t){return M(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*H(n,r,a)>>0)/1e3})}},Ct={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:H},functions:Mt};function _t(t,e){return parseFloat(t)/100*e}function jt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function It(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*H(e.s,n.s,r)>>0)/100,o=(100*H(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(o<1?0:o)>>0)/100+"px, "+a+"px"})}},Ut={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:H},functions:Rt,Util:{getRectLength:jt,getPolyLength:It,getLineLength:At,getCircleLength:Pt,getEllipseLength:Lt,getTotalLength:Vt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Nt,percent:_t}};function qt(t){return t.map((function(t){return Array.isArray(t)?qt(t):Number.isNaN(+t)?t:+t}))}var Ft=4;function Dt(t,e){var n=Number.isNaN(+e)?Ft:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):qt(t)}var Ht={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Bt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Ht[n]&&(t.segments.push([e].concat(r.splice(0,Ht[n]))),Ht[n]););}var Qt="Invalid path value";function zt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Qt+": invalid Arc flag "+e)}function Xt(t){return t>=48&&t<=57}function Yt(t){var e,n=t.index,r=t.max,a=n,i=!1,o=!1,s=!1,u=!1;if(a>=r)t.err=Qt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function $t(t){return t>=48&&t<=57||43===t||45===t||46===t}function Gt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Ht[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(n))if(t.index+=1,Wt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Yt(t):zt(t),t.err.length)return;t.data.push(t.param),Wt(t),t.index=t.max)break;if(!$t(t.pathValue.charCodeAt(t.index)))break}Bt(t)}else Bt(t);else t.err=Qt+": "+t.pathValue[t.index]+" not a path command"}function Zt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Kt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ht[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Jt(t,e){if(Kt(t))return qt(t);var n=new Zt(t);for(Wt(n);n.index7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function ne(t,e,n){var r=t[0],a=t.slice(1),i=t;if("TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null),"H"===r)i=["L",t[1],e.y1];else if("V"===r)i=["L",e.x1,t[1]];else if("S"===r){var o=function(t,e,n,r,a){return"CS".indexOf(a)>-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),s=o.x1,u=o.y1;e.x1=s,e.y1=u,i=["C",s,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,p=c.qy;e.qx=l,e.qy=p,i=["Q",l,p].concat(a)}else if("Q"===r){var h=a[0],f=a[1];e.qx=h,e.qy=f}return i}function re(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ht[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return qt(t);for(var n,r,a=te(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},o=[],s=a.length,u="",c=0;c1&&(x*=O=Math.sqrt(O),S*=O);var M=Math.pow(x,2),C=Math.pow(S,2),_=(i===o?-1:1)*Math.sqrt(Math.abs((M*C-M*T*T-C*k*k)/(M*T*T+C*k*k)));f=_*x*T/S+(y+b)/2,d=_*-S*k/x+(w+E)/2,p=Math.asin(((w-d)/S*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((E-d)/S*Math.pow(10,9)>>0)/Math.pow(10,9)),p=yh&&(p-=2*Math.PI),!o&&h>p&&(h-=2*Math.PI)}var j=h-p;if(Math.abs(j)>v){var I=h,A=b,P=E;h=p+v*(o&&h>p?1:-1),b=f+x*Math.cos(h),E=d+S*Math.sin(h),m=ie(b,E,x,S,a,0,o,A,P,[h,I,f,d])}j=h-p;var L=Math.cos(p),V=Math.sin(p),N=Math.cos(h),R=Math.sin(h),U=Math.tan(j/4),q=4/3*x*U,F=4/3*S*U,D=[y,w],H=[y+q*V,w-F*L],B=[b+q*R,E-F*N],Q=[b,E];return H[0]=2*D[0]-H[0],H[1]=2*D[1]-H[1],c?[H,B,Q].concat(m):(m=[H,B,Q].concat(m).join().split(",")).map((function(t,e){return e%2?ae(m[e-1],t,g).y:ae(t,m[e+1],g).x}))}function oe(t,e,n,r,a,i){var o=1/3,s=2/3;return[o*t+s*n,o*e+s*r,o*a+s*n,o*i+s*r,a,i]}function se(t,e,n,r,a,i,o,s,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*o,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*s}}function ue(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function ce(t,e,n,r){var a=.5,i=[t,e],o=[n,r],s=ue(i,o,a),u=ue(o,s,a),c=ue(s,u,a),l=ue(u,c,a),p=ue(c,l,a),h=se.apply(0,i.concat(s,c,p,a)),f=se.apply(0,p.concat(l,u,o,0));return[h.x,h.y,f.x,f.y,n,r]}function le(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(ie.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(oe.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ce(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ce(e.x1,e.y1,e.x,e.y))}return t}function pe(t,e){if(function(t){return Kt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return qt(t);for(var n,r,a=re(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},o=[],s="",u=a.length,c=0;c=0}function ge(t,e){var n=e||.5,r=t.slice(0,2),a=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),s=ue(r,a,n),u=ue(a,i,n),c=ue(i,o,n),l=ue(s,u,n),p=ue(u,c,n),h=ue(l,p,n);return[["C"].concat(s,l,h),["C"].concat(p,c,o)]}function me(t,e,n,r,a){return a*(a*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function ye(t,e,n,r,a,i,o,s,u){var c;(null===u||Number.isNaN(+u))&&(c=1),c>1&&(c=1),c<0&&(c=0);var l=c/2,p=0,h=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){h=me(t,n,a,o,p=l*u+l),f=me(e,r,i,s,p),d+=v[c]*Math.sqrt(h*h+f*f)})),l*d}function be(t){return pe((e=he(te(t)),he(te(e,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0]).map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),a=e?ye.apply(0,r):0;return{s:t,ss:e?a?ge(r):[t,t]:[t],l:a}}));var e}function we(t,e,n){var r=be(t),a=be(e),i=r.length,o=a.length,s=r.filter((function(t){return t.l})).length,u=a.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=a.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,p=n||Math.max(i,o),h=[c,l],f=[p-i,p-o],d=0,v=[r,a].map((function(t,e){return t.l===p?t.map((function(t){return t.s})):t.map((function(t,n){return d=n&&f[e]&&t.l>=h[e],f[e]-=d?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:we(v[0],v[1],p)}function Ee(t){var e=t.length,n=e-1;return t.map((function(r,a){return t.map((function(r,i){var o,s=a+i;return 0===i||t[s]&&"M"===t[s][0]?(o=t[s],["M"].concat(o.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}function xe(t,e){var n=t.length-1,r=[],a=0,i=Ee(t);return i.forEach((function(i,o){t.slice(1).forEach((function(r,i){a+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(o+i)%n].slice(-2),e[i%n].slice(-2))})),r[o]=a,a=0})),i[r.indexOf(Math.min.apply(null,r))]}var Se={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=P(e)),"object"==typeof e&&e.curve?e:(a&&/path|glyph/.test(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){for(var a=[],i=e.curve,o=n.curve,s=0,u=o.length;s>0)/1e3)}t.setAttribute("d",1===r?n.original:he(a))})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].curve,n=this.valuesEnd[t].curve;if(!e||!n||e&&n&&"M"===e[0][0]&&e.length!==n.length){var r=we(this.valuesStart[t].original,this.valuesEnd[t].original),a=ve(r[0])!==ve(r[1])?fe(r[0]):qt(r[0]);this.valuesStart[t].curve=a,this.valuesEnd[t].curve=xe(r[1],a)}}}},ke={component:"svgCubicMorph",property:"path",defaultValue:[],Interpolate:{numbers:H,pathToString:he},functions:Se,Util:{pathToCurve:pe,pathToAbsolute:te,pathToString:he,parsePathString:Jt,getRotatedCurve:xe,getRotations:Ee,equalizeSegments:we,reverseCurve:fe,clonePath:qt,getDrawDirection:ve,splitCubic:ge,getCurveArray:be}};function Te(t,e){var n=e.x,r=e.width;return/[a-z]/i.test(t)&&!/px/.test(t)?t.replace(/top|left/,0).replace(/right|bottom/,100).replace(/center|middle/,50):/%/.test(t)?n+parseFloat(t)*r/100:parseFloat(t)}function Oe(t){var e={},n=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none";if(n instanceof Array)for(var r=0,a=n.length;r>0)/1e3+(i?","+(1e3*i>>0)/1e3:"")+")":"")+(u?"rotate("+(1e3*u>>0)/1e3+")":"")+(p?"skewX("+(1e3*p>>0)/1e3+")":"")+(h?"skewY("+(1e3*h>>0)/1e3+")":"")+(1!==s?"scale("+(1e3*s>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],n=this.valuesEnd[t],r=Me.call(this,t,Oe(this.element.getAttribute("transform")));Object.keys(r).forEach((function(t){e[t]=r[t]}));var a=this.element.ownerSVGElement,i=a.createSVGTransformFromMatrix(a.createSVGMatrix().translate(-e.origin[0],-e.origin[1]).translate("translate"in e?e.translate[0]:0,"translate"in e?e.translate[1]:0).rotate(e.rotate||0).skewX(e.skewX||0).skewY(e.skewY||0).scale(e.scale||1).translate(+e.origin[0],+e.origin[1]));e.translate=[i.matrix.e,i.matrix.f],Object.keys(e).forEach((function(t){t in n&&"origin"!==t||(n[t]=e[t])}))}}},_e={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:H},functions:Ce,Util:{parseStringOrigin:Te,parseTransformString:Oe,parseTransformSVG:Me}},je=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){return t=!0}});document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t,e)}),e)}catch(t){throw Error("Passive events are not supported")}return t}(),Ie="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],Ae="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Pe=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Le=!!je&&{passive:!1};function Ve(t){this.scrolling&&t.preventDefault()}function Ne(){var t=this.element;return t===Pe?{el:document,st:document.body}:{el:t,st:t}}function Re(t,e){e[t](Ie[0],Ve,Le),e[t](Ae,Ve,Le)}function Ue(){var t=Ne.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,Re("addEventListener",t.el),t.st.style.pointerEvents="none")}function qe(){var t=Ne.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,Re("removeEventListener",t.el),t.st.style.pointerEvents="")}var Fe={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Pe,this.element===Pe?window.pageYOffset||Pe.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e,10)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Pe,Ue.call(this),e[t]=function(t,e,n,r){t.scrollTop=H(e,n,r)>>0})},onComplete:function(){qe.call(this)}},De={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:H},functions:Fe,Util:{preventScroll:Ve,scrollIn:Ue,scrollOut:qe,getScrollTargets:Ne,toggleScrollEvents:Re,supportPassive:je}};function He(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){for(var i=[],o="textShadow"===t?3:4,s=3===o?n[3]:n[4],u=3===o?r[3]:r[4],c=!!(n[5]&&"none"!==n[5]||r[5]&&"none"!==r[5])&&" inset",l=0;l>0)/1e3+"px");e.style[t]=c?ut(s,u,a)+i.join(" ")+c:ut(s,u,a)+i.join(" ")})}var Be={};["boxShadow","textShadow"].forEach((function(t){Be[t]=He}));var Qe=["boxShadow","textShadow"];function ze(t,e){var n;3===t.length?n=[t[0],t[1],0,0,t[2],"none"]:4===t.length?n=/inset|none/.test(t[3])?[t[0],t[1],0,0,t[2],t[3]]:[t[0],t[1],t[2],0,t[3],"none"]:5===t.length?n=/inset|none/.test(t[4])?[t[0],t[1],t[2],0,t[3],t[4]]:[t[0],t[1],t[2],t[3],t[4],"none"]:6===t.length&&(n=t);for(var r=0;r<4;r+=1)n[r]=parseFloat(n[r]);return n[4]=st(n[4]),n="boxShadow"===e?n:n.filter((function(t,e){return[0,1,2,4].includes(e)})),n}var Xe={};Qe.forEach((function(t){Xe[t]=He}));var Ye={component:"shadowProperties",properties:Qe,defaultValues:{boxShadow:"0px 0px 0px 0px rgb(0,0,0)",textShadow:"0px 0px 0px rgb(0,0,0)"},Interpolate:{numbers:H,colors:ut},functions:{prepareStart:function(t){var e=M(this.element,t);return/^none$|^initial$|^inherit$|^inset$/.test(e)?f[t]:e},prepareProperty:function(t,e){var n=e;if("string"==typeof n){var r="none",a=n.match(/(\s?(?:#(?:[\da-f]{3}){1,2}|rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))\s?)/gi);r=/inset/.test(n)?"inset":r,n=ze(n=(n=/inset/.test(n)?n.replace(/(\s+inset|inset+\s)/g,""):n).replace(a[0],"").split(" ").concat([a[0].replace(/\s/g,"")],[r]),t)}else n instanceof Array&&(n=ze(n,t));return n},onStart:Xe},Util:{processShadowArray:ze,trueColor:st}},We={};function $e(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=X(n.v,r.v,r.u,a)})}["fontSize","lineHeight","letterSpacing","wordSpacing"].forEach((function(t){We[t]=$e}));var Ge=["fontSize","lineHeight","letterSpacing","wordSpacing"],Ze={};Ge.forEach((function(t){Ze[t]=$e}));var Ke={component:"textProperties",category:"textProperties",properties:Ge,defaultValues:{fontSize:0,lineHeight:0,letterSpacing:0,wordSpacing:0},Interpolate:{units:X},functions:{prepareStart:function(t){return M(this.element,t)||f[t]},prepareProperty:function(t,e){return B(e)},onStart:Ze},Util:{trueDimension:B}},Je=String("abcdefghijklmnopqrstuvwxyz").split(""),tn=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),en=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),nn=String("0123456789").split(""),rn=Je.concat(tn,nn),an=rn.concat(en),on={alpha:Je,upper:tn,symbols:en,numeric:nn,alphanumeric:rn,all:an},sn={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=on[d.textChars];n in on?r=on[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",o="",s=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(o=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?o+l:s):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:s):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),o=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?o+l+i:s)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=H(e,n,r)>>0})}};function un(t,e){var n,r;if("string"==typeof t)return(r=document.createElement("SPAN")).innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){var a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function cn(t,e){var n=[],r=t.children.length;if(r){for(var a,i=[],o=t.innerHTML,s=0,u=void 0,c=void 0,l=void 0;s>0)/1e3;return r}var pn="undefined"!=typeof DOMMatrix?DOMMatrix:null,hn="transformMatrix";var fn={BackgroundPosition:z,BorderRadius:K,BoxModel:at,ClipProperty:ot,ColorProperties:dt,FilterEffects:wt,HTMLAttributes:Ot,OpacityProperty:Ct,SVGDraw:Ut,SVGCubicMorph:ke,SVGTransform:_e,ScrollProperty:De,ShadowProperties:Ye,TextProperties:Ke,TextWriteProperties:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",number:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:H},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:sn},Util:{charSet:on,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=I.tween,i=function(t,e){var n=cn(t,"text-part"),r=cn(un(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),o=i[0],s=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],p=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*o[e].innerHTML.length:r.duration,r.delay=p,r.onComplete=null,p+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*s[i].innerHTML.length:r.duration,r.delay=p,r.onComplete=i===s.length-1?function(){t.innerHTML=e,t.playing=!1}:null,p+=r.duration,new a(n,{text:""},{text:s[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},MatrixTransform:{component:hn,property:"transform",defaultValue:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,skew:[0,0],skewX:0,skewY:0,scale3d:[1,1,1],scaleX:1,scaleY:1,scaleZ:1},functions:{prepareStart:function(t,e){var n={},r=this.element.transformMatrix;return r?Object.keys(r).forEach((function(t){n[t]=r[t]})):Object.keys(e).forEach((function(t){n[t]="perspective"===t?e[t]:f.transform[t]})),n},prepareProperty:function(t,e){if("object"==typeof e&&!e.length){var n,r={},a={},i={},o={},s={},u=[{translate3d:a},{rotate3d:i},{skew:s},{scale3d:o}];return Object.keys(e).forEach((function(t){if(/3d/.test(t)&&"object"==typeof e[t]&&e[t].length)n=e[t].map((function(e){return"scale3d"===t?parseFloat(e):parseInt(e,10)})),r[t]="scale3d"===t?[n[0]||1,n[1]||1,n[2]||1]:[n[0]||0,n[1]||0,n[2]||0];else if(/[XYZ]/.test(t)){var u={};/translate/.test(t)?u=a:/rotate/.test(t)?u=i:/scale/.test(t)?u=o:/skew/.test(t)&&(u=s),u[t.replace(/translate|rotate|scale|skew/,"").toLowerCase()]=/scale/.test(t)?parseFloat(e[t]):parseInt(e[t],10)}else"skew"===t?(n=e[t].map((function(t){return parseInt(t,10)||0})),r[t]=[n[0]||0,n[1]||0]):r[t]=parseInt(e[t],10)})),u.forEach((function(t){var e=Object.keys(t)[0],n=t[e];Object.keys(n).length&&!r[e]&&(r[e]="scale3d"===e?[n.x||1,n.y||1,n.z||1]:"skew"===e?[n.x||0,n.y||0]:[n.x||0,n.y||0,n.z||0])})),r}throw Error('KUTE.js - "'+e+'" is not valid/supported transform function')},onStart:{transform:function(t){pn&&this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){var i=new pn,o={};Object.keys(r).forEach((function(t){o[t]="perspective"===t?H(n[t],r[t],a):ln(n[t],r[t],a)})),o.perspective&&(i.m34=-1/o.perspective),i=o.translate3d?i.translate(o.translate3d[0],o.translate3d[1],o.translate3d[2]):i,i=o.rotate3d?i.rotate(o.rotate3d[0],o.rotate3d[1],o.rotate3d[2]):i,o.skew&&(i=o.skew[0]?i.skewX(o.skew[0]):i,i=o.skew[1]?i.skewY(o.skew[1]):i),i=o.scale3d?i.scale(o.scale3d[0],o.scale3d[1],o.scale3d[2]):i,e.style[t]=i.toString()})},CSS3Matrix:function(t){pn&&this.valuesEnd.transform&&(e[t]||(e[t]=pn))}},onComplete:function(t){var e=this;this.valuesEnd[t]&&(this.element.transformMatrix={},Object.keys(this.valuesEnd[t]).forEach((function(n){e.element.transformMatrix[n]=e.valuesEnd[t][n]})))},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:H,translate3d:ln,rotate3d:ln,skew:ln,scale3d:ln}}};Object.keys(fn).forEach((function(t){var e=fn[t];fn[t]=new D(e)}));return{Animation:D,Components:fn,Tween:R,fromTo:function(t,e,n,r){var a=r||{};return new(0,I.tween)(P(t),e,n,a)},to:function(t,e,n){var r=n||{},a=I.tween;return r.resetStart=e,new a(P(t),e,e,r)},TweenCollection:U,ProgressBar:q,allFromTo:function(t,e,n,r){var a=r||{};return new U(P(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new U(P(t,!0),e,e,r)},Objects:w,Util:E,Easing:A,CubicBezier:t,Render:p,Interpolate:a,Process:j,Internals:T,Selector:P,Version:"2.1.3"}})); diff --git a/demo/src/kute.min.js b/demo/src/kute.min.js index a8f8306..9acfc78 100644 --- a/demo/src/kute.min.js +++ b/demo/src/kute.min.js @@ -1,2 +1,2 @@ // KUTE.js Standard v2.1.3 | thednp © 2021 | MIT-License -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function F(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*Q(n,r,a)>>0)/10:Q(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){w[e]||(w[e]=t.Util[e])})),e};var D={};["top","left","width","height"].forEach((function(t){D[t]=U}));var R=["top","left","width","height"],X={};R.forEach((function(t){X[t]=U}));var B={component:"essentialBoxModel",category:"boxModel",properties:R,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:F}};function Z(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=Q(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*Q(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function Y(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=z(n,r,a)})}var K={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach((function(t){K[t]=Y}));var $=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],W={};$.forEach((function(t){W[t]="#000"}));var G={};$.forEach((function(t){G[t]=Y}));var J={component:"colorProperties",category:"colors",properties:$,defaultValues:W,Interpolate:{numbers:Q,colors:z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return Z(e)},onStart:G},Util:{trueColor:Z}},tt={},et="htmlAttributes",nt=["fill","stroke","stop-color"];function rt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var at={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=rt(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=nt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=rt(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(nt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){t.setAttribute(e,z(n,r,a))})},r[s]=Z(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=F(u).u||F(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*Q(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=F(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=tt)}}},it={component:et,property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:Q,colors:z},functions:at,Util:{replaceUppercase:rt,trueColor:Z,trueDimension:F}};var st={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*Q(n,r,a)>>0)/1e3})}},ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:st},ut=String("abcdefghijklmnopqrstuvwxyz").split(""),ct=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),lt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ht=String("0123456789").split(""),pt=ut.concat(ct,ht),ft=pt.concat(lt),dt={alpha:ut,upper:ct,symbols:lt,numeric:ht,alphanumeric:pt,all:ft},vt={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=dt[d.textChars];n in dt?r=dt[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function yt(t,e){var n,r;if("string"==typeof t)return(r=document.createElement("SPAN")).innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){var a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function gt(t,e){var n=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function bt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function xt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function Et(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function Mt(t,e){return parseFloat(t)/100*e}function _t(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function kt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},jt=4;function Lt(t){return t.map((function(t){return Array.isArray(t)?Lt(t):Number.isNaN(+t)?t:+t}))}function Pt(t,e){var n=Number.isNaN(+e)?jt:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):Lt(t)}function Nt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Vt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function qt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Ht(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Vt[n]&&(t.segments.push([e].concat(r.splice(0,Vt[n]))),Vt[n]););}var Ft="Invalid path value";function Qt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Ft+": invalid Arc flag "+e)}function Ut(t){return t>=48&&t<=57}function Dt(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=Ft+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Xt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Bt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Vt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(n))if(t.index+=1,Rt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Dt(t):Qt(t),t.err.length)return;t.data.push(t.param),Rt(t),t.index=t.max)break;if(!Xt(t.pathValue.charCodeAt(t.index)))break}Ht(t)}else Ht(t);else t.err=Ft+": "+t.pathValue[t.index]+" not a path command"}function Zt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function zt(t,e){if(function(t){return qt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return Lt(t);var n=function(t,e){if(qt(t))return Lt(t);var n=new Zt(t);for(Rt(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function Kt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Lt(t);for(var n,r,a=zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(x+w)/2,h=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=w;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),w=d+M*Math.sin(p),g=Wt(b,w,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),F=4/3*E*H,Q=4/3*M*H,U=[m,x],D=[m+F*N,x-Q*P],R=[b+F*q,w-Q*V],X=[b,w];return D[0]=2*U[0]-D[0],D[1]=2*U[1]-D[1],c?[D,R,X].concat(g):(g=[D,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?$t(g[e-1],t,y).y:$t(t,g[e+1],y).x}))}function Gt(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function Jt(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function te(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function ee(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=te(i,s,a),u=te(s,o,a),c=te(o,u,a),l=te(u,c,a),h=te(c,l,a),p=Jt.apply(0,i.concat(o,c,h,a)),f=Jt.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function ne(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Wt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(Gt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ee(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ee(e.x1,e.y1,e.x,e.y))}return t}function re(t,e){if(function(t){return qt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Lt(t);for(var n,r,a=Kt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=ie(t,n,a,s,h=l*u+l),f=ie(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function oe(t,e){var n=0;return re(t,e).forEach((function(t,e,r){n+="M"!==t[0]?se.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function ue(t,e){var n,r,a=0;return re(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?se.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Jt.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function ce(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function le(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return re(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=ce.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(re(t,e))>=0}function he(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function pe(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function fe(t){return t.reduce((function(e,n,r){return r?e+he(t[r-1],n):0}),0)}function de(t,e){var n,r,a=re((n=ae(t),ae(zt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=oe(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=fe(n),!!r&&{ring:n,pathLength:e}}(n)||de(n,e)}function ye(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=te(n,r,.5),t.splice(a+1,0,r)}function be(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function xe(t,e){var n,r,a=t;if("string"==typeof a){var i=ve(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(Ft+": "+a);var s=a.slice(0);if(s.pathLength=r,!be(s))throw Error(Ft+": "+s);return s.length>1&&he(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&me(s,e),s}function we(t,e,n){var r=n||d.morphPrecision,a=xe(t,r),i=xe(e,r),s=a.length-i.length;return ge(a,s<0?-1*s:0),ge(i,s>0?s:0),ye(a,i),[Pt(a),Pt(i)]}var Ee={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+pe(a,i,s,r).join("L")+"Z")})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=we(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},Me={EssentialBoxModel:B,ColorsProperties:J,HTMLAttributes:it,OpacityProperty:ot,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",number:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:vt},Util:{charSet:dt,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=gt(t,"text-part"),r=gt(yt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:Et}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:At,Util:{getRectLength:_t,getPolyLength:kt,getLineLength:Ot,getCircleLength:Ct,getEllipseLength:Tt,getTotalLength:St,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:It,percent:Mt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:pe,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Ee,Util:{addPoints:ge,bisect:me,normalizeRing:xe,validRing:be,getInterpolationPoints:we,pathStringToRing:ve,distanceSquareRoot:he,midPoint:te,approximateRing:de,rotateRing:ye,pathToString:ae,pathToCurve:re,getPathLength:oe,getPointAtLength:ue,getDrawDirection:le,roundPath:Pt}}};Object.keys(Me).forEach((function(t){var e=Me[t];Me[t]=new H(e)}));return{Animation:H,Components:Me,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:x,Util:w,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.3"}})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{},a={},i={},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):"undefined"!=typeof Date&&Date.now?Date.now:function(){return(new Date).getTime()},o={};o.now=s;var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function D(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*F(n,r,a)>>0)/10:F(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){w[e]||(w[e]=t.Util[e])})),e};var U={};["top","left","width","height"].forEach((function(t){U[t]=Q}));var R=["top","left","width","height"],X={};R.forEach((function(t){X[t]=Q}));var B={component:"essentialBoxModel",category:"boxModel",properties:R,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:F},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=D(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:D}};function Z(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=F(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*F(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function Y(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=z(n,r,a)})}var K={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach((function(t){K[t]=Y}));var $=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],W={};$.forEach((function(t){W[t]="#000"}));var G={};$.forEach((function(t){G[t]=Y}));var J={component:"colorProperties",category:"colors",properties:$,defaultValues:W,Interpolate:{numbers:F,colors:z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return Z(e)},onStart:G},Util:{trueColor:Z}},tt={},et="htmlAttributes",nt=["fill","stroke","stop-color"];function rt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var at={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=rt(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=nt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=rt(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(nt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){t.setAttribute(e,z(n,r,a))})},r[s]=Z(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=D(u).u||D(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*F(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=D(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*F(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=tt)}}},it={component:et,property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:F,colors:z},functions:at,Util:{replaceUppercase:rt,trueColor:Z,trueDimension:D}};var st={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*F(n,r,a)>>0)/1e3})}},ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:F},functions:st},ut=String("abcdefghijklmnopqrstuvwxyz").split(""),ct=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),lt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ht=String("0123456789").split(""),pt=ut.concat(ct,ht),ft=pt.concat(lt),dt={alpha:ut,upper:ct,symbols:lt,numeric:ht,alphanumeric:pt,all:ft},vt={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=dt[d.textChars];n in dt?r=dt[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=F(e,n,r)>>0})}};function yt(t,e){var n,r;if("string"==typeof t)return(r=document.createElement("SPAN")).innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){var a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function gt(t,e){var n=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function bt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function xt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function Et(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function Mt(t,e){return parseFloat(t)/100*e}function _t(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function kt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*F(e.s,n.s,r)>>0)/100,s=(100*F(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},jt=4;function Lt(t){return t.map((function(t){return Array.isArray(t)?Lt(t):Number.isNaN(+t)?t:+t}))}function Pt(t,e){var n=Number.isNaN(+e)?jt:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):Lt(t)}function Nt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Vt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function qt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Ht(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Vt[n]&&(t.segments.push([e].concat(r.splice(0,Vt[n]))),Vt[n]););}var Dt="Invalid path value";function Ft(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Dt+": invalid Arc flag "+e)}function Qt(t){return t>=48&&t<=57}function Ut(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=Dt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Xt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Bt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Vt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(n))if(t.index+=1,Rt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Ut(t):Ft(t),t.err.length)return;t.data.push(t.param),Rt(t),t.index=t.max)break;if(!Xt(t.pathValue.charCodeAt(t.index)))break}Ht(t)}else Ht(t);else t.err=Dt+": "+t.pathValue[t.index]+" not a path command"}function Zt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function zt(t,e){if(function(t){return qt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return Lt(t);var n=function(t,e){if(qt(t))return Lt(t);var n=new Zt(t);for(Rt(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function Kt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Lt(t);for(var n,r,a=zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(x+w)/2,h=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=w;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),w=d+M*Math.sin(p),g=Wt(b,w,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),D=4/3*E*H,F=4/3*M*H,Q=[m,x],U=[m+D*N,x-F*P],R=[b+D*q,w-F*V],X=[b,w];return U[0]=2*Q[0]-U[0],U[1]=2*Q[1]-U[1],c?[U,R,X].concat(g):(g=[U,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?$t(g[e-1],t,y).y:$t(t,g[e+1],y).x}))}function Gt(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function Jt(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function te(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function ee(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=te(i,s,a),u=te(s,o,a),c=te(o,u,a),l=te(u,c,a),h=te(c,l,a),p=Jt.apply(0,i.concat(o,c,h,a)),f=Jt.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function ne(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Wt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(Gt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ee(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ee(e.x1,e.y1,e.x,e.y))}return t}function re(t,e){if(function(t){return qt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Lt(t);for(var n,r,a=Kt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=ie(t,n,a,s,h=l*u+l),f=ie(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function oe(t,e){var n=0;return re(t,e).forEach((function(t,e,r){n+="M"!==t[0]?se.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function ue(t,e){var n,r,a=0;return re(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?se.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Jt.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function ce(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function le(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return re(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=ce.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(re(t,e))>=0}function he(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function pe(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function fe(t){return t.reduce((function(e,n,r){return r?e+he(t[r-1],n):0}),0)}function de(t,e){var n,r,a=re((n=ae(t),ae(zt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=oe(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=fe(n),!!r&&{ring:n,pathLength:e}}(n)||de(n,e)}function ye(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=te(n,r,.5),t.splice(a+1,0,r)}function be(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function xe(t,e){var n,r,a=t;if("string"==typeof a){var i=ve(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(Dt+": "+a);var s=a.slice(0);if(s.pathLength=r,!be(s))throw Error(Dt+": "+s);return s.length>1&&he(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&me(s,e),s}function we(t,e,n){var r=n||d.morphPrecision,a=xe(t,r),i=xe(e,r),s=a.length-i.length;return ge(a,s<0?-1*s:0),ge(i,s>0?s:0),ye(a,i),[Pt(a),Pt(i)]}var Ee={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+pe(a,i,s,r).join("L")+"Z")})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=we(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},Me={EssentialBoxModel:B,ColorsProperties:J,HTMLAttributes:it,OpacityProperty:ot,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",number:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:F},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:vt},Util:{charSet:dt,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=gt(t,"text-part"),r=gt(yt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:Et}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:F},functions:At,Util:{getRectLength:_t,getPolyLength:kt,getLineLength:Ot,getCircleLength:Ct,getEllipseLength:Tt,getTotalLength:St,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:It,percent:Mt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:pe,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Ee,Util:{addPoints:ge,bisect:me,normalizeRing:xe,validRing:be,getInterpolationPoints:we,pathStringToRing:ve,distanceSquareRoot:he,midPoint:te,approximateRing:de,rotateRing:ye,pathToString:ae,pathToCurve:re,getPathLength:oe,getPointAtLength:ue,getDrawDirection:le,roundPath:Pt}}};Object.keys(Me).forEach((function(t){var e=Me[t];Me[t]=new H(e)}));return{Animation:H,Components:Me,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:x,Util:w,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.3"}})); diff --git a/dist/kute.esm.js b/dist/kute.esm.js index 2f7fb5f..ae67e7f 100644 --- a/dist/kute.esm.js +++ b/dist/kute.esm.js @@ -96,12 +96,41 @@ var Interpolate = {}; // link property update function to KUTE.js execution context var onStart = {}; -// import now from '../objects/now.js'; +let now; + +// Include a performance.now polyfill. +// source https://github.com/tweenjs/tween.js/blob/master/src/Now.ts +// In node.js, use process.hrtime. +// eslint-disable-next-line +// @ts-ignore +if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) { + now = () => { + // eslint-disable-next-line + // @ts-ignore + const time = process.hrtime(); + + // Convert [seconds, nanoseconds] to milliseconds. + return time[0] * 1000 + time[1] / 1000000; + }; +} else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) { + // In a browser, use self.performance.now if it is available. + // This must be bound, because directly assigning this function + // leads to an invocation exception in Chrome. + now = self.performance.now.bind(self.performance); +} else if (typeof Date !== 'undefined' && Date.now) { + // Use Date.now if it is available. + now = Date.now; +} else { + // Otherwise, use 'new Date().getTime()'. + now = () => new Date().getTime(); +} + +var now$1 = now; const Time = {}; -// Time.now = now; -const that = window.self || window || {}; -Time.now = that.performance.now.bind(that.performance); +Time.now = now$1; +// const that = window.self || window || {}; +// Time.now = that.performance.now.bind(that.performance); let Tick = 0; diff --git a/dist/kute.esm.min.js b/dist/kute.esm.min.js index d098c02..4b2c22e 100644 --- a/dist/kute.esm.min.js +++ b/dist/kute.esm.min.js @@ -1,2 +1,2 @@ // KUTE.js Standard v2.1.3 | thednp © 2021 | MIT-License -class t{constructor(t,e,n,r,s){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;const a=t=>this.sampleCurveY(this.solveCurveX(t));return Object.defineProperty(a,"name",{writable:!0}),a.name=s||`cubic-bezier(${[t,e,n,r]})`,a}sampleCurveX(t){return((this.ax*t+this.bx)*t+this.cx)*t}sampleCurveY(t){return((this.ay*t+this.by)*t+this.cy)*t}sampleCurveDerivativeX(t){return(3*this.ax*t+2*this.bx)*t+this.cx}solveCurveX(t){let e,n,r,s,a,i;const o=1e-5;for(r=t,i=0;i<32;i+=1){if(s=this.sampleCurveX(r)-t,Math.abs(s)n)return n;for(;es?e=r:n=r,r=.5*(n-e)+e}return r}}var e={},n=[];let r;r="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{};var s=r,a={},i={};const o={},l=window.self||window||{};o.now=l.performance.now.bind(l.performance);let c=0;const u=t=>{let e=0;for(;e{!n.length&&c&&(cancelAnimationFrame(c),c=null,Object.keys(i).forEach((t=>{"function"==typeof i[t]?e[t]&&delete e[t]:Object.keys(i[t]).forEach((t=>{e[t]&&delete e[t]}))})),Object.keys(a).forEach((t=>{e[t]&&delete e[t]})))}),64)}const p={Tick:c,Ticker:u,Tweens:n,Time:o};Object.keys(p).forEach((t=>{e[t]||(e[t]="Time"===t?o.now:p[t])})),s._KUTE=e;var f={},d={};const g={duration:700,delay:0,easing:"linear"};var y={},m={},b={},v={},x={},E={supportedProperties:f,defaultValues:d,defaultOptions:g,prepareProperty:y,prepareStart:m,crossCheck:b,onStart:i,onComplete:v,linkProperty:x},w={},k=t=>n.push(t),C=t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)};function O(){Object.keys(x).forEach((t=>{const n=x[t],r=f[t];Object.keys(n).forEach((t=>{"function"==typeof n[t]&&Object.keys(this.valuesEnd).some((t=>r&&r.includes(t)||"attr"===t&&Object.keys(this.valuesEnd[t]).some((t=>r&&r.includes(t)))))?e[t]||(e[t]=n[t]):Object.keys(this.valuesEnd).forEach((r=>{const s=this.valuesEnd[r];s instanceof Object&&Object.keys(s).forEach((r=>{"function"==typeof n[r]?e[r]||(e[r]=n[r]):Object.keys(n[t]).forEach((t=>{n[r]&&"function"==typeof n[r][t]&&(e[t]||(e[t]=n[r][t]))}))}))}))}))}))}var _={add:k,remove:C,getAll:()=>n,removeAll:()=>{n.length=0},stop:h,linkInterpolation:O};function M(t){if(!t.style)return!1;const e=t.style.cssText.replace(/\s/g,"").split(";"),n={},r=["translate3d","translate","scale3d","skew"];return e.forEach((t=>{if(/transform/i.test(t)){t.split(":")[1].split(")").forEach((t=>{const e=t.split("("),s=e[0],a=e[1];/matrix/.test(s)||(n[s]=r.includes(s)?a.split(","):a)}))}})),n}function T(t,e){const n=t.style,r=getComputedStyle(t)||t.currentStyle,s=n[e]&&!/auto|initial|none|unset/.test(n[e])?n[e]:r[e];let a=d[e];return"transform"!==e&&(e in r||e in n)&&(a=s),a}function I(t,e){const n="start"===e?this.valuesStart:this.valuesEnd;Object.keys(y).forEach((e=>{const r=y[e],s=f[e];Object.keys(r).forEach((e=>{const a={};Object.keys(t).forEach((i=>{d[i]&&r[i]?n[i]=r[i].call(this,i,t[i]):!d[e]&&"transform"===e&&s.includes(i)?a[i]=t[i]:d[i]||"transform"!==i?!d[e]&&s&&s.includes(i)&&(n[i]=r[e].call(this,i,t[i])):n[i]=t[i]})),Object.keys(a).length&&(n[e]=r[e].call(this,e,a))}))}))}function S(){const t={},e=M(this.element);Object.keys(this.valuesStart).forEach((e=>{Object.keys(m).forEach((n=>{const r=m[n];Object.keys(r).forEach((s=>{(s===e&&r[e]||f[n]&&f[n].includes(e))&&(t[e]=r[s].call(this,e,this.valuesStart[e]))}))}))})),Object.keys(e).forEach((n=>{n in this.valuesStart||(t[n]=e[n]||d[n])})),this.valuesStart={},I.call(this,t,"start")}var A={getInlineStyle:M,getStyleForProperty:T,getStartValues:S,prepareObject:I},j={};const L={linear:new t(0,0,1,1,"linear"),easingSinusoidalIn:new t(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new t(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new t(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new t(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new t(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new t(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new t(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new t(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new t(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new t(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new t(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new t(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new t(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new t(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new t(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new t(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new t(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new t(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new t(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new t(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new t(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new t(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new t(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new t(.68,-.55,.265,1.55,"easingBackInOut")};function P(t,e){try{let n,r;return e?(r=t instanceof Array&&t.every((t=>t instanceof Element)),n=t instanceof HTMLCollection||t instanceof NodeList||r?t:document.querySelectorAll(t)):n=t instanceof Element||t===window?t:document.querySelector(t),n}catch(e){throw TypeError(`KUTE.js - Element(s) not found: ${t}.`)}}function N(){Object.keys(i).forEach((t=>{"function"==typeof i[t]?i[t].call(this,t):Object.keys(i[t]).forEach((e=>{i[t][e].call(this,e)}))})),O.call(this)}j.processEasing=function(e){if("function"==typeof e)return e;if("function"==typeof L[e])return L[e];if(/bezier/.test(e)){const n=e.replace(/bezier|\s|\(|\)/g,"").split(",");return new t(1*n[0],1*n[1],1*n[2],1*n[3])}return L.linear};class ${constructor(t,n,r,s){this.element=t,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n;const a=s||{};this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:j.processEasing(a.easing),this._duration=a.duration||g.duration,this._delay=a.delay||g.delay,Object.keys(a).forEach((t=>{const e=`_${t}`;e in this||(this[e]=a[t])}));const o=this._easing.name;return i[o]||(i[o]=function(t){e[t]||t!==this._easing.name||(e[t]=this._easing)}),this}start(t){return k(this),this.playing=!0,this._startTime=void 0!==t?t:e.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),N.call(this),this._startFired=!0),c||u(),this}stop(){return this.playing&&(C(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this}close(){Object.keys(v).forEach((t=>{Object.keys(v[t]).forEach((e=>{v[t][e].call(this,e)}))})),this._startFired=!1,h.call(this)}chain(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this}stopChainedTweens(){this._chain&&this._chain.length&&this._chain.forEach((t=>t.stop()))}update(t){const n=void 0!==t?t:e.Time();let r;if(n1?1:r;const s=this._easing(r);return Object.keys(this.valuesEnd).forEach((t=>{e[t](this.element,this.valuesStart[t],this.valuesEnd[t],s)})),this._onUpdate&&this._onUpdate.call(this),1!==r||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((t=>t.start())),!1)}}j.tween=$,g.repeat=0,g.repeatDelay=0,g.yoyo=!1,g.resetStart=!1;class V extends ${constructor(...t){super(...t),this.valuesStart={},this.valuesEnd={};const e=t[1],n=t[2];I.call(this,n,"end"),this._resetStart?this.valuesStart=e:I.call(this,e,"start"),this._resetStart||Object.keys(b).forEach((t=>{Object.keys(b[t]).forEach((e=>{b[t][e].call(this,e)}))})),this.paused=!1,this._pauseTime=null;const r=t[3];return this._repeat=r.repeat||g.repeat,this._repeatDelay=r.repeatDelay||g.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=r.yoyo||g.yoyo,this._reversed=!1,this}start(t){return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(b).forEach((t=>{Object.keys(b[t]).forEach((e=>{b[t][e].call(this,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((t=>{this.valuesRepeat[t]=this.valuesStart[t]})),super.start(t),this}stop(){return super.stop(),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this}close(){return super.close(),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this}resume(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),N.call(this),this._startTime+=e.Time()-this._pauseTime,k(this),c||u()),this}pause(){return!this.paused&&this.playing&&(C(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this}reverse(){Object.keys(this.valuesEnd).forEach((t=>{const e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}))}update(t){const n=void 0!==t?t:e.Time();let r;if(n1?1:r;const s=this._easing(r);return Object.keys(this.valuesEnd).forEach((t=>{e[t](this.element,this.valuesStart[t],this.valuesEnd[t],s)})),this._onUpdate&&this._onUpdate.call(this),1!==r||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=n,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.forEach((t=>t.start())),!1))}}j.tween=V;class q{constructor(t,e,n,r){this.tweens=[],"offset"in g||(g.offset=0);const s=r||{};s.delay=s.delay||g.delay;const a=[];return Array.from(t).forEach(((t,r)=>{const i=j.tween;if(a[r]=s||{},a[r].delay=r>0?s.delay+(s.offset||g.offset):s.delay,!(t instanceof Element))throw Error(`KUTE.js - ${t} not instanceof [Element]`);this.tweens.push(new i(t,e,n,a[r]))})),this.length=this.tweens.length,this}start(t){const n=void 0===t?e.Time():t;return this.tweens.map((t=>t.start(n))),this}stop(){return this.tweens.map((t=>t.stop())),this}pause(t){const n=void 0===t?e.Time():t;return this.tweens.map((t=>t.pause(n))),this}resume(t){const n=void 0===t?e.Time():t;return this.tweens.map((t=>t.resume(n))),this}chain(t){const e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof j.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this}playing(){return this.tweens.some((t=>t.playing))}removeTweens(){this.tweens=[]}getMaxDuration(){const t=[];return this.tweens.forEach((e=>{t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)}}class H{constructor(t){try{if(t.component in f)throw Error(`KUTE.js - ${t.component} already registered`);if(t.property in d)throw Error(`KUTE.js - ${t.property} already registered`);this.setComponent(t)}catch(t){throw Error(t)}}setComponent(t){const e=this,n=t.component,r={prepareProperty:y,prepareStart:m,onStart:i,onComplete:v,crossCheck:b},s=t.category,o=t.property,l=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return f[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(d[o]=t.defaultValue,e.supports=`${o} property`):t.defaultValues&&(Object.keys(t.defaultValues).forEach((e=>{d[e]=t.defaultValues[e]})),e.supports=`${l||o} ${o||s} properties`),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((e=>{g[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((e=>{e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((s=>{r[e][n]||(r[e][n]={}),r[e][n][s]||(r[e][n][s]=t.functions[e][s])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((e=>{const n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((t=>{"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),x[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((e=>{w[e]||(w[e]=t.Util[e])})),e}}function F(t,e){const n=parseInt(t,10)||0,r=["px","%","deg","rad","em","rem","vh","vw"];let s;for(let e=0;e{e.style[t]=(s>.99||s<.01?(10*Q(n,r,s)>>0)/10:Q(n,r,s)>>0)+"px"})}const D={};["top","left","width","height"].forEach((t=>{D[t]=U}));const R=["top","left","width","height"],X={};R.forEach((t=>{X[t]=U}));const B={component:"essentialBoxModel",category:"boxModel",properties:R,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return T(this.element,t)||d[t]},prepareProperty:function(t,e){const n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:F}};function Z(t){let e;if(/rgb|rgba/.test(t)){const n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){const n=(t=>{const e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,e,n,r)=>e+e+n+n+r+r)),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null})(t);e={r:n.r,g:n.g,b:n.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){const n=document.getElementsByTagName("head")[0];n.style.color=t;let r=getComputedStyle(n,null).color;r=/rgb/.test(r)?r.replace(/[^\d,]/g,"").split(","):[0,0,0],n.style.color="",e={r:parseInt(r[0],10),g:parseInt(r[1],10),b:parseInt(r[2],10)}}return e}function z(t,e,n){const r={},s=",";return Object.keys(e).forEach((s=>{"a"!==s?r[s]=Q(t[s],e[s],n)>>0||0:t[s]&&e[s]&&(r[s]=(100*Q(t[s],e[s],n)>>0)/100)})),r.a?"rgba("+r.r+s+r.g+s+r.b+s+r.a+")":"rgb("+r.r+s+r.g+s+r.b+")"}function Y(t){this.valuesEnd[t]&&!e[t]&&(e[t]=(e,n,r,s)=>{e.style[t]=z(n,r,s)})}const K={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach((t=>{K[t]=Y}));const W=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],G={};W.forEach((t=>{G[t]="#000"}));const J={};W.forEach((t=>{J[t]=Y}));const tt={component:"colorProperties",category:"colors",properties:W,defaultValues:G,Interpolate:{numbers:Q,colors:z},functions:{prepareStart:function(t){return T(this.element,t)||d[t]},prepareProperty:function(t,e){return Z(e)},onStart:J},Util:{trueColor:Z}},et={},nt=["fill","stroke","stop-color"];function rt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}const st={prepareStart:function(t,e){const n={};return Object.keys(e).forEach((t=>{const e=rt(t).replace(/_+[a-z]+/,""),r=this.element.getAttribute(e);n[e]=nt.includes(e)?r||"rgba(0,0,0,0)":r||(/opacity/i.test(t)?1:0)})),n},prepareProperty:function(t,e){const n={};return Object.keys(e).forEach((r=>{const s=rt(r),a=/(%|[a-z]+)$/,o=this.element.getAttribute(s.replace(/_+[a-z]+/,""));if(nt.includes(s))i.htmlAttributes[s]=e=>{this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=(t,e,n,r,s)=>{t.setAttribute(e,z(n,r,s))})},n[s]=Z(e[r])||d.htmlAttributes[r];else if(null!==o&&a.test(o)){const a=F(o).u||F(e[r]).u,l=/%/.test(a)?"_percent":`_${a}`;i.htmlAttributes[s+l]=e=>{this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=(t,e,n,r,s)=>{const a=e.replace(l,"");t.setAttribute(a,(1e3*Q(n.v,r.v,s)>>0)/1e3+r.u)})},n[s+l]=F(e[r])}else a.test(e[r])&&null!==o&&(null===o||a.test(o))||(i.htmlAttributes[s]=e=>{this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in et)&&(et[e]=(t,e,n,r,s)=>{t.setAttribute(e,(1e3*Q(n,r,s)>>0)/1e3)})},n[s]=parseFloat(e[r]))})),n},onStart:{attr(t){!e[t]&&this.valuesEnd[t]&&(e[t]=(t,n,r,s)=>{Object.keys(r).forEach((a=>{e.attributes[a](t,a,n[a],r[a],s)}))})},attributes(t){!e[t]&&this.valuesEnd.attr&&(e[t]=et)}}},at={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:Q,colors:z},functions:st,Util:{replaceUppercase:rt,trueColor:Z,trueDimension:F}};const it={prepareStart:function(t){return T(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=(e,n,r,s)=>{e.style[t]=(1e3*Q(n,r,s)>>0)/1e3})}},ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:it},lt=String("abcdefghijklmnopqrstuvwxyz").split(""),ct=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ut=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ht=String("0123456789").split(""),pt=lt.concat(ct,ht),ft=pt.concat(ut),dt={alpha:lt,upper:ct,symbols:ut,numeric:ht,alphanumeric:pt,all:ft},gt={text(t){if(!e[t]&&this.valuesEnd[t]){const n=this._textChars;let r=dt[g.textChars];n in dt?r=dt[n]:n&&n.length&&(r=n),e[t]=(t,e,n,s)=>{let a="",i="";const o=""===n?" ":n,l=e.substring(0),c=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(i=c.substring(Math.min(s*c.length,c.length)>>0,0),t.innerHTML=s<1?i+u:o):" "===n?(a=l.substring(0,Math.min((1-s)*l.length,l.length)>>0),t.innerHTML=s<1?a+u:o):(a=l.substring(l.length,Math.min(s*l.length,l.length)>>0),i=c.substring(0,Math.min(s*c.length,c.length)>>0),t.innerHTML=s<1?i+u+a:o)}}},number(t){t in this.valuesEnd&&!e[t]&&(e[t]=(t,e,n,r)=>{t.innerHTML=Q(e,n,r)>>0})}};function yt(t,e){let n,r;if("string"==typeof t)return r=document.createElement("SPAN"),r.innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){const r=t.innerHTML;n=document.createElement("SPAN"),n.className=e,n.innerHTML=r,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&([n]=t.children);return n}function mt(t,e){let n=[];const r=t.children.length;if(r){const s=[];let a,i=t.innerHTML;for(let n,o,l,c=0;c>0)/1e3}${n})`}function vt(t,e,n,r){const s=[];for(let a=0;a<3;a+=1)s[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return`translate3d(${s.join(",")})`}function xt(t,e,n,r){let s="";return s+=t[0]||e[0]?`rotateX(${(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3}${n})`:"",s+=t[1]||e[1]?`rotateY(${(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3}${n})`:"",s+=t[2]||e[2]?`rotateZ(${(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3}${n})`:"",s}function Et(t,e,n){return`scale(${(1e3*(t+(e-t)*n)>>0)/1e3})`}function wt(t,e,n,r){const s=[];return s[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,s[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0",`skew(${s.join(",")})`}function kt(t,e){return parseFloat(t)/100*e}function Ct(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Ot(t){const e=t.getAttribute("points").split(" ");let n=0;if(e.length>1){const r=t=>{const e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},s=(t,e)=>void 0!==t&&void 0!==e?Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2):0;if(e.length>2)for(let t=0;t{const s=(100*e.l>>0)/100,a=0-(100*Q(e.s,n.s,r)>>0)/100,i=(100*Q(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=`${a}px`,t.style.strokeDasharray=`${(100*(i<1?0:i)>>0)/100}px, ${s}px`})}},jt=4;function Lt(t){return t.map((t=>Array.isArray(t)?Lt(t):Number.isNaN(+t)?t:+t))}function Pt(t,e){const n=Number.isNaN(+e)?jt:+e;let r;return r=n?t.map((t=>t.map((t=>{const e=+t,r=10**n;return e?e%1==0?e:Math.round(e*r)/r:t})))):Lt(t),r}function Nt(t,e,n){if(t[n].length>7){t[n].shift();const r=t[n];let s=n;for(;r.length;)e[n]="A",t.splice(s+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var $t={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Vt(t){return Array.isArray(t)&&t.every((t=>{const e=t[0].toLowerCase();return $t[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function qt(t){let e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=$t[n]&&(t.segments.push([e].concat(r.splice(0,$t[n]))),$t[n]););}function Ht(t){const e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=`Invalid path value: invalid Arc flag ${e}`)}function Ft(t){return t>=48&&t<=57}function Qt(t){const e=t.index,{max:n}=t;let r,s=e,a=!1,i=!1,o=!1,l=!1;if(s>=n)t.err=`Invalid path value: missing param ${t.pathValue[s]}`;else if(r=t.pathValue.charCodeAt(s),43!==r&&45!==r||(s+=1,r=s=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Dt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Rt(t){const{max:e}=t,n=t.pathValue.charCodeAt(t.index),r=$t[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(n))if(t.index+=1,Ut(t),t.data=[],r){for(;;){for(let s=r;s>0;s-=1){if(97!=(32|n)||3!==s&&4!==s?Qt(t):Ht(t),t.err.length)return;t.data.push(t.param),Ut(t),t.index=t.max)break;if(!Dt(t.pathValue.charCodeAt(t.index)))break}qt(t)}else qt(t);else t.err=`Invalid path value: ${t.pathValue[t.index]} not a path command`}function Xt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Bt(t,e){if(function(t){return Vt(t)&&t.every((t=>t[0]===t[0].toUpperCase()))}(t))return Lt(t);const n=function(t,e){if(Vt(t))return Lt(t);const n=new Xt(t);for(Ut(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n);e.x1=t,e.y1=r,a=["C",t,r].concat(s)}else if("T"===r){const{qx:t,qy:r}=function(t,e,n,r,s){return"QT".indexOf(s)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n);e.qx=t,e.qy=r,a=["Q",t,r].concat(s)}else if("Q"===r){const[t,n]=s;e.qx=t,e.qy=n}return a}function zt(t,e){if(function(t){return Array.isArray(t)&&t.every((t=>{const e=t[0].toLowerCase();return $t[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Lt(t);const n=Bt(t,e),r={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],a=n.length;let i,o,l="";for(let t=0;t1&&(n=Math.sqrt(n),w*=n,k*=n);const r=w**2,s=k**2,o=(a===i?-1:1)*Math.sqrt(Math.abs((r*s-r*e*e-s*t*t)/(r*e*e+s*t*t)));g=o*w*e/k+(b+v)/2,y=o*-k*t/w+(x+E)/2,f=Math.asin(((x-y)/k*10**9>>0)/10**9),d=Math.asin(((E-y)/k*10**9>>0)/10**9),f=bd&&(f-=2*Math.PI),!i&&d>f&&(d-=2*Math.PI)}let C=d-f;if(Math.abs(C)>u){const t=d,e=v,n=E;d=f+u*(i&&d>f?1:-1),v=g+w*Math.cos(d),E=y+k*Math.sin(d),m=Kt(v,E,w,k,s,0,i,e,n,[d,t,g,y])}C=d-f;const O=Math.cos(f),_=Math.sin(f),M=Math.cos(d),T=Math.sin(d),I=Math.tan(C/4),S=4/3*w*I,A=4/3*k*I,j=[b,x],L=[b+S*_,x-A*O],P=[v+S*T,E-A*M],N=[v,E];return L[0]=2*j[0]-L[0],L[1]=2*j[1]-L[1],c?[L,P,N].concat(m):(m=[L,P,N].concat(m).join().split(","),m.map(((t,e)=>e%2?Yt(m[e-1],t,h).y:Yt(t,m[e+1],h).x)))}function Wt(t,e,n,r,s,a){const i=1/3,o=2/3;return[i*t+o*n,i*e+o*r,i*s+o*n,i*a+o*r,s,a]}function Gt(t,e,n,r,s,a,i,o,l){const c=1-l;return{x:c**3*t+c*c*3*l*n+3*c*l*l*s+l**3*i,y:c**3*e+c*c*3*l*r+3*c*l*l*a+l**3*o}}function Jt(t,e,n){const r=t[0],s=t[1];return[r+(e[0]-r)*n,s+(e[1]-s)*n]}function te(t,e,n,r){const s=.5,a=[t,e],i=[n,r],o=Jt(a,i,s),l=Jt(i,o,s),c=Jt(o,l,s),u=Jt(l,c,s),h=Jt(c,u,s),p=Gt.apply(0,a.concat(o,c,h,s)),f=Gt.apply(0,h.concat(u,l,i,0));return[p.x,p.y,f.x,f.y,n,r]}function ee(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);const[n,r]=t.slice(1);switch(t[0]){case"M":return e.x=n,e.y=r,t;case"A":return["C"].concat(Kt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=n,e.qy=r,["C"].concat(Wt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(te(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(te(e.x1,e.y1,e.x,e.y))}return t}function ne(t,e){if(function(t){return Vt(t)&&t.slice(1).every((t=>"C"===t[0]))}(t))return Lt(t);const n=zt(t,e),r={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[];let a,i,o="",l=n.length;for(let t=0;tt[0].concat(t.slice(1).join(" ")))).join("")}function se(t,e,n,r,s){return s*(s*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function ae(t,e,n,r,s,a,i,o,l){let c;(null===l||Number.isNaN(+l))&&(c=1),c>1&&(c=1),c<0&&(c=0);const u=c/2;let h=0,p=0,f=0,d=0;const g=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach(((l,c)=>{h=u*l+u,p=se(t,n,s,i,h),f=se(e,r,a,o,h),d+=g[c]*Math.sqrt(p*p+f*f)})),u*d}function ie(t,e){let n=0;return ne(t,e).forEach(((t,e,r)=>{n+="M"!==t[0]?ae.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function oe(t,e){let n,r,s,a=0;return ne(t,9).map(((t,i,o)=>(r=i?o[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?ae.apply(0,r):0,a+=n,s=0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Gt.apply(0,r.concat(1-(a-e)/n)):null,s))).filter((t=>t)).slice(-1)[0]}function le(t,e,n,r,s,a,i,o){return 3*((o-e)*(n+s)-(i-t)*(r+a)+r*(t-s)-n*(e-a)+o*(s+t/3)-i*(a+e/3))/20}function ce(t,e){return function(t,e){let n=0,r=0,s=0,a=0,i=0;return ne(t,e).map((t=>{switch(t[0]){case"M":case"Z":return s="M"===t[0]?t[1]:s,a="M"===t[0]?t[2]:a,n=s,r=a,0;default:return i=le.apply(0,[n,r].concat(t.slice(1))),[n,r]=t.slice(-2),i}})).reduce(((t,e)=>t+e),0)}(ne(t,e))>=0}function ue(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function he(t,e,n,r){const s=[];for(let a=0;a>0)/1e3)}return s}function pe(t){return t.reduce(((e,n,r)=>r?e+ue(t[r-1],n):0),0)}function fe(t,e){var n;const r=ne((n=re(t),re(Bt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((t=>t.trim())).filter((t=>t)))[0],4),s=ie(r),a=[];let i,o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(s/e)));for(let t=0;t-1))return!1;e.push([r[1],r[2]])}return a=pe(e),!!n&&{ring:e,pathLength:a}}(n)||fe(n,e)}function ge(t,e){const n=t.length;let r,s,a,i,o=1/0,l=0;for(let s=0;se;)r=Jt(n,r,.5),t.splice(s+1,0,r)}function be(t){return Array.isArray(t)&&t.every((t=>Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])))}function ve(t,e){let n,r,s=t;if("string"==typeof s){const t=de(s,e);s=t.ring,n=t.skipBisect,r=t.pathLength}else if(!Array.isArray(s))throw Error(`Invalid path value: ${s}`);const a=s.slice(0);if(a.pathLength=r,!be(a))throw Error(`Invalid path value: ${a}`);return a.length>1&&ue(a[0],a[a.length-1])<1e-9&&a.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&me(a,e),a}function xe(t,e,n){const r=n||g.morphPrecision,s=ve(t,r),a=ve(e,r),i=s.length-a.length;return ye(s,i<0?-1*i:0),ye(a,i>0?i:0),ge(s,a),[Pt(s),Pt(a)]}const Ee={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){const n={},r=new RegExp("\\n","ig");let s=null;return e instanceof SVGElement?s=e:/^\.|^#/.test(e)&&(s=P(e)),"object"==typeof e&&e.pathArray?e:(s&&["path","glyph"].includes(s.tagName)?n.original=s.getAttribute("d").replace(r,""):s||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=(t,e,n,r)=>{const s=e.pathArray,a=n.pathArray,i=a.length;t.setAttribute("d",1===r?n.original:`M${he(s,a,i,r).join("L")}Z`)})},crossCheck:function(t){if(this.valuesEnd[t]){const e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){const e=this.valuesStart[t].original,n=this.valuesEnd[t].original,r=this._morphPrecision?parseInt(this._morphPrecision,10):g.morphPrecision,[s,a]=xe(e,n,r);this.valuesStart[t].pathArray=s,this.valuesEnd[t].pathArray=a}}}},we={EssentialBoxModel:B,ColorsProperties:tt,HTMLAttributes:at,OpacityProperty:ot,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",number:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:gt},Util:{charSet:dt,createTextTweens:function(t,e,n){if(t.playing)return!1;const r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);const s=j.tween,a=function(t,e){const n=mt(t,"text-part"),r=mt(yt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((t=>(t.className+=" oldText",t.outerHTML))).join(""),t.innerHTML+=r.map((t=>(t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")))).join(""),[n,r]}(t,e),i=a[0],o=a[1],l=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText"));let u=[],h=0;return u=u.concat(l.map(((t,e)=>(r.duration="auto"===r.duration?75*i[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new s(t,{text:t.innerHTML},{text:""},r))))),u=u.concat(c.map(((n,a)=>(r.duration="auto"===r.duration?75*o[a].innerHTML.length:r.duration,r.delay=h,r.onComplete=a===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new s(n,{text:""},{text:o[a].innerHTML},r))))),u.start=function(){t.playing||(u.forEach((t=>t.start())),t.playing=!0)},u}}},TransformFunctions:{component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t){const e=M(this.element);return e[t]?e[t]:d[t]},prepareProperty:function(t,e){const n=["X","Y","Z"],r={},s=[],a=[],i=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((t=>{const l="object"==typeof e[t]&&e[t].length?e[t].map((t=>parseInt(t,10))):parseInt(e[t],10);if(o.includes(t)){const e="translate"===t||"rotate"===t?`${t}3d`:t;r[e]="skew"===t?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===t?l.length?[l[0]||0,l[1]||0,l[2]||0]:[l||0,0,0]:[l[0]||0,l[1]||0,l[2]||0]}else if(/[XYZ]/.test(t)){const o=t.replace(/[XYZ]/,""),l="skew"===o?o:`${o}3d`,c="skew"===o?2:3;let u=[];"translate"===o?u=s:"rotate"===o?u=a:"skew"===o&&(u=i);for(let t=0;t{e.style[t]=(n.perspective||r.perspective?bt(n.perspective,r.perspective,"px",s):"")+(n.translate3d?vt(n.translate3d,r.translate3d,"px",s):"")+(n.rotate3d?xt(n.rotate3d,r.rotate3d,"deg",s):"")+(n.skew?wt(n.skew,r.skew,"deg",s):"")+(n.scale||r.scale?Et(n.scale,r.scale,s):"")})},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:bt,translate3d:vt,rotate3d:xt,translate:function(t,e,n,r){const s=[];return s[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,s[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0",`translate(${s.join(",")})`},rotate:function(t,e,n,r){return`rotate(${(1e3*(t+(e-t)*r)>>0)/1e3}${n})`},scale:Et,skew:wt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:At,Util:{getRectLength:Ct,getPolyLength:Ot,getLineLength:_t,getCircleLength:Mt,getEllipseLength:Tt,getTotalLength:It,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:St,percent:kt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:he,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Ee,Util:{addPoints:ye,bisect:me,normalizeRing:ve,validRing:be,getInterpolationPoints:xe,pathStringToRing:de,distanceSquareRoot:ue,midPoint:Jt,approximateRing:fe,rotateRing:ge,pathToString:re,pathToCurve:ne,getPathLength:ie,getPointAtLength:oe,getDrawDirection:ce,roundPath:Pt}}};Object.keys(we).forEach((t=>{const e=we[t];we[t]=new H(e)}));const ke={Animation:H,Components:we,Tween:V,fromTo:function(t,e,n,r){const s=r||{};return new(0,j.tween)(P(t),e,n,s)},to:function(t,e,n){const r=n||{},s=j.tween;return r.resetStart=e,new s(P(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){const s=r||{};return new q(P(t,!0),e,n,s)},allTo:function(t,e,n){const r=n||{};return n.resetStart=e,new q(P(t,!0),e,e,r)},Objects:E,Util:w,Easing:L,CubicBezier:t,Render:p,Interpolate:a,Process:A,Internals:_,Selector:P,Version:"2.1.3"};export{ke as default}; +class t{constructor(t,e,n,r,s){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;const a=t=>this.sampleCurveY(this.solveCurveX(t));return Object.defineProperty(a,"name",{writable:!0}),a.name=s||`cubic-bezier(${[t,e,n,r]})`,a}sampleCurveX(t){return((this.ax*t+this.bx)*t+this.cx)*t}sampleCurveY(t){return((this.ay*t+this.by)*t+this.cy)*t}sampleCurveDerivativeX(t){return(3*this.ax*t+2*this.bx)*t+this.cx}solveCurveX(t){let e,n,r,s,a,i;const o=1e-5;for(r=t,i=0;i<32;i+=1){if(s=this.sampleCurveX(r)-t,Math.abs(s)n)return n;for(;es?e=r:n=r,r=.5*(n-e)+e}return r}}var e={},n=[];let r;r="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{};var s=r,a={},i={};let o;o="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?()=>{const t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):"undefined"!=typeof Date&&Date.now?Date.now:()=>(new Date).getTime();var l=o;const c={};c.now=l;let u=0;const h=t=>{let e=0;for(;e{!n.length&&u&&(cancelAnimationFrame(u),u=null,Object.keys(i).forEach((t=>{"function"==typeof i[t]?e[t]&&delete e[t]:Object.keys(i[t]).forEach((t=>{e[t]&&delete e[t]}))})),Object.keys(a).forEach((t=>{e[t]&&delete e[t]})))}),64)}const f={Tick:u,Ticker:h,Tweens:n,Time:c};Object.keys(f).forEach((t=>{e[t]||(e[t]="Time"===t?c.now:f[t])})),s._KUTE=e;var d={},g={};const y={duration:700,delay:0,easing:"linear"};var m={},b={},v={},x={},E={},w={supportedProperties:d,defaultValues:g,defaultOptions:y,prepareProperty:m,prepareStart:b,crossCheck:v,onStart:i,onComplete:x,linkProperty:E},k={},C=t=>n.push(t),O=t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)};function _(){Object.keys(E).forEach((t=>{const n=E[t],r=d[t];Object.keys(n).forEach((t=>{"function"==typeof n[t]&&Object.keys(this.valuesEnd).some((t=>r&&r.includes(t)||"attr"===t&&Object.keys(this.valuesEnd[t]).some((t=>r&&r.includes(t)))))?e[t]||(e[t]=n[t]):Object.keys(this.valuesEnd).forEach((r=>{const s=this.valuesEnd[r];s instanceof Object&&Object.keys(s).forEach((r=>{"function"==typeof n[r]?e[r]||(e[r]=n[r]):Object.keys(n[t]).forEach((t=>{n[r]&&"function"==typeof n[r][t]&&(e[t]||(e[t]=n[r][t]))}))}))}))}))}))}var M={add:C,remove:O,getAll:()=>n,removeAll:()=>{n.length=0},stop:p,linkInterpolation:_};function T(t){if(!t.style)return!1;const e=t.style.cssText.replace(/\s/g,"").split(";"),n={},r=["translate3d","translate","scale3d","skew"];return e.forEach((t=>{if(/transform/i.test(t)){t.split(":")[1].split(")").forEach((t=>{const e=t.split("("),s=e[0],a=e[1];/matrix/.test(s)||(n[s]=r.includes(s)?a.split(","):a)}))}})),n}function I(t,e){const n=t.style,r=getComputedStyle(t)||t.currentStyle,s=n[e]&&!/auto|initial|none|unset/.test(n[e])?n[e]:r[e];let a=g[e];return"transform"!==e&&(e in r||e in n)&&(a=s),a}function S(t,e){const n="start"===e?this.valuesStart:this.valuesEnd;Object.keys(m).forEach((e=>{const r=m[e],s=d[e];Object.keys(r).forEach((e=>{const a={};Object.keys(t).forEach((i=>{g[i]&&r[i]?n[i]=r[i].call(this,i,t[i]):!g[e]&&"transform"===e&&s.includes(i)?a[i]=t[i]:g[i]||"transform"!==i?!g[e]&&s&&s.includes(i)&&(n[i]=r[e].call(this,i,t[i])):n[i]=t[i]})),Object.keys(a).length&&(n[e]=r[e].call(this,e,a))}))}))}function A(){const t={},e=T(this.element);Object.keys(this.valuesStart).forEach((e=>{Object.keys(b).forEach((n=>{const r=b[n];Object.keys(r).forEach((s=>{(s===e&&r[e]||d[n]&&d[n].includes(e))&&(t[e]=r[s].call(this,e,this.valuesStart[e]))}))}))})),Object.keys(e).forEach((n=>{n in this.valuesStart||(t[n]=e[n]||g[n])})),this.valuesStart={},S.call(this,t,"start")}var j={getInlineStyle:T,getStyleForProperty:I,getStartValues:A,prepareObject:S},L={};const P={linear:new t(0,0,1,1,"linear"),easingSinusoidalIn:new t(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new t(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new t(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new t(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new t(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new t(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new t(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new t(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new t(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new t(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new t(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new t(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new t(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new t(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new t(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new t(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new t(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new t(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new t(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new t(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new t(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new t(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new t(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new t(.68,-.55,.265,1.55,"easingBackInOut")};function N(t,e){try{let n,r;return e?(r=t instanceof Array&&t.every((t=>t instanceof Element)),n=t instanceof HTMLCollection||t instanceof NodeList||r?t:document.querySelectorAll(t)):n=t instanceof Element||t===window?t:document.querySelector(t),n}catch(e){throw TypeError(`KUTE.js - Element(s) not found: ${t}.`)}}function $(){Object.keys(i).forEach((t=>{"function"==typeof i[t]?i[t].call(this,t):Object.keys(i[t]).forEach((e=>{i[t][e].call(this,e)}))})),_.call(this)}L.processEasing=function(e){if("function"==typeof e)return e;if("function"==typeof P[e])return P[e];if(/bezier/.test(e)){const n=e.replace(/bezier|\s|\(|\)/g,"").split(",");return new t(1*n[0],1*n[1],1*n[2],1*n[3])}return P.linear};class V{constructor(t,n,r,s){this.element=t,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n;const a=s||{};this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||y.duration,this._delay=a.delay||y.delay,Object.keys(a).forEach((t=>{const e=`_${t}`;e in this||(this[e]=a[t])}));const o=this._easing.name;return i[o]||(i[o]=function(t){e[t]||t!==this._easing.name||(e[t]=this._easing)}),this}start(t){return C(this),this.playing=!0,this._startTime=void 0!==t?t:e.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),$.call(this),this._startFired=!0),u||h(),this}stop(){return this.playing&&(O(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this}close(){Object.keys(x).forEach((t=>{Object.keys(x[t]).forEach((e=>{x[t][e].call(this,e)}))})),this._startFired=!1,p.call(this)}chain(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this}stopChainedTweens(){this._chain&&this._chain.length&&this._chain.forEach((t=>t.stop()))}update(t){const n=void 0!==t?t:e.Time();let r;if(n1?1:r;const s=this._easing(r);return Object.keys(this.valuesEnd).forEach((t=>{e[t](this.element,this.valuesStart[t],this.valuesEnd[t],s)})),this._onUpdate&&this._onUpdate.call(this),1!==r||(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.map((t=>t.start())),!1)}}L.tween=V,y.repeat=0,y.repeatDelay=0,y.yoyo=!1,y.resetStart=!1;class q extends V{constructor(...t){super(...t),this.valuesStart={},this.valuesEnd={};const e=t[1],n=t[2];S.call(this,n,"end"),this._resetStart?this.valuesStart=e:S.call(this,e,"start"),this._resetStart||Object.keys(v).forEach((t=>{Object.keys(v[t]).forEach((e=>{v[t][e].call(this,e)}))})),this.paused=!1,this._pauseTime=null;const r=t[3];return this._repeat=r.repeat||y.repeat,this._repeatDelay=r.repeatDelay||y.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=r.yoyo||y.yoyo,this._reversed=!1,this}start(t){return this._resetStart&&(this.valuesStart=this._resetStart,A.call(this),Object.keys(v).forEach((t=>{Object.keys(v[t]).forEach((e=>{v[t][e].call(this,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((t=>{this.valuesRepeat[t]=this.valuesStart[t]})),super.start(t),this}stop(){return super.stop(),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this}close(){return super.close(),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this}resume(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),$.call(this),this._startTime+=e.Time()-this._pauseTime,C(this),u||h()),this}pause(){return!this.paused&&this.playing&&(O(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this}reverse(){Object.keys(this.valuesEnd).forEach((t=>{const e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}))}update(t){const n=void 0!==t?t:e.Time();let r;if(n1?1:r;const s=this._easing(r);return Object.keys(this.valuesEnd).forEach((t=>{e[t](this.element,this.valuesStart[t],this.valuesEnd[t],s)})),this._onUpdate&&this._onUpdate.call(this),1!==r||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=n,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.forEach((t=>t.start())),!1))}}L.tween=q;class H{constructor(t,e,n,r){this.tweens=[],"offset"in y||(y.offset=0);const s=r||{};s.delay=s.delay||y.delay;const a=[];return Array.from(t).forEach(((t,r)=>{const i=L.tween;if(a[r]=s||{},a[r].delay=r>0?s.delay+(s.offset||y.offset):s.delay,!(t instanceof Element))throw Error(`KUTE.js - ${t} not instanceof [Element]`);this.tweens.push(new i(t,e,n,a[r]))})),this.length=this.tweens.length,this}start(t){const n=void 0===t?e.Time():t;return this.tweens.map((t=>t.start(n))),this}stop(){return this.tweens.map((t=>t.stop())),this}pause(t){const n=void 0===t?e.Time():t;return this.tweens.map((t=>t.pause(n))),this}resume(t){const n=void 0===t?e.Time():t;return this.tweens.map((t=>t.resume(n))),this}chain(t){const e=this.tweens[this.length-1];if(t instanceof H)e.chain(t.tweens);else{if(!(t instanceof L.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this}playing(){return this.tweens.some((t=>t.playing))}removeTweens(){this.tweens=[]}getMaxDuration(){const t=[];return this.tweens.forEach((e=>{t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)}}class D{constructor(t){try{if(t.component in d)throw Error(`KUTE.js - ${t.component} already registered`);if(t.property in g)throw Error(`KUTE.js - ${t.property} already registered`);this.setComponent(t)}catch(t){throw Error(t)}}setComponent(t){const e=this,n=t.component,r={prepareProperty:m,prepareStart:b,onStart:i,onComplete:x,crossCheck:v},s=t.category,o=t.property,l=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return d[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(g[o]=t.defaultValue,e.supports=`${o} property`):t.defaultValues&&(Object.keys(t.defaultValues).forEach((e=>{g[e]=t.defaultValues[e]})),e.supports=`${l||o} ${o||s} properties`),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((e=>{y[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((e=>{e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((s=>{r[e][n]||(r[e][n]={}),r[e][n][s]||(r[e][n][s]=t.functions[e][s])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((e=>{const n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((t=>{"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),E[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((e=>{k[e]||(k[e]=t.Util[e])})),e}}function F(t,e){const n=parseInt(t,10)||0,r=["px","%","deg","rad","em","rem","vh","vw"];let s;for(let e=0;e{e.style[t]=(s>.99||s<.01?(10*Q(n,r,s)>>0)/10:Q(n,r,s)>>0)+"px"})}const R={};["top","left","width","height"].forEach((t=>{R[t]=U}));const X=["top","left","width","height"],B={};X.forEach((t=>{B[t]=U}));const Z={component:"essentialBoxModel",category:"boxModel",properties:X,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return I(this.element,t)||g[t]},prepareProperty:function(t,e){const n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:B},Util:{trueDimension:F}};function z(t){let e;if(/rgb|rgba/.test(t)){const n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){const n=(t=>{const e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,e,n,r)=>e+e+n+n+r+r)),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null})(t);e={r:n.r,g:n.g,b:n.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){const n=document.getElementsByTagName("head")[0];n.style.color=t;let r=getComputedStyle(n,null).color;r=/rgb/.test(r)?r.replace(/[^\d,]/g,"").split(","):[0,0,0],n.style.color="",e={r:parseInt(r[0],10),g:parseInt(r[1],10),b:parseInt(r[2],10)}}return e}function Y(t,e,n){const r={},s=",";return Object.keys(e).forEach((s=>{"a"!==s?r[s]=Q(t[s],e[s],n)>>0||0:t[s]&&e[s]&&(r[s]=(100*Q(t[s],e[s],n)>>0)/100)})),r.a?"rgba("+r.r+s+r.g+s+r.b+s+r.a+")":"rgb("+r.r+s+r.g+s+r.b+")"}function K(t){this.valuesEnd[t]&&!e[t]&&(e[t]=(e,n,r,s)=>{e.style[t]=Y(n,r,s)})}const W={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach((t=>{W[t]=K}));const G=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],J={};G.forEach((t=>{J[t]="#000"}));const tt={};G.forEach((t=>{tt[t]=K}));const et={component:"colorProperties",category:"colors",properties:G,defaultValues:J,Interpolate:{numbers:Q,colors:Y},functions:{prepareStart:function(t){return I(this.element,t)||g[t]},prepareProperty:function(t,e){return z(e)},onStart:tt},Util:{trueColor:z}},nt={},rt=["fill","stroke","stop-color"];function st(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}const at={prepareStart:function(t,e){const n={};return Object.keys(e).forEach((t=>{const e=st(t).replace(/_+[a-z]+/,""),r=this.element.getAttribute(e);n[e]=rt.includes(e)?r||"rgba(0,0,0,0)":r||(/opacity/i.test(t)?1:0)})),n},prepareProperty:function(t,e){const n={};return Object.keys(e).forEach((r=>{const s=st(r),a=/(%|[a-z]+)$/,o=this.element.getAttribute(s.replace(/_+[a-z]+/,""));if(rt.includes(s))i.htmlAttributes[s]=e=>{this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in nt)&&(nt[e]=(t,e,n,r,s)=>{t.setAttribute(e,Y(n,r,s))})},n[s]=z(e[r])||g.htmlAttributes[r];else if(null!==o&&a.test(o)){const a=F(o).u||F(e[r]).u,l=/%/.test(a)?"_percent":`_${a}`;i.htmlAttributes[s+l]=e=>{this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in nt)&&(nt[e]=(t,e,n,r,s)=>{const a=e.replace(l,"");t.setAttribute(a,(1e3*Q(n.v,r.v,s)>>0)/1e3+r.u)})},n[s+l]=F(e[r])}else a.test(e[r])&&null!==o&&(null===o||a.test(o))||(i.htmlAttributes[s]=e=>{this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in nt)&&(nt[e]=(t,e,n,r,s)=>{t.setAttribute(e,(1e3*Q(n,r,s)>>0)/1e3)})},n[s]=parseFloat(e[r]))})),n},onStart:{attr(t){!e[t]&&this.valuesEnd[t]&&(e[t]=(t,n,r,s)=>{Object.keys(r).forEach((a=>{e.attributes[a](t,a,n[a],r[a],s)}))})},attributes(t){!e[t]&&this.valuesEnd.attr&&(e[t]=nt)}}},it={component:"htmlAttributes",property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:Q,colors:Y},functions:at,Util:{replaceUppercase:st,trueColor:z,trueDimension:F}};const ot={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=(e,n,r,s)=>{e.style[t]=(1e3*Q(n,r,s)>>0)/1e3})}},lt={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:ot},ct=String("abcdefghijklmnopqrstuvwxyz").split(""),ut=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ht=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),pt=String("0123456789").split(""),ft=ct.concat(ut,pt),dt=ft.concat(ht),gt={alpha:ct,upper:ut,symbols:ht,numeric:pt,alphanumeric:ft,all:dt},yt={text(t){if(!e[t]&&this.valuesEnd[t]){const n=this._textChars;let r=gt[y.textChars];n in gt?r=gt[n]:n&&n.length&&(r=n),e[t]=(t,e,n,s)=>{let a="",i="";const o=""===n?" ":n,l=e.substring(0),c=n.substring(0),u=r[Math.random()*r.length>>0];" "===e?(i=c.substring(Math.min(s*c.length,c.length)>>0,0),t.innerHTML=s<1?i+u:o):" "===n?(a=l.substring(0,Math.min((1-s)*l.length,l.length)>>0),t.innerHTML=s<1?a+u:o):(a=l.substring(l.length,Math.min(s*l.length,l.length)>>0),i=c.substring(0,Math.min(s*c.length,c.length)>>0),t.innerHTML=s<1?i+u+a:o)}}},number(t){t in this.valuesEnd&&!e[t]&&(e[t]=(t,e,n,r)=>{t.innerHTML=Q(e,n,r)>>0})}};function mt(t,e){let n,r;if("string"==typeof t)return r=document.createElement("SPAN"),r.innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){const r=t.innerHTML;n=document.createElement("SPAN"),n.className=e,n.innerHTML=r,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&([n]=t.children);return n}function bt(t,e){let n=[];const r=t.children.length;if(r){const s=[];let a,i=t.innerHTML;for(let n,o,l,c=0;c>0)/1e3}${n})`}function xt(t,e,n,r){const s=[];for(let a=0;a<3;a+=1)s[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return`translate3d(${s.join(",")})`}function Et(t,e,n,r){let s="";return s+=t[0]||e[0]?`rotateX(${(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3}${n})`:"",s+=t[1]||e[1]?`rotateY(${(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3}${n})`:"",s+=t[2]||e[2]?`rotateZ(${(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3}${n})`:"",s}function wt(t,e,n){return`scale(${(1e3*(t+(e-t)*n)>>0)/1e3})`}function kt(t,e,n,r){const s=[];return s[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,s[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0",`skew(${s.join(",")})`}function Ct(t,e){return parseFloat(t)/100*e}function Ot(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function _t(t){const e=t.getAttribute("points").split(" ");let n=0;if(e.length>1){const r=t=>{const e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},s=(t,e)=>void 0!==t&&void 0!==e?Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2):0;if(e.length>2)for(let t=0;t{const s=(100*e.l>>0)/100,a=0-(100*Q(e.s,n.s,r)>>0)/100,i=(100*Q(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=`${a}px`,t.style.strokeDasharray=`${(100*(i<1?0:i)>>0)/100}px, ${s}px`})}},Lt=4;function Pt(t){return t.map((t=>Array.isArray(t)?Pt(t):Number.isNaN(+t)?t:+t))}function Nt(t,e){const n=Number.isNaN(+e)?Lt:+e;let r;return r=n?t.map((t=>t.map((t=>{const e=+t,r=10**n;return e?e%1==0?e:Math.round(e*r)/r:t})))):Pt(t),r}function $t(t,e,n){if(t[n].length>7){t[n].shift();const r=t[n];let s=n;for(;r.length;)e[n]="A",t.splice(s+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Vt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function qt(t){return Array.isArray(t)&&t.every((t=>{const e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Ht(t){let e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Vt[n]&&(t.segments.push([e].concat(r.splice(0,Vt[n]))),Vt[n]););}function Dt(t){const e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=`Invalid path value: invalid Arc flag ${e}`)}function Ft(t){return t>=48&&t<=57}function Qt(t){const e=t.index,{max:n}=t;let r,s=e,a=!1,i=!1,o=!1,l=!1;if(s>=n)t.err=`Invalid path value: missing param ${t.pathValue[s]}`;else if(r=t.pathValue.charCodeAt(s),43!==r&&45!==r||(s+=1,r=s=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Rt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Xt(t){const{max:e}=t,n=t.pathValue.charCodeAt(t.index),r=Vt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(n))if(t.index+=1,Ut(t),t.data=[],r){for(;;){for(let s=r;s>0;s-=1){if(97!=(32|n)||3!==s&&4!==s?Qt(t):Dt(t),t.err.length)return;t.data.push(t.param),Ut(t),t.index=t.max)break;if(!Rt(t.pathValue.charCodeAt(t.index)))break}Ht(t)}else Ht(t);else t.err=`Invalid path value: ${t.pathValue[t.index]} not a path command`}function Bt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Zt(t,e){if(function(t){return qt(t)&&t.every((t=>t[0]===t[0].toUpperCase()))}(t))return Pt(t);const n=function(t,e){if(qt(t))return Pt(t);const n=new Bt(t);for(Ut(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n);e.x1=t,e.y1=r,a=["C",t,r].concat(s)}else if("T"===r){const{qx:t,qy:r}=function(t,e,n,r,s){return"QT".indexOf(s)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n);e.qx=t,e.qy=r,a=["Q",t,r].concat(s)}else if("Q"===r){const[t,n]=s;e.qx=t,e.qy=n}return a}function Yt(t,e){if(function(t){return Array.isArray(t)&&t.every((t=>{const e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Pt(t);const n=Zt(t,e),r={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],a=n.length;let i,o,l="";for(let t=0;t1&&(n=Math.sqrt(n),w*=n,k*=n);const r=w**2,s=k**2,o=(a===i?-1:1)*Math.sqrt(Math.abs((r*s-r*e*e-s*t*t)/(r*e*e+s*t*t)));g=o*w*e/k+(b+v)/2,y=o*-k*t/w+(x+E)/2,f=Math.asin(((x-y)/k*10**9>>0)/10**9),d=Math.asin(((E-y)/k*10**9>>0)/10**9),f=bd&&(f-=2*Math.PI),!i&&d>f&&(d-=2*Math.PI)}let C=d-f;if(Math.abs(C)>u){const t=d,e=v,n=E;d=f+u*(i&&d>f?1:-1),v=g+w*Math.cos(d),E=y+k*Math.sin(d),m=Wt(v,E,w,k,s,0,i,e,n,[d,t,g,y])}C=d-f;const O=Math.cos(f),_=Math.sin(f),M=Math.cos(d),T=Math.sin(d),I=Math.tan(C/4),S=4/3*w*I,A=4/3*k*I,j=[b,x],L=[b+S*_,x-A*O],P=[v+S*T,E-A*M],N=[v,E];return L[0]=2*j[0]-L[0],L[1]=2*j[1]-L[1],c?[L,P,N].concat(m):(m=[L,P,N].concat(m).join().split(","),m.map(((t,e)=>e%2?Kt(m[e-1],t,h).y:Kt(t,m[e+1],h).x)))}function Gt(t,e,n,r,s,a){const i=1/3,o=2/3;return[i*t+o*n,i*e+o*r,i*s+o*n,i*a+o*r,s,a]}function Jt(t,e,n,r,s,a,i,o,l){const c=1-l;return{x:c**3*t+c*c*3*l*n+3*c*l*l*s+l**3*i,y:c**3*e+c*c*3*l*r+3*c*l*l*a+l**3*o}}function te(t,e,n){const r=t[0],s=t[1];return[r+(e[0]-r)*n,s+(e[1]-s)*n]}function ee(t,e,n,r){const s=.5,a=[t,e],i=[n,r],o=te(a,i,s),l=te(i,o,s),c=te(o,l,s),u=te(l,c,s),h=te(c,u,s),p=Jt.apply(0,a.concat(o,c,h,s)),f=Jt.apply(0,h.concat(u,l,i,0));return[p.x,p.y,f.x,f.y,n,r]}function ne(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);const[n,r]=t.slice(1);switch(t[0]){case"M":return e.x=n,e.y=r,t;case"A":return["C"].concat(Wt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=n,e.qy=r,["C"].concat(Gt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ee(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ee(e.x1,e.y1,e.x,e.y))}return t}function re(t,e){if(function(t){return qt(t)&&t.slice(1).every((t=>"C"===t[0]))}(t))return Pt(t);const n=Yt(t,e),r={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[];let a,i,o="",l=n.length;for(let t=0;tt[0].concat(t.slice(1).join(" ")))).join("")}function ae(t,e,n,r,s){return s*(s*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function ie(t,e,n,r,s,a,i,o,l){let c;(null===l||Number.isNaN(+l))&&(c=1),c>1&&(c=1),c<0&&(c=0);const u=c/2;let h=0,p=0,f=0,d=0;const g=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach(((l,c)=>{h=u*l+u,p=ae(t,n,s,i,h),f=ae(e,r,a,o,h),d+=g[c]*Math.sqrt(p*p+f*f)})),u*d}function oe(t,e){let n=0;return re(t,e).forEach(((t,e,r)=>{n+="M"!==t[0]?ie.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function le(t,e){let n,r,s,a=0;return re(t,9).map(((t,i,o)=>(r=i?o[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?ie.apply(0,r):0,a+=n,s=0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Jt.apply(0,r.concat(1-(a-e)/n)):null,s))).filter((t=>t)).slice(-1)[0]}function ce(t,e,n,r,s,a,i,o){return 3*((o-e)*(n+s)-(i-t)*(r+a)+r*(t-s)-n*(e-a)+o*(s+t/3)-i*(a+e/3))/20}function ue(t,e){return function(t,e){let n=0,r=0,s=0,a=0,i=0;return re(t,e).map((t=>{switch(t[0]){case"M":case"Z":return s="M"===t[0]?t[1]:s,a="M"===t[0]?t[2]:a,n=s,r=a,0;default:return i=ce.apply(0,[n,r].concat(t.slice(1))),[n,r]=t.slice(-2),i}})).reduce(((t,e)=>t+e),0)}(re(t,e))>=0}function he(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function pe(t,e,n,r){const s=[];for(let a=0;a>0)/1e3)}return s}function fe(t){return t.reduce(((e,n,r)=>r?e+he(t[r-1],n):0),0)}function de(t,e){var n;const r=re((n=se(t),se(Zt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((t=>t.trim())).filter((t=>t)))[0],4),s=oe(r),a=[];let i,o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(s/e)));for(let t=0;t-1))return!1;e.push([r[1],r[2]])}return a=fe(e),!!n&&{ring:e,pathLength:a}}(n)||de(n,e)}function ye(t,e){const n=t.length;let r,s,a,i,o=1/0,l=0;for(let s=0;se;)r=te(n,r,.5),t.splice(s+1,0,r)}function ve(t){return Array.isArray(t)&&t.every((t=>Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])))}function xe(t,e){let n,r,s=t;if("string"==typeof s){const t=ge(s,e);s=t.ring,n=t.skipBisect,r=t.pathLength}else if(!Array.isArray(s))throw Error(`Invalid path value: ${s}`);const a=s.slice(0);if(a.pathLength=r,!ve(a))throw Error(`Invalid path value: ${a}`);return a.length>1&&he(a[0],a[a.length-1])<1e-9&&a.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&be(a,e),a}function Ee(t,e,n){const r=n||y.morphPrecision,s=xe(t,r),a=xe(e,r),i=s.length-a.length;return me(s,i<0?-1*i:0),me(a,i>0?i:0),ye(s,a),[Nt(s),Nt(a)]}const we={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){const n={},r=new RegExp("\\n","ig");let s=null;return e instanceof SVGElement?s=e:/^\.|^#/.test(e)&&(s=N(e)),"object"==typeof e&&e.pathArray?e:(s&&["path","glyph"].includes(s.tagName)?n.original=s.getAttribute("d").replace(r,""):s||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=(t,e,n,r)=>{const s=e.pathArray,a=n.pathArray,i=a.length;t.setAttribute("d",1===r?n.original:`M${pe(s,a,i,r).join("L")}Z`)})},crossCheck:function(t){if(this.valuesEnd[t]){const e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){const e=this.valuesStart[t].original,n=this.valuesEnd[t].original,r=this._morphPrecision?parseInt(this._morphPrecision,10):y.morphPrecision,[s,a]=Ee(e,n,r);this.valuesStart[t].pathArray=s,this.valuesEnd[t].pathArray=a}}}},ke={EssentialBoxModel:Z,ColorsProperties:et,HTMLAttributes:it,OpacityProperty:lt,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",number:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:yt},Util:{charSet:gt,createTextTweens:function(t,e,n){if(t.playing)return!1;const r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);const s=L.tween,a=function(t,e){const n=bt(t,"text-part"),r=bt(mt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((t=>(t.className+=" oldText",t.outerHTML))).join(""),t.innerHTML+=r.map((t=>(t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")))).join(""),[n,r]}(t,e),i=a[0],o=a[1],l=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText"));let u=[],h=0;return u=u.concat(l.map(((t,e)=>(r.duration="auto"===r.duration?75*i[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new s(t,{text:t.innerHTML},{text:""},r))))),u=u.concat(c.map(((n,a)=>(r.duration="auto"===r.duration?75*o[a].innerHTML.length:r.duration,r.delay=h,r.onComplete=a===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new s(n,{text:""},{text:o[a].innerHTML},r))))),u.start=function(){t.playing||(u.forEach((t=>t.start())),t.playing=!0)},u}}},TransformFunctions:{component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t){const e=T(this.element);return e[t]?e[t]:g[t]},prepareProperty:function(t,e){const n=["X","Y","Z"],r={},s=[],a=[],i=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((t=>{const l="object"==typeof e[t]&&e[t].length?e[t].map((t=>parseInt(t,10))):parseInt(e[t],10);if(o.includes(t)){const e="translate"===t||"rotate"===t?`${t}3d`:t;r[e]="skew"===t?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===t?l.length?[l[0]||0,l[1]||0,l[2]||0]:[l||0,0,0]:[l[0]||0,l[1]||0,l[2]||0]}else if(/[XYZ]/.test(t)){const o=t.replace(/[XYZ]/,""),l="skew"===o?o:`${o}3d`,c="skew"===o?2:3;let u=[];"translate"===o?u=s:"rotate"===o?u=a:"skew"===o&&(u=i);for(let t=0;t{e.style[t]=(n.perspective||r.perspective?vt(n.perspective,r.perspective,"px",s):"")+(n.translate3d?xt(n.translate3d,r.translate3d,"px",s):"")+(n.rotate3d?Et(n.rotate3d,r.rotate3d,"deg",s):"")+(n.skew?kt(n.skew,r.skew,"deg",s):"")+(n.scale||r.scale?wt(n.scale,r.scale,s):"")})},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:vt,translate3d:xt,rotate3d:Et,translate:function(t,e,n,r){const s=[];return s[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,s[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0",`translate(${s.join(",")})`},rotate:function(t,e,n,r){return`rotate(${(1e3*(t+(e-t)*r)>>0)/1e3}${n})`},scale:wt,skew:kt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:jt,Util:{getRectLength:Ot,getPolyLength:_t,getLineLength:Mt,getCircleLength:Tt,getEllipseLength:It,getTotalLength:St,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:At,percent:Ct}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:pe,defaultOptions:{morphPrecision:10,morphIndex:0},functions:we,Util:{addPoints:me,bisect:be,normalizeRing:xe,validRing:ve,getInterpolationPoints:Ee,pathStringToRing:ge,distanceSquareRoot:he,midPoint:te,approximateRing:de,rotateRing:ye,pathToString:se,pathToCurve:re,getPathLength:oe,getPointAtLength:le,getDrawDirection:ue,roundPath:Nt}}};Object.keys(ke).forEach((t=>{const e=ke[t];ke[t]=new D(e)}));const Ce={Animation:D,Components:ke,Tween:q,fromTo:function(t,e,n,r){const s=r||{};return new(0,L.tween)(N(t),e,n,s)},to:function(t,e,n){const r=n||{},s=L.tween;return r.resetStart=e,new s(N(t),e,e,r)},TweenCollection:H,allFromTo:function(t,e,n,r){const s=r||{};return new H(N(t,!0),e,n,s)},allTo:function(t,e,n){const r=n||{};return n.resetStart=e,new H(N(t,!0),e,e,r)},Objects:w,Util:k,Easing:P,CubicBezier:t,Render:f,Interpolate:a,Process:j,Internals:M,Selector:N,Version:"2.1.3"};export{Ce as default}; diff --git a/dist/kute.js b/dist/kute.js index 4c84b55..886d971 100644 --- a/dist/kute.js +++ b/dist/kute.js @@ -102,12 +102,41 @@ // link property update function to KUTE.js execution context var onStart = {}; - // import now from '../objects/now.js'; + var now; + + // Include a performance.now polyfill. + // source https://github.com/tweenjs/tween.js/blob/master/src/Now.ts + // In node.js, use process.hrtime. + // eslint-disable-next-line + // @ts-ignore + if (typeof self === 'undefined' && typeof process !== 'undefined' && process.hrtime) { + now = function () { + // eslint-disable-next-line + // @ts-ignore + var time = process.hrtime(); + + // Convert [seconds, nanoseconds] to milliseconds. + return time[0] * 1000 + time[1] / 1000000; + }; + } else if (typeof self !== 'undefined' && self.performance !== undefined && self.performance.now !== undefined) { + // In a browser, use self.performance.now if it is available. + // This must be bound, because directly assigning this function + // leads to an invocation exception in Chrome. + now = self.performance.now.bind(self.performance); + } else if (typeof Date !== 'undefined' && Date.now) { + // Use Date.now if it is available. + now = Date.now; + } else { + // Otherwise, use 'new Date().getTime()'. + now = function () { return new Date().getTime(); }; + } + + var now$1 = now; var Time = {}; - // Time.now = now; - var that = window.self || window || {}; - Time.now = that.performance.now.bind(that.performance); + Time.now = now$1; + // const that = window.self || window || {}; + // Time.now = that.performance.now.bind(that.performance); var Tick = 0; diff --git a/dist/kute.min.js b/dist/kute.min.js index a8f8306..9acfc78 100644 --- a/dist/kute.min.js +++ b/dist/kute.min.js @@ -1,2 +1,2 @@ // KUTE.js Standard v2.1.3 | thednp © 2021 | MIT-License -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{},a={},i={},s={},o=window.self||window||{};s.now=o.performance.now.bind(o.performance);var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function F(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*Q(n,r,a)>>0)/10:Q(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){w[e]||(w[e]=t.Util[e])})),e};var D={};["top","left","width","height"].forEach((function(t){D[t]=U}));var R=["top","left","width","height"],X={};R.forEach((function(t){X[t]=U}));var B={component:"essentialBoxModel",category:"boxModel",properties:R,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:Q},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=F(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:F}};function Z(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=Q(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*Q(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function Y(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=z(n,r,a)})}var K={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach((function(t){K[t]=Y}));var $=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],W={};$.forEach((function(t){W[t]="#000"}));var G={};$.forEach((function(t){G[t]=Y}));var J={component:"colorProperties",category:"colors",properties:$,defaultValues:W,Interpolate:{numbers:Q,colors:z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return Z(e)},onStart:G},Util:{trueColor:Z}},tt={},et="htmlAttributes",nt=["fill","stroke","stop-color"];function rt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var at={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=rt(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=nt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=rt(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(nt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){t.setAttribute(e,z(n,r,a))})},r[s]=Z(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=F(u).u||F(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*Q(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=F(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=tt)}}},it={component:et,property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:Q,colors:z},functions:at,Util:{replaceUppercase:rt,trueColor:Z,trueDimension:F}};var st={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*Q(n,r,a)>>0)/1e3})}},ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:st},ut=String("abcdefghijklmnopqrstuvwxyz").split(""),ct=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),lt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ht=String("0123456789").split(""),pt=ut.concat(ct,ht),ft=pt.concat(lt),dt={alpha:ut,upper:ct,symbols:lt,numeric:ht,alphanumeric:pt,all:ft},vt={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=dt[d.textChars];n in dt?r=dt[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function yt(t,e){var n,r;if("string"==typeof t)return(r=document.createElement("SPAN")).innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){var a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function gt(t,e){var n=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function bt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function xt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function Et(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function Mt(t,e){return parseFloat(t)/100*e}function _t(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function kt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},jt=4;function Lt(t){return t.map((function(t){return Array.isArray(t)?Lt(t):Number.isNaN(+t)?t:+t}))}function Pt(t,e){var n=Number.isNaN(+e)?jt:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):Lt(t)}function Nt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Vt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function qt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Ht(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Vt[n]&&(t.segments.push([e].concat(r.splice(0,Vt[n]))),Vt[n]););}var Ft="Invalid path value";function Qt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Ft+": invalid Arc flag "+e)}function Ut(t){return t>=48&&t<=57}function Dt(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=Ft+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Xt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Bt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Vt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(n))if(t.index+=1,Rt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Dt(t):Qt(t),t.err.length)return;t.data.push(t.param),Rt(t),t.index=t.max)break;if(!Xt(t.pathValue.charCodeAt(t.index)))break}Ht(t)}else Ht(t);else t.err=Ft+": "+t.pathValue[t.index]+" not a path command"}function Zt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function zt(t,e){if(function(t){return qt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return Lt(t);var n=function(t,e){if(qt(t))return Lt(t);var n=new Zt(t);for(Rt(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function Kt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Lt(t);for(var n,r,a=zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(x+w)/2,h=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=w;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),w=d+M*Math.sin(p),g=Wt(b,w,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),F=4/3*E*H,Q=4/3*M*H,U=[m,x],D=[m+F*N,x-Q*P],R=[b+F*q,w-Q*V],X=[b,w];return D[0]=2*U[0]-D[0],D[1]=2*U[1]-D[1],c?[D,R,X].concat(g):(g=[D,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?$t(g[e-1],t,y).y:$t(t,g[e+1],y).x}))}function Gt(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function Jt(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function te(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function ee(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=te(i,s,a),u=te(s,o,a),c=te(o,u,a),l=te(u,c,a),h=te(c,l,a),p=Jt.apply(0,i.concat(o,c,h,a)),f=Jt.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function ne(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Wt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(Gt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ee(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ee(e.x1,e.y1,e.x,e.y))}return t}function re(t,e){if(function(t){return qt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Lt(t);for(var n,r,a=Kt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=ie(t,n,a,s,h=l*u+l),f=ie(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function oe(t,e){var n=0;return re(t,e).forEach((function(t,e,r){n+="M"!==t[0]?se.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function ue(t,e){var n,r,a=0;return re(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?se.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Jt.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function ce(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function le(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return re(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=ce.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(re(t,e))>=0}function he(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function pe(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function fe(t){return t.reduce((function(e,n,r){return r?e+he(t[r-1],n):0}),0)}function de(t,e){var n,r,a=re((n=ae(t),ae(zt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=oe(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=fe(n),!!r&&{ring:n,pathLength:e}}(n)||de(n,e)}function ye(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=te(n,r,.5),t.splice(a+1,0,r)}function be(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function xe(t,e){var n,r,a=t;if("string"==typeof a){var i=ve(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(Ft+": "+a);var s=a.slice(0);if(s.pathLength=r,!be(s))throw Error(Ft+": "+s);return s.length>1&&he(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&me(s,e),s}function we(t,e,n){var r=n||d.morphPrecision,a=xe(t,r),i=xe(e,r),s=a.length-i.length;return ge(a,s<0?-1*s:0),ge(i,s>0?s:0),ye(a,i),[Pt(a),Pt(i)]}var Ee={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+pe(a,i,s,r).join("L")+"Z")})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=we(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},Me={EssentialBoxModel:B,ColorsProperties:J,HTMLAttributes:it,OpacityProperty:ot,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",number:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:Q},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:vt},Util:{charSet:dt,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=gt(t,"text-part"),r=gt(yt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:Et}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:At,Util:{getRectLength:_t,getPolyLength:kt,getLineLength:Ot,getCircleLength:Ct,getEllipseLength:Tt,getTotalLength:St,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:It,percent:Mt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:pe,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Ee,Util:{addPoints:ge,bisect:me,normalizeRing:xe,validRing:be,getInterpolationPoints:we,pathStringToRing:ve,distanceSquareRoot:he,midPoint:te,approximateRing:de,rotateRing:ye,pathToString:ae,pathToCurve:re,getPathLength:oe,getPointAtLength:ue,getDrawDirection:le,roundPath:Pt}}};Object.keys(Me).forEach((function(t){var e=Me[t];Me[t]=new H(e)}));return{Animation:H,Components:Me,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:x,Util:w,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.3"}})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).KUTE=e()}(this,(function(){"use strict";var t=function(t,e,n,r,a){var i=this;this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by;var s=function(t){return i.sampleCurveY(i.solveCurveX(t))};return Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s};t.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},t.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},t.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},t.prototype.solveCurveX=function(t){var e,n,r,a,i,s,o=1e-5;for(r=t,s=0;s<32;s+=1){if(a=this.sampleCurveX(r)-t,Math.abs(a)(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var e={},n=[],r="undefined"!=typeof global?global:"undefined"!=typeof window?window.self:{},a={},i={},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):"undefined"!=typeof Date&&Date.now?Date.now:function(){return(new Date).getTime()},o={};o.now=s;var u=0,c=function(t){for(var e=0;e1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(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)},A.tween=N,d.repeat=0,d.repeatDelay=0,d.yoyo=!1,d.resetStart=!1;var V=function(t){function n(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];t.apply(this,n),this.valuesStart={},this.valuesEnd={};var a=n[1],i=n[2];T.call(this,i,"end"),this._resetStart?this.valuesStart=a:T.call(this,a,"start"),this._resetStart||Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(n){g[t][n].call(e,n)}))})),this.paused=!1,this._pauseTime=null;var s=n[3];return this._repeat=s.repeat||d.repeat,this._repeatDelay=s.repeatDelay||d.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=s.yoyo||d.yoyo,this._reversed=!1,this}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.start=function(e){var n=this;return this._resetStart&&(this.valuesStart=this._resetStart,S.call(this),Object.keys(g).forEach((function(t){Object.keys(g[t]).forEach((function(e){g[t][e].call(n,e)}))}))),this.paused=!1,this._yoyo&&Object.keys(this.valuesEnd).forEach((function(t){n.valuesRepeat[t]=n.valuesStart[t]})),t.prototype.start.call(this,e),this},n.prototype.stop=function(){return t.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return t.prototype.close.call(this),this._repeatOption>0&&(this._repeat=this._repeatOption),this._yoyo&&!0===this._reversed&&(this.reverse(),this._reversed=!1),this},n.prototype.resume=function(){return this.paused&&this.playing&&(this.paused=!1,void 0!==this._onResume&&this._onResume.call(this),P.call(this),this._startTime+=e.Time()-this._pauseTime,E(this),u||c()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=e.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){var t=this;Object.keys(this.valuesEnd).forEach((function(e){var n=t.valuesRepeat[e];t.valuesRepeat[e]=t.valuesEnd[e],t.valuesEnd[e]=n,t.valuesStart[e]=t.valuesRepeat[e]}))},n.prototype.update=function(t){var n,r=this,a=void 0!==t?t:e.Time();if(a1?1:n;var i=this._easing(n);return Object.keys(this.valuesEnd).forEach((function(t){e[t](r.element,r.valuesStart[t],r.valuesEnd[t],i)})),this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(Number.isFinite(this._repeat)&&(this._repeat-=1),this._startTime=a,Number.isFinite(this._repeat)&&this._yoyo&&!this._reversed&&(this._startTime+=this._repeatDelay),this._yoyo&&(this._reversed=!this._reversed,this.reverse()),!0):(this._onComplete&&this._onComplete.call(this),this.playing=!1,this.close(),void 0!==this._chain&&this._chain.length&&this._chain.forEach((function(t){return t.start()})),!1))},n}(N);A.tween=V;var q=function(t,e,n,r){var a=this;this.tweens=[],"offset"in d||(d.offset=0);var i=r||{};i.delay=i.delay||d.delay;var s=[];return Array.from(t).forEach((function(t,r){var o=A.tween;if(s[r]=i||{},s[r].delay=r>0?i.delay+(i.offset||d.offset):i.delay,!(t instanceof Element))throw Error("KUTE.js - "+t+" not instanceof [Element]");a.tweens.push(new o(t,e,n,s[r]))})),this.length=this.tweens.length,this};q.prototype.start=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.start(n)})),this},q.prototype.stop=function(){return this.tweens.map((function(t){return t.stop()})),this},q.prototype.pause=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.pause(n)})),this},q.prototype.resume=function(t){var n=void 0===t?e.Time():t;return this.tweens.map((function(t){return t.resume(n)})),this},q.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof q)e.chain(t.tweens);else{if(!(t instanceof A.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},q.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},q.prototype.removeTweens=function(){this.tweens=[]},q.prototype.getMaxDuration=function(){var t=[];return this.tweens.forEach((function(e){t.push(e._duration+e._delay+e._repeat*e._repeatDelay)})),Math.max(t)};var H=function(t){try{if(t.component in p)throw Error("KUTE.js - "+t.component+" already registered");if(t.property in f)throw Error("KUTE.js - "+t.property+" already registered");this.setComponent(t)}catch(t){throw Error(t)}};function D(t,e){for(var n,r=parseInt(t,10)||0,a=["px","%","deg","rad","em","rem","vh","vw"],i=0;i.99||a<.01?(10*F(n,r,a)>>0)/10:F(n,r,a)>>0)+"px"})}H.prototype.setComponent=function(t){var e=this,n=t.component,r={prepareProperty:v,prepareStart:y,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;return p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t?(f[o]=t.defaultValue,e.supports=o+" property"):t.defaultValues&&(Object.keys(t.defaultValues).forEach((function(e){f[e]=t.defaultValues[e]})),e.supports=(u||o)+" "+(o||s)+" properties"),t.defaultOptions&&Object.keys(t.defaultOptions).forEach((function(e){d[e]=t.defaultOptions[e]})),t.functions&&Object.keys(r).forEach((function(e){e in t.functions&&("function"==typeof t.functions[e]?(r[e][n]||(r[e][n]={}),r[e][n][s||o]||(r[e][n][s||o]=t.functions[e])):Object.keys(t.functions[e]).forEach((function(a){r[e][n]||(r[e][n]={}),r[e][n][a]||(r[e][n][a]=t.functions[e][a])})))})),t.Interpolate&&(Object.keys(t.Interpolate).forEach((function(e){var n=t.Interpolate[e];"function"!=typeof n||a[e]?Object.keys(n).forEach((function(t){"function"!=typeof n[t]||a[e]||(a[e]=n[t])})):a[e]=n})),b[n]=t.Interpolate),t.Util&&Object.keys(t.Util).forEach((function(e){w[e]||(w[e]=t.Util[e])})),e};var U={};["top","left","width","height"].forEach((function(t){U[t]=Q}));var R=["top","left","width","height"],X={};R.forEach((function(t){X[t]=Q}));var B={component:"essentialBoxModel",category:"boxModel",properties:R,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:F},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){var n=D(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:D}};function Z(t){var e;if(/rgb|rgba/.test(t)){var n=t.replace(/\s|\)/,"").split("(")[1].split(","),r=n[3]?n[3]:null;r||(e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10)}),e={r:parseInt(n[0],10),g:parseInt(n[1],10),b:parseInt(n[2],10),a:parseFloat(r)}}if(/^#/.test(t)){var a=function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}(t);e={r:a.r,g:a.g,b:a.b}}if(/transparent|none|initial|inherit/.test(t)&&(e={r:0,g:0,b:0,a:0}),!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var s=getComputedStyle(i,null).color;s=/rgb/.test(s)?s.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",e={r:parseInt(s[0],10),g:parseInt(s[1],10),b:parseInt(s[2],10)}}return e}function z(t,e,n){var r={},a=",";return Object.keys(e).forEach((function(a){"a"!==a?r[a]=F(t[a],e[a],n)>>0||0:t[a]&&e[a]&&(r[a]=(100*F(t[a],e[a],n)>>0)/100)})),r.a?"rgba("+r.r+a+r.g+a+r.b+a+r.a+")":"rgb("+r.r+a+r.g+a+r.b+")"}function Y(t){this.valuesEnd[t]&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=z(n,r,a)})}var K={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach((function(t){K[t]=Y}));var $=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],W={};$.forEach((function(t){W[t]="#000"}));var G={};$.forEach((function(t){G[t]=Y}));var J={component:"colorProperties",category:"colors",properties:$,defaultValues:W,Interpolate:{numbers:F,colors:z},functions:{prepareStart:function(t){return C(this.element,t)||f[t]},prepareProperty:function(t,e){return Z(e)},onStart:G},Util:{trueColor:Z}},tt={},et="htmlAttributes",nt=["fill","stroke","stop-color"];function rt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var at={prepareStart:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(t){var e=rt(t).replace(/_+[a-z]+/,""),a=n.element.getAttribute(e);r[e]=nt.includes(e)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(t)?1:0)})),r},prepareProperty:function(t,e){var n=this,r={};return Object.keys(e).forEach((function(a){var s=rt(a),o=/(%|[a-z]+)$/,u=n.element.getAttribute(s.replace(/_+[a-z]+/,""));if(nt.includes(s))i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){t.setAttribute(e,z(n,r,a))})},r[s]=Z(e[a])||f.htmlAttributes[a];else if(null!==u&&o.test(u)){var c=D(u).u||D(e[a]).u,l=/%/.test(c)?"_percent":"_"+c;i.htmlAttributes[s+l]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){var i=e.replace(l,"");t.setAttribute(i,(1e3*F(n.v,r.v,a)>>0)/1e3+r.u)})},r[s+l]=D(e[a])}else o.test(e[a])&&null!==u&&(null===u||o.test(u))||(i.htmlAttributes[s]=function(e){n.valuesEnd[t]&&n.valuesEnd[t][e]&&!(e in tt)&&(tt[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*F(n,r,a)>>0)/1e3)})},r[s]=parseFloat(e[a]))})),r},onStart:{attr:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,n,r,a){Object.keys(r).forEach((function(i){e.attributes[i](t,i,n[i],r[i],a)}))})},attributes:function(t){!e[t]&&this.valuesEnd.attr&&(e[t]=tt)}}},it={component:et,property:"attr",subProperties:["fill","stroke","stop-color","fill-opacity","stroke-opacity"],defaultValue:{fill:"rgb(0,0,0)",stroke:"rgb(0,0,0)","stop-color":"rgb(0,0,0)",opacity:1,"stroke-opacity":1,"fill-opacity":1},Interpolate:{numbers:F,colors:z},functions:at,Util:{replaceUppercase:rt,trueColor:Z,trueDimension:D}};var st={prepareStart:function(t){return C(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(e,n,r,a){e.style[t]=(1e3*F(n,r,a)>>0)/1e3})}},ot={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:F},functions:st},ut=String("abcdefghijklmnopqrstuvwxyz").split(""),ct=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),lt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ht=String("0123456789").split(""),pt=ut.concat(ct,ht),ft=pt.concat(lt),dt={alpha:ut,upper:ct,symbols:lt,numeric:ht,alphanumeric:pt,all:ft},vt={text:function(t){if(!e[t]&&this.valuesEnd[t]){var n=this._textChars,r=dt[d.textChars];n in dt?r=dt[n]:n&&n.length&&(r=n),e[t]=function(t,e,n,a){var i="",s="",o=""===n?" ":n,u=e.substring(0),c=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=c.substring(Math.min(a*c.length,c.length)>>0,0),t.innerHTML=a<1?s+l:o):" "===n?(i=u.substring(0,Math.min((1-a)*u.length,u.length)>>0),t.innerHTML=a<1?i+l:o):(i=u.substring(u.length,Math.min(a*u.length,u.length)>>0),s=c.substring(0,Math.min(a*c.length,c.length)>>0),t.innerHTML=a<1?s+l+i:o)}}},number:function(t){t in this.valuesEnd&&!e[t]&&(e[t]=function(t,e,n,r){t.innerHTML=F(e,n,r)>>0})}};function yt(t,e){var n,r;if("string"==typeof t)return(r=document.createElement("SPAN")).innerHTML=t,r.className=e,r;if(!t.children.length||t.children.length&&t.children[0].className!==e){var a=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=a,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function gt(t,e){var n=[],r=t.children.length;if(r){for(var a,i=[],s=t.innerHTML,o=0,u=void 0,c=void 0,l=void 0;o>0)/1e3+n+")"}function bt(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function xt(t,e,n,r){var a="";return a+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",a+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",a+=t[2]||e[2]?"rotateZ("+(1e3*(t[2]+(e[2]-t[2])*r)>>0)/1e3+n+")":""}function wt(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function Et(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function Mt(t,e){return parseFloat(t)/100*e}function _t(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function kt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");return 2!==e.length||Number.isNaN(1*e[0])||Number.isNaN(1*e[1])?0:[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return void 0!==t&&void 0!==e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var i=0;i>0)/100,i=0-(100*F(e.s,n.s,r)>>0)/100,s=(100*F(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+a+"px"})}},jt=4;function Lt(t){return t.map((function(t){return Array.isArray(t)?Lt(t):Number.isNaN(+t)?t:+t}))}function Pt(t,e){var n=Number.isNaN(+e)?jt:+e;return n?t.map((function(t){return t.map((function(t){var e=+t,r=Math.pow(10,n);return e?e%1==0?e:Math.round(e*r)/r:t}))})):Lt(t)}function Nt(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],a=n;r.length;)e[n]="A",t.splice(a+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Vt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function qt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Ht(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&r.length>2&&(t.segments.push([e,r[0],r[1]]),r=r.slice(2),n="l",e="m"===e?"l":"L"),"r"===n)t.segments.push([e].concat(r));else for(;r.length>=Vt[n]&&(t.segments.push([e].concat(r.splice(0,Vt[n]))),Vt[n]););}var Dt="Invalid path value";function Ft(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void(t.index+=1)):49===e?(t.param=1,void(t.index+=1)):void(t.err=Dt+": invalid Arc flag "+e)}function Qt(t){return t>=48&&t<=57}function Ut(t){var e,n=t.index,r=t.max,a=n,i=!1,s=!1,o=!1,u=!1;if(a>=r)t.err=Dt+": missing param "+t.pathValue[a];else if(43!==(e=t.pathValue.charCodeAt(a))&&45!==e||(e=(a+=1)=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index+=1;var e}function Xt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Bt(t){var e=t.max,n=t.pathValue.charCodeAt(t.index),r=Vt[t.pathValue[t.index].toLowerCase()];if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0;default:return!1}}(n))if(t.index+=1,Rt(t),t.data=[],r){for(;;){for(var a=r;a>0;a-=1){if(97!=(32|n)||3!==a&&4!==a?Ut(t):Ft(t),t.err.length)return;t.data.push(t.param),Rt(t),t.index=t.max)break;if(!Xt(t.pathValue.charCodeAt(t.index)))break}Ht(t)}else Ht(t);else t.err=Dt+": "+t.pathValue[t.index]+" not a path command"}function Zt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function zt(t,e){if(function(t){return qt(t)&&t.every((function(t){return t[0]===t[0].toUpperCase()}))}(t))return Lt(t);var n=function(t,e){if(qt(t))return Lt(t);var n=new Zt(t);for(Rt(n);n.index-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),o=s.x1,u=s.y1;e.x1=o,e.y1=u,i=["C",o,u].concat(a)}else if("T"===r){var c=function(t,e,n,r,a){return"QT".indexOf(a)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),l=c.qx,h=c.qy;e.qx=l,e.qy=h,i=["Q",l,h].concat(a)}else if("Q"===r){var p=a[0],f=a[1];e.qx=p,e.qy=f}return i}function Kt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Vt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Lt(t);for(var n,r,a=zt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o=a.length,u="",c=0;c1&&(E*=O=Math.sqrt(O),M*=O);var C=Math.pow(E,2),T=Math.pow(M,2),S=(i===s?-1:1)*Math.sqrt(Math.abs((C*T-C*k*k-T*_*_)/(C*k*k+T*_*_)));f=S*E*k/M+(m+b)/2,d=S*-M*_/E+(x+w)/2,h=Math.asin(((x-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),p=Math.asin(((w-d)/M*Math.pow(10,9)>>0)/Math.pow(10,9)),h=mp&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var I=p-h;if(Math.abs(I)>v){var A=p,j=b,L=w;p=h+v*(s&&p>h?1:-1),b=f+E*Math.cos(p),w=d+M*Math.sin(p),g=Wt(b,w,E,M,a,0,s,j,L,[p,A,f,d])}I=p-h;var P=Math.cos(h),N=Math.sin(h),V=Math.cos(p),q=Math.sin(p),H=Math.tan(I/4),D=4/3*E*H,F=4/3*M*H,Q=[m,x],U=[m+D*N,x-F*P],R=[b+D*q,w-F*V],X=[b,w];return U[0]=2*Q[0]-U[0],U[1]=2*Q[1]-U[1],c?[U,R,X].concat(g):(g=[U,R,X].concat(g).join().split(",")).map((function(t,e){return e%2?$t(g[e-1],t,y).y:$t(t,g[e+1],y).x}))}function Gt(t,e,n,r,a,i){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*a+o*n,s*i+o*r,a,i]}function Jt(t,e,n,r,a,i,s,o,u){var c=1-u;return{x:Math.pow(c,3)*t+c*c*3*u*n+3*c*u*u*a+Math.pow(u,3)*s,y:Math.pow(c,3)*e+c*c*3*u*r+3*c*u*u*i+Math.pow(u,3)*o}}function te(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function ee(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=te(i,s,a),u=te(s,o,a),c=te(o,u,a),l=te(u,c,a),h=te(c,l,a),p=Jt.apply(0,i.concat(o,c,h,a)),f=Jt.apply(0,h.concat(l,u,s,0));return[p.x,p.y,f.x,f.y,n,r]}function ne(t,e){"TQ".indexOf(t[0])<0&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],a=n[1];switch(t[0]){case"M":return e.x=r,e.y=a,t;case"A":return["C"].concat(Wt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=a,["C"].concat(Gt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ee(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ee(e.x1,e.y1,e.x,e.y))}return t}function re(t,e){if(function(t){return qt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Lt(t);for(var n,r,a=Kt(t,e),i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},s=[],o="",u=a.length,c=0;c1&&(c=1),c<0&&(c=0);var l=c/2,h=0,p=0,f=0,d=0,v=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];return[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816].forEach((function(u,c){p=ie(t,n,a,s,h=l*u+l),f=ie(e,r,i,o,h),d+=v[c]*Math.sqrt(p*p+f*f)})),l*d}function oe(t,e){var n=0;return re(t,e).forEach((function(t,e,r){n+="M"!==t[0]?se.apply(0,r[e-1].slice(-2).concat(t.slice(1))):0})),n}function ue(t,e){var n,r,a=0;return re(t,9).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?se.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?Jt.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function ce(t,e,n,r,a,i,s,o){return 3*((o-e)*(n+a)-(s-t)*(r+i)+r*(t-a)-n*(e-i)+o*(a+t/3)-s*(i+e/3))/20}function le(t,e){return function(t,e){var n=0,r=0,a=0,i=0,s=0;return re(t,e).map((function(t){var e;switch(t[0]){case"M":case"Z":return a="M"===t[0]?t[1]:a,i="M"===t[0]?t[2]:i,n=a,r=i,0;default:return s=ce.apply(0,[n,r].concat(t.slice(1))),e=t.slice(-2),n=e[0],r=e[1],s}})).reduce((function(t,e){return t+e}),0)}(re(t,e))>=0}function he(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function pe(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}function fe(t){return t.reduce((function(e,n,r){return r?e+he(t[r-1],n):0}),0)}function de(t,e){var n,r,a=re((n=ae(t),ae(zt(n,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=oe(a),s=[],o=3;e&&!Number.isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;u-1))return!1;n.push([a[1],a[2]])}return e=fe(n),!!r&&{ring:n,pathLength:e}}(n)||de(n,e)}function ye(t,e){for(var n,r,a,i,s=t.length,o=1/0,u=0,c=0;ce;)r=te(n,r,.5),t.splice(a+1,0,r)}function be(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])}))}function xe(t,e){var n,r,a=t;if("string"==typeof a){var i=ve(a,e);a=i.ring,n=i.skipBisect,r=i.pathLength}else if(!Array.isArray(a))throw Error(Dt+": "+a);var s=a.slice(0);if(s.pathLength=r,!be(s))throw Error(Dt+": "+s);return s.length>1&&he(s[0],s[s.length-1])<1e-9&&s.pop(),!n&&e&&!Number.isNaN(e)&&+e>0&&me(s,e),s}function we(t,e,n){var r=n||d.morphPrecision,a=xe(t,r),i=xe(e,r),s=a.length-i.length;return ge(a,s<0?-1*s:0),ge(i,s>0?s:0),ye(a,i),[Pt(a),Pt(i)]}var Ee={prepareStart:function(){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=new RegExp("\\n","ig"),a=null;return e instanceof SVGElement?a=e:/^\.|^#/.test(e)&&(a=L(e)),"object"==typeof e&&e.pathArray?e:(a&&["path","glyph"].includes(a.tagName)?n.original=a.getAttribute("d").replace(r,""):a||"string"!=typeof e||(n.original=e.replace(r,"")),n)},onStart:function(t){!e[t]&&this.valuesEnd[t]&&(e[t]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+pe(a,i,s,r).join("L")+"Z")})},crossCheck:function(t){if(this.valuesEnd[t]){var e=this.valuesStart[t].pathArray,n=this.valuesEnd[t].pathArray;if(!e||!n||e&&n&&e.length!==n.length){var r=we(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision,10):d.morphPrecision),a=r[0],i=r[1];this.valuesStart[t].pathArray=a,this.valuesEnd[t].pathArray=i}}}},Me={EssentialBoxModel:B,ColorsProperties:J,HTMLAttributes:it,OpacityProperty:ot,TextWrite:{component:"textWriteProperties",category:"textWrite",properties:["text","number"],defaultValues:{text:" ",number:"0"},defaultOptions:{textChars:"alpha"},Interpolate:{numbers:F},functions:{prepareStart:function(){return this.element.innerHTML},prepareProperty:function(t,e){return"number"===t?parseFloat(e):""===e?" ":e},onStart:vt},Util:{charSet:dt,createTextTweens:function(t,e,n){if(t.playing)return!1;var r=n||{};r.duration=1e3,"auto"===n.duration?r.duration="auto":Number.isFinite(1*n.duration)&&(r.duration=1*n.duration);var a=A.tween,i=function(t,e){var n=gt(t,"text-part"),r=gt(yt(e),"text-part");return t.innerHTML="",t.innerHTML+=n.map((function(t){return t.className+=" oldText",t.outerHTML})).join(""),t.innerHTML+=r.map((function(t){return t.className+=" newText",t.outerHTML.replace(t.innerHTML,"")})).join(""),[n,r]}(t,e),s=i[0],o=i[1],u=[].slice.call(t.getElementsByClassName("oldText")).reverse(),c=[].slice.call(t.getElementsByClassName("newText")),l=[],h=0;return(l=(l=l.concat(u.map((function(t,e){return r.duration="auto"===r.duration?75*s[e].innerHTML.length:r.duration,r.delay=h,r.onComplete=null,h+=r.duration,new a(t,{text:t.innerHTML},{text:""},r)})))).concat(c.map((function(n,i){return r.duration="auto"===r.duration?75*o[i].innerHTML.length:r.duration,r.delay=h,r.onComplete=i===o.length-1?function(){t.innerHTML=e,t.playing=!1}:null,h+=r.duration,new a(n,{text:""},{text:o[i].innerHTML},r)})))).start=function(){t.playing||(l.forEach((function(t){return t.start()})),t.playing=!0)},l}}},TransformFunctions:{component:"transformFunctions",property:"transform",subProperties:["perspective","translate3d","translateX","translateY","translateZ","translate","rotate3d","rotateX","rotateY","rotateZ","rotate","skewX","skewY","skew","scale"],defaultValues:{perspective:400,translate3d:[0,0,0],translateX:0,translateY:0,translateZ:0,translate:[0,0],rotate3d:[0,0,0],rotateX:0,rotateY:0,rotateZ:0,rotate:0,skewX:0,skewY:0,skew:[0,0],scale:1},functions:{prepareStart:function(t){var e=O(this.element);return e[t]?e[t]:f[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];return Object.keys(e).forEach((function(t){var u="object"==typeof e[t]&&e[t].length?e[t].map((function(t){return parseInt(t,10)})):parseInt(e[t],10);if(o.includes(t)){var c="translate"===t||"rotate"===t?t+"3d":t;r[c]="skew"===t?u.length?[u[0]||0,u[1]||0]:[u||0,0]:"translate"===t?u.length?[u[0]||0,u[1]||0,u[2]||0]:[u||0,0,0]:[u[0]||0,u[1]||0,u[2]||0]}else if(/[XYZ]/.test(t)){var l=t.replace(/[XYZ]/,""),h="skew"===l?l:l+"3d",p="skew"===l?2:3,f=[];"translate"===l?f=a:"rotate"===l?f=i:"skew"===l&&(f=s);for(var d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:Et}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:F},functions:At,Util:{getRectLength:_t,getPolyLength:kt,getLineLength:Ot,getCircleLength:Ct,getEllipseLength:Tt,getTotalLength:St,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:It,percent:Mt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:pe,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Ee,Util:{addPoints:ge,bisect:me,normalizeRing:xe,validRing:be,getInterpolationPoints:we,pathStringToRing:ve,distanceSquareRoot:he,midPoint:te,approximateRing:de,rotateRing:ye,pathToString:ae,pathToCurve:re,getPathLength:oe,getPointAtLength:ue,getDrawDirection:le,roundPath:Pt}}};Object.keys(Me).forEach((function(t){var e=Me[t];Me[t]=new H(e)}));return{Animation:H,Components:Me,Tween:V,fromTo:function(t,e,n,r){var a=r||{};return new(0,A.tween)(L(t),e,n,a)},to:function(t,e,n){var r=n||{},a=A.tween;return r.resetStart=e,new a(L(t),e,e,r)},TweenCollection:q,allFromTo:function(t,e,n,r){var a=r||{};return new q(L(t,!0),e,n,a)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new q(L(t,!0),e,e,r)},Objects:x,Util:w,Easing:j,CubicBezier:t,Render:h,Interpolate:a,Process:I,Internals:k,Selector:L,Version:"2.1.3"}})); diff --git a/src/core/render.js b/src/core/render.js index 6fdbcf4..0869a9e 100644 --- a/src/core/render.js +++ b/src/core/render.js @@ -3,12 +3,12 @@ import Tweens from '../objects/tweens.js'; import globalObject from '../objects/globalObject.js'; import Interpolate from '../objects/interpolate.js'; import onStart from '../objects/onStart.js'; -// import now from '../objects/now.js'; +import now from '../objects/now.js'; const Time = {}; -// Time.now = now; -const that = window.self || window || {}; -Time.now = that.performance.now.bind(that.performance); +Time.now = now; +// const that = window.self || window || {}; +// Time.now = that.performance.now.bind(that.performance); let Tick = 0; export { Tick }; diff --git a/typescript/index.d.ts b/typescript/index.d.ts index d16ed7d..e71089c 100644 --- a/typescript/index.d.ts +++ b/typescript/index.d.ts @@ -18,6 +18,10 @@ declare module "src/objects/onStart" { var _default: {}; export default _default; } +declare module "src/objects/now" { + export default now; + let now: any; +} declare module "src/core/render" { export function stop(): void; export default Render; @@ -31,8 +35,9 @@ declare module "src/core/render" { } import Tweens from "src/objects/tweens"; namespace Time { - const now: () => number; + export { now }; } + import now from "src/objects/now"; } declare module "src/objects/supportedProperties" { var _default: {};