diff --git a/demo/src/kute-base.js b/demo/src/kute-base.js index 96dac3b..7ef23cc 100644 --- a/demo/src/kute-base.js +++ b/demo/src/kute-base.js @@ -1,6 +1,6 @@ /*! -* KUTE.js Base v2.0.16 (http://thednp.github.io/kute.js) -* Copyright 2015-2020 © thednp +* KUTE.js Base v2.1.0 (http://thednp.github.io/kute.js) +* Copyright 2015-2021 © thednp * Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE) */ (function (global, factory) { @@ -9,7 +9,7 @@ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.KUTE = factory()); }(this, (function () { 'use strict'; - var version = "2.0.16"; + var version = "2.1.0"; var KUTE = {}; diff --git a/demo/src/kute-base.min.js b/demo/src/kute-base.min.js index 815148b..748a424 100644 --- a/demo/src/kute-base.min.js +++ b/demo/src/kute-base.min.js @@ -1,2 +1,2 @@ -// KUTE.js Base v2.0.16 | thednp © 2020 | 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 self?self:"undefined"!=typeof window?window:{},i={},r={},o={};o.now=self.performance.now.bind(self.performance);var a=0,s=function(t){for(var e=0;e>0)/1e3;return i}E.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),b.call(this),this._startFired=!0),!a&&s(),this},E.prototype.stop=function(){return this.playing&&(_(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},E.prototype.close=function(){for(var t in h)for(var n in h[t])h[t][n].call(this,n);this._startFired=!1,u.call(this)},E.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},E.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},E.prototype.update=function(n){var e,i;if((n=void 0!==n?n:t.Time())1?1:e,i=this._easing(e),this.valuesEnd)t[r](this.element,this.valuesStart[r],this.valuesEnd[r],i);return 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)},y.tween=E;var k="undefined"!=typeof DOMMatrix?DOMMatrix:"undefined"!=typeof WebKitCSSMatrix?WebKitCSSMatrix:"undefined"!=typeof CSSMatrix?CSSMatrix:"undefined"!=typeof MSCSSMatrix?MSCSSMatrix:null,x={component:"transformMatrixBase",property:"transform",functions:{onStart:{transform:function(n){this.valuesEnd[n]&&!t[n]&&(t[n]=function(t,e,i,r){var o=new k,a={};for(var s in i)a[s]="perspective"===s?O(e[s],i[s],r):I(e[s],i[s],r);a.perspective&&(o.m34=-1/a.perspective),o=a.translate3d?o.translate(a.translate3d[0],a.translate3d[1],a.translate3d[2]):o,o=a.rotate3d?o.rotate(a.rotate3d[0],a.rotate3d[1],a.rotate3d[2]):o,a.skew&&(o=a.skew[0]?o.skewX(a.skew[0]):o,o=a.skew[1]?o.skewY(a.skew[1]):o),o=a.scale3d?o.scale(a.scale3d[0],a.scale3d[1],a.scale3d[2]):o,t.style[n]=o.toString()})},CSS3Matrix:function(n){this.valuesEnd.transform&&!t[n]&&(t[n]=k)}}},Interpolate:{perspective:O,translate3d:I,rotate3d:I,skew:I,scale3d:I}};function U(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,r){t.style[n]=(r>.99||r<.01?(10*O(e,i,r)>>0)/10:O(e,i,r)>>0)+"px"})}var q=["top","left","width","height"],A={};q.map((function(t){return A[t]=U}));var B={component:"baseBoxModel",category:"boxModel",properties:q,Interpolate:{numbers:O},functions:{onStart:A}};var F={component:"baseOpacity",property:"opacity",Interpolate:{numbers:O},functions:{onStart:function(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,r){t.style[n]=(1e3*O(e,i,r)>>0)/1e3})}}},j=new M(x),K=new M(B),Q=new M(F);return{Animation:M,Components:{Transform:j,BoxModel:K,Opacity:Q},Tween:E,fromTo:function(t,n,e,i){return i=i||{},new y.tween(C(t),n,e,i)},Objects:d,Easing:m,Util:v,Render:f,Interpolate:i,Internals:T,Selector:C,Version:"2.0.16"}})); +// KUTE.js Base v2.1.0 | 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 self?self:"undefined"!=typeof window?window:{},i={},r={},o={};o.now=self.performance.now.bind(self.performance);var a=0,s=function(t){for(var e=0;e>0)/1e3;return i}E.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),b.call(this),this._startFired=!0),!a&&s(),this},E.prototype.stop=function(){return this.playing&&(_(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},E.prototype.close=function(){for(var t in h)for(var n in h[t])h[t][n].call(this,n);this._startFired=!1,u.call(this)},E.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},E.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},E.prototype.update=function(n){var e,i;if((n=void 0!==n?n:t.Time())1?1:e,i=this._easing(e),this.valuesEnd)t[r](this.element,this.valuesStart[r],this.valuesEnd[r],i);return 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)},y.tween=E;var k="undefined"!=typeof DOMMatrix?DOMMatrix:"undefined"!=typeof WebKitCSSMatrix?WebKitCSSMatrix:"undefined"!=typeof CSSMatrix?CSSMatrix:"undefined"!=typeof MSCSSMatrix?MSCSSMatrix:null,x={component:"transformMatrixBase",property:"transform",functions:{onStart:{transform:function(n){this.valuesEnd[n]&&!t[n]&&(t[n]=function(t,e,i,r){var o=new k,a={};for(var s in i)a[s]="perspective"===s?O(e[s],i[s],r):I(e[s],i[s],r);a.perspective&&(o.m34=-1/a.perspective),o=a.translate3d?o.translate(a.translate3d[0],a.translate3d[1],a.translate3d[2]):o,o=a.rotate3d?o.rotate(a.rotate3d[0],a.rotate3d[1],a.rotate3d[2]):o,a.skew&&(o=a.skew[0]?o.skewX(a.skew[0]):o,o=a.skew[1]?o.skewY(a.skew[1]):o),o=a.scale3d?o.scale(a.scale3d[0],a.scale3d[1],a.scale3d[2]):o,t.style[n]=o.toString()})},CSS3Matrix:function(n){this.valuesEnd.transform&&!t[n]&&(t[n]=k)}}},Interpolate:{perspective:O,translate3d:I,rotate3d:I,skew:I,scale3d:I}};function U(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,r){t.style[n]=(r>.99||r<.01?(10*O(e,i,r)>>0)/10:O(e,i,r)>>0)+"px"})}var q=["top","left","width","height"],A={};q.map((function(t){return A[t]=U}));var B={component:"baseBoxModel",category:"boxModel",properties:q,Interpolate:{numbers:O},functions:{onStart:A}};var F={component:"baseOpacity",property:"opacity",Interpolate:{numbers:O},functions:{onStart:function(n){n in this.valuesEnd&&!t[n]&&(t[n]=function(t,e,i,r){t.style[n]=(1e3*O(e,i,r)>>0)/1e3})}}},j=new M(x),K=new M(B),Q=new M(F);return{Animation:M,Components:{Transform:j,BoxModel:K,Opacity:Q},Tween:E,fromTo:function(t,n,e,i){return i=i||{},new y.tween(C(t),n,e,i)},Objects:d,Easing:m,Util:v,Render:f,Interpolate:i,Internals:T,Selector:C,Version:"2.1.0"}})); diff --git a/demo/src/kute-extra.js b/demo/src/kute-extra.js index eed22f2..bea423b 100644 --- a/demo/src/kute-extra.js +++ b/demo/src/kute-extra.js @@ -1,6 +1,6 @@ /*! -* KUTE.js Extra v2.0.16 (http://thednp.github.io/kute.js) -* Copyright 2015-2020 © thednp +* KUTE.js Extra v2.1.0 (http://thednp.github.io/kute.js) +* Copyright 2015-2021 © thednp * Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE) */ (function (global, factory) { @@ -9,7 +9,7 @@ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.KUTE = factory()); }(this, (function () { 'use strict'; - var version = "2.0.16"; + var version = "2.1.0"; var KUTE = {}; @@ -1496,7 +1496,7 @@ return getCircleLength(el); } else if ('ellipse'===el.tagName) { return getEllipseLength(el); - } else if (['polygon,polyline'].indexOf(el.tagName)>-1) { + } else if (['polygon','polyline'].indexOf(el.tagName)>-1) { return getPolyLength(el); } else if ('line'===el.tagName) { return getLineLength(el); diff --git a/demo/src/kute-extra.min.js b/demo/src/kute-extra.min.js index cfe7f28..e0b38a9 100644 --- a/demo/src/kute-extra.min.js +++ b/demo/src/kute-extra.min.js @@ -1,2 +1,2 @@ -// KUTE.js Extra v2.0.16 | thednp © 2020 | 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={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var P={},V={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function L(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t instanceof Element}))?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}function j(){for(var t in i)if("function"==typeof i[t])i[t].call(this,t);else for(var e in i[t])i[t][e].call(this,e);T.call(this)}P.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof V[t])return V[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),V.linear};var U=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:P.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};U.prototype.start=function(e){return S(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),j.call(this),this._startFired=!0),!s&&o(),this},U.prototype.stop=function(){return this.playing&&(M(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},U.prototype.close=function(){for(var t in m)for(var e in m[t])m[t][e].call(this,e);this._startFired=!1,u.call(this)},U.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},U.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},U.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return 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)},P.tween=U,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var F=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(I.call(this,i,"end"),this._resetStart?this.valuesStart=r:I.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,A.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.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),j.call(this),this._startTime+=t.Time()-this._pauseTime,S(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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.map((function(t){return t.start()})),!1))},n}(U);P.tween=F;var q=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.to=function(t,e){},e.prototype.fromTo=function(t,e){},e.prototype.getTotalDuration=function(){},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}(F);P.tween=q;var N=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new P.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),this},N.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},N.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},N.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},N.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof N)e.chain(t.tweens);else{if(!(t instanceof P.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},N.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},N.prototype.removeTweens=function(){this.tweens=[]},N.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,e){if(this.element=L(t),this.element.tween=e,this.element.tween.toolbar=this.element,this.element.toolbar=this,this.element.output=this.element.parentNode.getElementsByTagName("OUTPUT")[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 P.tween))throw TypeError("tween parameter is not ["+P.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)};H.prototype.updateBar=function(){var e=this.toolbar.output,n=this.paused?this.toolbar.value:(t.Time()-this._startTime)/this._duration;n=n>.9999?1:n<.01?0:n;var r=this._reversed?1-n:n;this.toolbar.value=r,e&&(e.value=(100*r).toFixed(2)+"%")},H.prototype.toggleEvents=function(t){this.element[t+"EventListener"]("mousemove",this.moveAction,!1),this.element[t+"EventListener"]("mouseup",this.upAction,!1)},H.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)},H.prototype.moveAction=function(){this.toolbar.updateTween.call(this)},H.prototype.downAction=function(){this.tween.playing||this.tween.start(),this.tween.paused||(this.tween.pause(),this.toolbar.toggleEvents("add"),t.Tick=cancelAnimationFrame(t.Ticker))},H.prototype.upAction=function(){this.tween.paused&&(this.tween.paused&&this.tween.resume(),this.tween._startTime=t.Time()-(this.tween._reversed?1-this.value:this.value)*this.tween._duration,this.toolbar.toggleEvents("remove"),t.Tick=requestAnimationFrame(t.Ticker))};var D=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};D.prototype.setComponent=function(t){var e=this,n=t.component,a={prepareProperty:d,prepareStart:v,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[o]=t.defaultValue,e.supports=o+" property";else if(t.defaultValues){for(var l in t.defaultValues)h[l]=t.defaultValues[l];e.supports=(u||o)+" "+(o||s)+" properties"}if(t.defaultOptions)for(var c in t.defaultOptions)f[c]=t.defaultOptions[c];if(t.functions)for(var w in a)if(w in t.functions)if("function"==typeof t.functions[w])!a[w][n]&&(a[w][n]={}),!a[w][n][s||o]&&(a[w][n][s||o]=t.functions[w]);else for(var x in t.functions[w])!a[w][n]&&(a[w][n]={}),!a[w][n][x]&&(a[w][n][x]=t.functions[w][x]);if(t.Interpolate){for(var S in t.Interpolate){var M=t.Interpolate[S];if("function"!=typeof M||r[S])for(var T in M)"function"!=typeof M[T]||r[S]||(r[S]=M[T]);else r[S]=M}y[n]=t.Interpolate}if(t.Util)for(var C in t.Util)!b[C]&&(b[C]=t.Util[C]);return e};var R=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];t.apply(this,e)}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,a={prepareProperty:d,prepareStart:v,onStart:i,onComplete:m,crossCheck:g},s=e.category,o=e.property,u=e.properties&&e.properties.length||e.subProperties&&e.subProperties.length;if("defaultValue"in e?(n.supports=o+" property",n.defaultValue=(e.defaultValue+"").length?"YES":"not set or incorrect"):e.defaultValues&&(n.supports=(u||o)+" "+(o||s)+" properties",n.defaultValues=Object.keys(e.defaultValues).length===u?"YES":"Not set or incomplete"),e.defaultOptions){for(var l in n.extends=[],e.defaultOptions)n.extends.push(l);n.extends.length?n.extends="with <"+n.extends.join(", ")+"> new option(s)":delete n.extends}if(e.functions){for(var c in n.interface=[],n.render=[],n.warning=[],a)c in e.functions?("prepareProperty"===c&&n.interface.push("fromTo()"),"prepareStart"===c&&n.interface.push("to()"),"onStart"===c&&(n.render="can render update")):("prepareProperty"===c&&n.warning.push("fromTo()"),"prepareStart"===c&&n.warning.push("to()"),"onStart"===c&&(n.render="no function to render update"));n.interface.length?n.interface=(s||o)+" can use ["+n.interface.join(", ")+"] method(s)":delete n.uses,n.warning.length?n.warning=(s||o)+" can't use ["+n.warning.join(", ")+"] method(s) because values aren't processed":delete n.warning}if(e.Interpolate){for(var p in n.uses=[],n.adds=[],e.Interpolate){var h=e.Interpolate[p];if("function"==typeof h)r[p]||n.adds.push(""+p),n.uses.push(""+p);else for(var f in h)"function"!=typeof h[f]||r[p]||n.adds.push(""+f),n.uses.push(""+f)}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}else n.critical="For "+(o||s)+" no interpolation function[s] is set";return e.Util&&(n.hasUtil=Object.keys(e.Util).join(",")),n},e}(D);function B(t,e,n){return(t=+t)+(e-=t)*n}function Q(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a>0)/100+"% "+(100*B(n[1],r[1],i)>>0)/100+"%"})}},X={component:"backgroundPositionProp",property:"backgroundPosition",defaultValue:[50,50],Interpolate:{numbers:B},functions:z,Util:{trueDimension:Q}};function Y(t,e,n,r){return(t=+t)+(e-=t)*r+n}function W(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=Y(n.v,r.v,r.u,i)})}x.BackgroundPosition=X;var K=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],$={};K.map((function(t){return $[t]=0}));var G={};K.forEach((function(t){G[t]=W}));var Z={component:"borderRadiusProperties",category:"borderRadius",properties:K,defaultValues:$,Interpolate:{units:Y},functions:{prepareStart:function(t){return E(this.element,t)||h[t]},prepareProperty:function(t,e){return Q(e)},onStart:G},Util:{trueDimension:Q}};function J(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(i>.99||i<.01?(10*B(n,r,i)>>0)/10:B(n,r,i)>>0)+"px"})}x.BorderRadiusProperties=Z;var tt=["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"],et={};tt.map((function(t){return et[t]=0}));var nt={};tt.map((function(t){return nt[t]=J}));var rt={component:"boxModelProperties",category:"boxModel",properties:tt,defaultValues:et,Interpolate:{numbers:B},functions:{prepareStart:function(t){return E(this.element,t)||h[t]},prepareProperty:function(t,e){var n=Q(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:nt}};x.BoxModelProperties=rt;var it={prepareStart:function(t,e){var n=E(this.element,t),r=E(this.element,"width"),i=E(this.element,"height");return/rect/.test(n)?n:[0,r,i,0]},prepareProperty:function(t,e){if(e instanceof Array)return[Q(e[0]),Q(e[1]),Q(e[2]),Q(e[3])];var n=e.replace(/rect|\(|\)/g,"");return[Q((n=/\,/g.test(n)?n.split(/\,/g):n.split(/\s/g))[0]),Q(n[1]),Q(n[2]),Q(n[3])]},onStart:function(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,e,n,r){for(var i=0,a=[];i<4;i++){var s=e[i].v,o=n[i].v,u=n[i].u||"px";a[i]=(100*B(s,o,r)>>0)/100+u}t.style.clip="rect("+a+")"})}},at={component:"clipProperty",property:"clip",defaultValue:[0,0,0,0],Interpolate:{numbers:B},functions:it,Util:{trueDimension:Q}};function st(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function ot(t,e,n){var r,i={},a=",";for(r in e)i[r]="a"!==r?B(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*B(t[r],e[r],n)>>0)/100:null;return i.a?"rgba("+i.r+a+i.g+a+i.b+a+i.a+")":"rgb("+i.r+a+i.g+a+i.b+")"}function ut(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=ot(n,r,i)})}x.ClipProperty=at;var lt=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],ct={};lt.map((function(t){ct[t]="#000"}));var pt={};lt.map((function(t){return pt[t]=ut}));var ht={component:"colorProperties",category:"colors",properties:lt,defaultValues:ct,Interpolate:{numbers:B,colors:ot},functions:{prepareStart:function(t,e){return E(this.element,t)||h[t]},prepareProperty:function(t,e){return st(e)},onStart:pt},Util:{trueColor:st}};function ft(t,e,n){for(var r=[],i=0;i<3;i++)r[i]=(100*B(t[i],e[i],n)>>0)/100+"px";return"drop-shadow("+r.concat(ot(t[3],e[3],n)).join(" ")+")"}function dt(t){return t.replace("-r","R").replace("-s","S")}function vt(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++)e[n]=parseFloat(e[n]);return e[3]=st(e[3]),e}function gt(t){var e={},n=t.match(/(([a-z].*?)\(.*?\))(?=\s([a-z].*?)\(.*?\)|\s*$)/g),r="none"!==t?n:"none";if(r instanceof Array)for(var i=0,a=r.length;i>0)/100+"%)":"")+(n.blur||r.blur?"blur("+(100*B(n.blur,r.blur,i)>>0)/100+"em)":"")+(n.saturate||r.saturate?"saturate("+(100*B(n.saturate,r.saturate,i)>>0)/100+"%)":"")+(n.invert||r.invert?"invert("+(100*B(n.invert,r.invert,i)>>0)/100+"%)":"")+(n.grayscale||r.grayscale?"grayscale("+(100*B(n.grayscale,r.grayscale,i)>>0)/100+"%)":"")+(n.hueRotate||r.hueRotate?"hue-rotate("+(100*B(n.hueRotate,r.hueRotate,i)>>0)/100+"deg)":"")+(n.sepia||r.sepia?"sepia("+(100*B(n.sepia,r.sepia,i)>>0)/100+"%)":"")+(n.brightness||r.brightness?"brightness("+(100*B(n.brightness,r.brightness,i)>>0)/100+"%)":"")+(n.contrast||r.contrast?"contrast("+(100*B(n.contrast,r.contrast,i)>>0)/100+"%)":"")+(n.dropShadow||r.dropShadow?ft(n.dropShadow,r.dropShadow,i):"")})},crossCheck:function(t){if(this.valuesEnd[t])for(var e in this.valuesStart[t])this.valuesEnd[t][e]||(this.valuesEnd[t][e]=this.valuesStart[t][e])}},yt={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:B,blur:B,saturate:B,grayscale:B,brightness:B,contrast:B,sepia:B,invert:B,hueRotate:B,dropShadow:{numbers:B,colors:ot,dropShadow:ft}},functions:mt,Util:{parseDropShadow:vt,parseFilterString:gt,replaceDashNamespace:dt,trueColor:st}};x.FilterEffects=yt;var wt={},bt="htmlAttributes",xt=["fill","stroke","stop-color"];function St(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var Mt={prepareStart:function(t,e){var n={};for(var r in e){var i=St(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=xt.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=St(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(xt.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in wt)&&(wt[e]=function(t,e,n,r,i){t.setAttribute(e,ot(n,r,i))})},n[a]=st(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=Q(o).u||Q(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in wt)&&(wt[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*B(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=Q(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in wt)&&(wt[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*B(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=wt)}}},Tt={component:bt,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:B,colors:ot},functions:Mt,Util:{replaceUppercase:St,trueColor:st,trueDimension:Q}};x.HTMLAttributes=Tt;var Ct={prepareStart:function(t){return E(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*B(n,r,i)>>0)/1e3})}},_t={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:B},functions:Ct};function Et(t,e){return parseFloat(t)/100*e}function It(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function At(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a-1?At(t):"line"===t.tagName?kt(t):void 0}function Lt(t,e){var n,r,i,a,s=/path|glyph/.test(t.tagName)?t.getTotalLength():Vt(t);return e instanceof Object?e:("string"==typeof e?(e=e.split(/\,|\s/),n=/%/.test(e[0])?Et(e[0].trim(),s):parseFloat(e[0]),r=/%/.test(e[1])?Et(e[1].trim(),s):parseFloat(e[1])):void 0===e&&(a=parseFloat(E(t,"stroke-dashoffset")),i=E(t,"stroke-dasharray").split(/\,/),n=0-a,r=parseFloat(i[0])+n||s),{s:n,e:r,l:s})}x.OpacityProperty=_t;var jt={prepareStart:function(){return Lt(this.element)},prepareProperty:function(t,e){return Lt(this.element,e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){var i=(100*e.l>>0)/100,a=0-(100*B(e.s,n.s,r)>>0)/100,s=(100*B(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"})}},Ut={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:B},functions:jt,Util:{getRectLength:It,getPolyLength:At,getLineLength:kt,getCircleLength:Ot,getEllipseLength:Pt,getTotalLength:Vt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Lt,percent:Et}};function Ft(t){return t.map((function(t){return t[0].concat(t.slice(1).join(" "))})).join("")}function qt(t){return t.map((function(t){return Array.isArray(t)?qt(t):isNaN(+t)?t:+t}))}x.SVGDraw=Ut;var Nt=3;function Ht(t,e){var n=isNaN(+e)?Nt:+e;return n?t.map((function(t){return t.map((function(t,e){var r=+t,i=Math.pow(10,n);return r?r%1==0?r:Math.round(r*i)/i: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 Rt(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 Bt="Invalid path value";function Qt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=Bt+": invalid Arc flag "+e)}function zt(t){return t>=48&&t<=57}function Xt(t){var e,n=t.index,r=n,i=t.max,a=!1,s=!1,o=!1,u=!1;if(r>=i)t.err=Bt+": missing param "+t.pathValue[r];else if(43!==(e=t.pathValue.charCodeAt(r))&&45!==e||(e=++r=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index++;var e}function Wt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Kt(t){var e,n,r,i,a=t.max;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}return!1}(e=t.pathValue.charCodeAt(t.index)))if(r=Dt[t.pathValue[t.index].toLowerCase()],t.index++,Yt(t),t.data=[],r){for(n=!1;;){for(i=r;i>0;i--){if(97!=(32|e)||3!==i&&4!==i?Xt(t):Qt(t),t.err.length)return;t.data.push(t.param),Yt(t),n=!1,t.index=t.max)break;if(!Wt(t.pathValue.charCodeAt(t.index)))break}}Rt(t)}else Rt(t);else t.err=Bt+": "+t.pathValue[t.index]+" not a path command"}function $t(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 Gt(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 Zt(t,e){if(Gt(t))return qt(t);var n=new $t(t);for(Yt(n);n.index7){t[n].shift();for(var r=t[n];r.length;)e[n]="A",t.splice(n++,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function ee(t,e,n){var r,i;switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"H":return["L",t[1],e.y1];case"V":return["L",e.x1,t[1]];case"S":return i=function(t,e,n,r,i){return"CS".indexOf(i)>-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),e.x1=i.x1,e.y1=i.y1,["C",i.x1,i.y1].concat(t.slice(1));case"T":return r=function(t,e,n,r,i){return"QT".indexOf(i)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),e.qx=r.qx,e.qy=r.qy,["Q",e.qx,e.qy].concat(t.slice(1));case"Q":e.qx=t[1],e.qy=t[2]}return t}function ne(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,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o="",u=(t=Jt(t)).length,l=0;l1&&(n*=b=Math.sqrt(b),r*=b);var x=n*n,S=r*r,M=(a==s?-1:1)*Math.sqrt(Math.abs((x*S-x*w*w-S*y*y)/(x*w*w+S*y*y)));f=M*n*w/r+(t+o)/2,d=M*-r*y/n+(e+u)/2,p=Math.asin(((e-d)/r).toFixed(9)),h=Math.asin(((u-d)/r).toFixed(9)),p=th&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var T=h-p;if(Math.abs(T)>v){var C=h,_=o,E=u;h=p+v*(s&&h>p?1:-1),o=f+n*Math.cos(h),u=d+r*Math.sin(h),m=ie(o,u,n,r,i,0,s,_,E,[h,C,f,d])}T=h-p;var I=Math.cos(p),A=Math.sin(p),k=Math.cos(h),O=Math.sin(h),P=Math.tan(T/4),V=4/3*n*P,L=4/3*r*P,j=[t,e],U=[t+V*A,e-L*I],F=[o+V*O,u-L*k],q=[o,u];return U[0]=2*j[0]-U[0],U[1]=2*j[1]-U[1],l?[U,F,q].concat(m):(m=[U,F,q].concat(m).join().split(",")).map((function(t,e){return e%2?re(m[e-1],t,g).y:re(t,m[e+1],g).x}))}function ae(t,e,n,r,i,a){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*i+o*n,s*a+o*r,i,a]}function se(t,e,n,r,i,a,s,o,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*u*u*i+Math.pow(u,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*u*u*a+Math.pow(u,3)*o}}function oe(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ue(t,e,n,r){var i=.5,a=[t,e],s=[n,r],o=oe(a,s,i),u=oe(s,o,i),l=oe(o,u,i),c=oe(u,l,i),p=oe(l,c,i),h=se.apply(0,a.concat(o,l,p,i)),f=se.apply(0,p.concat(c,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function le(t,e){switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"M":return e.x=t[1],e.y=t[2],t;case"A":return["C"].concat(ie.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(ae.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ue(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ue(e.x1,e.y1,e.x,e.y))}return t}function ce(t,e){if(function(t){return Gt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return qt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o=(t=ne(t)).length,u=0;u=0}function de(t,e){e=e||.5;var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),s=oe(n,r,e),o=oe(r,i,e),u=oe(i,a,e),l=oe(s,o,e),c=oe(o,u,e),p=oe(l,c,e);return[["C"].concat(s,l,p),["C"].concat(c,u,a)]}function ve(t,e,n,r,i){return i*(i*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function ge(t,e,n,r,i,a,s,o,u){(null===u||isNaN(+u))&&(u=1);var l=(u=u>1?1:u<0?0:u)/2,c=0,p=0,h=0,f=0,d=[.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].map((function(u,v){p=ve(t,n,i,s,c=l*u+l),h=ve(e,r,a,o,c),f+=d[v]*Math.sqrt(p*p+h*h)})),l*f}function me(t){return ce((e=Ft(Jt(t)),Ft(Jt(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)),i=e?ge.apply(0,r):0;return{s:t,ss:e?i?de(r):[t,t]:[t],l:i}}));var e}function ye(t,e,n){var r=me(t),i=me(e),a=r.length,s=i.length,o=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/o||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,p=n||Math.max(a,s),h=[l,c],f=[p-a,p-s],d=0,v=[r,i].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:ye(v[0],v[1],p)}function we(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var s,o=i+a;return 0===a||t[o]&&"M"===t[o][0]?(s=t[o],["M"].concat(s.slice(-2))):(o>=e&&(o-=n),t[o])}))}))}function be(t,e){var n=t.length-1,r=[],i=0,a=we(t);return a.map((function(a,s){t.slice(1).map((function(r,a){i+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(s+a)%n].slice(-2),e[a%n].slice(-2))})),r[s]=i,i=0})),a[r.indexOf(Math.min.apply(null,r))]}var xe={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof SVGElement?e:/^\.|^\#/.test(e)?L(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.curve?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):r||"string"!=typeof e||(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){for(var i=[],a=e.curve,s=n.curve,o=0,u=s.length;o>0)/1e3)}t.setAttribute("d",1===r?n.original:Ft(i))})},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=ye(this.valuesStart[t].original,this.valuesEnd[t].original),i=fe(r[0])!==fe(r[1])?pe(r[0]):qt(r[0]);this.valuesStart[t].curve=i,this.valuesEnd[t].curve=be(r[1],i)}}}},Se={component:"svgCubicMorph",property:"path",defaultValue:[],Interpolate:{numbers:B,pathToString:Ft},functions:xe,Util:{pathToCurve:ce,pathToAbsolute:Jt,pathToString:Ft,parsePathString:Zt,getRotatedCurve:be,getRotations:we,equalizeSegments:ye,reverseCurve:pe,clonePath:qt,getDrawDirection:fe,splitCubic:de,getCurveArray:me}};function Me(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=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",n={};if(e instanceof Array)for(var r=0,i=e.length;r>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(l?"rotate("+(1e3*l>>0)/1e3+")":"")+(h?"skewX("+(1e3*h>>0)/1e3+")":"")+(f?"skewY("+(1e3*f>>0)/1e3+")":"")+(1!==u?"scale("+(1e3*u>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],n=this.valuesEnd[t],r=Ce.call(this,t,Te(this.element.getAttribute("transform")));for(var i in r)e[i]=r[i];var a=this.element.ownerSVGElement,s=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]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in n&&"origin"!==o||(n[o]=e[o])}}},Ee={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:B},functions:_e,Util:{parseStringOrigin:Me,parseTransformString:Te,parseTransformSVG:Ce}};x.SVGTransformProperty=Ee;var Ie=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t,e)}),e)}catch(t){}return t}(),Ae="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],ke="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Oe=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Pe=!!Ie&&{passive:!1};function Ve(t){this.scrolling&&t.preventDefault()}function Le(){var t=this.element;return t===Oe?{el:document,st:document.body}:{el:t,st:t}}function je(t,e){e[t](Ae[0],Ve,Pe),e[t](ke,Ve,Pe)}function Ue(){var t=Le.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,je("addEventListener",t.el),t.st.style.pointerEvents="none")}function Fe(){var t=Le.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,je("removeEventListener",t.el),t.st.style.pointerEvents="")}var qe={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Oe,this.element===Oe?window.pageYOffset||Oe.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Oe,Ue.call(this),t[e]=function(t,e,n,r){t.scrollTop=B(e,n,r)>>0})},onComplete:function(t){Fe.call(this)}},Ne={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:B},functions:qe,Util:{preventScroll:Ve,scrollIn:Ue,scrollOut:Fe,getScrollTargets:Le,toggleScrollEvents:je,supportPassive:Ie}};function He(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){for(var a=[],s="textShadow"===e?3:4,o=3===s?n[3]:n[4],u=3===s?r[3]:r[4],l=!!(n[5]&&"none"!==n[5]||r[5]&&"none"!==r[5])&&" inset",c=0;c>0)/1e3+"px");t.style[e]=l?ot(o,u,i)+a.join(" ")+l:ot(o,u,i)+a.join(" ")})}x.ScrollProperty=Ne;var De=["boxShadow","textShadow"];function Re(t,e){var n,r;for(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),r=0;r<4;r++)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].indexOf(e)>-1}))}var Be={};De.map((function(t){return Be[t]=He}));var Qe={component:"shadowProperties",properties:De,defaultValues:{boxShadow:"0px 0px 0px 0px rgb(0,0,0)",textShadow:"0px 0px 0px rgb(0,0,0)"},Interpolate:{numbers:B,colors:ot},functions:{prepareStart:function(t,e){var n=E(this.element,t);return/^none$|^initial$|^inherit$|^inset$/.test(n)?h[t]:n},prepareProperty:function(t,e){if("string"==typeof e){var n,r="none";r=/inset/.test(e)?"inset":r,n=(e=/inset/.test(e)?e.replace(/(\s+inset|inset+\s)/g,""):e).match(/(\s?(?:#(?:[\da-f]{3}){1,2}|rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))\s?)/gi),e=Re(e=e.replace(n[0],"").split(" ").concat([n[0].replace(/\s/g,"")],[r]),t)}else e instanceof Array&&(e=Re(e,t));return e},onStart:Be},Util:{processShadowArray:Re,trueColor:st}};function ze(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=Y(n.v,r.v,r.u,i)})}x.ShadowProperties=Qe;var Xe=["fontSize","lineHeight","letterSpacing","wordSpacing"],Ye={};Xe.forEach((function(t){Ye[t]=ze}));var We={component:"textProperties",category:"textProperties",properties:Xe,defaultValues:{fontSize:0,lineHeight:0,letterSpacing:0,wordSpacing:0},Interpolate:{units:Y},functions:{prepareStart:function(t){return E(this.element,t)||h[t]},prepareProperty:function(t,e){return Q(e)},onStart:Ye},Util:{trueDimension:Q}};x.TextProperties=We;var Ke=String("abcdefghijklmnopqrstuvwxyz").split(""),$e=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),Ge=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),Ze=String("0123456789").split(""),Je=Ke.concat($e,Ze),tn=Je.concat(Ge),en={alpha:Ke,upper:$e,symbols:Ge,numeric:Ze,alphanumeric:Je,all:tn},nn={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in en?en[n]:n&&n.length?n:en[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=B(e,n,r)>>0})}};function rn(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 i=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=i,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function an(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3;return r}x.TextWriteProperties=sn;var un="undefined"!=typeof DOMMatrix?DOMMatrix:"undefined"!=typeof WebKitCSSMatrix?WebKitCSSMatrix:"undefined"!=typeof CSSMatrix?CSSMatrix:"undefined"!=typeof MSCSSMatrix?MSCSSMatrix:null,ln="transformMatrix";var cn={component:ln,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={};if(this.element.transformMatrix){var r=this.element.transformMatrix;for(var i in r)n[i]=r[i]}else for(var a in e)n[a]="perspective"===a?e[a]:h.transform[a];return n},prepareProperty:function(t,e){if("object"==typeof e&&!e.length){var n,r={},i={},a={},s={},o={},u=[{translate3d:i},{rotate3d:a},{skew:o},{scale3d:s}],l=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)})),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)){(/translate/.test(t)?i:/rotate/.test(t)?a:/scale/.test(t)?s:/skew/.test(t)?o:{})[t.replace(/translate|rotate|scale|skew/,"").toLowerCase()]=/scale/.test(t)?parseFloat(e[t]):parseInt(e[t])}else"skew"===t?(n=e[t].map((function(t){return parseInt(t)||0})),r[t]=[n[0]||0,n[1]||0]):r[t]=parseInt(e[t])};for(var c in e)l(c);return u.map((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}console.error('KUTE.js - "'+e+'" is not valid/supported transform function')},onStart:{transform:function(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){var a=new un,s={};for(var o in r)s[o]="perspective"===o?B(n[o],r[o],i):on(n[o],r[o],i);s.perspective&&(a.m34=-1/s.perspective),a=s.translate3d?a.translate(s.translate3d[0],s.translate3d[1],s.translate3d[2]):a,a=s.rotate3d?a.rotate(s.rotate3d[0],s.rotate3d[1],s.rotate3d[2]):a,s.skew&&(a=s.skew[0]?a.skewX(s.skew[0]):a,a=s.skew[1]?a.skewY(s.skew[1]):a),a=s.scale3d?a.scale(s.scale3d[0],s.scale3d[1],s.scale3d[2]):a,t.style[e]=a.toString()})},CSS3Matrix:function(e){this.valuesEnd.transform&&!t[e]&&(t[e]=un)}},onComplete:function(t){if(this.valuesEnd[t])for(var e in this.element.transformMatrix={},this.valuesEnd[t])this.element.transformMatrix[e]=this.valuesEnd[t][e]},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:B,translate3d:on,rotate3d:on,skew:on,scale3d:on}};for(var pn in x.TransformMatrix=cn,x){var hn=x[pn];x[pn]=new R(hn)}return{Animation:R,Components:x,Tween:q,fromTo:function(t,e,n,r){return r=r||{},new P.tween(L(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new P.tween(L(t),e,e,n)},TweenCollection:N,ProgressBar:H,allFromTo:function(t,e,n,r){return r=r||{},new N(L(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new N(L(t,!0),e,e,n)},Objects:w,Util:b,Easing:V,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:C,Selector:L,Version:"2.0.16"}})); +// KUTE.js Extra v2.1.0 | 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={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var P={},V={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function L(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t instanceof Element}))?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}function j(){for(var t in i)if("function"==typeof i[t])i[t].call(this,t);else for(var e in i[t])i[t][e].call(this,e);T.call(this)}P.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof V[t])return V[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),V.linear};var U=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:P.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};U.prototype.start=function(e){return S(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),j.call(this),this._startFired=!0),!s&&o(),this},U.prototype.stop=function(){return this.playing&&(M(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},U.prototype.close=function(){for(var t in m)for(var e in m[t])m[t][e].call(this,e);this._startFired=!1,u.call(this)},U.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},U.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},U.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return 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)},P.tween=U,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var F=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(I.call(this,i,"end"),this._resetStart?this.valuesStart=r:I.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,A.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.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),j.call(this),this._startTime+=t.Time()-this._pauseTime,S(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(M(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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.map((function(t){return t.start()})),!1))},n}(U);P.tween=F;var q=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.to=function(t,e){},e.prototype.fromTo=function(t,e){},e.prototype.getTotalDuration=function(){},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}(F);P.tween=q;var N=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new P.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};N.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),this},N.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},N.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},N.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},N.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof N)e.chain(t.tweens);else{if(!(t instanceof P.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},N.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},N.prototype.removeTweens=function(){this.tweens=[]},N.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,e){if(this.element=L(t),this.element.tween=e,this.element.tween.toolbar=this.element,this.element.toolbar=this,this.element.output=this.element.parentNode.getElementsByTagName("OUTPUT")[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 P.tween))throw TypeError("tween parameter is not ["+P.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)};H.prototype.updateBar=function(){var e=this.toolbar.output,n=this.paused?this.toolbar.value:(t.Time()-this._startTime)/this._duration;n=n>.9999?1:n<.01?0:n;var r=this._reversed?1-n:n;this.toolbar.value=r,e&&(e.value=(100*r).toFixed(2)+"%")},H.prototype.toggleEvents=function(t){this.element[t+"EventListener"]("mousemove",this.moveAction,!1),this.element[t+"EventListener"]("mouseup",this.upAction,!1)},H.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)},H.prototype.moveAction=function(){this.toolbar.updateTween.call(this)},H.prototype.downAction=function(){this.tween.playing||this.tween.start(),this.tween.paused||(this.tween.pause(),this.toolbar.toggleEvents("add"),t.Tick=cancelAnimationFrame(t.Ticker))},H.prototype.upAction=function(){this.tween.paused&&(this.tween.paused&&this.tween.resume(),this.tween._startTime=t.Time()-(this.tween._reversed?1-this.value:this.value)*this.tween._duration,this.toolbar.toggleEvents("remove"),t.Tick=requestAnimationFrame(t.Ticker))};var D=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};D.prototype.setComponent=function(t){var e=this,n=t.component,a={prepareProperty:d,prepareStart:v,onStart:i,onComplete:m,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[o]=t.defaultValue,e.supports=o+" property";else if(t.defaultValues){for(var l in t.defaultValues)h[l]=t.defaultValues[l];e.supports=(u||o)+" "+(o||s)+" properties"}if(t.defaultOptions)for(var c in t.defaultOptions)f[c]=t.defaultOptions[c];if(t.functions)for(var w in a)if(w in t.functions)if("function"==typeof t.functions[w])!a[w][n]&&(a[w][n]={}),!a[w][n][s||o]&&(a[w][n][s||o]=t.functions[w]);else for(var x in t.functions[w])!a[w][n]&&(a[w][n]={}),!a[w][n][x]&&(a[w][n][x]=t.functions[w][x]);if(t.Interpolate){for(var S in t.Interpolate){var M=t.Interpolate[S];if("function"!=typeof M||r[S])for(var T in M)"function"!=typeof M[T]||r[S]||(r[S]=M[T]);else r[S]=M}y[n]=t.Interpolate}if(t.Util)for(var C in t.Util)!b[C]&&(b[C]=t.Util[C]);return e};var R=function(t){function e(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];t.apply(this,e)}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,a={prepareProperty:d,prepareStart:v,onStart:i,onComplete:m,crossCheck:g},s=e.category,o=e.property,u=e.properties&&e.properties.length||e.subProperties&&e.subProperties.length;if("defaultValue"in e?(n.supports=o+" property",n.defaultValue=(e.defaultValue+"").length?"YES":"not set or incorrect"):e.defaultValues&&(n.supports=(u||o)+" "+(o||s)+" properties",n.defaultValues=Object.keys(e.defaultValues).length===u?"YES":"Not set or incomplete"),e.defaultOptions){for(var l in n.extends=[],e.defaultOptions)n.extends.push(l);n.extends.length?n.extends="with <"+n.extends.join(", ")+"> new option(s)":delete n.extends}if(e.functions){for(var c in n.interface=[],n.render=[],n.warning=[],a)c in e.functions?("prepareProperty"===c&&n.interface.push("fromTo()"),"prepareStart"===c&&n.interface.push("to()"),"onStart"===c&&(n.render="can render update")):("prepareProperty"===c&&n.warning.push("fromTo()"),"prepareStart"===c&&n.warning.push("to()"),"onStart"===c&&(n.render="no function to render update"));n.interface.length?n.interface=(s||o)+" can use ["+n.interface.join(", ")+"] method(s)":delete n.uses,n.warning.length?n.warning=(s||o)+" can't use ["+n.warning.join(", ")+"] method(s) because values aren't processed":delete n.warning}if(e.Interpolate){for(var p in n.uses=[],n.adds=[],e.Interpolate){var h=e.Interpolate[p];if("function"==typeof h)r[p]||n.adds.push(""+p),n.uses.push(""+p);else for(var f in h)"function"!=typeof h[f]||r[p]||n.adds.push(""+f),n.uses.push(""+f)}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}else n.critical="For "+(o||s)+" no interpolation function[s] is set";return e.Util&&(n.hasUtil=Object.keys(e.Util).join(",")),n},e}(D);function B(t,e,n){return(t=+t)+(e-=t)*n}function Q(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a>0)/100+"% "+(100*B(n[1],r[1],i)>>0)/100+"%"})}},X={component:"backgroundPositionProp",property:"backgroundPosition",defaultValue:[50,50],Interpolate:{numbers:B},functions:z,Util:{trueDimension:Q}};function Y(t,e,n,r){return(t=+t)+(e-=t)*r+n}function W(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=Y(n.v,r.v,r.u,i)})}x.BackgroundPosition=X;var K=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],$={};K.map((function(t){return $[t]=0}));var G={};K.forEach((function(t){G[t]=W}));var Z={component:"borderRadiusProperties",category:"borderRadius",properties:K,defaultValues:$,Interpolate:{units:Y},functions:{prepareStart:function(t){return E(this.element,t)||h[t]},prepareProperty:function(t,e){return Q(e)},onStart:G},Util:{trueDimension:Q}};function J(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(i>.99||i<.01?(10*B(n,r,i)>>0)/10:B(n,r,i)>>0)+"px"})}x.BorderRadiusProperties=Z;var tt=["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"],et={};tt.map((function(t){return et[t]=0}));var nt={};tt.map((function(t){return nt[t]=J}));var rt={component:"boxModelProperties",category:"boxModel",properties:tt,defaultValues:et,Interpolate:{numbers:B},functions:{prepareStart:function(t){return E(this.element,t)||h[t]},prepareProperty:function(t,e){var n=Q(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:nt}};x.BoxModelProperties=rt;var it={prepareStart:function(t,e){var n=E(this.element,t),r=E(this.element,"width"),i=E(this.element,"height");return/rect/.test(n)?n:[0,r,i,0]},prepareProperty:function(t,e){if(e instanceof Array)return[Q(e[0]),Q(e[1]),Q(e[2]),Q(e[3])];var n=e.replace(/rect|\(|\)/g,"");return[Q((n=/\,/g.test(n)?n.split(/\,/g):n.split(/\s/g))[0]),Q(n[1]),Q(n[2]),Q(n[3])]},onStart:function(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,e,n,r){for(var i=0,a=[];i<4;i++){var s=e[i].v,o=n[i].v,u=n[i].u||"px";a[i]=(100*B(s,o,r)>>0)/100+u}t.style.clip="rect("+a+")"})}},at={component:"clipProperty",property:"clip",defaultValue:[0,0,0,0],Interpolate:{numbers:B},functions:it,Util:{trueDimension:Q}};function st(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function ot(t,e,n){var r,i={},a=",";for(r in e)i[r]="a"!==r?B(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*B(t[r],e[r],n)>>0)/100:null;return i.a?"rgba("+i.r+a+i.g+a+i.b+a+i.a+")":"rgb("+i.r+a+i.g+a+i.b+")"}function ut(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=ot(n,r,i)})}x.ClipProperty=at;var lt=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],ct={};lt.map((function(t){ct[t]="#000"}));var pt={};lt.map((function(t){return pt[t]=ut}));var ht={component:"colorProperties",category:"colors",properties:lt,defaultValues:ct,Interpolate:{numbers:B,colors:ot},functions:{prepareStart:function(t,e){return E(this.element,t)||h[t]},prepareProperty:function(t,e){return st(e)},onStart:pt},Util:{trueColor:st}};function ft(t,e,n){for(var r=[],i=0;i<3;i++)r[i]=(100*B(t[i],e[i],n)>>0)/100+"px";return"drop-shadow("+r.concat(ot(t[3],e[3],n)).join(" ")+")"}function dt(t){return t.replace("-r","R").replace("-s","S")}function vt(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++)e[n]=parseFloat(e[n]);return e[3]=st(e[3]),e}function gt(t){var e={},n=t.match(/(([a-z].*?)\(.*?\))(?=\s([a-z].*?)\(.*?\)|\s*$)/g),r="none"!==t?n:"none";if(r instanceof Array)for(var i=0,a=r.length;i>0)/100+"%)":"")+(n.blur||r.blur?"blur("+(100*B(n.blur,r.blur,i)>>0)/100+"em)":"")+(n.saturate||r.saturate?"saturate("+(100*B(n.saturate,r.saturate,i)>>0)/100+"%)":"")+(n.invert||r.invert?"invert("+(100*B(n.invert,r.invert,i)>>0)/100+"%)":"")+(n.grayscale||r.grayscale?"grayscale("+(100*B(n.grayscale,r.grayscale,i)>>0)/100+"%)":"")+(n.hueRotate||r.hueRotate?"hue-rotate("+(100*B(n.hueRotate,r.hueRotate,i)>>0)/100+"deg)":"")+(n.sepia||r.sepia?"sepia("+(100*B(n.sepia,r.sepia,i)>>0)/100+"%)":"")+(n.brightness||r.brightness?"brightness("+(100*B(n.brightness,r.brightness,i)>>0)/100+"%)":"")+(n.contrast||r.contrast?"contrast("+(100*B(n.contrast,r.contrast,i)>>0)/100+"%)":"")+(n.dropShadow||r.dropShadow?ft(n.dropShadow,r.dropShadow,i):"")})},crossCheck:function(t){if(this.valuesEnd[t])for(var e in this.valuesStart[t])this.valuesEnd[t][e]||(this.valuesEnd[t][e]=this.valuesStart[t][e])}},yt={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:B,blur:B,saturate:B,grayscale:B,brightness:B,contrast:B,sepia:B,invert:B,hueRotate:B,dropShadow:{numbers:B,colors:ot,dropShadow:ft}},functions:mt,Util:{parseDropShadow:vt,parseFilterString:gt,replaceDashNamespace:dt,trueColor:st}};x.FilterEffects=yt;var wt={},bt="htmlAttributes",xt=["fill","stroke","stop-color"];function St(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var Mt={prepareStart:function(t,e){var n={};for(var r in e){var i=St(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=xt.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=St(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(xt.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in wt)&&(wt[e]=function(t,e,n,r,i){t.setAttribute(e,ot(n,r,i))})},n[a]=st(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=Q(o).u||Q(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in wt)&&(wt[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*B(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=Q(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in wt)&&(wt[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*B(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=wt)}}},Tt={component:bt,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:B,colors:ot},functions:Mt,Util:{replaceUppercase:St,trueColor:st,trueDimension:Q}};x.HTMLAttributes=Tt;var Ct={prepareStart:function(t){return E(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*B(n,r,i)>>0)/1e3})}},_t={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:B},functions:Ct};function Et(t,e){return parseFloat(t)/100*e}function It(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function At(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a-1?At(t):"line"===t.tagName?kt(t):void 0}function Lt(t,e){var n,r,i,a,s=/path|glyph/.test(t.tagName)?t.getTotalLength():Vt(t);return e instanceof Object?e:("string"==typeof e?(e=e.split(/\,|\s/),n=/%/.test(e[0])?Et(e[0].trim(),s):parseFloat(e[0]),r=/%/.test(e[1])?Et(e[1].trim(),s):parseFloat(e[1])):void 0===e&&(a=parseFloat(E(t,"stroke-dashoffset")),i=E(t,"stroke-dasharray").split(/\,/),n=0-a,r=parseFloat(i[0])+n||s),{s:n,e:r,l:s})}x.OpacityProperty=_t;var jt={prepareStart:function(){return Lt(this.element)},prepareProperty:function(t,e){return Lt(this.element,e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){var i=(100*e.l>>0)/100,a=0-(100*B(e.s,n.s,r)>>0)/100,s=(100*B(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"})}},Ut={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:B},functions:jt,Util:{getRectLength:It,getPolyLength:At,getLineLength:kt,getCircleLength:Ot,getEllipseLength:Pt,getTotalLength:Vt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Lt,percent:Et}};function Ft(t){return t.map((function(t){return t[0].concat(t.slice(1).join(" "))})).join("")}function qt(t){return t.map((function(t){return Array.isArray(t)?qt(t):isNaN(+t)?t:+t}))}x.SVGDraw=Ut;var Nt=3;function Ht(t,e){var n=isNaN(+e)?Nt:+e;return n?t.map((function(t){return t.map((function(t,e){var r=+t,i=Math.pow(10,n);return r?r%1==0?r:Math.round(r*i)/i: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 Rt(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 Bt="Invalid path value";function Qt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=Bt+": invalid Arc flag "+e)}function zt(t){return t>=48&&t<=57}function Xt(t){var e,n=t.index,r=n,i=t.max,a=!1,s=!1,o=!1,u=!1;if(r>=i)t.err=Bt+": missing param "+t.pathValue[r];else if(43!==(e=t.pathValue.charCodeAt(r))&&45!==e||(e=++r=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index++;var e}function Wt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Kt(t){var e,n,r,i,a=t.max;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}return!1}(e=t.pathValue.charCodeAt(t.index)))if(r=Dt[t.pathValue[t.index].toLowerCase()],t.index++,Yt(t),t.data=[],r){for(n=!1;;){for(i=r;i>0;i--){if(97!=(32|e)||3!==i&&4!==i?Xt(t):Qt(t),t.err.length)return;t.data.push(t.param),Yt(t),n=!1,t.index=t.max)break;if(!Wt(t.pathValue.charCodeAt(t.index)))break}}Rt(t)}else Rt(t);else t.err=Bt+": "+t.pathValue[t.index]+" not a path command"}function $t(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 Gt(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 Zt(t,e){if(Gt(t))return qt(t);var n=new $t(t);for(Yt(n);n.index7){t[n].shift();for(var r=t[n];r.length;)e[n]="A",t.splice(n++,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function ee(t,e,n){var r,i;switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"H":return["L",t[1],e.y1];case"V":return["L",e.x1,t[1]];case"S":return i=function(t,e,n,r,i){return"CS".indexOf(i)>-1?{x1:2*t-n,y1:2*e-r}:{x1:t,y1:e}}(e.x1,e.y1,e.x2,e.y2,n),e.x1=i.x1,e.y1=i.y1,["C",i.x1,i.y1].concat(t.slice(1));case"T":return r=function(t,e,n,r,i){return"QT".indexOf(i)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),e.qx=r.qx,e.qy=r.qy,["Q",e.qx,e.qy].concat(t.slice(1));case"Q":e.qx=t[1],e.qy=t[2]}return t}function ne(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,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o="",u=(t=Jt(t)).length,l=0;l1&&(n*=b=Math.sqrt(b),r*=b);var x=n*n,S=r*r,M=(a==s?-1:1)*Math.sqrt(Math.abs((x*S-x*w*w-S*y*y)/(x*w*w+S*y*y)));f=M*n*w/r+(t+o)/2,d=M*-r*y/n+(e+u)/2,p=Math.asin(((e-d)/r).toFixed(9)),h=Math.asin(((u-d)/r).toFixed(9)),p=th&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var T=h-p;if(Math.abs(T)>v){var C=h,_=o,E=u;h=p+v*(s&&h>p?1:-1),o=f+n*Math.cos(h),u=d+r*Math.sin(h),m=ie(o,u,n,r,i,0,s,_,E,[h,C,f,d])}T=h-p;var I=Math.cos(p),A=Math.sin(p),k=Math.cos(h),O=Math.sin(h),P=Math.tan(T/4),V=4/3*n*P,L=4/3*r*P,j=[t,e],U=[t+V*A,e-L*I],F=[o+V*O,u-L*k],q=[o,u];return U[0]=2*j[0]-U[0],U[1]=2*j[1]-U[1],l?[U,F,q].concat(m):(m=[U,F,q].concat(m).join().split(",")).map((function(t,e){return e%2?re(m[e-1],t,g).y:re(t,m[e+1],g).x}))}function ae(t,e,n,r,i,a){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*i+o*n,s*a+o*r,i,a]}function se(t,e,n,r,i,a,s,o,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*u*u*i+Math.pow(u,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*u*u*a+Math.pow(u,3)*o}}function oe(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ue(t,e,n,r){var i=.5,a=[t,e],s=[n,r],o=oe(a,s,i),u=oe(s,o,i),l=oe(o,u,i),c=oe(u,l,i),p=oe(l,c,i),h=se.apply(0,a.concat(o,l,p,i)),f=se.apply(0,p.concat(c,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function le(t,e){switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"M":return e.x=t[1],e.y=t[2],t;case"A":return["C"].concat(ie.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(ae.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ue(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ue(e.x1,e.y1,e.x,e.y))}return t}function ce(t,e){if(function(t){return Gt(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return qt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o=(t=ne(t)).length,u=0;u=0}function de(t,e){e=e||.5;var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),s=oe(n,r,e),o=oe(r,i,e),u=oe(i,a,e),l=oe(s,o,e),c=oe(o,u,e),p=oe(l,c,e);return[["C"].concat(s,l,p),["C"].concat(c,u,a)]}function ve(t,e,n,r,i){return i*(i*(-3*t+9*e-9*n+3*r)+6*t-12*e+6*n)-3*t+3*e}function ge(t,e,n,r,i,a,s,o,u){(null===u||isNaN(+u))&&(u=1);var l=(u=u>1?1:u<0?0:u)/2,c=0,p=0,h=0,f=0,d=[.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].map((function(u,v){p=ve(t,n,i,s,c=l*u+l),h=ve(e,r,a,o,c),f+=d[v]*Math.sqrt(p*p+h*h)})),l*f}function me(t){return ce((e=Ft(Jt(t)),Ft(Jt(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)),i=e?ge.apply(0,r):0;return{s:t,ss:e?i?de(r):[t,t]:[t],l:i}}));var e}function ye(t,e,n){var r=me(t),i=me(e),a=r.length,s=i.length,o=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/o||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,p=n||Math.max(a,s),h=[l,c],f=[p-a,p-s],d=0,v=[r,i].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:ye(v[0],v[1],p)}function we(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var s,o=i+a;return 0===a||t[o]&&"M"===t[o][0]?(s=t[o],["M"].concat(s.slice(-2))):(o>=e&&(o-=n),t[o])}))}))}function be(t,e){var n=t.length-1,r=[],i=0,a=we(t);return a.map((function(a,s){t.slice(1).map((function(r,a){i+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(s+a)%n].slice(-2),e[a%n].slice(-2))})),r[s]=i,i=0})),a[r.indexOf(Math.min.apply(null,r))]}var xe={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof SVGElement?e:/^\.|^\#/.test(e)?L(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.curve?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):r||"string"!=typeof e||(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){for(var i=[],a=e.curve,s=n.curve,o=0,u=s.length;o>0)/1e3)}t.setAttribute("d",1===r?n.original:Ft(i))})},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=ye(this.valuesStart[t].original,this.valuesEnd[t].original),i=fe(r[0])!==fe(r[1])?pe(r[0]):qt(r[0]);this.valuesStart[t].curve=i,this.valuesEnd[t].curve=be(r[1],i)}}}},Se={component:"svgCubicMorph",property:"path",defaultValue:[],Interpolate:{numbers:B,pathToString:Ft},functions:xe,Util:{pathToCurve:ce,pathToAbsolute:Jt,pathToString:Ft,parsePathString:Zt,getRotatedCurve:be,getRotations:we,equalizeSegments:ye,reverseCurve:pe,clonePath:qt,getDrawDirection:fe,splitCubic:de,getCurveArray:me}};function Me(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=t&&/\)/.test(t)?t.substring(0,t.length-1).split(/\)\s|\)/):"none",n={};if(e instanceof Array)for(var r=0,i=e.length;r>0)/1e3+(s?","+(1e3*s>>0)/1e3:"")+")":"")+(l?"rotate("+(1e3*l>>0)/1e3+")":"")+(h?"skewX("+(1e3*h>>0)/1e3+")":"")+(f?"skewY("+(1e3*f>>0)/1e3+")":"")+(1!==u?"scale("+(1e3*u>>0)/1e3+")":""))})},crossCheck:function(t){if(this._resetStart&&this.valuesEnd[t]){var e=this.valuesStart[t],n=this.valuesEnd[t],r=Ce.call(this,t,Te(this.element.getAttribute("transform")));for(var i in r)e[i]=r[i];var a=this.element.ownerSVGElement,s=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]));for(var o in e.translate=[s.matrix.e,s.matrix.f],e)o in n&&"origin"!==o||(n[o]=e[o])}}},Ee={component:"svgTransformProperty",property:"svgTransform",defaultOptions:{transformOrigin:"50% 50%"},defaultValue:{translate:0,rotate:0,skewX:0,skewY:0,scale:1},Interpolate:{numbers:B},functions:_e,Util:{parseStringOrigin:Me,parseTransformString:Te,parseTransformSVG:Ce}};x.SVGTransformProperty=Ee;var Ie=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});document.addEventListener("DOMContentLoaded",(function t(){document.removeEventListener("DOMContentLoaded",t,e)}),e)}catch(t){}return t}(),Ae="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],ke="ontouchstart"in window||navigator.msMaxTouchPoints||!1?"touchstart":"mousewheel",Oe=navigator&&/(EDGE|Mac)/i.test(navigator.userAgent)?document.body:document.documentElement,Pe=!!Ie&&{passive:!1};function Ve(t){this.scrolling&&t.preventDefault()}function Le(){var t=this.element;return t===Oe?{el:document,st:document.body}:{el:t,st:t}}function je(t,e){e[t](Ae[0],Ve,Pe),e[t](ke,Ve,Pe)}function Ue(){var t=Le.call(this);"scroll"in this.valuesEnd&&!t.el.scrolling&&(t.el.scrolling=1,je("addEventListener",t.el),t.st.style.pointerEvents="none")}function Fe(){var t=Le.call(this);"scroll"in this.valuesEnd&&t.el.scrolling&&(t.el.scrolling=0,je("removeEventListener",t.el),t.st.style.pointerEvents="")}var qe={prepareStart:function(){return this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Oe,this.element===Oe?window.pageYOffset||Oe.scrollTop:this.element.scrollTop},prepareProperty:function(t,e){return parseInt(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(this.element=!("scroll"in this.valuesEnd)||this.element&&this.element!==window?this.element:Oe,Ue.call(this),t[e]=function(t,e,n,r){t.scrollTop=B(e,n,r)>>0})},onComplete:function(t){Fe.call(this)}},Ne={component:"scrollProperty",property:"scroll",defaultValue:0,Interpolate:{numbers:B},functions:qe,Util:{preventScroll:Ve,scrollIn:Ue,scrollOut:Fe,getScrollTargets:Le,toggleScrollEvents:je,supportPassive:Ie}};function He(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){for(var a=[],s="textShadow"===e?3:4,o=3===s?n[3]:n[4],u=3===s?r[3]:r[4],l=!!(n[5]&&"none"!==n[5]||r[5]&&"none"!==r[5])&&" inset",c=0;c>0)/1e3+"px");t.style[e]=l?ot(o,u,i)+a.join(" ")+l:ot(o,u,i)+a.join(" ")})}x.ScrollProperty=Ne;var De=["boxShadow","textShadow"];function Re(t,e){var n,r;for(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),r=0;r<4;r++)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].indexOf(e)>-1}))}var Be={};De.map((function(t){return Be[t]=He}));var Qe={component:"shadowProperties",properties:De,defaultValues:{boxShadow:"0px 0px 0px 0px rgb(0,0,0)",textShadow:"0px 0px 0px rgb(0,0,0)"},Interpolate:{numbers:B,colors:ot},functions:{prepareStart:function(t,e){var n=E(this.element,t);return/^none$|^initial$|^inherit$|^inset$/.test(n)?h[t]:n},prepareProperty:function(t,e){if("string"==typeof e){var n,r="none";r=/inset/.test(e)?"inset":r,n=(e=/inset/.test(e)?e.replace(/(\s+inset|inset+\s)/g,""):e).match(/(\s?(?:#(?:[\da-f]{3}){1,2}|rgba?\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))\s?)/gi),e=Re(e=e.replace(n[0],"").split(" ").concat([n[0].replace(/\s/g,"")],[r]),t)}else e instanceof Array&&(e=Re(e,t));return e},onStart:Be},Util:{processShadowArray:Re,trueColor:st}};function ze(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=Y(n.v,r.v,r.u,i)})}x.ShadowProperties=Qe;var Xe=["fontSize","lineHeight","letterSpacing","wordSpacing"],Ye={};Xe.forEach((function(t){Ye[t]=ze}));var We={component:"textProperties",category:"textProperties",properties:Xe,defaultValues:{fontSize:0,lineHeight:0,letterSpacing:0,wordSpacing:0},Interpolate:{units:Y},functions:{prepareStart:function(t){return E(this.element,t)||h[t]},prepareProperty:function(t,e){return Q(e)},onStart:Ye},Util:{trueDimension:Q}};x.TextProperties=We;var Ke=String("abcdefghijklmnopqrstuvwxyz").split(""),$e=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),Ge=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),Ze=String("0123456789").split(""),Je=Ke.concat($e,Ze),tn=Je.concat(Ge),en={alpha:Ke,upper:$e,symbols:Ge,numeric:Ze,alphanumeric:Je,all:tn},nn={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in en?en[n]:n&&n.length?n:en[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=B(e,n,r)>>0})}};function rn(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 i=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=i,t.appendChild(n),t.innerHTML=n.outerHTML}else t.children.length&&t.children[0].className===e&&(n=t.children[0]);return n}function an(t,e){var n=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3;return r}x.TextWriteProperties=sn;var un="undefined"!=typeof DOMMatrix?DOMMatrix:"undefined"!=typeof WebKitCSSMatrix?WebKitCSSMatrix:"undefined"!=typeof CSSMatrix?CSSMatrix:"undefined"!=typeof MSCSSMatrix?MSCSSMatrix:null,ln="transformMatrix";var cn={component:ln,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={};if(this.element.transformMatrix){var r=this.element.transformMatrix;for(var i in r)n[i]=r[i]}else for(var a in e)n[a]="perspective"===a?e[a]:h.transform[a];return n},prepareProperty:function(t,e){if("object"==typeof e&&!e.length){var n,r={},i={},a={},s={},o={},u=[{translate3d:i},{rotate3d:a},{skew:o},{scale3d:s}],l=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)})),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)){(/translate/.test(t)?i:/rotate/.test(t)?a:/scale/.test(t)?s:/skew/.test(t)?o:{})[t.replace(/translate|rotate|scale|skew/,"").toLowerCase()]=/scale/.test(t)?parseFloat(e[t]):parseInt(e[t])}else"skew"===t?(n=e[t].map((function(t){return parseInt(t)||0})),r[t]=[n[0]||0,n[1]||0]):r[t]=parseInt(e[t])};for(var c in e)l(c);return u.map((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}console.error('KUTE.js - "'+e+'" is not valid/supported transform function')},onStart:{transform:function(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){var a=new un,s={};for(var o in r)s[o]="perspective"===o?B(n[o],r[o],i):on(n[o],r[o],i);s.perspective&&(a.m34=-1/s.perspective),a=s.translate3d?a.translate(s.translate3d[0],s.translate3d[1],s.translate3d[2]):a,a=s.rotate3d?a.rotate(s.rotate3d[0],s.rotate3d[1],s.rotate3d[2]):a,s.skew&&(a=s.skew[0]?a.skewX(s.skew[0]):a,a=s.skew[1]?a.skewY(s.skew[1]):a),a=s.scale3d?a.scale(s.scale3d[0],s.scale3d[1],s.scale3d[2]):a,t.style[e]=a.toString()})},CSS3Matrix:function(e){this.valuesEnd.transform&&!t[e]&&(t[e]=un)}},onComplete:function(t){if(this.valuesEnd[t])for(var e in this.element.transformMatrix={},this.valuesEnd[t])this.element.transformMatrix[e]=this.valuesEnd[t][e]},crossCheck:function(t){this.valuesEnd[t]&&this.valuesEnd[t].perspective&&!this.valuesStart[t].perspective&&(this.valuesStart[t].perspective=this.valuesEnd[t].perspective)}},Interpolate:{perspective:B,translate3d:on,rotate3d:on,skew:on,scale3d:on}};for(var pn in x.TransformMatrix=cn,x){var hn=x[pn];x[pn]=new R(hn)}return{Animation:R,Components:x,Tween:q,fromTo:function(t,e,n,r){return r=r||{},new P.tween(L(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new P.tween(L(t),e,e,n)},TweenCollection:N,ProgressBar:H,allFromTo:function(t,e,n,r){return r=r||{},new N(L(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new N(L(t,!0),e,e,n)},Objects:w,Util:b,Easing:V,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:C,Selector:L,Version:"2.1.0"}})); diff --git a/demo/src/kute.min.js b/demo/src/kute.min.js index e849259..ca37b63 100644 --- a/demo/src/kute.min.js +++ b/demo/src/kute.min.js @@ -1,2 +1,2 @@ -// KUTE.js Standard v2.0.16 | thednp © 2020 | 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={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function V(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t instanceof Element}))?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}function q(){for(var t in i)if("function"==typeof i[t])i[t].call(this,t);else for(var e in i[t])i[t][e].call(this,e);C.call(this)}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),P.linear};var N=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};N.prototype.start=function(e){return M(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),q.call(this),this._startFired=!0),!s&&o(),this},N.prototype.stop=function(){return this.playing&&(_(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},N.prototype.close=function(){for(var t in y)for(var e in y[t])y[t][e].call(this,e);this._startFired=!1,u.call(this)},N.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},N.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},N.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return 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)},L.tween=N,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var j=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,E.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.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),q.call(this),this._startTime+=t.Time()-this._pauseTime,M(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(_(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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.map((function(t){return t.start()})),!1))},n}(N);L.tween=j;var H=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};H.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),this},H.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},H.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},H.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},H.prototype.chain=function(t){var 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},H.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},H.prototype.removeTweens=function(){this.tweens=[]},H.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 F=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function U(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*Q(n,r,i)>>0)/10:Q(n,r,i)>>0)+"px"})}F.prototype.setComponent=function(t){var e=this,n=t.component,a={prepareProperty:d,prepareStart:v,onStart:i,onComplete:y,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[o]=t.defaultValue,e.supports=o+" property";else if(t.defaultValues){for(var l in t.defaultValues)h[l]=t.defaultValues[l];e.supports=(u||o)+" "+(o||s)+" properties"}if(t.defaultOptions)for(var c in t.defaultOptions)f[c]=t.defaultOptions[c];if(t.functions)for(var x in a)if(x in t.functions)if("function"==typeof t.functions[x])!a[x][n]&&(a[x][n]={}),!a[x][n][s||o]&&(a[x][n][s||o]=t.functions[x]);else for(var w in t.functions[x])!a[x][n]&&(a[x][n]={}),!a[x][n][w]&&(a[x][n][w]=t.functions[x][w]);if(t.Interpolate){for(var M in t.Interpolate){var _=t.Interpolate[M];if("function"!=typeof _||r[M])for(var C in _)"function"!=typeof _[C]||r[M]||(r[M]=_[C]);else r[M]=_}m[n]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return e};var R=["top","left","width","height"],X={};R.map((function(t){return X[t]=D}));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 I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=U(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:U}};function Z(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function z(t,e,n){var r,i={},a=",";for(r in e)i[r]="a"!==r?Q(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*Q(t[r],e[r],n)>>0)/100:null;return i.a?"rgba("+i.r+a+i.g+a+i.b+a+i.a+")":"rgb("+i.r+a+i.g+a+i.b+")"}function Y(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=z(n,r,i)})}w.BoxModelEssential=B;var K=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],$={};K.map((function(t){$[t]="#000"}));var W={};K.map((function(t){return W[t]=Y}));var G={component:"colorProperties",category:"colors",properties:K,defaultValues:$,Interpolate:{numbers:Q,colors:z},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return Z(e)},onStart:W},Util:{trueColor:Z}};w.ColorProperties=G;var J={},tt="htmlAttributes",et=["fill","stroke","stop-color"];function nt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var rt={prepareStart:function(t,e){var n={};for(var r in e){var i=nt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=et.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=nt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(et.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){t.setAttribute(e,z(n,r,i))})},n[a]=Z(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=U(o).u||U(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*Q(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=U(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*Q(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=J)}}},it={component:tt,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:rt,Util:{replaceUppercase:nt,trueColor:Z,trueDimension:U}};w.HTMLAttributes=it;var at={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*Q(n,r,i)>>0)/1e3})}},st={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at};w.OpacityProperty=st;var ot=String("abcdefghijklmnopqrstuvwxyz").split(""),ut=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),lt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ct=String("0123456789").split(""),pt=ot.concat(ut,ct),ht=pt.concat(lt),ft={alpha:ot,upper:ut,symbols:lt,numeric:ct,alphanumeric:pt,all:ht},dt={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in ft?ft[n]:n&&n.length?n:ft[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function vt(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 i=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=i,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=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function xt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function bt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=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 Mt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}w.TextWriteProperties=yt;var _t={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,e){var n=S(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?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(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},d=0;d>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:Mt}};function Ct(t,e){return parseFloat(t)/100*e}function Tt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function St(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a-1?St(t):"line"===t.tagName?It(t):void 0}function Ot(t,e){var n,r,i,a,s=/path|glyph/.test(t.tagName)?t.getTotalLength():kt(t);return e instanceof Object?e:("string"==typeof e?(e=e.split(/\,|\s/),n=/%/.test(e[0])?Ct(e[0].trim(),s):parseFloat(e[0]),r=/%/.test(e[1])?Ct(e[1].trim(),s):parseFloat(e[1])):void 0===e&&(a=parseFloat(I(t,"stroke-dashoffset")),i=I(t,"stroke-dasharray").split(/\,/),n=0-a,r=parseFloat(i[0])+n||s),{s:n,e:r,l:s})}w.TransformFunctions=_t;var Lt={prepareStart:function(){return Ot(this.element)},prepareProperty:function(t,e){return Ot(this.element,e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){var i=(100*e.l>>0)/100,a=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"})}},Pt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:Lt,Util:{getRectLength:Tt,getPolyLength:St,getLineLength:It,getCircleLength:At,getEllipseLength:Et,getTotalLength:kt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Ot,percent:Ct}};function Vt(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}w.SVGDraw=Pt;var qt=3;function Nt(t){return t.map((function(t){return Array.isArray(t)?Nt(t):isNaN(+t)?t:+t}))}function jt(t,e){var n=isNaN(+e)?qt:+e;return n?t.map((function(t){return t.map((function(t,e){var r=+t,i=Math.pow(10,n);return r?r%1==0?r:Math.round(r*i)/i:t}))})):Nt(t)}function Ht(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n];r.length;)e[n]="A",t.splice(n++,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Ft={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ut(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Qt(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>=Ft[n]&&(t.segments.push([e].concat(r.splice(0,Ft[n]))),Ft[n]););}var Dt="Invalid path value";function Rt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=Dt+": invalid Arc flag "+e)}function Xt(t){return t>=48&&t<=57}function Bt(t){var e,n=t.index,r=n,i=t.max,a=!1,s=!1,o=!1,u=!1;if(r>=i)t.err=Dt+": missing param "+t.pathValue[r];else if(43!==(e=t.pathValue.charCodeAt(r))&&45!==e||(e=++r=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index++;var e}function zt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Yt(t){var e,n,r,i,a=t.max;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}return!1}(e=t.pathValue.charCodeAt(t.index)))if(r=Ft[t.pathValue[t.index].toLowerCase()],t.index++,Zt(t),t.data=[],r){for(n=!1;;){for(i=r;i>0;i--){if(97!=(32|e)||3!==i&&4!==i?Bt(t):Rt(t),t.err.length)return;t.data.push(t.param),Zt(t),n=!1,t.index=t.max)break;if(!zt(t.pathValue.charCodeAt(t.index)))break}}Qt(t)}else Qt(t);else t.err=Dt+": "+t.pathValue[t.index]+" not a path command"}function Kt(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 $t(t,e){if(Ut(n=t)&&n.every((function(t){return t[0]===t[0].toUpperCase()})))return Nt(t);var n;t=function(t,e){if(Ut(t))return Nt(t);var n=new Kt(t);for(Zt(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=i.x1,e.y1=i.y1,["C",i.x1,i.y1].concat(t.slice(1));case"T":return r=function(t,e,n,r,i){return"QT".indexOf(i)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),e.qx=r.qx,e.qy=r.qy,["Q",e.qx,e.qy].concat(t.slice(1));case"Q":e.qx=t[1],e.qy=t[2]}return t}function Gt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Nt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o="",u=(t=$t(t)).length,l=0;l1&&(n*=b=Math.sqrt(b),r*=b);var w=n*n,M=r*r,_=(a==s?-1:1)*Math.sqrt(Math.abs((w*M-w*x*x-M*m*m)/(w*x*x+M*m*m)));f=_*n*x/r+(t+o)/2,d=_*-r*m/n+(e+u)/2,p=Math.asin(((e-d)/r).toFixed(9)),h=Math.asin(((u-d)/r).toFixed(9)),p=th&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var C=h-p;if(Math.abs(C)>v){var T=h,S=o,I=u;h=p+v*(s&&h>p?1:-1),o=f+n*Math.cos(h),u=d+r*Math.sin(h),y=te(o,u,n,r,i,0,s,S,I,[h,T,f,d])}C=h-p;var A=Math.cos(p),E=Math.sin(p),k=Math.cos(h),O=Math.sin(h),L=Math.tan(C/4),P=4/3*n*L,V=4/3*r*L,q=[t,e],N=[t+P*E,e-V*A],j=[o+P*O,u-V*k],H=[o,u];return N[0]=2*q[0]-N[0],N[1]=2*q[1]-N[1],l?[N,j,H].concat(y):(y=[N,j,H].concat(y).join().split(",")).map((function(t,e){return e%2?Jt(y[e-1],t,g).y:Jt(t,y[e+1],g).x}))}function ee(t,e,n,r,i,a){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*i+o*n,s*a+o*r,i,a]}function ne(t,e,n,r,i,a,s,o,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*u*u*i+Math.pow(u,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*u*u*a+Math.pow(u,3)*o}}function re(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ie(t,e,n,r){var i=.5,a=[t,e],s=[n,r],o=re(a,s,i),u=re(s,o,i),l=re(o,u,i),c=re(u,l,i),p=re(l,c,i),h=ne.apply(0,a.concat(o,l,p,i)),f=ne.apply(0,p.concat(c,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function ae(t,e){switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"M":return e.x=t[1],e.y=t[2],t;case"A":return["C"].concat(te.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(ee.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ie(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ie(e.x1,e.y1,e.x,e.y))}return t}function se(t,e){if(function(t){return Ut(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Nt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o=(t=Gt(t)).length,u=0;u1?1:u<0?0:u)/2,c=0,p=0,h=0,f=0,d=[.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].map((function(u,v){p=ue(t,n,i,s,c=l*u+l),h=ue(e,r,a,o,c),f+=d[v]*Math.sqrt(p*p+h*h)})),l*f}function ce(t){var e=0;return se(t).map((function(t,n,r){e+="M"!==t[0]?le.apply(0,r[n-1].slice(-2).concat(t.slice(1))):0})),e}function pe(t,e){var n,r,i=0;return se(t).map((function(t,a,s){return r=a?s[a-1].slice(-2).concat(t.slice(1)):t.slice(1),n=a?le.apply(0,r):0,i+=n,0===a?{x:r[0],y:r[1]}:i>e&&e>i-n?ne.apply(0,r.concat(1-(i-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function he(t,e,n,r,i,a,s,o){return 3*((o-e)*(n+i)-(s-t)*(r+a)+r*(t-i)-n*(e-a)+o*(i+t/3)-s*(a+e/3))/20}function fe(t){return function(t){var e=0,n=0,r=0,i=0,a=0;return se(t).map((function(t){var s;switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,i="M"===t[0]?t[2]:i,e=r,n=i,0;default:return a=he.apply(0,[e,n].concat(t.slice(1))),s=t.slice(-2),e=s[0],n=s[1],a}})).reduce((function(t,e){return t+e}),0)}(se(t))>=0}function de(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ve(t){return t.reduce((function(e,n,r){return r?e+de(t[r-1],n):0}),0)}function ge(t,e){var n=Gt(t,0);return function(t){var e=[],n=[],r="",i=t.length,a=0;if(!t.length||"M"!==t[0][0])return!1;for(var s=0;s-1))return!1;e.push([n[1],n[2]])}return a=ve(e),!!i&&{ring:e,pathLength:a}}(n)||ye(n,e)}function ye(t,e){var n,r,i=se((r=oe(t),oe($t(r,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),a=ce(i),s=[],o=3;e&&!isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(a/e)));for(var u=0;ue;)r=re(n,r,.5),t.splice(i+1,0,r)}function we(t,e){var n,r,i;if("string"==typeof t){var a=ge(t,e);t=a.ring,r=a.skipBisect,i=a.pathLength}else if(!Array.isArray(t))throw Dt;if((n=t.slice(0)).pathLength=i,!Me(n))throw Dt;return n.length>1&&de(n[0],n[n.length-1])<1e-9&&n.pop(),!r&&e&&!isNaN(e)&&+e>0&&be(n,e),n}function Me(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!isNaN(t[0])&&!isNaN(t[1])}))}function _e(t,e,n){var r=we(t,n=n||f.morphPrecision),i=we(e,n),a=r.length-i.length;return xe(r,a<0?-1*a:0),xe(i,a>0?a:0),me(r,i),[jt(r),jt(i)]}var Ce={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof SVGElement?e:/^\.|^\#/.test(e)?V(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):r||"string"!=typeof e||(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i=e.pathArray,a=n.pathArray,s=a.length;t.setAttribute("d",1===r?n.original:"M"+Vt(i,a,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=_e(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},Te={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Vt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Ce,Util:{addPoints:xe,bisect:be,normalizeRing:we,validRing:Me,getInterpolationPoints:_e,pathStringToRing:ge,distanceSquareRoot:de,midPoint:re,approximateRing:ye,rotateRing:me,pathToString:oe,pathToCurve:se,getPathLength:ce,getPointAtLength:pe,getDrawDirection:fe,roundPath:jt}};for(var Se in w.SVGMorph=Te,w){var Ie=w[Se];w[Se]=new F(Ie)}return{Animation:F,Components:w,Tween:j,fromTo:function(t,e,n,r){return r=r||{},new L.tween(V(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(V(t),e,e,n)},TweenCollection:H,allFromTo:function(t,e,n,r){return r=r||{},new H(V(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new H(V(t,!0),e,e,n)},Objects:x,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:T,Selector:V,Version:"2.0.16"}})); +// KUTE.js Standard v2.1.0 | 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={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function V(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t instanceof Element}))?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}function q(){for(var t in i)if("function"==typeof i[t])i[t].call(this,t);else for(var e in i[t])i[t][e].call(this,e);C.call(this)}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),P.linear};var N=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};N.prototype.start=function(e){return M(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),q.call(this),this._startFired=!0),!s&&o(),this},N.prototype.stop=function(){return this.playing&&(_(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},N.prototype.close=function(){for(var t in y)for(var e in y[t])y[t][e].call(this,e);this._startFired=!1,u.call(this)},N.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},N.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},N.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return 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)},L.tween=N,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var j=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,E.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.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),q.call(this),this._startTime+=t.Time()-this._pauseTime,M(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(_(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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.map((function(t){return t.start()})),!1))},n}(N);L.tween=j;var H=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};H.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),this},H.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},H.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},H.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},H.prototype.chain=function(t){var 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},H.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},H.prototype.removeTweens=function(){this.tweens=[]},H.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 F=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function U(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*Q(n,r,i)>>0)/10:Q(n,r,i)>>0)+"px"})}F.prototype.setComponent=function(t){var e=this,n=t.component,a={prepareProperty:d,prepareStart:v,onStart:i,onComplete:y,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[o]=t.defaultValue,e.supports=o+" property";else if(t.defaultValues){for(var l in t.defaultValues)h[l]=t.defaultValues[l];e.supports=(u||o)+" "+(o||s)+" properties"}if(t.defaultOptions)for(var c in t.defaultOptions)f[c]=t.defaultOptions[c];if(t.functions)for(var x in a)if(x in t.functions)if("function"==typeof t.functions[x])!a[x][n]&&(a[x][n]={}),!a[x][n][s||o]&&(a[x][n][s||o]=t.functions[x]);else for(var w in t.functions[x])!a[x][n]&&(a[x][n]={}),!a[x][n][w]&&(a[x][n][w]=t.functions[x][w]);if(t.Interpolate){for(var M in t.Interpolate){var _=t.Interpolate[M];if("function"!=typeof _||r[M])for(var C in _)"function"!=typeof _[C]||r[M]||(r[M]=_[C]);else r[M]=_}m[n]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return e};var R=["top","left","width","height"],X={};R.map((function(t){return X[t]=D}));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 I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=U(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:U}};function Z(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function z(t,e,n){var r,i={},a=",";for(r in e)i[r]="a"!==r?Q(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*Q(t[r],e[r],n)>>0)/100:null;return i.a?"rgba("+i.r+a+i.g+a+i.b+a+i.a+")":"rgb("+i.r+a+i.g+a+i.b+")"}function Y(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=z(n,r,i)})}w.BoxModelEssential=B;var K=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],$={};K.map((function(t){$[t]="#000"}));var W={};K.map((function(t){return W[t]=Y}));var G={component:"colorProperties",category:"colors",properties:K,defaultValues:$,Interpolate:{numbers:Q,colors:z},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return Z(e)},onStart:W},Util:{trueColor:Z}};w.ColorProperties=G;var J={},tt="htmlAttributes",et=["fill","stroke","stop-color"];function nt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var rt={prepareStart:function(t,e){var n={};for(var r in e){var i=nt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=et.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=nt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(et.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){t.setAttribute(e,z(n,r,i))})},n[a]=Z(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=U(o).u||U(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*Q(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=U(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*Q(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=J)}}},it={component:tt,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:rt,Util:{replaceUppercase:nt,trueColor:Z,trueDimension:U}};w.HTMLAttributes=it;var at={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*Q(n,r,i)>>0)/1e3})}},st={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at};w.OpacityProperty=st;var ot=String("abcdefghijklmnopqrstuvwxyz").split(""),ut=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),lt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ct=String("0123456789").split(""),pt=ot.concat(ut,ct),ht=pt.concat(lt),ft={alpha:ot,upper:ut,symbols:lt,numeric:ct,alphanumeric:pt,all:ht},dt={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in ft?ft[n]:n&&n.length?n:ft[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function vt(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 i=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=i,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=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function xt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function bt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=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 Mt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}w.TextWriteProperties=yt;var _t={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,e){var n=S(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?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(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},d=0;d>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:Mt}};function Ct(t,e){return parseFloat(t)/100*e}function Tt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function St(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a-1?St(t):"line"===t.tagName?It(t):void 0}function Ot(t,e){var n,r,i,a,s=/path|glyph/.test(t.tagName)?t.getTotalLength():kt(t);return e instanceof Object?e:("string"==typeof e?(e=e.split(/\,|\s/),n=/%/.test(e[0])?Ct(e[0].trim(),s):parseFloat(e[0]),r=/%/.test(e[1])?Ct(e[1].trim(),s):parseFloat(e[1])):void 0===e&&(a=parseFloat(I(t,"stroke-dashoffset")),i=I(t,"stroke-dasharray").split(/\,/),n=0-a,r=parseFloat(i[0])+n||s),{s:n,e:r,l:s})}w.TransformFunctions=_t;var Lt={prepareStart:function(){return Ot(this.element)},prepareProperty:function(t,e){return Ot(this.element,e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){var i=(100*e.l>>0)/100,a=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"})}},Pt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:Lt,Util:{getRectLength:Tt,getPolyLength:St,getLineLength:It,getCircleLength:At,getEllipseLength:Et,getTotalLength:kt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Ot,percent:Ct}};function Vt(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}w.SVGDraw=Pt;var qt=3;function Nt(t){return t.map((function(t){return Array.isArray(t)?Nt(t):isNaN(+t)?t:+t}))}function jt(t,e){var n=isNaN(+e)?qt:+e;return n?t.map((function(t){return t.map((function(t,e){var r=+t,i=Math.pow(10,n);return r?r%1==0?r:Math.round(r*i)/i:t}))})):Nt(t)}function Ht(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n];r.length;)e[n]="A",t.splice(n++,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Ft={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ut(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Qt(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>=Ft[n]&&(t.segments.push([e].concat(r.splice(0,Ft[n]))),Ft[n]););}var Dt="Invalid path value";function Rt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=Dt+": invalid Arc flag "+e)}function Xt(t){return t>=48&&t<=57}function Bt(t){var e,n=t.index,r=n,i=t.max,a=!1,s=!1,o=!1,u=!1;if(r>=i)t.err=Dt+": missing param "+t.pathValue[r];else if(43!==(e=t.pathValue.charCodeAt(r))&&45!==e||(e=++r=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index++;var e}function zt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Yt(t){var e,n,r,i,a=t.max;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}return!1}(e=t.pathValue.charCodeAt(t.index)))if(r=Ft[t.pathValue[t.index].toLowerCase()],t.index++,Zt(t),t.data=[],r){for(n=!1;;){for(i=r;i>0;i--){if(97!=(32|e)||3!==i&&4!==i?Bt(t):Rt(t),t.err.length)return;t.data.push(t.param),Zt(t),n=!1,t.index=t.max)break;if(!zt(t.pathValue.charCodeAt(t.index)))break}}Qt(t)}else Qt(t);else t.err=Dt+": "+t.pathValue[t.index]+" not a path command"}function Kt(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 $t(t,e){if(Ut(n=t)&&n.every((function(t){return t[0]===t[0].toUpperCase()})))return Nt(t);var n;t=function(t,e){if(Ut(t))return Nt(t);var n=new Kt(t);for(Zt(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=i.x1,e.y1=i.y1,["C",i.x1,i.y1].concat(t.slice(1));case"T":return r=function(t,e,n,r,i){return"QT".indexOf(i)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),e.qx=r.qx,e.qy=r.qy,["Q",e.qx,e.qy].concat(t.slice(1));case"Q":e.qx=t[1],e.qy=t[2]}return t}function Gt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Nt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o="",u=(t=$t(t)).length,l=0;l1&&(n*=b=Math.sqrt(b),r*=b);var w=n*n,M=r*r,_=(a==s?-1:1)*Math.sqrt(Math.abs((w*M-w*x*x-M*m*m)/(w*x*x+M*m*m)));f=_*n*x/r+(t+o)/2,d=_*-r*m/n+(e+u)/2,p=Math.asin(((e-d)/r).toFixed(9)),h=Math.asin(((u-d)/r).toFixed(9)),p=th&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var C=h-p;if(Math.abs(C)>v){var T=h,S=o,I=u;h=p+v*(s&&h>p?1:-1),o=f+n*Math.cos(h),u=d+r*Math.sin(h),y=te(o,u,n,r,i,0,s,S,I,[h,T,f,d])}C=h-p;var A=Math.cos(p),E=Math.sin(p),k=Math.cos(h),O=Math.sin(h),L=Math.tan(C/4),P=4/3*n*L,V=4/3*r*L,q=[t,e],N=[t+P*E,e-V*A],j=[o+P*O,u-V*k],H=[o,u];return N[0]=2*q[0]-N[0],N[1]=2*q[1]-N[1],l?[N,j,H].concat(y):(y=[N,j,H].concat(y).join().split(",")).map((function(t,e){return e%2?Jt(y[e-1],t,g).y:Jt(t,y[e+1],g).x}))}function ee(t,e,n,r,i,a){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*i+o*n,s*a+o*r,i,a]}function ne(t,e,n,r,i,a,s,o,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*u*u*i+Math.pow(u,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*u*u*a+Math.pow(u,3)*o}}function re(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ie(t,e,n,r){var i=.5,a=[t,e],s=[n,r],o=re(a,s,i),u=re(s,o,i),l=re(o,u,i),c=re(u,l,i),p=re(l,c,i),h=ne.apply(0,a.concat(o,l,p,i)),f=ne.apply(0,p.concat(c,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function ae(t,e){switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"M":return e.x=t[1],e.y=t[2],t;case"A":return["C"].concat(te.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(ee.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ie(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ie(e.x1,e.y1,e.x,e.y))}return t}function se(t,e){if(function(t){return Ut(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Nt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o=(t=Gt(t)).length,u=0;u1?1:u<0?0:u)/2,c=0,p=0,h=0,f=0,d=[.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].map((function(u,v){p=ue(t,n,i,s,c=l*u+l),h=ue(e,r,a,o,c),f+=d[v]*Math.sqrt(p*p+h*h)})),l*f}function ce(t){var e=0;return se(t).map((function(t,n,r){e+="M"!==t[0]?le.apply(0,r[n-1].slice(-2).concat(t.slice(1))):0})),e}function pe(t,e){var n,r,i=0;return se(t).map((function(t,a,s){return r=a?s[a-1].slice(-2).concat(t.slice(1)):t.slice(1),n=a?le.apply(0,r):0,i+=n,0===a?{x:r[0],y:r[1]}:i>e&&e>i-n?ne.apply(0,r.concat(1-(i-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function he(t,e,n,r,i,a,s,o){return 3*((o-e)*(n+i)-(s-t)*(r+a)+r*(t-i)-n*(e-a)+o*(i+t/3)-s*(a+e/3))/20}function fe(t){return function(t){var e=0,n=0,r=0,i=0,a=0;return se(t).map((function(t){var s;switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,i="M"===t[0]?t[2]:i,e=r,n=i,0;default:return a=he.apply(0,[e,n].concat(t.slice(1))),s=t.slice(-2),e=s[0],n=s[1],a}})).reduce((function(t,e){return t+e}),0)}(se(t))>=0}function de(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ve(t){return t.reduce((function(e,n,r){return r?e+de(t[r-1],n):0}),0)}function ge(t,e){var n=Gt(t,0);return function(t){var e=[],n=[],r="",i=t.length,a=0;if(!t.length||"M"!==t[0][0])return!1;for(var s=0;s-1))return!1;e.push([n[1],n[2]])}return a=ve(e),!!i&&{ring:e,pathLength:a}}(n)||ye(n,e)}function ye(t,e){var n,r,i=se((r=oe(t),oe($t(r,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),a=ce(i),s=[],o=3;e&&!isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(a/e)));for(var u=0;ue;)r=re(n,r,.5),t.splice(i+1,0,r)}function we(t,e){var n,r,i;if("string"==typeof t){var a=ge(t,e);t=a.ring,r=a.skipBisect,i=a.pathLength}else if(!Array.isArray(t))throw Dt;if((n=t.slice(0)).pathLength=i,!Me(n))throw Dt;return n.length>1&&de(n[0],n[n.length-1])<1e-9&&n.pop(),!r&&e&&!isNaN(e)&&+e>0&&be(n,e),n}function Me(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!isNaN(t[0])&&!isNaN(t[1])}))}function _e(t,e,n){var r=we(t,n=n||f.morphPrecision),i=we(e,n),a=r.length-i.length;return xe(r,a<0?-1*a:0),xe(i,a>0?a:0),me(r,i),[jt(r),jt(i)]}var Ce={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof SVGElement?e:/^\.|^\#/.test(e)?V(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):r||"string"!=typeof e||(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i=e.pathArray,a=n.pathArray,s=a.length;t.setAttribute("d",1===r?n.original:"M"+Vt(i,a,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=_e(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},Te={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Vt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Ce,Util:{addPoints:xe,bisect:be,normalizeRing:we,validRing:Me,getInterpolationPoints:_e,pathStringToRing:ge,distanceSquareRoot:de,midPoint:re,approximateRing:ye,rotateRing:me,pathToString:oe,pathToCurve:se,getPathLength:ce,getPointAtLength:pe,getDrawDirection:fe,roundPath:jt}};for(var Se in w.SVGMorph=Te,w){var Ie=w[Se];w[Se]=new F(Ie)}return{Animation:F,Components:w,Tween:j,fromTo:function(t,e,n,r){return r=r||{},new L.tween(V(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(V(t),e,e,n)},TweenCollection:H,allFromTo:function(t,e,n,r){return r=r||{},new H(V(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new H(V(t,!0),e,e,n)},Objects:x,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:T,Selector:V,Version:"2.1.0"}})); diff --git a/dist/kute.esm.js b/dist/kute.esm.js index 969a50c..8431d70 100644 --- a/dist/kute.esm.js +++ b/dist/kute.esm.js @@ -1,9 +1,9 @@ /*! -* KUTE.js Standard v2.0.16 (http://thednp.github.io/kute.js) -* Copyright 2015-2020 © thednp +* KUTE.js Standard v2.1.0 (http://thednp.github.io/kute.js) +* Copyright 2015-2021 © thednp * Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE) */ -var version = "2.0.16"; +var version = "2.1.0"; var KUTE = {}; @@ -1379,7 +1379,7 @@ function getTotalLength(el) { return getCircleLength(el); } else if ('ellipse'===el.tagName) { return getEllipseLength(el); - } else if (['polygon,polyline'].indexOf(el.tagName)>-1) { + } else if (['polygon','polyline'].indexOf(el.tagName)>-1) { return getPolyLength(el); } else if ('line'===el.tagName) { return getLineLength(el); diff --git a/dist/kute.esm.min.js b/dist/kute.esm.min.js index 1e5ec0e..665ea3e 100644 --- a/dist/kute.esm.min.js +++ b/dist/kute.esm.min.js @@ -1,2 +1,2 @@ -// KUTE.js Standard v2.0.16 | thednp © 2020 | MIT-License -var t={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},a={},i={};i.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function V(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t instanceof Element}))?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}function q(){for(var t in a)if("function"==typeof a[t])a[t].call(this,t);else for(var e in a[t])a[t][e].call(this,e);C.call(this)}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),P.linear};var N=function(e,n,r,i){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,i=i||{},this._resetStart=i.resetStart||0,this._easing="function"==typeof i.easing?i.easing:L.processEasing(i.easing),this._duration=i.duration||f.duration,this._delay=i.delay||f.delay,i){var o="_"+s;o in this||(this[o]=i[s])}var u=this._easing.name;return a[u]||(a[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};N.prototype.start=function(e){return M(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),q.call(this),this._startFired=!0),!s&&o(),this},N.prototype.stop=function(){return this.playing&&(_(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},N.prototype.close=function(){for(var t in y)for(var e in y[t])y[t][e].call(this,e);this._startFired=!1,u.call(this)},N.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},N.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},N.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[a](this.element,this.valuesStart[a],this.valuesEnd[a],r);return 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)},L.tween=N,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var H=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],a=t[2];if(A.call(this,a,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var i in g)for(var s in g[i])g[i][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,E.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var a in this.valuesEnd)this.valuesRepeat[a]=this.valuesStart[a];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.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),q.call(this),this._startTime+=t.Time()-this._pauseTime,M(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(_(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[a](this.element,this.valuesStart[a],this.valuesEnd[a],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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.map((function(t){return t.start()})),!1))},n}(N);L.tween=H;var j=function(t,e,n,r){var a=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var i=[];return Array.from(t).map((function(t,s){i[s]=r||{},i[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?a.tweens.push(new L.tween(t,e,n,i[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};j.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),this},j.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},j.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},j.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},j.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof j)e.chain(t.tweens);else{if(!(t instanceof L.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},j.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},j.prototype.removeTweens=function(){this.tweens=[]},j.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 F=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function U(t,e){for(var n,r=parseInt(t)||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"})}F.prototype.setComponent=function(t){var e=this,n=t.component,i={prepareProperty:v,prepareStart:d,onStart:a,onComplete:y,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[o]=t.defaultValue,e.supports=o+" property";else if(t.defaultValues){for(var l in t.defaultValues)h[l]=t.defaultValues[l];e.supports=(u||o)+" "+(o||s)+" properties"}if(t.defaultOptions)for(var c in t.defaultOptions)f[c]=t.defaultOptions[c];if(t.functions)for(var x in i)if(x in t.functions)if("function"==typeof t.functions[x])!i[x][n]&&(i[x][n]={}),!i[x][n][s||o]&&(i[x][n][s||o]=t.functions[x]);else for(var b in t.functions[x])!i[x][n]&&(i[x][n]={}),!i[x][n][b]&&(i[x][n][b]=t.functions[x][b]);if(t.Interpolate){for(var M in t.Interpolate){var _=t.Interpolate[M];if("function"!=typeof _||r[M])for(var C in _)"function"!=typeof _[C]||r[M]||(r[M]=_[C]);else r[M]=_}m[n]=t.Interpolate}if(t.Util)for(var T in t.Util)!w[T]&&(w[T]=t.Util[T]);return e};var R=["top","left","width","height"],X={};R.map((function(t){return X[t]=D}));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 I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=U(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:U}};function Z(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var a=document.getElementsByTagName("head")[0];a.style.color=t;var i=getComputedStyle(a,null).color;return i=/rgb/.test(i)?i.replace(/[^\d,]/g,"").split(","):[0,0,0],a.style.color="",{r:parseInt(i[0]),g:parseInt(i[1]),b:parseInt(i[2])}}}function z(t,e,n){var r,a={},i=",";for(r in e)a[r]="a"!==r?Q(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*Q(t[r],e[r],n)>>0)/100:null;return a.a?"rgba("+a.r+i+a.g+i+a.b+i+a.a+")":"rgb("+a.r+i+a.g+i+a.b+")"}function Y(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,a){t.style[e]=z(n,r,a)})}b.BoxModelEssential=B;var K=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],$={};K.map((function(t){$[t]="#000"}));var W={};K.map((function(t){return W[t]=Y}));var G={component:"colorProperties",category:"colors",properties:K,defaultValues:$,Interpolate:{numbers:Q,colors:z},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return Z(e)},onStart:W},Util:{trueColor:Z}};b.ColorProperties=G;var J={},tt=["fill","stroke","stop-color"];function et(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var nt={prepareStart:function(t,e){var n={};for(var r in e){var a=et(r).replace(/_+[a-z]+/,""),i=this.element.getAttribute(a);n[a]=tt.includes(a)?i||"rgba(0,0,0,0)":i||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var i=et(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(i.replace(/_+[a-z]+/,""));if(tt.includes(i))a.htmlAttributes[i]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,a){t.setAttribute(e,z(n,r,a))})},n[i]=Z(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=U(o).u||U(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;a.htmlAttributes[i+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[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)})},n[i+l]=U(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(a.htmlAttributes[i]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},n[i]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,a){for(var i in r)t.attributes[i](e,i,n[i],r[i],a)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=J)}}},rt={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:nt,Util:{replaceUppercase:et,trueColor:Z,trueDimension:U}};b.HTMLAttributes=rt;var at={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,a){t.style[e]=(1e3*Q(n,r,a)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at};b.OpacityProperty=it;var st=String("abcdefghijklmnopqrstuvwxyz").split(""),ot=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ut=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),lt=String("0123456789").split(""),ct=st.concat(ot,lt),pt=ct.concat(ut),ht={alpha:st,upper:ot,symbols:ut,numeric:lt,alphanumeric:ct,all:pt},ft={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in ht?ht[n]:n&&n.length?n:ht[f.textChars];t[e]=function(t,e,n,a){var i="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(a*u.length,u.length)>>0,0),t.innerHTML=a<1?s+l:""===n?" ":n):" "===n?(i=o.substring(0,Math.min((1-a)*o.length,o.length)>>0),t.innerHTML=a<1?i+l:""===n?" ":n):(i=o.substring(o.length,Math.min(a*o.length,o.length)>>0),s=u.substring(0,Math.min(a*u.length,u.length)>>0),t.innerHTML=a<1?s+l+i:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function vt(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 dt(t,e){var n=[];if(t.children.length){for(var r,a=[],i=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function mt(t,e,n,r){for(var a=[],i=0;i<3;i++)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 bt(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(",")+")"}b.TextWriteProperties=gt;var Mt={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,e){var n=S(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?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(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?a:"rotate"===c?i:"skew"===c?s:{},v=0;v>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:bt}};function _t(t,e){return parseFloat(t)/100*e}function Ct(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Tt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return null!=t&&null!=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-1?Tt(t):"line"===t.tagName?St(t):void 0}function kt(t,e){var n,r,a,i,s=/path|glyph/.test(t.tagName)?t.getTotalLength():Et(t);return e instanceof Object?e:("string"==typeof e?(e=e.split(/\,|\s/),n=/%/.test(e[0])?_t(e[0].trim(),s):parseFloat(e[0]),r=/%/.test(e[1])?_t(e[1].trim(),s):parseFloat(e[1])):void 0===e&&(i=parseFloat(I(t,"stroke-dashoffset")),a=I(t,"stroke-dasharray").split(/\,/),n=0-i,r=parseFloat(a[0])+n||s),{s:n,e:r,l:s})}b.TransformFunctions=Mt;var Ot={prepareStart:function(){return kt(this.element)},prepareProperty:function(t,e){return kt(this.element,e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){var a=(100*e.l>>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"})}},Lt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:Ot,Util:{getRectLength:Ct,getPolyLength:Tt,getLineLength:St,getCircleLength:It,getEllipseLength:At,getTotalLength:Et,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:kt,percent:_t}};function Pt(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}b.SVGDraw=Lt;var Vt=3;function qt(t){return t.map((function(t){return Array.isArray(t)?qt(t):isNaN(+t)?t:+t}))}function Nt(t,e){var n=isNaN(+e)?Vt:+e;return n?t.map((function(t){return t.map((function(t,e){var r=+t,a=Math.pow(10,n);return r?r%1==0?r:Math.round(r*a)/a:t}))})):qt(t)}function Ht(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n];r.length;)e[n]="A",t.splice(n++,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var jt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ft(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return jt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Ut(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>=jt[n]&&(t.segments.push([e].concat(r.splice(0,jt[n]))),jt[n]););}var Qt="Invalid path value";function Dt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=Qt+": invalid Arc flag "+e)}function Rt(t){return t>=48&&t<=57}function Xt(t){var e,n=t.index,r=n,a=t.max,i=!1,s=!1,o=!1,u=!1;if(r>=a)t.err=Qt+": missing param "+t.pathValue[r];else if(43!==(e=t.pathValue.charCodeAt(r))&&45!==e||(e=++r=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index++;var e}function Zt(t){return t>=48&&t<=57||43===t||45===t||46===t}function zt(t){var e,n,r,a,i=t.max;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}return!1}(e=t.pathValue.charCodeAt(t.index)))if(r=jt[t.pathValue[t.index].toLowerCase()],t.index++,Bt(t),t.data=[],r){for(n=!1;;){for(a=r;a>0;a--){if(97!=(32|e)||3!==a&&4!==a?Xt(t):Dt(t),t.err.length)return;t.data.push(t.param),Bt(t),n=!1,t.index=t.max)break;if(!Zt(t.pathValue.charCodeAt(t.index)))break}}Ut(t)}else Ut(t);else t.err=Qt+": "+t.pathValue[t.index]+" not a path command"}function Yt(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,e){if(Ft(n=t)&&n.every((function(t){return t[0]===t[0].toUpperCase()})))return qt(t);var n;t=function(t,e){if(Ft(t))return qt(t);var n=new Yt(t);for(Bt(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=a.x1,e.y1=a.y1,["C",a.x1,a.y1].concat(t.slice(1));case"T":return r=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),e.qx=r.qx,e.qy=r.qy,["Q",e.qx,e.qy].concat(t.slice(1));case"Q":e.qx=t[1],e.qy=t[2]}return t}function Wt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return jt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return qt(t);for(var n,r,a={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},i=[],s="",o="",u=(t=Kt(t)).length,l=0;l1&&(n*=w=Math.sqrt(w),r*=w);var b=n*n,M=r*r,_=(i==s?-1:1)*Math.sqrt(Math.abs((b*M-b*x*x-M*m*m)/(b*x*x+M*m*m)));f=_*n*x/r+(t+o)/2,v=_*-r*m/n+(e+u)/2,p=Math.asin(((e-v)/r).toFixed(9)),h=Math.asin(((u-v)/r).toFixed(9)),p=th&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var C=h-p;if(Math.abs(C)>d){var T=h,S=o,I=u;h=p+d*(s&&h>p?1:-1),o=f+n*Math.cos(h),u=v+r*Math.sin(h),y=Jt(o,u,n,r,a,0,s,S,I,[h,T,f,v])}C=h-p;var A=Math.cos(p),E=Math.sin(p),k=Math.cos(h),O=Math.sin(h),L=Math.tan(C/4),P=4/3*n*L,V=4/3*r*L,q=[t,e],N=[t+P*E,e-V*A],H=[o+P*O,u-V*k],j=[o,u];return N[0]=2*q[0]-N[0],N[1]=2*q[1]-N[1],l?[N,H,j].concat(y):(y=[N,H,j].concat(y).join().split(",")).map((function(t,e){return e%2?Gt(y[e-1],t,g).y:Gt(t,y[e+1],g).x}))}function te(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 ee(t,e,n,r,a,i,s,o,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*u*u*a+Math.pow(u,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*u*u*i+Math.pow(u,3)*o}}function ne(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function re(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=ne(i,s,a),u=ne(s,o,a),l=ne(o,u,a),c=ne(u,l,a),p=ne(l,c,a),h=ee.apply(0,i.concat(o,l,p,a)),f=ee.apply(0,p.concat(c,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function ae(t,e){switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"M":return e.x=t[1],e.y=t[2],t;case"A":return["C"].concat(Jt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(te.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(re(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(re(e.x1,e.y1,e.x,e.y))}return t}function ie(t,e){if(function(t){return Ft(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return qt(t);for(var n,r,a={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},i=[],s="",o=(t=Wt(t)).length,u=0;u1?1:u<0?0:u)/2,c=0,p=0,h=0,f=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].map((function(u,d){p=oe(t,n,a,s,c=l*u+l),h=oe(e,r,i,o,c),f+=v[d]*Math.sqrt(p*p+h*h)})),l*f}function le(t){var e=0;return ie(t).map((function(t,n,r){e+="M"!==t[0]?ue.apply(0,r[n-1].slice(-2).concat(t.slice(1))):0})),e}function ce(t,e){var n,r,a=0;return ie(t).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?ue.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?ee.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function pe(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 he(t){return function(t){var e=0,n=0,r=0,a=0,i=0;return ie(t).map((function(t){var s;switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,a="M"===t[0]?t[2]:a,e=r,n=a,0;default:return i=pe.apply(0,[e,n].concat(t.slice(1))),s=t.slice(-2),e=s[0],n=s[1],i}})).reduce((function(t,e){return t+e}),0)}(ie(t))>=0}function fe(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ve(t){return t.reduce((function(e,n,r){return r?e+fe(t[r-1],n):0}),0)}function de(t,e){var n=Wt(t,0);return function(t){var e=[],n=[],r="",a=t.length,i=0;if(!t.length||"M"!==t[0][0])return!1;for(var s=0;s-1))return!1;e.push([n[1],n[2]])}return i=ve(e),!!a&&{ring:e,pathLength:i}}(n)||ge(n,e)}function ge(t,e){var n,r,a=ie((r=se(t),se(Kt(r,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=le(a),s=[],o=3;e&&!isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;ue;)r=ne(n,r,.5),t.splice(a+1,0,r)}function we(t,e){var n,r,a;if("string"==typeof t){var i=de(t,e);t=i.ring,r=i.skipBisect,a=i.pathLength}else if(!Array.isArray(t))throw Qt;if((n=t.slice(0)).pathLength=a,!be(n))throw Qt;return n.length>1&&fe(n[0],n[n.length-1])<1e-9&&n.pop(),!r&&e&&!isNaN(e)&&+e>0&&xe(n,e),n}function be(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!isNaN(t[0])&&!isNaN(t[1])}))}function Me(t,e,n){var r=we(t,n=n||f.morphPrecision),a=we(e,n),i=r.length-a.length;return me(r,i<0?-1*i:0),me(a,i>0?i:0),ye(r,a),[Nt(r),Nt(a)]}var _e={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof SVGElement?e:/^\.|^\#/.test(e)?V(e):null,a=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(a,""):r||"string"!=typeof e||(n.original=e.replace(a,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+Pt(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=Me(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},Ce={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Pt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:_e,Util:{addPoints:me,bisect:xe,normalizeRing:we,validRing:be,getInterpolationPoints:Me,pathStringToRing:de,distanceSquareRoot:fe,midPoint:ne,approximateRing:ge,rotateRing:ye,pathToString:se,pathToCurve:ie,getPathLength:le,getPointAtLength:ce,getDrawDirection:he,roundPath:Nt}};for(var Te in b.SVGMorph=Ce,b){var Se=b[Te];b[Te]=new F(Se)}var Ie={Animation:F,Components:b,Tween:H,fromTo:function(t,e,n,r){return r=r||{},new L.tween(V(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(V(t),e,e,n)},TweenCollection:j,allFromTo:function(t,e,n,r){return r=r||{},new j(V(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new j(V(t,!0),e,e,n)},Objects:x,Util:w,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:T,Selector:V,Version:"2.0.16"};export default Ie; +// KUTE.js Standard v2.1.0 | thednp © 2021 | MIT-License +var t={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},a={},i={};i.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ea?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function V(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t instanceof Element}))?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}function q(){for(var t in a)if("function"==typeof a[t])a[t].call(this,t);else for(var e in a[t])a[t][e].call(this,e);C.call(this)}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),P.linear};var N=function(e,n,r,i){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,i=i||{},this._resetStart=i.resetStart||0,this._easing="function"==typeof i.easing?i.easing:L.processEasing(i.easing),this._duration=i.duration||f.duration,this._delay=i.delay||f.delay,i){var o="_"+s;o in this||(this[o]=i[s])}var u=this._easing.name;return a[u]||(a[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};N.prototype.start=function(e){return M(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),q.call(this),this._startFired=!0),!s&&o(),this},N.prototype.stop=function(){return this.playing&&(_(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},N.prototype.close=function(){for(var t in y)for(var e in y[t])y[t][e].call(this,e);this._startFired=!1,u.call(this)},N.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},N.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},N.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[a](this.element,this.valuesStart[a],this.valuesEnd[a],r);return 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)},L.tween=N,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var H=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],a=t[2];if(A.call(this,a,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var i in g)for(var s in g[i])g[i][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,E.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var a in this.valuesEnd)this.valuesRepeat[a]=this.valuesStart[a];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.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),q.call(this),this._startTime+=t.Time()-this._pauseTime,M(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(_(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[a](this.element,this.valuesStart[a],this.valuesEnd[a],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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.map((function(t){return t.start()})),!1))},n}(N);L.tween=H;var j=function(t,e,n,r){var a=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var i=[];return Array.from(t).map((function(t,s){i[s]=r||{},i[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?a.tweens.push(new L.tween(t,e,n,i[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};j.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),this},j.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},j.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},j.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},j.prototype.chain=function(t){var e=this.tweens[this.length-1];if(t instanceof j)e.chain(t.tweens);else{if(!(t instanceof L.tween))throw new TypeError("KUTE.js - invalid chain value");e.chain(t)}return this},j.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},j.prototype.removeTweens=function(){this.tweens=[]},j.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 F=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function U(t,e){for(var n,r=parseInt(t)||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"})}F.prototype.setComponent=function(t){var e=this,n=t.component,i={prepareProperty:v,prepareStart:d,onStart:a,onComplete:y,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[o]=t.defaultValue,e.supports=o+" property";else if(t.defaultValues){for(var l in t.defaultValues)h[l]=t.defaultValues[l];e.supports=(u||o)+" "+(o||s)+" properties"}if(t.defaultOptions)for(var c in t.defaultOptions)f[c]=t.defaultOptions[c];if(t.functions)for(var x in i)if(x in t.functions)if("function"==typeof t.functions[x])!i[x][n]&&(i[x][n]={}),!i[x][n][s||o]&&(i[x][n][s||o]=t.functions[x]);else for(var b in t.functions[x])!i[x][n]&&(i[x][n]={}),!i[x][n][b]&&(i[x][n][b]=t.functions[x][b]);if(t.Interpolate){for(var M in t.Interpolate){var _=t.Interpolate[M];if("function"!=typeof _||r[M])for(var C in _)"function"!=typeof _[C]||r[M]||(r[M]=_[C]);else r[M]=_}m[n]=t.Interpolate}if(t.Util)for(var T in t.Util)!w[T]&&(w[T]=t.Util[T]);return e};var R=["top","left","width","height"],X={};R.map((function(t){return X[t]=D}));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 I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=U(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:U}};function Z(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var a=document.getElementsByTagName("head")[0];a.style.color=t;var i=getComputedStyle(a,null).color;return i=/rgb/.test(i)?i.replace(/[^\d,]/g,"").split(","):[0,0,0],a.style.color="",{r:parseInt(i[0]),g:parseInt(i[1]),b:parseInt(i[2])}}}function z(t,e,n){var r,a={},i=",";for(r in e)a[r]="a"!==r?Q(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*Q(t[r],e[r],n)>>0)/100:null;return a.a?"rgba("+a.r+i+a.g+i+a.b+i+a.a+")":"rgb("+a.r+i+a.g+i+a.b+")"}function Y(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,a){t.style[e]=z(n,r,a)})}b.BoxModelEssential=B;var K=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],$={};K.map((function(t){$[t]="#000"}));var W={};K.map((function(t){return W[t]=Y}));var G={component:"colorProperties",category:"colors",properties:K,defaultValues:$,Interpolate:{numbers:Q,colors:z},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return Z(e)},onStart:W},Util:{trueColor:Z}};b.ColorProperties=G;var J={},tt=["fill","stroke","stop-color"];function et(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var nt={prepareStart:function(t,e){var n={};for(var r in e){var a=et(r).replace(/_+[a-z]+/,""),i=this.element.getAttribute(a);n[a]=tt.includes(a)?i||"rgba(0,0,0,0)":i||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var i=et(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(i.replace(/_+[a-z]+/,""));if(tt.includes(i))a.htmlAttributes[i]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,a){t.setAttribute(e,z(n,r,a))})},n[i]=Z(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=U(o).u||U(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;a.htmlAttributes[i+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[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)})},n[i+l]=U(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(a.htmlAttributes[i]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,a){t.setAttribute(e,(1e3*Q(n,r,a)>>0)/1e3)})},n[i]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,a){for(var i in r)t.attributes[i](e,i,n[i],r[i],a)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=J)}}},rt={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:nt,Util:{replaceUppercase:et,trueColor:Z,trueDimension:U}};b.HTMLAttributes=rt;var at={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,a){t.style[e]=(1e3*Q(n,r,a)>>0)/1e3})}},it={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at};b.OpacityProperty=it;var st=String("abcdefghijklmnopqrstuvwxyz").split(""),ot=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),ut=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),lt=String("0123456789").split(""),ct=st.concat(ot,lt),pt=ct.concat(ut),ht={alpha:st,upper:ot,symbols:ut,numeric:lt,alphanumeric:ct,all:pt},ft={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in ht?ht[n]:n&&n.length?n:ht[f.textChars];t[e]=function(t,e,n,a){var i="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(a*u.length,u.length)>>0,0),t.innerHTML=a<1?s+l:""===n?" ":n):" "===n?(i=o.substring(0,Math.min((1-a)*o.length,o.length)>>0),t.innerHTML=a<1?i+l:""===n?" ":n):(i=o.substring(o.length,Math.min(a*o.length,o.length)>>0),s=u.substring(0,Math.min(a*u.length,u.length)>>0),t.innerHTML=a<1?s+l+i:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function vt(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 dt(t,e){var n=[];if(t.children.length){for(var r,a=[],i=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function mt(t,e,n,r){for(var a=[],i=0;i<3;i++)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 bt(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(",")+")"}b.TextWriteProperties=gt;var Mt={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,e){var n=S(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},a=[],i=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?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(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?a:"rotate"===c?i:"skew"===c?s:{},v=0;v>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:bt}};function _t(t,e){return parseFloat(t)/100*e}function Ct(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Tt(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},a=function(t,e){return null!=t&&null!=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-1?Tt(t):"line"===t.tagName?St(t):void 0}function kt(t,e){var n,r,a,i,s=/path|glyph/.test(t.tagName)?t.getTotalLength():Et(t);return e instanceof Object?e:("string"==typeof e?(e=e.split(/\,|\s/),n=/%/.test(e[0])?_t(e[0].trim(),s):parseFloat(e[0]),r=/%/.test(e[1])?_t(e[1].trim(),s):parseFloat(e[1])):void 0===e&&(i=parseFloat(I(t,"stroke-dashoffset")),a=I(t,"stroke-dasharray").split(/\,/),n=0-i,r=parseFloat(a[0])+n||s),{s:n,e:r,l:s})}b.TransformFunctions=Mt;var Ot={prepareStart:function(){return kt(this.element)},prepareProperty:function(t,e){return kt(this.element,e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){var a=(100*e.l>>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"})}},Lt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:Ot,Util:{getRectLength:Ct,getPolyLength:Tt,getLineLength:St,getCircleLength:It,getEllipseLength:At,getTotalLength:Et,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:kt,percent:_t}};function Pt(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}b.SVGDraw=Lt;var Vt=3;function qt(t){return t.map((function(t){return Array.isArray(t)?qt(t):isNaN(+t)?t:+t}))}function Nt(t,e){var n=isNaN(+e)?Vt:+e;return n?t.map((function(t){return t.map((function(t,e){var r=+t,a=Math.pow(10,n);return r?r%1==0?r:Math.round(r*a)/a:t}))})):qt(t)}function Ht(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n];r.length;)e[n]="A",t.splice(n++,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var jt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ft(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return jt[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Ut(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>=jt[n]&&(t.segments.push([e].concat(r.splice(0,jt[n]))),jt[n]););}var Qt="Invalid path value";function Dt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=Qt+": invalid Arc flag "+e)}function Rt(t){return t>=48&&t<=57}function Xt(t){var e,n=t.index,r=n,a=t.max,i=!1,s=!1,o=!1,u=!1;if(r>=a)t.err=Qt+": missing param "+t.pathValue[r];else if(43!==(e=t.pathValue.charCodeAt(r))&&45!==e||(e=++r=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index++;var e}function Zt(t){return t>=48&&t<=57||43===t||45===t||46===t}function zt(t){var e,n,r,a,i=t.max;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}return!1}(e=t.pathValue.charCodeAt(t.index)))if(r=jt[t.pathValue[t.index].toLowerCase()],t.index++,Bt(t),t.data=[],r){for(n=!1;;){for(a=r;a>0;a--){if(97!=(32|e)||3!==a&&4!==a?Xt(t):Dt(t),t.err.length)return;t.data.push(t.param),Bt(t),n=!1,t.index=t.max)break;if(!Zt(t.pathValue.charCodeAt(t.index)))break}}Ut(t)}else Ut(t);else t.err=Qt+": "+t.pathValue[t.index]+" not a path command"}function Yt(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,e){if(Ft(n=t)&&n.every((function(t){return t[0]===t[0].toUpperCase()})))return qt(t);var n;t=function(t,e){if(Ft(t))return qt(t);var n=new Yt(t);for(Bt(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=a.x1,e.y1=a.y1,["C",a.x1,a.y1].concat(t.slice(1));case"T":return r=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),e.qx=r.qx,e.qy=r.qy,["Q",e.qx,e.qy].concat(t.slice(1));case"Q":e.qx=t[1],e.qy=t[2]}return t}function Wt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return jt[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return qt(t);for(var n,r,a={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},i=[],s="",o="",u=(t=Kt(t)).length,l=0;l1&&(n*=w=Math.sqrt(w),r*=w);var b=n*n,M=r*r,_=(i==s?-1:1)*Math.sqrt(Math.abs((b*M-b*x*x-M*m*m)/(b*x*x+M*m*m)));f=_*n*x/r+(t+o)/2,v=_*-r*m/n+(e+u)/2,p=Math.asin(((e-v)/r).toFixed(9)),h=Math.asin(((u-v)/r).toFixed(9)),p=th&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var C=h-p;if(Math.abs(C)>d){var T=h,S=o,I=u;h=p+d*(s&&h>p?1:-1),o=f+n*Math.cos(h),u=v+r*Math.sin(h),y=Jt(o,u,n,r,a,0,s,S,I,[h,T,f,v])}C=h-p;var A=Math.cos(p),E=Math.sin(p),k=Math.cos(h),O=Math.sin(h),L=Math.tan(C/4),P=4/3*n*L,V=4/3*r*L,q=[t,e],N=[t+P*E,e-V*A],H=[o+P*O,u-V*k],j=[o,u];return N[0]=2*q[0]-N[0],N[1]=2*q[1]-N[1],l?[N,H,j].concat(y):(y=[N,H,j].concat(y).join().split(",")).map((function(t,e){return e%2?Gt(y[e-1],t,g).y:Gt(t,y[e+1],g).x}))}function te(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 ee(t,e,n,r,a,i,s,o,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*u*u*a+Math.pow(u,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*u*u*i+Math.pow(u,3)*o}}function ne(t,e,n){var r=t[0],a=t[1];return[r+(e[0]-r)*n,a+(e[1]-a)*n]}function re(t,e,n,r){var a=.5,i=[t,e],s=[n,r],o=ne(i,s,a),u=ne(s,o,a),l=ne(o,u,a),c=ne(u,l,a),p=ne(l,c,a),h=ee.apply(0,i.concat(o,l,p,a)),f=ee.apply(0,p.concat(c,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function ae(t,e){switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"M":return e.x=t[1],e.y=t[2],t;case"A":return["C"].concat(Jt.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(te.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(re(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(re(e.x1,e.y1,e.x,e.y))}return t}function ie(t,e){if(function(t){return Ft(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return qt(t);for(var n,r,a={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},i=[],s="",o=(t=Wt(t)).length,u=0;u1?1:u<0?0:u)/2,c=0,p=0,h=0,f=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].map((function(u,d){p=oe(t,n,a,s,c=l*u+l),h=oe(e,r,i,o,c),f+=v[d]*Math.sqrt(p*p+h*h)})),l*f}function le(t){var e=0;return ie(t).map((function(t,n,r){e+="M"!==t[0]?ue.apply(0,r[n-1].slice(-2).concat(t.slice(1))):0})),e}function ce(t,e){var n,r,a=0;return ie(t).map((function(t,i,s){return r=i?s[i-1].slice(-2).concat(t.slice(1)):t.slice(1),n=i?ue.apply(0,r):0,a+=n,0===i?{x:r[0],y:r[1]}:a>e&&e>a-n?ee.apply(0,r.concat(1-(a-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function pe(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 he(t){return function(t){var e=0,n=0,r=0,a=0,i=0;return ie(t).map((function(t){var s;switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,a="M"===t[0]?t[2]:a,e=r,n=a,0;default:return i=pe.apply(0,[e,n].concat(t.slice(1))),s=t.slice(-2),e=s[0],n=s[1],i}})).reduce((function(t,e){return t+e}),0)}(ie(t))>=0}function fe(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ve(t){return t.reduce((function(e,n,r){return r?e+fe(t[r-1],n):0}),0)}function de(t,e){var n=Wt(t,0);return function(t){var e=[],n=[],r="",a=t.length,i=0;if(!t.length||"M"!==t[0][0])return!1;for(var s=0;s-1))return!1;e.push([n[1],n[2]])}return i=ve(e),!!a&&{ring:e,pathLength:i}}(n)||ge(n,e)}function ge(t,e){var n,r,a=ie((r=se(t),se(Kt(r,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),i=le(a),s=[],o=3;e&&!isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(i/e)));for(var u=0;ue;)r=ne(n,r,.5),t.splice(a+1,0,r)}function we(t,e){var n,r,a;if("string"==typeof t){var i=de(t,e);t=i.ring,r=i.skipBisect,a=i.pathLength}else if(!Array.isArray(t))throw Qt;if((n=t.slice(0)).pathLength=a,!be(n))throw Qt;return n.length>1&&fe(n[0],n[n.length-1])<1e-9&&n.pop(),!r&&e&&!isNaN(e)&&+e>0&&xe(n,e),n}function be(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!isNaN(t[0])&&!isNaN(t[1])}))}function Me(t,e,n){var r=we(t,n=n||f.morphPrecision),a=we(e,n),i=r.length-a.length;return me(r,i<0?-1*i:0),me(a,i>0?i:0),ye(r,a),[Nt(r),Nt(a)]}var _e={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof SVGElement?e:/^\.|^\#/.test(e)?V(e):null,a=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(a,""):r||"string"!=typeof e||(n.original=e.replace(a,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var a=e.pathArray,i=n.pathArray,s=i.length;t.setAttribute("d",1===r?n.original:"M"+Pt(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=Me(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},Ce={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Pt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:_e,Util:{addPoints:me,bisect:xe,normalizeRing:we,validRing:be,getInterpolationPoints:Me,pathStringToRing:de,distanceSquareRoot:fe,midPoint:ne,approximateRing:ge,rotateRing:ye,pathToString:se,pathToCurve:ie,getPathLength:le,getPointAtLength:ce,getDrawDirection:he,roundPath:Nt}};for(var Te in b.SVGMorph=Ce,b){var Se=b[Te];b[Te]=new F(Se)}var Ie={Animation:F,Components:b,Tween:H,fromTo:function(t,e,n,r){return r=r||{},new L.tween(V(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(V(t),e,e,n)},TweenCollection:j,allFromTo:function(t,e,n,r){return r=r||{},new j(V(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new j(V(t,!0),e,e,n)},Objects:x,Util:w,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:T,Selector:V,Version:"2.1.0"};export default Ie; diff --git a/dist/kute.js b/dist/kute.js index 67f032d..a7045b5 100644 --- a/dist/kute.js +++ b/dist/kute.js @@ -1,6 +1,6 @@ /*! -* KUTE.js Standard v2.0.16 (http://thednp.github.io/kute.js) -* Copyright 2015-2020 © thednp +* KUTE.js Standard v2.1.0 (http://thednp.github.io/kute.js) +* Copyright 2015-2021 © thednp * Licensed under MIT (https://github.com/thednp/kute.js/blob/master/LICENSE) */ (function (global, factory) { @@ -9,7 +9,7 @@ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.KUTE = factory()); }(this, (function () { 'use strict'; - var version = "2.0.16"; + var version = "2.1.0"; var KUTE = {}; @@ -1385,7 +1385,7 @@ return getCircleLength(el); } else if ('ellipse'===el.tagName) { return getEllipseLength(el); - } else if (['polygon,polyline'].indexOf(el.tagName)>-1) { + } else if (['polygon','polyline'].indexOf(el.tagName)>-1) { return getPolyLength(el); } else if ('line'===el.tagName) { return getLineLength(el); diff --git a/dist/kute.min.js b/dist/kute.min.js index e849259..ca37b63 100644 --- a/dist/kute.min.js +++ b/dist/kute.min.js @@ -1,2 +1,2 @@ -// KUTE.js Standard v2.0.16 | thednp © 2020 | 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={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function V(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t instanceof Element}))?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}function q(){for(var t in i)if("function"==typeof i[t])i[t].call(this,t);else for(var e in i[t])i[t][e].call(this,e);C.call(this)}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),P.linear};var N=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};N.prototype.start=function(e){return M(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),q.call(this),this._startFired=!0),!s&&o(),this},N.prototype.stop=function(){return this.playing&&(_(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},N.prototype.close=function(){for(var t in y)for(var e in y[t])y[t][e].call(this,e);this._startFired=!1,u.call(this)},N.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},N.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},N.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return 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)},L.tween=N,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var j=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,E.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.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),q.call(this),this._startTime+=t.Time()-this._pauseTime,M(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(_(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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.map((function(t){return t.start()})),!1))},n}(N);L.tween=j;var H=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};H.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),this},H.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},H.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},H.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},H.prototype.chain=function(t){var 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},H.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},H.prototype.removeTweens=function(){this.tweens=[]},H.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 F=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function U(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*Q(n,r,i)>>0)/10:Q(n,r,i)>>0)+"px"})}F.prototype.setComponent=function(t){var e=this,n=t.component,a={prepareProperty:d,prepareStart:v,onStart:i,onComplete:y,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[o]=t.defaultValue,e.supports=o+" property";else if(t.defaultValues){for(var l in t.defaultValues)h[l]=t.defaultValues[l];e.supports=(u||o)+" "+(o||s)+" properties"}if(t.defaultOptions)for(var c in t.defaultOptions)f[c]=t.defaultOptions[c];if(t.functions)for(var x in a)if(x in t.functions)if("function"==typeof t.functions[x])!a[x][n]&&(a[x][n]={}),!a[x][n][s||o]&&(a[x][n][s||o]=t.functions[x]);else for(var w in t.functions[x])!a[x][n]&&(a[x][n]={}),!a[x][n][w]&&(a[x][n][w]=t.functions[x][w]);if(t.Interpolate){for(var M in t.Interpolate){var _=t.Interpolate[M];if("function"!=typeof _||r[M])for(var C in _)"function"!=typeof _[C]||r[M]||(r[M]=_[C]);else r[M]=_}m[n]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return e};var R=["top","left","width","height"],X={};R.map((function(t){return X[t]=D}));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 I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=U(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:U}};function Z(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function z(t,e,n){var r,i={},a=",";for(r in e)i[r]="a"!==r?Q(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*Q(t[r],e[r],n)>>0)/100:null;return i.a?"rgba("+i.r+a+i.g+a+i.b+a+i.a+")":"rgb("+i.r+a+i.g+a+i.b+")"}function Y(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=z(n,r,i)})}w.BoxModelEssential=B;var K=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],$={};K.map((function(t){$[t]="#000"}));var W={};K.map((function(t){return W[t]=Y}));var G={component:"colorProperties",category:"colors",properties:K,defaultValues:$,Interpolate:{numbers:Q,colors:z},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return Z(e)},onStart:W},Util:{trueColor:Z}};w.ColorProperties=G;var J={},tt="htmlAttributes",et=["fill","stroke","stop-color"];function nt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var rt={prepareStart:function(t,e){var n={};for(var r in e){var i=nt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=et.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=nt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(et.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){t.setAttribute(e,z(n,r,i))})},n[a]=Z(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=U(o).u||U(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*Q(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=U(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*Q(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=J)}}},it={component:tt,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:rt,Util:{replaceUppercase:nt,trueColor:Z,trueDimension:U}};w.HTMLAttributes=it;var at={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*Q(n,r,i)>>0)/1e3})}},st={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at};w.OpacityProperty=st;var ot=String("abcdefghijklmnopqrstuvwxyz").split(""),ut=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),lt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ct=String("0123456789").split(""),pt=ot.concat(ut,ct),ht=pt.concat(lt),ft={alpha:ot,upper:ut,symbols:lt,numeric:ct,alphanumeric:pt,all:ht},dt={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in ft?ft[n]:n&&n.length?n:ft[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function vt(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 i=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=i,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=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function xt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function bt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=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 Mt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}w.TextWriteProperties=yt;var _t={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,e){var n=S(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?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(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},d=0;d>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:Mt}};function Ct(t,e){return parseFloat(t)/100*e}function Tt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function St(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a-1?St(t):"line"===t.tagName?It(t):void 0}function Ot(t,e){var n,r,i,a,s=/path|glyph/.test(t.tagName)?t.getTotalLength():kt(t);return e instanceof Object?e:("string"==typeof e?(e=e.split(/\,|\s/),n=/%/.test(e[0])?Ct(e[0].trim(),s):parseFloat(e[0]),r=/%/.test(e[1])?Ct(e[1].trim(),s):parseFloat(e[1])):void 0===e&&(a=parseFloat(I(t,"stroke-dashoffset")),i=I(t,"stroke-dasharray").split(/\,/),n=0-a,r=parseFloat(i[0])+n||s),{s:n,e:r,l:s})}w.TransformFunctions=_t;var Lt={prepareStart:function(){return Ot(this.element)},prepareProperty:function(t,e){return Ot(this.element,e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){var i=(100*e.l>>0)/100,a=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"})}},Pt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:Lt,Util:{getRectLength:Tt,getPolyLength:St,getLineLength:It,getCircleLength:At,getEllipseLength:Et,getTotalLength:kt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Ot,percent:Ct}};function Vt(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}w.SVGDraw=Pt;var qt=3;function Nt(t){return t.map((function(t){return Array.isArray(t)?Nt(t):isNaN(+t)?t:+t}))}function jt(t,e){var n=isNaN(+e)?qt:+e;return n?t.map((function(t){return t.map((function(t,e){var r=+t,i=Math.pow(10,n);return r?r%1==0?r:Math.round(r*i)/i:t}))})):Nt(t)}function Ht(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n];r.length;)e[n]="A",t.splice(n++,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Ft={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ut(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Qt(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>=Ft[n]&&(t.segments.push([e].concat(r.splice(0,Ft[n]))),Ft[n]););}var Dt="Invalid path value";function Rt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=Dt+": invalid Arc flag "+e)}function Xt(t){return t>=48&&t<=57}function Bt(t){var e,n=t.index,r=n,i=t.max,a=!1,s=!1,o=!1,u=!1;if(r>=i)t.err=Dt+": missing param "+t.pathValue[r];else if(43!==(e=t.pathValue.charCodeAt(r))&&45!==e||(e=++r=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index++;var e}function zt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Yt(t){var e,n,r,i,a=t.max;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}return!1}(e=t.pathValue.charCodeAt(t.index)))if(r=Ft[t.pathValue[t.index].toLowerCase()],t.index++,Zt(t),t.data=[],r){for(n=!1;;){for(i=r;i>0;i--){if(97!=(32|e)||3!==i&&4!==i?Bt(t):Rt(t),t.err.length)return;t.data.push(t.param),Zt(t),n=!1,t.index=t.max)break;if(!zt(t.pathValue.charCodeAt(t.index)))break}}Qt(t)}else Qt(t);else t.err=Dt+": "+t.pathValue[t.index]+" not a path command"}function Kt(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 $t(t,e){if(Ut(n=t)&&n.every((function(t){return t[0]===t[0].toUpperCase()})))return Nt(t);var n;t=function(t,e){if(Ut(t))return Nt(t);var n=new Kt(t);for(Zt(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=i.x1,e.y1=i.y1,["C",i.x1,i.y1].concat(t.slice(1));case"T":return r=function(t,e,n,r,i){return"QT".indexOf(i)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),e.qx=r.qx,e.qy=r.qy,["Q",e.qx,e.qy].concat(t.slice(1));case"Q":e.qx=t[1],e.qy=t[2]}return t}function Gt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Nt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o="",u=(t=$t(t)).length,l=0;l1&&(n*=b=Math.sqrt(b),r*=b);var w=n*n,M=r*r,_=(a==s?-1:1)*Math.sqrt(Math.abs((w*M-w*x*x-M*m*m)/(w*x*x+M*m*m)));f=_*n*x/r+(t+o)/2,d=_*-r*m/n+(e+u)/2,p=Math.asin(((e-d)/r).toFixed(9)),h=Math.asin(((u-d)/r).toFixed(9)),p=th&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var C=h-p;if(Math.abs(C)>v){var T=h,S=o,I=u;h=p+v*(s&&h>p?1:-1),o=f+n*Math.cos(h),u=d+r*Math.sin(h),y=te(o,u,n,r,i,0,s,S,I,[h,T,f,d])}C=h-p;var A=Math.cos(p),E=Math.sin(p),k=Math.cos(h),O=Math.sin(h),L=Math.tan(C/4),P=4/3*n*L,V=4/3*r*L,q=[t,e],N=[t+P*E,e-V*A],j=[o+P*O,u-V*k],H=[o,u];return N[0]=2*q[0]-N[0],N[1]=2*q[1]-N[1],l?[N,j,H].concat(y):(y=[N,j,H].concat(y).join().split(",")).map((function(t,e){return e%2?Jt(y[e-1],t,g).y:Jt(t,y[e+1],g).x}))}function ee(t,e,n,r,i,a){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*i+o*n,s*a+o*r,i,a]}function ne(t,e,n,r,i,a,s,o,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*u*u*i+Math.pow(u,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*u*u*a+Math.pow(u,3)*o}}function re(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ie(t,e,n,r){var i=.5,a=[t,e],s=[n,r],o=re(a,s,i),u=re(s,o,i),l=re(o,u,i),c=re(u,l,i),p=re(l,c,i),h=ne.apply(0,a.concat(o,l,p,i)),f=ne.apply(0,p.concat(c,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function ae(t,e){switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"M":return e.x=t[1],e.y=t[2],t;case"A":return["C"].concat(te.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(ee.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ie(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ie(e.x1,e.y1,e.x,e.y))}return t}function se(t,e){if(function(t){return Ut(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Nt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o=(t=Gt(t)).length,u=0;u1?1:u<0?0:u)/2,c=0,p=0,h=0,f=0,d=[.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].map((function(u,v){p=ue(t,n,i,s,c=l*u+l),h=ue(e,r,a,o,c),f+=d[v]*Math.sqrt(p*p+h*h)})),l*f}function ce(t){var e=0;return se(t).map((function(t,n,r){e+="M"!==t[0]?le.apply(0,r[n-1].slice(-2).concat(t.slice(1))):0})),e}function pe(t,e){var n,r,i=0;return se(t).map((function(t,a,s){return r=a?s[a-1].slice(-2).concat(t.slice(1)):t.slice(1),n=a?le.apply(0,r):0,i+=n,0===a?{x:r[0],y:r[1]}:i>e&&e>i-n?ne.apply(0,r.concat(1-(i-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function he(t,e,n,r,i,a,s,o){return 3*((o-e)*(n+i)-(s-t)*(r+a)+r*(t-i)-n*(e-a)+o*(i+t/3)-s*(a+e/3))/20}function fe(t){return function(t){var e=0,n=0,r=0,i=0,a=0;return se(t).map((function(t){var s;switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,i="M"===t[0]?t[2]:i,e=r,n=i,0;default:return a=he.apply(0,[e,n].concat(t.slice(1))),s=t.slice(-2),e=s[0],n=s[1],a}})).reduce((function(t,e){return t+e}),0)}(se(t))>=0}function de(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ve(t){return t.reduce((function(e,n,r){return r?e+de(t[r-1],n):0}),0)}function ge(t,e){var n=Gt(t,0);return function(t){var e=[],n=[],r="",i=t.length,a=0;if(!t.length||"M"!==t[0][0])return!1;for(var s=0;s-1))return!1;e.push([n[1],n[2]])}return a=ve(e),!!i&&{ring:e,pathLength:a}}(n)||ye(n,e)}function ye(t,e){var n,r,i=se((r=oe(t),oe($t(r,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),a=ce(i),s=[],o=3;e&&!isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(a/e)));for(var u=0;ue;)r=re(n,r,.5),t.splice(i+1,0,r)}function we(t,e){var n,r,i;if("string"==typeof t){var a=ge(t,e);t=a.ring,r=a.skipBisect,i=a.pathLength}else if(!Array.isArray(t))throw Dt;if((n=t.slice(0)).pathLength=i,!Me(n))throw Dt;return n.length>1&&de(n[0],n[n.length-1])<1e-9&&n.pop(),!r&&e&&!isNaN(e)&&+e>0&&be(n,e),n}function Me(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!isNaN(t[0])&&!isNaN(t[1])}))}function _e(t,e,n){var r=we(t,n=n||f.morphPrecision),i=we(e,n),a=r.length-i.length;return xe(r,a<0?-1*a:0),xe(i,a>0?a:0),me(r,i),[jt(r),jt(i)]}var Ce={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof SVGElement?e:/^\.|^\#/.test(e)?V(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):r||"string"!=typeof e||(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i=e.pathArray,a=n.pathArray,s=a.length;t.setAttribute("d",1===r?n.original:"M"+Vt(i,a,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=_e(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},Te={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Vt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Ce,Util:{addPoints:xe,bisect:be,normalizeRing:we,validRing:Me,getInterpolationPoints:_e,pathStringToRing:ge,distanceSquareRoot:de,midPoint:re,approximateRing:ye,rotateRing:me,pathToString:oe,pathToCurve:se,getPathLength:ce,getPointAtLength:pe,getDrawDirection:fe,roundPath:jt}};for(var Se in w.SVGMorph=Te,w){var Ie=w[Se];w[Se]=new F(Ie)}return{Animation:F,Components:w,Tween:j,fromTo:function(t,e,n,r){return r=r||{},new L.tween(V(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(V(t),e,e,n)},TweenCollection:H,allFromTo:function(t,e,n,r){return r=r||{},new H(V(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new H(V(t,!0),e,e,n)},Objects:x,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:T,Selector:V,Version:"2.0.16"}})); +// KUTE.js Standard v2.1.0 | 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={},e=[],n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r={},i={},a={};a.now=self.performance.now.bind(self.performance);var s=0,o=function(t){for(var n=0;n(n=1))return n;for(;ei?e=r:n=r,r=.5*(n-e)+e}return r};var L={},P={linear:new O(0,0,1,1,"linear"),easingSinusoidalIn:new O(.47,0,.745,.715,"easingSinusoidalIn"),easingSinusoidalOut:new O(.39,.575,.565,1,"easingSinusoidalOut"),easingSinusoidalInOut:new O(.445,.05,.55,.95,"easingSinusoidalInOut"),easingQuadraticIn:new O(.55,.085,.68,.53,"easingQuadraticIn"),easingQuadraticOut:new O(.25,.46,.45,.94,"easingQuadraticOut"),easingQuadraticInOut:new O(.455,.03,.515,.955,"easingQuadraticInOut"),easingCubicIn:new O(.55,.055,.675,.19,"easingCubicIn"),easingCubicOut:new O(.215,.61,.355,1,"easingCubicOut"),easingCubicInOut:new O(.645,.045,.355,1,"easingCubicInOut"),easingQuarticIn:new O(.895,.03,.685,.22,"easingQuarticIn"),easingQuarticOut:new O(.165,.84,.44,1,"easingQuarticOut"),easingQuarticInOut:new O(.77,0,.175,1,"easingQuarticInOut"),easingQuinticIn:new O(.755,.05,.855,.06,"easingQuinticIn"),easingQuinticOut:new O(.23,1,.32,1,"easingQuinticOut"),easingQuinticInOut:new O(.86,0,.07,1,"easingQuinticInOut"),easingExponentialIn:new O(.95,.05,.795,.035,"easingExponentialIn"),easingExponentialOut:new O(.19,1,.22,1,"easingExponentialOut"),easingExponentialInOut:new O(1,0,0,1,"easingExponentialInOut"),easingCircularIn:new O(.6,.04,.98,.335,"easingCircularIn"),easingCircularOut:new O(.075,.82,.165,1,"easingCircularOut"),easingCircularInOut:new O(.785,.135,.15,.86,"easingCircularInOut"),easingBackIn:new O(.6,-.28,.735,.045,"easingBackIn"),easingBackOut:new O(.175,.885,.32,1.275,"easingBackOut"),easingBackInOut:new O(.68,-.55,.265,1.55,"easingBackInOut")};function V(t,e){try{return e?t instanceof HTMLCollection||t instanceof NodeList||t instanceof Array&&t.every((function(t){return t instanceof Element}))?t:document.querySelectorAll(t):t instanceof Element||t===window?t:document.querySelector(t)}catch(e){console.error("KUTE.js - Element(s) not found: "+t+".")}}function q(){for(var t in i)if("function"==typeof i[t])i[t].call(this,t);else for(var e in i[t])i[t][e].call(this,e);C.call(this)}L.processEasing=function(t){if("function"==typeof t)return t;if("function"==typeof P[t])return P[t];if(/bezier/.test(t)){var e=t.replace(/bezier|\s|\(|\)/g,"").split(",");return new O(1*e[0],1*e[1],1*e[2],1*e[3])}return/elastic|bounce/i.test(t)&&console.warn("KUTE.js - CubicBezier doesn't support "+t+" easing."),P.linear};var N=function(e,n,r,a){for(var s in this.element=e,this.playing=!1,this._startTime=null,this._startFired=!1,this.valuesEnd=r,this.valuesStart=n,a=a||{},this._resetStart=a.resetStart||0,this._easing="function"==typeof a.easing?a.easing:L.processEasing(a.easing),this._duration=a.duration||f.duration,this._delay=a.delay||f.delay,a){var o="_"+s;o in this||(this[o]=a[s])}var u=this._easing.name;return i[u]||(i[u]=function(e){!t[e]&&e===this._easing.name&&(t[e]=this._easing)}),this};N.prototype.start=function(e){return M(this),this.playing=!0,this._startTime=void 0!==e?e:t.Time(),this._startTime+=this._delay,this._startFired||(this._onStart&&this._onStart.call(this),q.call(this),this._startFired=!0),!s&&o(),this},N.prototype.stop=function(){return this.playing&&(_(this),this.playing=!1,this._onStop&&this._onStop.call(this),this.close()),this},N.prototype.close=function(){for(var t in y)for(var e in y[t])y[t][e].call(this,e);this._startFired=!1,u.call(this)},N.prototype.chain=function(t){return this._chain=[],this._chain=t.length?t:this._chain.concat(t),this},N.prototype.stopChainedTweens=function(){this._chain&&this._chain.length&&this._chain.map((function(t){return t.stop()}))},N.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return 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)},L.tween=N,f.repeat=0,f.repeatDelay=0,f.yoyo=!1,f.resetStart=!1;var j=function(e){function n(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];e.apply(this,t),this.valuesStart={},this.valuesEnd={};var r=t[1],i=t[2];if(A.call(this,i,"end"),this._resetStart?this.valuesStart=r:A.call(this,r,"start"),!this._resetStart)for(var a in g)for(var s in g[a])g[a][s].call(this,s);this.paused=!1,this._pauseTime=null;var o=t[3];return this._repeat=o.repeat||f.repeat,this._repeatDelay=o.repeatDelay||f.repeatDelay,this._repeatOption=this._repeat,this.valuesRepeat={},this._yoyo=o.yoyo||f.yoyo,this._reversed=!1,this}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.start=function(t){if(this._resetStart)for(var n in this.valuesStart=this._resetStart,E.call(this),g)for(var r in g[n])g[n][r].call(this,r);if(this.paused=!1,this._yoyo)for(var i in this.valuesEnd)this.valuesRepeat[i]=this.valuesStart[i];return e.prototype.start.call(this,t),this},n.prototype.stop=function(){return e.prototype.stop.call(this),!this.paused&&this.playing&&(this.paused=!1,this.stopChainedTweens()),this},n.prototype.close=function(){return e.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),q.call(this),this._startTime+=t.Time()-this._pauseTime,M(this),!s&&o()),this},n.prototype.pause=function(){return!this.paused&&this.playing&&(_(this),this.paused=!0,this._pauseTime=t.Time(),void 0!==this._onPause&&this._onPause.call(this)),this},n.prototype.reverse=function(){for(var t in this.valuesEnd){var e=this.valuesRepeat[t];this.valuesRepeat[t]=this.valuesEnd[t],this.valuesEnd[t]=e,this.valuesStart[t]=this.valuesRepeat[t]}},n.prototype.update=function(e){var n,r;if((e=void 0!==e?e:t.Time())1?1:n,r=this._easing(n),this.valuesEnd)t[i](this.element,this.valuesStart[i],this.valuesEnd[i],r);return this._onUpdate&&this._onUpdate.call(this),1!==n||(this._repeat>0?(isFinite(this._repeat)&&this._repeat--,this._startTime=isFinite(this._repeat)&&this._yoyo&&!this._reversed?e+this._repeatDelay:e,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.map((function(t){return t.start()})),!1))},n}(N);L.tween=j;var H=function(t,e,n,r){var i=this;this.tweens=[],!("offset"in f)&&(f.offset=0),(r=r||{}).delay=r.delay||f.delay;var a=[];return Array.from(t).map((function(t,s){a[s]=r||{},a[s].delay=s>0?r.delay+(r.offset||f.offset):r.delay,t instanceof Element?i.tweens.push(new L.tween(t,e,n,a[s])):console.error("KUTE.js - "+t+" not instanceof [Element]")})),this.length=this.tweens.length,this};H.prototype.start=function(e){return e=void 0===e?t.Time():e,this.tweens.map((function(t){return t.start(e)})),this},H.prototype.stop=function(){return this.tweens.map((function(t){return t.stop(time)})),this},H.prototype.pause=function(){return this.tweens.map((function(t){return t.pause(time)})),this},H.prototype.resume=function(){return this.tweens.map((function(t){return t.resume(time)})),this},H.prototype.chain=function(t){var 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},H.prototype.playing=function(){return this.tweens.some((function(t){return t.playing}))},H.prototype.removeTweens=function(){this.tweens=[]},H.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 F=function(t){try{t.component in p?console.error("KUTE.js - "+t.component+" already registered"):t.property in h?console.error("KUTE.js - "+t.property+" already registered"):this.setComponent(t)}catch(t){console.error(t)}};function U(t,e){for(var n,r=parseInt(t)||0,i=["px","%","deg","rad","em","rem","vh","vw"],a=0;a.99||i<.01?(10*Q(n,r,i)>>0)/10:Q(n,r,i)>>0)+"px"})}F.prototype.setComponent=function(t){var e=this,n=t.component,a={prepareProperty:d,prepareStart:v,onStart:i,onComplete:y,crossCheck:g},s=t.category,o=t.property,u=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(p[n]=t.properties||t.subProperties||t.property,"defaultValue"in t)h[o]=t.defaultValue,e.supports=o+" property";else if(t.defaultValues){for(var l in t.defaultValues)h[l]=t.defaultValues[l];e.supports=(u||o)+" "+(o||s)+" properties"}if(t.defaultOptions)for(var c in t.defaultOptions)f[c]=t.defaultOptions[c];if(t.functions)for(var x in a)if(x in t.functions)if("function"==typeof t.functions[x])!a[x][n]&&(a[x][n]={}),!a[x][n][s||o]&&(a[x][n][s||o]=t.functions[x]);else for(var w in t.functions[x])!a[x][n]&&(a[x][n]={}),!a[x][n][w]&&(a[x][n][w]=t.functions[x][w]);if(t.Interpolate){for(var M in t.Interpolate){var _=t.Interpolate[M];if("function"!=typeof _||r[M])for(var C in _)"function"!=typeof _[C]||r[M]||(r[M]=_[C]);else r[M]=_}m[n]=t.Interpolate}if(t.Util)for(var T in t.Util)!b[T]&&(b[T]=t.Util[T]);return e};var R=["top","left","width","height"],X={};R.map((function(t){return X[t]=D}));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 I(this.element,t)||h[t]},prepareProperty:function(t,e){var n=U(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:X},Util:{trueDimension:U}};function Z(t){if(/rgb|rgba/.test(t)){var e=t.replace(/\s|\)/,"").split("(")[1].split(","),n=e[3]?e[3]:null;return n?{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2]),a:parseFloat(n)}:{r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}if(/^#/.test(t)){var r=function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}(t);return{r:r.r,g:r.g,b:r.b}}if(/transparent|none|initial|inherit/.test(t))return{r:0,g:0,b:0,a:0};if(!/^#|^rgb/.test(t)){var i=document.getElementsByTagName("head")[0];i.style.color=t;var a=getComputedStyle(i,null).color;return a=/rgb/.test(a)?a.replace(/[^\d,]/g,"").split(","):[0,0,0],i.style.color="",{r:parseInt(a[0]),g:parseInt(a[1]),b:parseInt(a[2])}}}function z(t,e,n){var r,i={},a=",";for(r in e)i[r]="a"!==r?Q(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*Q(t[r],e[r],n)>>0)/100:null;return i.a?"rgba("+i.r+a+i.g+a+i.b+a+i.a+")":"rgb("+i.r+a+i.g+a+i.b+")"}function Y(e){this.valuesEnd[e]&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=z(n,r,i)})}w.BoxModelEssential=B;var K=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],$={};K.map((function(t){$[t]="#000"}));var W={};K.map((function(t){return W[t]=Y}));var G={component:"colorProperties",category:"colors",properties:K,defaultValues:$,Interpolate:{numbers:Q,colors:z},functions:{prepareStart:function(t,e){return I(this.element,t)||h[t]},prepareProperty:function(t,e){return Z(e)},onStart:W},Util:{trueColor:Z}};w.ColorProperties=G;var J={},tt="htmlAttributes",et=["fill","stroke","stop-color"];function nt(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var rt={prepareStart:function(t,e){var n={};for(var r in e){var i=nt(r).replace(/_+[a-z]+/,""),a=this.element.getAttribute(i);n[i]=et.includes(i)?a||"rgba(0,0,0,0)":a||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(t,e){var n={};for(var r in e){var a=nt(r),s=/(%|[a-z]+)$/,o=this.element.getAttribute(a.replace(/_+[a-z]+/,""));if(et.includes(a))i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){t.setAttribute(e,z(n,r,i))})},n[a]=Z(e[r])||h.htmlAttributes[r];else if(null!==o&&s.test(o)){var u=U(o).u||U(e[r]).u,l=/%/.test(u)?"_percent":"_"+u;i.htmlAttributes[a+l]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){var a=e.replace(l,"");t.setAttribute(a,(1e3*Q(n.v,r.v,i)>>0)/1e3+r.u)})},n[a+l]=U(e[r])}else s.test(e[r])&&null!==o&&(null===o||s.test(o))||(i.htmlAttributes[a]=function(e){this.valuesEnd[t]&&this.valuesEnd[t][e]&&!(e in J)&&(J[e]=function(t,e,n,r,i){t.setAttribute(e,(1e3*Q(n,r,i)>>0)/1e3)})},n[a]=parseFloat(e[r]))}return n},onStart:{attr:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(e,n,r,i){for(var a in r)t.attributes[a](e,a,n[a],r[a],i)})},attributes:function(e){!t[e]&&this.valuesEnd.attr&&(t[e]=J)}}},it={component:tt,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:rt,Util:{replaceUppercase:nt,trueColor:Z,trueDimension:U}};w.HTMLAttributes=it;var at={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,n,r,i){t.style[e]=(1e3*Q(n,r,i)>>0)/1e3})}},st={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:Q},functions:at};w.OpacityProperty=st;var ot=String("abcdefghijklmnopqrstuvwxyz").split(""),ut=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),lt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ct=String("0123456789").split(""),pt=ot.concat(ut,ct),ht=pt.concat(lt),ft={alpha:ot,upper:ut,symbols:lt,numeric:ct,alphanumeric:pt,all:ht},dt={text:function(e){if(!t[e]&&this.valuesEnd[e]){var n=this._textChars,r=n in ft?ft[n]:n&&n.length?n:ft[f.textChars];t[e]=function(t,e,n,i){var a="",s="",o=e.substring(0),u=n.substring(0),l=r[Math.random()*r.length>>0];" "===e?(s=u.substring(Math.min(i*u.length,u.length)>>0,0),t.innerHTML=i<1?s+l:""===n?" ":n):" "===n?(a=o.substring(0,Math.min((1-i)*o.length,o.length)>>0),t.innerHTML=i<1?a+l:""===n?" ":n):(a=o.substring(o.length,Math.min(i*o.length,o.length)>>0),s=u.substring(0,Math.min(i*u.length,u.length)>>0),t.innerHTML=i<1?s+l+a:""===n?" ":n)}}},number:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){t.innerHTML=Q(e,n,r)>>0})}};function vt(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 i=t.innerHTML;(n=document.createElement("SPAN")).className=e,n.innerHTML=i,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=[];if(t.children.length){for(var r,i=[],a=t.innerHTML,s=0,o=t.children.length,u=void 0,l=void 0,c=void 0;s>0)/1e3+n+")"}function xt(t,e,n,r){for(var i=[],a=0;a<3;a++)i[a]=(t[a]||e[a]?(1e3*(t[a]+(e[a]-t[a])*r)>>0)/1e3:0)+n;return"translate3d("+i.join(",")+")"}function bt(t,e,n,r){var i="";return i+=t[0]||e[0]?"rotateX("+(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3+n+")":"",i+=t[1]||e[1]?"rotateY("+(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3+n+")":"",i+=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 Mt(t,e,n,r){var i=[];return i[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+i.join(",")+")"}w.TextWriteProperties=yt;var _t={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,e){var n=S(this.element);return n[t]?n[t]:h[t]},prepareProperty:function(t,e){var n=["X","Y","Z"],r={},i=[],a=[],s=[],o=["translate3d","translate","rotate3d","skew"];for(var u in e){var l="object"==typeof e[u]&&e[u].length?e[u].map((function(t){return parseInt(t)})):parseInt(e[u]);if(o.includes(u))r["translate"===u||"rotate"===u?u+"3d":u]="skew"===u?l.length?[l[0]||0,l[1]||0]:[l||0,0]:"translate"===u?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(u)){for(var c=u.replace(/[XYZ]/,""),p="skew"===c?c:c+"3d",h="skew"===c?2:3,f="translate"===c?i:"rotate"===c?a:"skew"===c?s:{},d=0;d>0)/1e3)+n,i[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+i.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:wt,skew:Mt}};function Ct(t,e){return parseFloat(t)/100*e}function Tt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function St(t){var e=t.getAttribute("points").split(" "),n=0;if(e.length>1){var r=function(t){var e=t.split(",");if(2==e.length&&!isNaN(e[0])&&!isNaN(e[1]))return[parseFloat(e[0]),parseFloat(e[1])]},i=function(t,e){return null!=t&&null!=e?Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)):0};if(e.length>2)for(var a=0;a-1?St(t):"line"===t.tagName?It(t):void 0}function Ot(t,e){var n,r,i,a,s=/path|glyph/.test(t.tagName)?t.getTotalLength():kt(t);return e instanceof Object?e:("string"==typeof e?(e=e.split(/\,|\s/),n=/%/.test(e[0])?Ct(e[0].trim(),s):parseFloat(e[0]),r=/%/.test(e[1])?Ct(e[1].trim(),s):parseFloat(e[1])):void 0===e&&(a=parseFloat(I(t,"stroke-dashoffset")),i=I(t,"stroke-dasharray").split(/\,/),n=0-a,r=parseFloat(i[0])+n||s),{s:n,e:r,l:s})}w.TransformFunctions=_t;var Lt={prepareStart:function(){return Ot(this.element)},prepareProperty:function(t,e){return Ot(this.element,e)},onStart:function(e){e in this.valuesEnd&&!t[e]&&(t[e]=function(t,e,n,r){var i=(100*e.l>>0)/100,a=0-(100*Q(e.s,n.s,r)>>0)/100,s=(100*Q(e.e,n.e,r)>>0)/100+a;t.style.strokeDashoffset=a+"px",t.style.strokeDasharray=(100*(s<1?0:s)>>0)/100+"px, "+i+"px"})}},Pt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:Q},functions:Lt,Util:{getRectLength:Tt,getPolyLength:St,getLineLength:It,getCircleLength:At,getEllipseLength:Et,getTotalLength:kt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Ot,percent:Ct}};function Vt(t,e,n,r){for(var i=[],a=0;a>0)/1e3)}return i}w.SVGDraw=Pt;var qt=3;function Nt(t){return t.map((function(t){return Array.isArray(t)?Nt(t):isNaN(+t)?t:+t}))}function jt(t,e){var n=isNaN(+e)?qt:+e;return n?t.map((function(t){return t.map((function(t,e){var r=+t,i=Math.pow(10,n);return r?r%1==0?r:Math.round(r*i)/i:t}))})):Nt(t)}function Ht(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n];r.length;)e[n]="A",t.splice(n++,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Ft={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ut(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[achlmrqstvz]/g.test(e)}))}function Qt(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>=Ft[n]&&(t.segments.push([e].concat(r.splice(0,Ft[n]))),Ft[n]););}var Dt="Invalid path value";function Rt(t){var e=t.pathValue.charCodeAt(t.index);return 48===e?(t.param=0,void t.index++):49===e?(t.param=1,void t.index++):void(t.err=Dt+": invalid Arc flag "+e)}function Xt(t){return t>=48&&t<=57}function Bt(t){var e,n=t.index,r=n,i=t.max,a=!1,s=!1,o=!1,u=!1;if(r>=i)t.err=Dt+": missing param "+t.pathValue[r];else if(43!==(e=t.pathValue.charCodeAt(r))&&45!==e||(e=++r=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0);)t.index++;var e}function zt(t){return t>=48&&t<=57||43===t||45===t||46===t}function Yt(t){var e,n,r,i,a=t.max;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}return!1}(e=t.pathValue.charCodeAt(t.index)))if(r=Ft[t.pathValue[t.index].toLowerCase()],t.index++,Zt(t),t.data=[],r){for(n=!1;;){for(i=r;i>0;i--){if(97!=(32|e)||3!==i&&4!==i?Bt(t):Rt(t),t.err.length)return;t.data.push(t.param),Zt(t),n=!1,t.index=t.max)break;if(!zt(t.pathValue.charCodeAt(t.index)))break}}Qt(t)}else Qt(t);else t.err=Dt+": "+t.pathValue[t.index]+" not a path command"}function Kt(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 $t(t,e){if(Ut(n=t)&&n.every((function(t){return t[0]===t[0].toUpperCase()})))return Nt(t);var n;t=function(t,e){if(Ut(t))return Nt(t);var n=new Kt(t);for(Zt(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=i.x1,e.y1=i.y1,["C",i.x1,i.y1].concat(t.slice(1));case"T":return r=function(t,e,n,r,i){return"QT".indexOf(i)>-1?{qx:2*t-n,qy:2*e-r}:{qx:t,qy:e}}(e.x1,e.y1,e.qx,e.qy,n),e.qx=r.qx,e.qy=r.qy,["Q",e.qx,e.qy].concat(t.slice(1));case"Q":e.qx=t[1],e.qy=t[2]}return t}function Gt(t,e){if(function(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ft[e]===t.length-1&&/[ACLMQZ]/.test(t[0])}))}(t))return Nt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o="",u=(t=$t(t)).length,l=0;l1&&(n*=b=Math.sqrt(b),r*=b);var w=n*n,M=r*r,_=(a==s?-1:1)*Math.sqrt(Math.abs((w*M-w*x*x-M*m*m)/(w*x*x+M*m*m)));f=_*n*x/r+(t+o)/2,d=_*-r*m/n+(e+u)/2,p=Math.asin(((e-d)/r).toFixed(9)),h=Math.asin(((u-d)/r).toFixed(9)),p=th&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}var C=h-p;if(Math.abs(C)>v){var T=h,S=o,I=u;h=p+v*(s&&h>p?1:-1),o=f+n*Math.cos(h),u=d+r*Math.sin(h),y=te(o,u,n,r,i,0,s,S,I,[h,T,f,d])}C=h-p;var A=Math.cos(p),E=Math.sin(p),k=Math.cos(h),O=Math.sin(h),L=Math.tan(C/4),P=4/3*n*L,V=4/3*r*L,q=[t,e],N=[t+P*E,e-V*A],j=[o+P*O,u-V*k],H=[o,u];return N[0]=2*q[0]-N[0],N[1]=2*q[1]-N[1],l?[N,j,H].concat(y):(y=[N,j,H].concat(y).join().split(",")).map((function(t,e){return e%2?Jt(y[e-1],t,g).y:Jt(t,y[e+1],g).x}))}function ee(t,e,n,r,i,a){var s=1/3,o=2/3;return[s*t+o*n,s*e+o*r,s*i+o*n,s*a+o*r,i,a]}function ne(t,e,n,r,i,a,s,o,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*u*u*i+Math.pow(u,3)*s,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*u*u*a+Math.pow(u,3)*o}}function re(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function ie(t,e,n,r){var i=.5,a=[t,e],s=[n,r],o=re(a,s,i),u=re(s,o,i),l=re(o,u,i),c=re(u,l,i),p=re(l,c,i),h=ne.apply(0,a.concat(o,l,p,i)),f=ne.apply(0,p.concat(c,u,s,0));return[h.x,h.y,f.x,f.y,n,r]}function ae(t,e){switch("TQ".indexOf(t[0])<0&&(e.qx=e.qy=null),t[0]){case"M":return e.x=t[1],e.y=t[2],t;case"A":return["C"].concat(te.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(ee.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(ie(e.x1,e.y1,t[1],t[2]));case"Z":return["C"].concat(ie(e.x1,e.y1,e.x,e.y))}return t}function se(t,e){if(function(t){return Ut(t)&&t.slice(1).every((function(t){return"C"===t[0]}))}(t))return Nt(t);for(var n,r,i={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",o=(t=Gt(t)).length,u=0;u1?1:u<0?0:u)/2,c=0,p=0,h=0,f=0,d=[.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].map((function(u,v){p=ue(t,n,i,s,c=l*u+l),h=ue(e,r,a,o,c),f+=d[v]*Math.sqrt(p*p+h*h)})),l*f}function ce(t){var e=0;return se(t).map((function(t,n,r){e+="M"!==t[0]?le.apply(0,r[n-1].slice(-2).concat(t.slice(1))):0})),e}function pe(t,e){var n,r,i=0;return se(t).map((function(t,a,s){return r=a?s[a-1].slice(-2).concat(t.slice(1)):t.slice(1),n=a?le.apply(0,r):0,i+=n,0===a?{x:r[0],y:r[1]}:i>e&&e>i-n?ne.apply(0,r.concat(1-(i-e)/n)):null})).filter((function(t){return t})).slice(-1)[0]}function he(t,e,n,r,i,a,s,o){return 3*((o-e)*(n+i)-(s-t)*(r+a)+r*(t-i)-n*(e-a)+o*(i+t/3)-s*(a+e/3))/20}function fe(t){return function(t){var e=0,n=0,r=0,i=0,a=0;return se(t).map((function(t){var s;switch(t[0]){case"M":case"Z":return r="M"===t[0]?t[1]:r,i="M"===t[0]?t[2]:i,e=r,n=i,0;default:return a=he.apply(0,[e,n].concat(t.slice(1))),s=t.slice(-2),e=s[0],n=s[1],a}})).reduce((function(t,e){return t+e}),0)}(se(t))>=0}function de(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ve(t){return t.reduce((function(e,n,r){return r?e+de(t[r-1],n):0}),0)}function ge(t,e){var n=Gt(t,0);return function(t){var e=[],n=[],r="",i=t.length,a=0;if(!t.length||"M"!==t[0][0])return!1;for(var s=0;s-1))return!1;e.push([n[1],n[2]])}return a=ve(e),!!i&&{ring:e,pathLength:a}}(n)||ye(n,e)}function ye(t,e){var n,r,i=se((r=oe(t),oe($t(r,0)).replace(/(m|M)/g,"|$1").split("|").map((function(t){return t.trim()})).filter((function(t){return t})))[0],4),a=ce(i),s=[],o=3;e&&!isNaN(e)&&+e>0&&(o=Math.max(o,Math.ceil(a/e)));for(var u=0;ue;)r=re(n,r,.5),t.splice(i+1,0,r)}function we(t,e){var n,r,i;if("string"==typeof t){var a=ge(t,e);t=a.ring,r=a.skipBisect,i=a.pathLength}else if(!Array.isArray(t))throw Dt;if((n=t.slice(0)).pathLength=i,!Me(n))throw Dt;return n.length>1&&de(n[0],n[n.length-1])<1e-9&&n.pop(),!r&&e&&!isNaN(e)&&+e>0&&be(n,e),n}function Me(t){return Array.isArray(t)&&t.every((function(t){return Array.isArray(t)&&2===t.length&&!isNaN(t[0])&&!isNaN(t[1])}))}function _e(t,e,n){var r=we(t,n=n||f.morphPrecision),i=we(e,n),a=r.length-i.length;return xe(r,a<0?-1*a:0),xe(i,a>0?a:0),me(r,i),[jt(r),jt(i)]}var Ce={prepareStart:function(t){return this.element.getAttribute("d")},prepareProperty:function(t,e){var n={},r=e instanceof SVGElement?e:/^\.|^\#/.test(e)?V(e):null,i=new RegExp("\\n","ig");return"object"==typeof e&&e.pathArray?e:(r&&/path|glyph/.test(r.tagName)?n.original=r.getAttribute("d").replace(i,""):r||"string"!=typeof e||(n.original=e.replace(i,"")),n)},onStart:function(e){!t[e]&&this.valuesEnd[e]&&(t[e]=function(t,e,n,r){var i=e.pathArray,a=n.pathArray,s=a.length;t.setAttribute("d",1===r?n.original:"M"+Vt(i,a,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=_e(this.valuesStart[t].original,this.valuesEnd[t].original,this._morphPrecision?parseInt(this._morphPrecision):f.morphPrecision);this.valuesStart[t].pathArray=r[0],this.valuesEnd[t].pathArray=r[1]}}}},Te={component:"svgMorph",property:"path",defaultValue:[],Interpolate:Vt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:Ce,Util:{addPoints:xe,bisect:be,normalizeRing:we,validRing:Me,getInterpolationPoints:_e,pathStringToRing:ge,distanceSquareRoot:de,midPoint:re,approximateRing:ye,rotateRing:me,pathToString:oe,pathToCurve:se,getPathLength:ce,getPointAtLength:pe,getDrawDirection:fe,roundPath:jt}};for(var Se in w.SVGMorph=Te,w){var Ie=w[Se];w[Se]=new F(Ie)}return{Animation:F,Components:w,Tween:j,fromTo:function(t,e,n,r){return r=r||{},new L.tween(V(t),e,n,r)},to:function(t,e,n){return(n=n||{}).resetStart=e,new L.tween(V(t),e,e,n)},TweenCollection:H,allFromTo:function(t,e,n,r){return r=r||{},new H(V(t,!0),e,n,r)},allTo:function(t,e,n){return(n=n||{}).resetStart=e,new H(V(t,!0),e,e,n)},Objects:x,Util:b,Easing:P,CubicBezier:O,Render:l,Interpolate:r,Process:k,Internals:T,Selector:V,Version:"2.1.0"}})); diff --git a/package.json b/package.json index 60a639a..467c4d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kute.js", - "version": "2.0.16", + "version": "2.1.0", "description": "JavaScript animation engine of the future is called KUTE.js.", "main": "dist/kute.min.js", "module": "dist/kute.esm.js", @@ -56,16 +56,16 @@ "dependencies": { "cubic-bezier-easing": "^1.0.2", "minifill": "^0.0.14", - "shorter-js": "^0.1.4", - "svg-path-commander": "0.0.9" + "shorter-js": "^0.1.7", + "svg-path-commander": "0.1.0" }, "devDependencies": { "@rollup/plugin-buble": "^0.21.3", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^9.0.0", "npm-run-all": "^4.1.5", - "rollup": "^2.28.1", - "rollup-plugin-cleanup": "^3.1.1", + "rollup": "^2.36.1", + "rollup-plugin-cleanup": "^3.2.1", "rollup-plugin-terser": "^7.0.2" } } diff --git a/src/components/svgDraw.js b/src/components/svgDraw.js index 34e7ae0..1bb37f9 100644 --- a/src/components/svgDraw.js +++ b/src/components/svgDraw.js @@ -72,7 +72,7 @@ function getTotalLength(el) { // returns the result of any of the below function return getCircleLength(el); } else if ('ellipse'===el.tagName) { return getEllipseLength(el); - } else if (['polygon,polyline'].indexOf(el.tagName)>-1) { + } else if (['polygon','polyline'].indexOf(el.tagName)>-1) { return getPolyLength(el); } else if ('line'===el.tagName) { return getLineLength(el);