!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";function e(t,e,n,r,a){var i=this;function s(t){return i.sampleCurveY(i.solveCurveX(t))}return this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,Object.defineProperty(s,"name",{writable:!0}),s.name=a||"cubic-bezier("+[t,e,n,r]+")",s}e.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},e.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},e.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},e.prototype.solveCurveX=function(t){for(var e,n,r,a,i=t,s=0;s<32;s+=1){if(r=this.sampleCurveX(i)-t,Math.abs(r)<1e-5)return i;if(a=this.sampleCurveDerivativeX(i),Math.abs(a)<1e-5)break;i-=r/a}if((i=t)<(e=0))return e;if((n=1)>0)/10:U(e,n,r)>>0)+"px"})}F.prototype.setComponent=function(r){var n=r.component,a={prepareProperty:g,prepareStart:v,onStart:l,onComplete:b,crossCheck:m},t=r.category,i=r.property,e=r.properties&&r.properties.length||r.subProperties&&r.subProperties.length;return f[n]=r.properties||r.subProperties||r.property,"defaultValue"in r?(d[i]=r.defaultValue,this.supports=i+" property"):r.defaultValues&&(Object.keys(r.defaultValues).forEach(function(t){d[t]=r.defaultValues[t]}),this.supports=(e||i)+" "+(i||t)+" properties"),r.defaultOptions&&Object.keys(r.defaultOptions).forEach(function(t){y[t]=r.defaultOptions[t]}),r.functions&&Object.keys(a).forEach(function(e){e in r.functions&&("function"==typeof r.functions[e]?(a[e][n]||(a[e][n]={}),a[e][n][t||i]||(a[e][n][t||i]=r.functions[e])):Object.keys(r.functions[e]).forEach(function(t){a[e][n]||(a[e][n]={}),a[e][n][t]||(a[e][n][t]=r.functions[e][t])}))}),r.Interpolate&&(Object.keys(r.Interpolate).forEach(function(e){var n=r.Interpolate[e];"function"!=typeof n||o[e]?Object.keys(n).forEach(function(t){"function"!=typeof n[t]||o[e]||(o[e]=n[t])}):o[e]=n}),w[n]=r.Interpolate),r.Util&&Object.keys(r.Util).forEach(function(t){E[t]||(E[t]=r.Util[t])}),this};var R={};["top","left","width","height"].forEach(function(t){R[t]=D});var X=["top","left","width","height"],B={};X.forEach(function(t){B[t]=D});var Z={component:"essentialBoxModel",category:"boxModel",properties:X,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:U},functions:{prepareStart:function(t){return T(this.element,t)||d[t]},prepareProperty:function(t,e){return"%"===(e=Q(e)).u?e.v*this.element["height"===t?"offsetHeight":"offsetWidth"]/100:e.v},onStart:B},Util:{trueDimension:Q}};function z(t){var e,n,r,a;return/rgb|rgba/.test(t)&&((n=(e=t.replace(/\s|\)/,"").split("(")[1].split(","))[3]||null)||(r={r:parseInt(e[0],10),g:parseInt(e[1],10),b:parseInt(e[2],10)}),r={r:parseInt(e[0],10),g:parseInt(e[1],10),b:parseInt(e[2],10),a:parseFloat(n)}),/^#/.test(t)&&(a=(a=t).replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,n,r){return e+e+n+n+r+r}),r={r:(a=(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null).r,g:a.g,b:a.b}),/transparent|none|initial|inherit/.test(t)&&(r={r:0,g:0,b:0,a:0}),/^#|^rgb/.test(t)||((a=document.getElementsByTagName("head")[0]).style.color=t,t=getComputedStyle(a,null).color,t=/rgb/.test(t)?t.replace(/[^\d,]/g,"").split(","):[0,0,0],a.style.color="",r={r:parseInt(t[0],10),g:parseInt(t[1],10),b:parseInt(t[2],10)}),r}function Y(e,n,r){var a={};return Object.keys(n).forEach(function(t){"a"!==t?a[t]=U(e[t],n[t],r)>>0||0:e[t]&&n[t]&&(a[t]=(100*U(e[t],n[t],r)>>0)/100)}),a.a?"rgba("+a.r+","+a.g+","+a.b+","+a.a+")":"rgb("+a.r+","+a.g+","+a.b+")"}function K(a){this.valuesEnd[a]&&!s[a]&&(s[a]=function(t,e,n,r){t.style[a]=Y(e,n,r)})}var $={};["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"].forEach(function(t){$[t]=K});var W=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],G={};W.forEach(function(t){G[t]="#000"});var J={};W.forEach(function(t){J[t]=K});var tt={component:"colorProperties",category:"colors",properties:W,defaultValues:G,Interpolate:{numbers:U,colors:Y},functions:{prepareStart:function(t){return T(this.element,t)||d[t]},prepareProperty:function(t,e){return z(e)},onStart:J},Util:{trueColor:z}},et={},nt="htmlAttributes",rt=["fill","stroke","stop-color"];function at(t){return t.replace(/[A-Z]/g,"-$&").toLowerCase()}var it={prepareStart:function(t,e){var r=this,a={};return Object.keys(e).forEach(function(t){var e=at(t).replace(/_+[a-z]+/,""),n=r.element.getAttribute(e);a[e]=rt.includes(e)?n||"rgba(0,0,0,0)":n||(/opacity/i.test(t)?1:0)}),a},prepareProperty:function(s,o){var u=this,c={};return Object.keys(o).forEach(function(t){var e,i,n=at(t),r=/(%|[a-z]+)$/,a=u.element.getAttribute(n.replace(/_+[a-z]+/,""));rt.includes(n)?(l[nt][n]=function(t){!u.valuesEnd[s]||!u.valuesEnd[s][t]||t in et||(et[t]=function(t,e,n,r,a){t.setAttribute(e,Y(n,r,a))})},c[n]=z(o[t])||d.htmlAttributes[t]):null!==a&&r.test(a)?(e=Q(a).u||Q(o[t]).u,i=/%/.test(e)?"_percent":"_"+e,l[nt][n+i]=function(t){!u.valuesEnd[s]||!u.valuesEnd[s][t]||t in et||(et[t]=function(t,e,n,r,a){e=e.replace(i,"");t.setAttribute(e,(1e3*U(n.v,r.v,a)>>0)/1e3+r.u)})},c[n+i]=Q(o[t])):r.test(o[t])&&null!==a&&(null===a||r.test(a))||(l[nt][n]=function(t){!u.valuesEnd[s]||!u.valuesEnd[s][t]||t in et||(et[t]=function(t,e,n,r,a){t.setAttribute(e,(1e3*U(n,r,a)>>0)/1e3)})},c[n]=parseFloat(o[t]))}),c},onStart:{attr:function(t){!s[t]&&this.valuesEnd[t]&&(s[t]=function(e,n,r,a){Object.keys(r).forEach(function(t){s.attributes[t](e,t,n[t],r[t],a)})})},attributes:function(t){!s[t]&&this.valuesEnd.attr&&(s[t]=et)}}},st={component:nt,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:U,colors:Y},functions:it,Util:{replaceUppercase:at,trueColor:z,trueDimension:Q}};var t={prepareStart:function(t){return T(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(a){a in this.valuesEnd&&!s[a]&&(s[a]=function(t,e,n,r){t.style[a]=(1e3*U(e,n,r)>>0)/1e3})}},i={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:U},functions:t},r=String("abcdefghijklmnopqrstuvwxyz").split(""),V=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),X=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),W=String("0123456789").split(""),it=r.concat(V,W),t=it.concat(X),ot={alpha:r,upper:V,symbols:X,numeric:W,alphanumeric:it,all:t},W={text:function(t){var e,l;!s[t]&&this.valuesEnd[t]&&(e=this._textChars,l=ot[y.textChars],e in ot?l=ot[e]:e&&e.length&&(l=e),s[t]=function(t,e,n,r){var a="",i="",s=""===n?" ":n,o=e.substring(0),u=n.substring(0),c=l[Math.random()*l.length>>0];" "===e?(i=u.substring(Math.min(r*u.length,u.length)>>0,0),t.innerHTML=r<1?i+c:s):" "===n?(a=o.substring(0,Math.min((1-r)*o.length,o.length)>>0),t.innerHTML=r<1?a+c:s):(a=o.substring(o.length,Math.min(r*o.length,o.length)>>0),i=u.substring(0,Math.min(r*u.length,u.length)>>0),t.innerHTML=r<1?i+c+a:s)})},number:function(t){t in this.valuesEnd&&!s[t]&&(s[t]=function(t,e,n,r){t.innerHTML=U(e,n,r)>>0})}};function ut(t,e){var n,r;return"string"==typeof t?((n=document.createElement("SPAN")).innerHTML=t,n.className=e,n):(!t.children.length||t.children.length&&t.children[0].className!==e?(n=t.innerHTML,(r=document.createElement("SPAN")).className=e,r.innerHTML=n,t.appendChild(r),t.innerHTML=r.outerHTML):t.children.length&&t.children[0].className===e&&(r=t.children[0]),r)}function ct(t,e){var n=[],r=t.children.length;if(r){for(var a,i,s,o=[],u=t.innerHTML,c=0,l=void 0,h=void 0;c>0)/1e3+n+")"}function ht(t,e,n,r){for(var a=[],i=0;i<3;i+=1)a[i]=(t[i]||e[i]?(1e3*(t[i]+(e[i]-t[i])*r)>>0)/1e3:0)+n;return"translate3d("+a.join(",")+")"}function pt(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 ft(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function dt(t,e,n,r){var a=[];return a[0]=(t[0]===e[0]?e[0]:(1e3*(t[0]+(e[0]-t[0])*r)>>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","skew("+a.join(",")+")"}function yt(t,e){return parseFloat(t)/100*e}function gt(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function vt(t){var e=t.getAttribute("points").split(" "),n=0;if(1>0)/100,i=0-(100*U(e.s,n.s,r)>>0)/100,r=(100*U(e.e,n.e,r)>>0)/100+i;t.style.strokeDashoffset=i+"px",t.style.strokeDasharray=(100*(r<1?0:r)>>0)/100+"px, "+a+"px"})}},Mt={origin:null,decimals:4,round:1};function _t(t){return t.map(function(t){return Array.isArray(t)?_t(t):Number.isNaN(+t)?t:+t})}function kt(t,e){var r=Number.isNaN(+e)?Mt.decimals:+e,t=r?t.map(function(t){return t.map(function(t){var e=+t,n=Math.pow(10,r);return e?e%1==0?e:Math.round(e*n)/n:t})}):_t(t);return t}var Ot={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ct(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return Ot[e]===t.length-1&&/[achlmrqstvz]/g.test(e)})}function Tt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&2=Ot[n]&&(t.segments.push([e].concat(r.splice(0,Ot[n]))),Ot[n]););}var St="Invalid path value";function It(t){return 48<=t&&t<=57}function At(t){for(;t.index=t.max)break;if(!(48<=(e=t.pathValue.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}Tt(t)}else Tt(t);else t.err=St+": "+t.pathValue[t.index]+" not a path command"}function Lt(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 Pt(t,e){if(Ct(n=t)&&n.every(function(t){return t[0]===t[0].toUpperCase()}))return _t(t);var n,r=function(t,e){if(Ct(t))return _t(t);var n=new Lt(t);for(At(n);n.index>0)/Math.pow(10,9)),x=Math.asin(((c-b)/a*Math.pow(10,9)>>0)/Math.pow(10,9)),w=eh&&(d=x,y=u,g=c,x=w+h*(o&&w>0)/1e3)}return a}function Gt(r){return r.reduce(function(t,e,n){return n?t+$t(r[n-1],e):0},0)}function Jt(t,e){var n,r=Ut((t=Dt(t),Dt(Pt(t,0)).replace(/(m|M)/g,"|$1").split("|").map(function(t){return t.trim()}).filter(function(t){return t})[0]),4),a=Bt(r),i=[],s=3;e&&!Number.isNaN(e)&&0<+e&&(s=Math.max(s,Math.ceil(a/e)));for(var o=0;oe;)r=Ht(n,r,.5),t.splice(a+1,0,r)}function ae(t){return Array.isArray(t)&&t.every(function(t){return Array.isArray(t)&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])})}function ie(t,e){if("string"==typeof(t=t))var n=te(t,e),t=n.ring,r=n.skipBisect,n=n.pathLength;else if(!Array.isArray(t))throw Error(St+": "+t);t=t.slice(0);if(t.pathLength=n,!ae(t))throw Error(St+": "+t);return 1>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:ft,skew:dt}},SVGDraw:{component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:U},functions:it,Util:{getRectLength:gt,getPolyLength:vt,getLineLength:mt,getCircleLength:bt,getEllipseLength:wt,getTotalLength:xt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Et,percent:yt}},SVGMorph:{component:"svgMorph",property:"path",defaultValue:[],Interpolate:Wt,defaultOptions:{morphPrecision:10,morphIndex:0},functions:t,Util:{addPoints:ne,bisect:re,normalizeRing:ie,validRing:ae,getInterpolationPoints:se,pathStringToRing:te,distanceSquareRoot:$t,midPoint:Ht,approximateRing:Jt,rotateRing:ee,pathToString:Dt,pathToCurve:Ut,getPathLength:Bt,getPointAtLength:Zt,getDrawDirection:Yt,roundPath:kt}}};return Object.keys(oe).forEach(function(t){var e=oe[t];oe[t]=new F(e)}),{Animation:F,Components:oe,Tween:q,fromTo:function(t,e,n,r){return r=r||{},new j.tween(P(t),e,n,r)},to:function(t,e,n){var r=n||{},n=j.tween;return r.resetStart=e,new n(P(t),e,e,r)},TweenCollection:H,allFromTo:function(t,e,n,r){return r=r||{},new H(P(t,!0),e,n,r)},allTo:function(t,e,n){var r=n||{};return n.resetStart=e,new H(P(t,!0),e,e,r)},Objects:x,Util:E,Easing:L,CubicBezier:e,Render:p,Interpolate:o,Process:A,Internals:O,Selector:P,Version:"2.1.2"}});