!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 u={},r=[],t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},d={},v={},e={};e.now=self.performance.now.bind(self.performance);var a=0,n=function(t){for(var e=0;e>0)/10:R(e,n,r)>>0)+"px"})}Q.prototype.setComponent=function(t){var e=t.component,n={prepareProperty:x,prepareStart:w,onStart:v,onComplete:M,crossCheck:b},r=t.category,a=t.property,i=t.properties&&t.properties.length||t.subProperties&&t.subProperties.length;if(g[e]=t.properties||t.subProperties||t.property,"defaultValue"in t)y[a]=t.defaultValue,this.supports=a+" property";else if(t.defaultValues){for(var s in t.defaultValues)y[s]=t.defaultValues[s];this.supports=(i||a)+" "+(a||r)+" properties"}if(t.defaultOptions)for(var o in t.defaultOptions)m[o]=t.defaultOptions[o];if(t.functions)for(var u in n)if(u in t.functions)if("function"==typeof t.functions[u])n[u][e]||(n[u][e]={}),n[u][e][r||a]||(n[u][e][r||a]=t.functions[u]);else for(var l in t.functions[u])n[u][e]||(n[u][e]={}),n[u][e][l]||(n[u][e][l]=t.functions[u][l]);if(t.Interpolate){for(var c in t.Interpolate){var p=t.Interpolate[c];if("function"!=typeof p||d[c])for(var h in p)"function"!=typeof p[h]||d[c]||(d[c]=p[h]);else d[c]=p}_[e]=t.Interpolate}if(t.Util)for(var f in t.Util)C[f]||(C[f]=t.Util[f]);return this};var B=["top","left","width","height"],Z={};B.map(function(t){return Z[t]=X});var z={component:"essentialBoxModel",category:"boxModel",properties:B,defaultValues:{top:0,left:0,width:0,height:0},Interpolate:{numbers:R},functions:{prepareStart:function(t){return I(this.element,t)||y[t]},prepareProperty:function(t,e){var n=D(e),r="height"===t?"offsetHeight":"offsetWidth";return"%"===n.u?n.v*this.element[r]/100:n.v},onStart:Z},Util:{trueDimension:D}};function Y(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,i=/rgb/.test(i)?i.replace(/[^\d,]/g,"").split(","):[0,0,0];return a.style.color="",{r:parseInt(i[0]),g:parseInt(i[1]),b:parseInt(i[2])}}}function K(t,e,n){var r,a={};for(r in e)a[r]="a"!==r?R(t[r],e[r],n)>>0||0:t[r]&&e[r]?(100*R(t[r],e[r],n)>>0)/100:null;return a.a?"rgba("+a.r+","+a.g+","+a.b+","+a.a+")":"rgb("+a.r+","+a.g+","+a.b+")"}function $(a){this.valuesEnd[a]&&!u[a]&&(u[a]=function(t,e,n,r){t.style[a]=K(e,n,r)})}c.BoxModelEssential=z;var W=["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],G={};W.map(function(t){G[t]="#000"});var J={};W.map(function(t){return J[t]=$});var tt={component:"colorProperties",category:"colors",properties:W,defaultValues:G,Interpolate:{numbers:R,colors:K},functions:{prepareStart:function(t,e){return I(this.element,t)||y[t]},prepareProperty:function(t,e){return Y(e)},onStart:J},Util:{trueColor:Y}};c.ColorProperties=tt;var 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 n={};for(var r in e){var a=at(r).replace(/_+[a-z]+/,""),i=this.element.getAttribute(a);n[a]=rt.includes(a)?i||"rgba(0,0,0,0)":i||(/opacity/i.test(r)?1:0)}return n},prepareProperty:function(e,t){var n={};for(var r in t){var a,s,i=at(r),o=/(%|[a-z]+)$/,u=this.element.getAttribute(i.replace(/_+[a-z]+/,""));rt.includes(i)?(v[nt][i]=function(t){!this.valuesEnd[e]||!this.valuesEnd[e][t]||t in et||(et[t]=function(t,e,n,r,a){t.setAttribute(e,K(n,r,a))})},n[i]=Y(t[r])||y.htmlAttributes[r]):null!==u&&o.test(u)?(a=D(u).u||D(t[r]).u,s=/%/.test(a)?"_percent":"_"+a,v[nt][i+s]=function(t){!this.valuesEnd[e]||!this.valuesEnd[e][t]||t in et||(et[t]=function(t,e,n,r,a){var i=e.replace(s,"");t.setAttribute(i,(1e3*R(n.v,r.v,a)>>0)/1e3+r.u)})},n[i+s]=D(t[r])):o.test(t[r])&&null!==u&&(null===u||o.test(u))||(v[nt][i]=function(t){!this.valuesEnd[e]||!this.valuesEnd[e][t]||t in et||(et[t]=function(t,e,n,r,a){t.setAttribute(e,(1e3*R(n,r,a)>>0)/1e3)})},n[i]=parseFloat(t[r]))}return n},onStart:{attr:function(t){!u[t]&&this.valuesEnd[t]&&(u[t]=function(t,e,n,r){for(var a in n)u.attributes[a](t,a,e[a],n[a],r)})},attributes:function(t){!u[t]&&this.valuesEnd.attr&&(u[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:R,colors:K},functions:it,Util:{replaceUppercase:at,trueColor:Y,trueDimension:D}};c.HTMLAttributes=st;var ot={prepareStart:function(t){return I(this.element,t)},prepareProperty:function(t,e){return parseFloat(e)},onStart:function(a){a in this.valuesEnd&&!u[a]&&(u[a]=function(t,e,n,r){t.style[a]=(1e3*R(e,n,r)>>0)/1e3})}},ut={component:"opacityProperty",property:"opacity",defaultValue:1,Interpolate:{numbers:R},functions:ot};c.OpacityProperty=ut;var lt=String("abcdefghijklmnopqrstuvwxyz").split(""),ct=String("abcdefghijklmnopqrstuvwxyz").toUpperCase().split(""),pt=String("~!@#$%^&*()_+{}[];'<>,./?=-").split(""),ht=String("0123456789").split(""),ft=lt.concat(ct,ht),dt=ft.concat(pt),vt={alpha:lt,upper:ct,symbols:pt,numeric:ht,alphanumeric:ft,all:dt},gt={text:function(t){var e,l;!u[t]&&this.valuesEnd[t]&&(e=this._textChars,l=e in vt?vt[e]:e&&e.length?e:vt[m.textChars],u[t]=function(t,e,n,r){var a="",i="",s=e.substring(0),o=n.substring(0),u=l[Math.random()*l.length>>0];" "===e?(i=o.substring(Math.min(r*o.length,o.length)>>0,0),t.innerHTML=r<1?i+u:""===n?" ":n):" "===n?(a=s.substring(0,Math.min((1-r)*s.length,s.length)>>0),t.innerHTML=r<1?a+u:""===n?" ":n):(a=s.substring(s.length,Math.min(r*s.length,s.length)>>0),i=o.substring(0,Math.min(r*o.length,o.length)>>0),t.innerHTML=r<1?i+u+a:""===n?" ":n)})},number:function(t){t in this.valuesEnd&&!u[t]&&(u[t]=function(t,e,n,r){t.innerHTML=R(e,n,r)>>0})}};function yt(t,e){var n,r,a;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?(r=t.innerHTML,(a=document.createElement("SPAN")).className=e,a.innerHTML=r,t.appendChild(a),t.innerHTML=a.outerHTML):t.children.length&&t.children[0].className===e&&(a=t.children[0]),a)}function mt(t,e){var n=[];if(t.children.length){for(var r,a,i,s=[],o=t.innerHTML,u=0,l=t.children.length,c=void 0,p=void 0;u>0)/1e3+n+")"}function bt(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 Mt(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 _t(t,e,n){return"scale("+(1e3*(t+(e-t)*n)>>0)/1e3+")"}function Ct(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(",")+")"}c.TextWriteProperties=xt;var Tt={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]:y[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];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:{},d=0;d>0)/1e3)+n,a[1]=t[1]||e[1]?(t[1]===e[1]?e[1]:(1e3*(t[1]+(e[1]-t[1])*r)>>0)/1e3)+n:"0","translate("+a.join(",")+")"},rotate:function(t,e,n,r){return"rotate("+(1e3*(t+(e-t)*r)>>0)/1e3+n+")"},scale:_t,skew:Ct}};function St(t,e){return parseFloat(t)/100*e}function It(t){return 2*t.getAttribute("width")+2*t.getAttribute("height")}function Et(t){var e=t.getAttribute("points").split(" "),n=0;if(1>0)/100,i=0-(100*R(e.s,n.s,r)>>0)/100,s=(100*R(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"})}},qt={component:"svgDraw",property:"draw",defaultValue:"0% 0%",Interpolate:{numbers:R},functions:Vt,Util:{getRectLength:It,getPolyLength:Et,getLineLength:At,getCircleLength:kt,getEllipseLength:Ot,getTotalLength:Lt,resetDraw:function(t){t.style.strokeDashoffset="",t.style.strokeDasharray=""},getDraw:Pt,percent:St}};function Nt(t,e,n,r){for(var a=[],i=0;i>0)/1e3)}return a}c.SVGDraw=qt;var jt={origin:null,decimals:3,round:1};function Ht(t){return t.map(function(t){return Array.isArray(t)?Ht(t):isNaN(+t)?t:+t})}function Ft(t,e){var a=isNaN(+e)?jt.decimals:+e;return a?t.map(function(t){return t.map(function(t,e){var n=+t,r=Math.pow(10,a);return n?n%1==0?n:Math.round(n*r)/r:t})}):Ht(t)}var Ut={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Qt(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return Ut[e]===t.length-1&&/[achlmrqstvz]/g.test(e)})}function Dt(t){var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;if("m"===n&&2=Ut[n]&&(t.segments.push([e].concat(r.splice(0,Ut[n]))),Ut[n]););}var Rt="Invalid path value";function Xt(t){return 48<=t&&t<=57}function Bt(t){for(;t.index=t.max)break;if(!(48<=(i=t.pathValue.charCodeAt(t.index))&&i<=57||43===i||45===i||46===i))break}}Dt(t)}else Dt(t);else t.err=Rt+": "+t.pathValue[t.index]+" not a path command"}function zt(t){return this.segments=[],this.pathValue=t,this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err="",this}function Yt(t,e){if(Qt(n=t)&&n.every(function(t){return t[0]===t[0].toUpperCase()}))return Ht(t);var n;t=function(t,e){if(Qt(t))return Ht(t);var n=new zt(t);for(Bt(n);n.indexM&&(T=b,S=u,I=l,b=w+M*(o&&we;)r=Gt(n,r,.5),t.splice(a+1,0,r)}function ye(t,e){var n,r,a;if("string"==typeof t){var i=he(t,e);t=i.ring,r=i.skipBisect,a=i.pathLength}else if(!Array.isArray(t))throw Rt;if((n=t.slice(0)).pathLength=a,!me(n))throw Rt;return 1