diff --git a/dist/utils.esm.js b/dist/utils.esm.js index bb00406..e07e9da 100644 --- a/dist/utils.esm.js +++ b/dist/utils.esm.js @@ -473,8 +473,7 @@ function isHttps(url) { } function isLocalhost(url) { - const re = - /^(https?\:\/\/)(localhost(.[a-z0-9\-])*|127\.0\.0\.1)(\:[\d]+)?(\/(.)*)?$/; + const re = /^(https?:\/\/)(localhost(\.[a-z0-9-]+)*|127\.0\.0\.1)(:\d+)?(\/.*)?$/i; return re.test(url || getURL()); } @@ -3703,8 +3702,8 @@ var TestUtil = { // }; function removeNamespaces(str) { - return str.replace(/(\<(.|\n)+?\>)/g, (tag) => { - return tag.replace(/(\s|\<\/?){1}([\w]+\:){1}/g, '$1'); + return str.replace(/<[^>]*>/g, (tag) => { + return tag.replace(/(\s|<\/?)[a-zA-Z0-9]+\:/g, '$1'); }); } diff --git a/dist/utils.esm.min.js b/dist/utils.esm.min.js index 69c1857..51d463f 100644 --- a/dist/utils.esm.min.js +++ b/dist/utils.esm.min.js @@ -1 +1 @@ -var t={decode:function(t){return decodeURIComponent(escape(t))},encode:function(t){return unescape(encodeURIComponent(t))}};const n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/","="],e={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63,"=":64};var r={decode:function(n){const r=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");let o="";try{o=window.atob(r)}catch(t){const n=e;let i,u,a,c,s,l,f,g=0;const h=r.length;for(;g>4,u=(15&s)<<4|l>>2,a=(3&l)<<6|f,o+=String.fromCharCode(i),64!==l&&(o+=String.fromCharCode(u)),64!==f&&(o+=String.fromCharCode(a))}return o=t.decode(o),o},encode:function(e){const r=t.encode(e);let o="";try{o=window.btoa(r)}catch(t){const e=n;let i,u,a,c,s,l,f,g=0;const h=r.length;for(;g>2,s=(3&i)<<4|u>>4,l=(15&u)<<2|a>>6,f=63&a,isNaN(u)?l=f=64:isNaN(a)&&(f=64),o+=e[c]+e[s]+e[l]+e[f]}return o}};var o={decode:function(t){let n="";try{n=JSON.parse(t)}catch(e){t=t.replace(/"/g,'"'),n=JSON.parse(t)}return n},encode:function(t){return JSON.stringify(t)}};function i(t,n,e){return t*(1-e)+n*e}function u(t,n){const e=n*t,r=Math.floor(e),o=t-1,i=g.constrain(r,0,o);return{index:i,t:e-i}}var a={bilinear:function(t,n,e,r,o,u){const a=i;return a(a(t,n,o),a(e,r,o),u)},linear:i,multilinear:function(t,n){const e=u(t.length-1,n),r=e.index;return i(t[r],t[r+1],e.t)},scalar:u};function c(t,n){return t===n?t:(t0&&(e+=1e-10):e=1e-10,Math.abs(t-n)<=e},euclideanDistance:function(t,n){return Math.sqrt(f(t.map(((t,e)=>Math.abs(t-n[e])**2))))},factorial:function(t){let n=1;for(let e=n;e<=t;e++)n*=e;return n},gcd:c,interpolation:a,lcm:function(t,n){return t*n/c(t,n)},lerp:function(t,n,e){return a.linear(t,n,e)},map:function(t,n,e,r,o){return a.linear(r,o,l(t,n,e))},nearest:s,normalize:l,proportion:function(t,n,e,r){const o=[t,n,e,r];if(3!==Et.clean(o).length)return NaN;const i=tt.isNumber;return i(t)?i(n)?i(e)?i(r)?NaN:e*n/t:r*t/n:t*r/e:n*e/r},roundDecimals:function(t,n){return Number(t.toFixed(n||2))},roundToMultiple:function(t,n){return Math.round(t/n)*n},roundToNearest:function(t,n){const e=Et.sort(n.concat());let r=0,o=0,i=e.length;if(0===i)return NaN;if(i>2)for(;oe[r+1]))break;o=r+1}return o=r+1 in e?r+1:r,s(t,e[r],e[o])},roundToPower:function(t,n){return n**Math.round(Math.log(t)/Math.log(n))},sign:function(t){return t>=0?1:-1},summation:f};function h(t){return d(t)}function d(t){const n=m(t);let e;const r={};for(let t=0,o=n.length;t-1?t.substr(n+1):"";const r=e.indexOf("#");return r>-1&&(e=e.substring(0,r)),e}function y(){let t="";try{t=window.location.href}catch(t){}return t}var N={getDomain:function(t=y(),n){let e=t.replace(/(^\w+:|^)\/\/(www\.)?/,"");if(e=e.split(":")[0],!n)return e;let r=e.split(".");return n>r.length||n<=0?"":r[r.length-n]},getParameterByName:function(t,n,e){const r=h(t);return n in r?r[n]||e||"":e},getParameters:h,getParametersDict:d,getParametersList:m,getParametersString:p,getURL:y,hasParameter:function(t,n){return n in d(t)},isFile:function(t){return 0===(t||y()).indexOf("file://")},isHttp:function(t){return 0===(t||y()).indexOf("http://")},isHttps:function(t){return 0===(t||y()).indexOf("https://")},isLocalhost:function(t){return/^(https?\:\/\/)(localhost(.[a-z0-9\-])*|127\.0\.0\.1)(\:[\d]+)?(\/(.)*)?$/.test(t||y())}};function b(t,n,...e){const r=[n].concat(e);let o,i,u;for(o=0,i=r.length;ot===n?0!==t||1/t==1/n:t!=t&&n!=n),Object.is(t,n)}function E(t,n){const e=Object.keys(t);return!0===n&&e.sort(),e}function v(t){return E(t).length}var O={assign:b,clean:M,clone:S,decodeBase64:function(t){return o.decode(r.decode(t))},decodeJSON:function(t){return o.decode(t)},decodeParameters:function(t){return N.getParametersDict(`?${t}`)},encodeBase64:function(t){return r.encode(o.encode(t))},encodeJSON:function(t){return o.encode(t)},encodeParameters:function(t,n){const e=M(S(t),!0),r=tt.isArray(n)?n:E(t,!0);let o,i;const u=[];for(let t=0,n=r.length;t{e[r]=n.call(null,t[r],r,t)})),e},merge:function(t,n,...e){const r=[{},t,n].concat(e);return b.apply(null,r)},search:function(t,n){const e=[];let r,o,i,u,a,c,s,l,f;for(r=0,o=t.length;rrt(t,n,...e.concat(r))}function rt(t,n,...e){return tt.isString(t)&&(t=n[t]),t.apply(n,e)}function ot(t,n,e,...r){const o=et(n,e,...r),i=setInterval(o,t);return{cancel(){clearInterval(i)},func:o,id:i}}var it={args:nt,attempt:function(t,n,...e){try{return rt(t,n,...e)}catch(t){return t}},bind:et,call:rt,debounce:function(t,n,e){let r;return function(...o){r&&(clearTimeout(r),r=null),r=setTimeout((()=>{n.apply(e,o)}),t)}},delay:function(t,n,e,...r){const o=et(n,e,...r),i=setTimeout(o,t);return{cancel(){clearTimeout(i)},func:o,id:i}},memoize:function(t,n){const e={};return function(...r){const o=String(r);return o in e||(e[o]=rt(t,n,...r)),e[o]}},noop:function(){return!0},repeat:ot,throttle:function(t,n,e){let r;return(...o)=>{r||(n.apply(e,o),r=setTimeout((()=>{clearTimeout(r),r=null}),t))}},until:function(t,n,e,...r){const o=et(n,e,...r),i=ot(t,(()=>{!1===o()&&i.cancel()}));return i},validate:function(t,...n){const e=nt(t);let r=(n=n.map((t=>Array.isArray(t)?t:[t]))).length;for(;r>0&&n[r-1].includes("undefined");)r--;if(e.length{const r=tt.of(t),o=n[Math.min(e,n.length-1)];if(!o.includes(r))throw new TypeError(`invalid argument: type of argument[${e}] is "${r}", expected "${o.join('" or "')}".`)}))}};function ut(t){return Boolean(Math.random()<(isNaN(t)?.5:t))}function at(t){return t[st(t)]}function ct(t,n){return t+Math.random()*(n-t)}function st(t){return lt(0,t.length-1)}function lt(t,n){return Math.floor(Math.round(ct(t-.5,n+.5)))}var ft={argument:function(...t){return at(t)},bit:function(t){return ut(t)?1:0},boolean:ut,color:function(){return lt(0,16777215)},element:at,float:ct,index:st,integer:lt,map:function(t,n){const e=[];for(let r=0;r1?t.substr(1):"";return e+(!0===n?r.toLowerCase():r)}var yt={contains:gt,endsWith:function(t,n){return t.substring(t.length-n.length,t.length)===n},icontains:function(t,n){return gt(t.toLowerCase(),n.toLowerCase())},levenshteinDistance:ht,levenshteinSimilarity:function(t,n){const e=ht(t,n),r=Math.max(t.length,n.length);return 0===r?1:1-e/r},padLeft:dt,padRight:function(t,n,e){let r=t.length;for(;r{u=e[0],a=n[e[1]],tt.isNone(a)&&(a=""),t=mt(t,u,a)})),t},replace:mt,reverse:function(t){const n=t.split("");return n.reverse(),n.join("")},rotate:function(t,n){let e=t.split("");return e=Et.rotate(e,n),e.join("")},slugify:function(t){const n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ő":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ű":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","þ":"th","ÿ":"y","ẞ":"SS","œ":"oe","Œ":"OE","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"h","ώ":"w","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"H","Ώ":"W","Ϊ":"I","Ϋ":"Y","ş":"s","Ş":"S","ı":"i","İ":"I","ğ":"g","Ğ":"G","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Э":"E","Ю":"Yu","Я":"Ya","Є":"Ye","І":"I","Ї":"Yi","Ґ":"G","є":"ye","і":"i","ї":"yi","ґ":"g","č":"c","ď":"d","ě":"e","ň":"n","ř":"r","š":"s","ť":"t","ů":"u","ž":"z","Č":"C","Ď":"D","Ě":"E","Ň":"N","Ř":"R","Š":"S","Ť":"T","Ů":"U","Ž":"Z","ą":"a","ć":"c","ę":"e","ł":"l","ń":"n","ś":"s","ź":"z","ż":"z","Ą":"A","Ć":"C","Ę":"e","Ł":"L","Ń":"N","Ś":"S","Ź":"Z","Ż":"Z","ā":"a","ē":"e","ģ":"g","ī":"i","ķ":"k","ļ":"l","ņ":"n","ū":"u","Ā":"A","Ē":"E","Ģ":"G","Ī":"i","Ķ":"k","Ļ":"L","Ņ":"N","Ū":"u"};for(let e=0,r=t.length;eft.boolean()?t.toUpperCase():t.toLowerCase()))},toTitleCase:function(t,n){return t.replace(/[^\'‘’\`\-\s]+/gm,(t=>pt(t,n)))},toUpperCaseFirst:pt,trim:function(t){return t.trim()},trimLeft:function(t){return t.trimStart()},trimRight:function(t){return t.trimEnd()}};function Nt(t,n){return t.getTime()>n.getTime()?t:n}function bt(t,n){return t.getTime()<=n.getTime()?t:n}function Mt(){const t=new Date;return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}var St={clone:function(t){return new Date(t.getTime())},constrain:function(t,n,e){const r=bt(n,e),o=Nt(n,e);return bt(Nt(t,r),o)},format:function(t,n){const e=yt.replace,r=yt.padZeros,o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=t.getDate(),u=t.getFullYear(),a=t.getMonth(),c=a+1,s=["January","February","March","April","May","June","July","August","September","October","November","December"][a],l=t.getDay(),f=t.getHours(),g=t.getMinutes(),h=t.getSeconds(),d=t.getMilliseconds(),m=[["YYYY",u],["YY",r(u,4).substring(2,4)],["MM",r(c,2)],["M",c],["DD",r(i,2)],["D",i],["hh",r(f,2)],["h",f],["mm",r(g,2)],["m",g],["ss",r(h,2)],["s",h],["ll",r(d,2)],["XX",s],["X",s.substring(0,3)],["ZZ",o[l]],["Z",o[l].substring(0,3)]];let p,y;for(let t=0,r=m.length;t0},max:Nt,min:bt,normalize:function(t){return{milliseconds:t%1e3,seconds:Math.floor(t/1e3)%60,minutes:Math.floor(t/1e3/60)%60,hours:Math.floor(t/1e3/60/60)%24,days:Math.floor(t/1e3/60/60/24)}},parse:function(t){let n;const e=t=>tt.isNumber(t)&&t>=0&&tt.isNumber(new Date(t).getTime());if(tt.isDate(t))return t;if(tt.isNumber(t)){if(n=t,e(n))return new Date(n)}else if(tt.isString(t)){if(n=Number(t),e(n))return new Date(n);if(n=Date.parse(t),e(n))return new Date(n)}return null},timestamp:function(t){return(t||new Date).getTime()},today:Mt,tomorrow:function(){const t=Mt();return t.setDate(t.getDate()+1),t},yesterday:function(){const t=Mt();return t.setDate(t.getDate()-1),t},yyyymmdd:function(t,n){const e=t||new Date,r=e.getFullYear(),o=e.getMonth()+1,i=e.getDate(),u=n||"";return String(r)+u+yt.padZeros(o,2)+u+yt.padZeros(i,2)}};function wt(t,n,e){let r=tt.isUndefined(e)?0:e;for(let e=0,o=t.length;e{o=0===o?t.length:Math.min(o,t.length)}));const i=[];for(let t=0;t{switch(tt.of(t)){case tt.ARRAY:return t.length>0;case tt.OBJECT:return O.length(t)>0;default:return Boolean(t)}}))},any:function(t){return t.some((t=>{switch(tt.of(t)){case tt.ARRAY:return t.length>0;case tt.OBJECT:return O.length(t)>0;default:return Boolean(t)}}))},clean:function t(n,e){let r=n.slice();return r=r.filter((t=>!tt.isNone(t))),!0===e&&(r=r.map((n=>{let r;switch(tt.of(n)){case tt.ARRAY:return r=t(n,e),r.length>0?r:null;case tt.OBJECT:return r=O.clean(n,e),O.length(r)>0?r:null;case tt.STRING:return r=yt.trim(n),""!==r?n:null;default:return n}})).filter((t=>!tt.isNone(t)))),r},clone:function t(n){const e=n.slice();let r;for(let n=0,o=e.length;ntt.isFunction(n)?Math.max(t,n(e)):Math.max(t,e)),Number.MIN_VALUE)},min:function(t,n){return wt(t,((t,e)=>tt.isFunction(n)?Math.min(t,n(e)):Math.min(t,e)),Number.MAX_VALUE)},paginate:function(t,n){const e=t.length,r=n>0?Math.ceil(e/n):0,o=[];let i,u;for(i=0,u=0;i{let a,c;if(r(t)&&r(u)&&i(n))a=n in t?t[n]:t,c=n in u?u[n]:u;else if(e(t)&&e(u)&&o(n)){const e=n;a=e>=0&&e=0&&ett.isFunction(n)?t+n(e):t+e),0)},unique:function(t){let n;const e=[],r=t=>!O.equals(n,t);for(let o=0,i=t.length;o=1?"":u(255*e))+u(r)+u(o)+u(i))},toString:function(t){return`{ r:${String(t.r)}, g:${String(t.g)}, b:${String(t.b)}, a:${String(isNaN(t.a)?1:t.a)} }`},toStringCSS:function(t){return`rgba(${String(t.r)}, ${String(t.g)}, ${String(t.b)}, ${String(isNaN(t.a)?1:t.a)})`}};function Tt(t){const n=t.c/100,e=t.m/100,r=t.y/100,o=t.k/100,i=1-o;let u=1-Math.min(1,n*i+o),a=1-Math.min(1,e*i+o),c=1-Math.min(1,r*i+o);const s=Math.round;return u=s(255*u),a=s(255*a),c=s(255*c),{r:u,g:a,b:c,a:1}}var Rt={toHex:function(t,n){return It.toHex(Tt(t),n)},toRgb:Tt,toString:function(t){return`{ c:${String(t.c)}, m:${String(t.m)}, y:${String(t.y)}, k:${String(t.k)} }`},toStringCSS:function(t){return`cmyk(${String(t.c)}%, ${String(t.m)}%, ${String(t.y)}%, ${String(t.k)}%)`}};function Ct(t){const n=vt.decodeInt,e=vt.encodeInt;let r,o,i;if(tt.isNumber(t))r=e(t);else{if(!tt.isString(t))return null;r=t.replace(/\#|0x/,"")}switch(r=r.toUpperCase(),r.length){case 3:i=/^([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),o={a:1,r:n(i[1]+i[1]),g:n(i[2]+i[2]),b:n(i[3]+i[3])};break;case 6:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:1,r:n(i[1]),g:n(i[2]),b:n(i[3])};break;case 8:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:g.roundDecimals(n(i[1])/255,2),r:n(i[2]),g:n(i[3]),b:n(i[4])};break;default:return null}return o}function kt(t,n){return It.toHex(Ct(t),n)}var qt={average:function(t){return It.toHex(It.average(t.map((t=>Ct(t)))))},distance:function(t,n){return It.distance(Ct(t),Ct(n))},gradient:function(t,n){return It.gradient(t.map((t=>Ct(t))),n).map((t=>It.toHex(t)))},gradientMatrix:function(t,n,e){return It.gradientMatrix(O.map(t,(t=>Ct(t))),n,e).map((t=>t.map((t=>It.toHex(t)))))},interpolateBilinear:function(t,n,e,r,o,i){return It.toHex(It.interpolateBilinear(Ct(t),Ct(n),Ct(e),Ct(r),o,i))},interpolateLinear:function(t,n,e){return It.toHex(It.interpolateLinear(Ct(t),Ct(n),e))},interpolateMultilinear:function(t,n){return It.toHex(It.interpolateMultilinear(t.map((t=>Ct(t))),n))},nearest:function(t,n){return It.toHex(It.nearest(Ct(t),n.map((t=>Ct(t)))))},toCmyk:function(t){return It.toCmyk(Ct(t))},toRgb:Ct,toString:kt,toStringCSS:function(t){return kt(t,"#")}},jt={cmyk:Rt,cmykToHex:Rt.toHex,cmykToRgb:Rt.toRgb,hex:qt,hexToCmyk:qt.toCmyk,hexToRgb:qt.toRgb,rgb:It,rgbToCmyk:It.toCmyk,rgbToHex:It.toRgb};var Ut={backIn:function(t,n){return t*t*(((n=isNaN(n)?1.70158:n)+1)*t-n)},backInOut:function(t,n){return n=isNaN(n)?1.70158:n,(t/=.5)<1?t*t*(((n*=1.525)+1)*t-n)*.5:.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},backOut:function(t,n){return(t-=1)*t*(((n=isNaN(n)?1.70158:n)+1)*t+n)+1},bounceIn:function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)},bounceInOut:function(t){return t<.5?(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375):t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},circularIn:function(t){return-(Math.sqrt(1-t*t)-1)},circularInOut:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):(t-=2,.5*(Math.sqrt(1-t*t)+1))},circularOut:function(t){return t-=1,Math.sqrt(1-t*t)},cubicIn:function(t){return t*t*t},cubicInOut:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},cubicOut:function(t){return(t-=1)*t*t+1},elasticIn:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),-n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)},elasticInOut:function(t,n,e){if(0===t)return 0;if(2===(t/=.5))return 1;let r;return n=isNaN(n)?0:n,.3===(e=isNaN(e)?.3:e)&&(e*=1.5),n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),t<1?n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*-.5:n*2**(-10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*.5+1},elasticOut:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),n*2**(-10*t)*Math.sin((t-r)*(2*Math.PI)/e)+1},exponentialIn:function(t){return 0===t?0:2**(10*(t-1))},exponentialInOut:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*2**(10*(t-1)):.5*(2-2**(-10*(t-=1)))},exponentialOut:function(t){return 1===t?t:1-2**(-10*t)},none:function(t){return t},quadraticIn:function(t){return t*t},quadraticInOut:function(t){return(t/=.5)<1?.5*t*t:-.5*((t-=1)*(t-2)-1)},quadraticOut:function(t){return-t*(t-2)},quarticIn:function(t){return t*t*t*t},quarticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quarticOut:function(t){return-((t-=1)*t*t*t-1)},quinticIn:function(t){return t*t*t*t*t},quinticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},quinticOut:function(t){return(t-=1)*t*t*t*t+1},sexticIn:function(t){return t*t*t*t*t*t},sexticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t*t:-.5*((t-=2)*t*t*t*t*t-2)},sexticOut:function(t){return-((t-=1)*t*t*t*t*t-1)},sineIn:function(t){return 1-Math.cos(t*(Math.PI/2))},sineInOut:function(t){return-.5*(Math.cos(Math.PI*t)-1)},sineOut:function(t){return Math.sin(t*(Math.PI/2))},waveCosine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.cos(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o},waveSawtooth:function(t,n,e,r){r=!0===r;let o=t*(n=isNaN(n)?1:n)%1;return o=(e=!0===e)?Math.abs(o):o,o=r?1-o:o,o},waveSine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.sin(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o}};const Bt=Math.PI/180,Pt=180/Math.PI;function Lt(t,n){return Math.atan2(t,n)*Pt}function Yt(t){return t*Bt}var Ft={DEG_0:0,DEG_90:90,DEG_180:180,DEG_270:270,DEG_360:360,DEG_TO_RAD:Bt,RAD_TO_DEG:Pt,acosDeg:function(t){return Math.acos(t)*Pt},angleDeg:function(t,n){return Lt(t,n)},angleRad:function(t,n){return Math.atan2(t,n)},asinDeg:function(t){return Math.asin(t)*Pt},atanDeg:function(t){return Math.atan(t)*Pt},atan2Deg:Lt,cosDeg:function(t){return Math.cos(t*Bt)},cycleDeg:function(t){return g.cycle(t,360)},degToRad:Yt,fastDeg:function(t,n){const e=n-t;return e>180?-360+e:e<-180?360+n:n},haversine:function(t,n,e,r,o){const i=Yt(t),u=Yt(n),a=Yt(e),c=a-i,s=Yt(r)-u,l=Math.sin(c/2)*Math.sin(c/2)+Math.cos(i)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2),f=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));let h;return h=!1===o?3956:6371,g.roundDecimals(h*f,3)},hypo:function(t,n){return Math.sqrt(t*t+n*n)},radToDeg:function(t){return t*Pt},sinDeg:function(t){return Math.sin(t*Bt)},tanDeg:function(t){return Math.tan(t*Bt)}};function Ht(t,n){return{x:t.x+n.x,y:t.y+n.y}}function Jt(t,n){const e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)}function Zt(t){return Jt(t,{x:0,y:0})}function Gt(t,n){return{x:t.x-n.x,y:t.y-n.y}}var zt={add:Ht,angle:function(t,n){const e=Ft.angleDeg(n.y-t.y,n.x-t.x);return Ft.cycleDeg(e)},cross:function(t,n){return t.x*n.y-t.y*n.x},distance:Jt,dot:function(t,n){return t.x*n.x+t.y*n.y},equals:function(t,n,e){const r=g.equals;return r(t.x,n.x,e)&&r(t.y,n.y,e)},interpolate:function(t,n,e){const r=a.linear;return{x:r(t.x,n.x,e),y:r(t.y,n.y,e)}},length:Zt,magnitude:function(t){return Zt(t)},project:function(t,n,e){return{x:t.x+n*Ft.cosDeg(e),y:t.y+n*Ft.sinDeg(e)}},rect:function(t){let n;const e=[],r=[];for(let o=0,i=t.length;o=n&&t<=e},isEven:function(t){return t%2==0&&!_t(t)},isFloat:_t,isNegative:function(t){return t<0},isOdd:function(t){return t%2!=0&&!_t(t)},isPositive:function(t){return t>=0},isPrime:function(t){if("number"!=typeof t||Number.isNaN(t)||_t(t))return!1;if(t<=1)return!1;if(t<=3)return!0;if(t%2==0||t%3==0)return!1;for(let n=5;n*n<=t;n+=6)if(t%n==0||t%(n+2)==0)return!1;return!0}};function Xt(t){if(!tt.isBoolean(t))throw new Error(`value is not boolean: ${String(t)}.`)}function Kt(t,n){if(!O.equals(t,n)){let e=tt.isArray(t)||tt.isObject(t)?`\n${o.encode(t)}\n`:String(t),r=tt.isArray(n)||tt.isObject(n)?`\n${o.encode(n)}`:String(n);throw e=tt.isString(t)?String(`"${e}"`):e,r=tt.isString(n)?String(`"${r}"`):r,new Error(`values are not equal: ${e} != ${r}`)}}function Vt(t){if(!tt.isFunction(t))throw new Error(`value is not function: ${String(t)}.`)}function Qt(t){if(!tt.isNumber(t))throw new Error(`value is not number: ${String(t)}.`)}var tn={assertArray:function(t,n){if(!tt.isArray(t))throw new Error(`value is not array: ${String(t)}.`);tt.isNumber(n)&&Kt(t.length,n)},assertBase64:function(t){if(!tt.isBase64(t))throw new Error(`value is not base64: ${String(t)}.`)},assertBoolean:Xt,assertDate:function(t){if(!tt.isDate(t))throw new Error(`value is not date: ${String(t)}.`)},assertEqual:Kt,assertError:function(t){if(!tt.isError(t))throw new Error(`value is not error: ${String(t)}.`)},assertFalse:function(t){if(Xt(t),!1!==t)throw new Error(`value is not false: ${String(t)}.`)},assertFunction:Vt,assertJSON:function(t){if(!tt.isJSON(t))throw new Error(`value is not json: ${String(t)}.`)},assertModule:function(t){if(!tt.isModule(t))throw new Error(`value is not module: ${String(t)}.`)},assertNaN:function(t){if(!tt.isNaN(t))throw new Error(`value is not NaN: ${String(t)}.`)},assertNone:function(t){if(!tt.isNone(t))throw new Error(`value is not none: ${String(t)}.`)},assertNotArray:function(t){if(tt.isArray(t))throw new Error(`value is array: ${String(t)}.`)},assertNotBase64:function(t){if(tt.isBase64(t))throw new Error(`value is base64: ${String(t)}.`)},assertNotBoolean:function(t){if(tt.isBoolean(t))throw new Error(`value is boolean: ${String(t)}.`)},assertNotDate:function(t){if(tt.isDate(t))throw new Error(`value is date: ${String(t)}.`)},assertNotEqual:function(t,n){if(O.equals(t,n)){const e=tt.isArray(t)||tt.isObject(t)?`\n${o.encode(t)}\n`:String(t),r=tt.isArray(n)||tt.isObject(n)?`\n${o.encode(n)}`:String(n);throw new Error(`values are equal: ${e} == ${r}`)}},assertNotError:function(t){if(tt.isError(t))throw new Error(`value is error: ${String(t)}.`)},assertNotFunction:function(t){if(tt.isFunction(t))throw new Error(`value is function: ${String(t)}.`)},assertNotJSON:function(t){if(tt.isJSON(t))throw new Error(`value is json: ${String(t)}.`)},assertNotModule:function(t){if(tt.isModule(t))throw new Error(`value is module: ${String(t)}.`)},assertNotNone:function(t){if(tt.isNone(t))throw new Error(`value is none: ${String(t)}.`)},assertNotNumber:function(t){if(tt.isNumber(t))throw new Error(`value is number: ${String(t)}.`)},assertNotNull:function(t){if(tt.isNull(t))throw new Error(`value is null: ${String(t)}.`)},assertNotObject:function(t){if(tt.isObject(t))throw new Error(`value is object: ${String(t)}.`)},assertNotRegExp:function(t){if(tt.isRegExp(t))throw new Error(`value is regexp: ${String(t)}.`)},assertNotString:function(t){if(tt.isString(t))throw new Error(`value is string: ${String(t)}.`)},assertNotUndefined:function(t){if(tt.isUndefined(t))throw new Error(`value is undefined: ${String(t)}.`)},assertNumber:Qt,assertNumberAlmostEqual:function(t,n,e){if(Qt(t),Qt(n),!g.equals(t,n,e))throw new Error(`values are not almost equals (tolerance = ${String(e)}): ${String(t)} != ${String(n)}.`)},assertNull:function(t){if(!tt.isNull(t))throw new Error(`value is not null: ${String(t)}.`)},assertObject:function(t){if(!tt.isObject(t))throw new Error(`value is not object: ${String(t)}.`)},assertRegExp:function(t){if(!tt.isRegExp(t))throw new Error(`value is not regexp: ${String(t)}.`)},assertString:function(t){if(!tt.isString(t))throw new Error(`value is not string: ${String(t)}.`)},assertThrows:function(t,...n){Vt(t);try{const e=null;FunctionUtil.call.apply(null,[t,e].concat(n))}catch(t){return}throw new Error(`value didn't throw error: ${String(t)}.`)},assertTrue:function(t){if(Xt(t),!0!==t)throw new Error(`value is not true: ${String(t)}.`)},assertUndefined:function(t){if(!tt.isUndefined(t))throw new Error(`value is not undefined: ${String(t)}.`)}};const nn={array:Et,base64:r,color:jt,date:St,ease:Ut,func:it,geom:{point:zt},hex:vt,json:o,math:g,number:Wt,object:O,random:ft,string:yt,test:tn,trigo:Ft,type:tt,xml:{removeNamespaces:function(t){return t.replace(/(\<(.|\n)+?\>)/g,(t=>t.replace(/(\s|\<\/?){1}([\w]+\:){1}/g,"$1")))}},url:N,utf8:t,version:"1.0.0"};export{nn as default,nn as utils}; +var t={decode:function(t){return decodeURIComponent(escape(t))},encode:function(t){return unescape(encodeURIComponent(t))}};const n=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/","="],e={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63,"=":64};var r={decode:function(n){const r=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");let o="";try{o=window.atob(r)}catch(t){const n=e;let i,u,a,c,s,l,f,g=0;const h=r.length;for(;g>4,u=(15&s)<<4|l>>2,a=(3&l)<<6|f,o+=String.fromCharCode(i),64!==l&&(o+=String.fromCharCode(u)),64!==f&&(o+=String.fromCharCode(a))}return o=t.decode(o),o},encode:function(e){const r=t.encode(e);let o="";try{o=window.btoa(r)}catch(t){const e=n;let i,u,a,c,s,l,f,g=0;const h=r.length;for(;g>2,s=(3&i)<<4|u>>4,l=(15&u)<<2|a>>6,f=63&a,isNaN(u)?l=f=64:isNaN(a)&&(f=64),o+=e[c]+e[s]+e[l]+e[f]}return o}};var o={decode:function(t){let n="";try{n=JSON.parse(t)}catch(e){t=t.replace(/"/g,'"'),n=JSON.parse(t)}return n},encode:function(t){return JSON.stringify(t)}};function i(t,n,e){return t*(1-e)+n*e}function u(t,n){const e=n*t,r=Math.floor(e),o=t-1,i=g.constrain(r,0,o);return{index:i,t:e-i}}var a={bilinear:function(t,n,e,r,o,u){const a=i;return a(a(t,n,o),a(e,r,o),u)},linear:i,multilinear:function(t,n){const e=u(t.length-1,n),r=e.index;return i(t[r],t[r+1],e.t)},scalar:u};function c(t,n){return t===n?t:(t0&&(e+=1e-10):e=1e-10,Math.abs(t-n)<=e},euclideanDistance:function(t,n){return Math.sqrt(f(t.map(((t,e)=>Math.abs(t-n[e])**2))))},factorial:function(t){let n=1;for(let e=n;e<=t;e++)n*=e;return n},gcd:c,interpolation:a,lcm:function(t,n){return t*n/c(t,n)},lerp:function(t,n,e){return a.linear(t,n,e)},map:function(t,n,e,r,o){return a.linear(r,o,l(t,n,e))},nearest:s,normalize:l,proportion:function(t,n,e,r){const o=[t,n,e,r];if(3!==Et.clean(o).length)return NaN;const i=tt.isNumber;return i(t)?i(n)?i(e)?i(r)?NaN:e*n/t:r*t/n:t*r/e:n*e/r},roundDecimals:function(t,n){return Number(t.toFixed(n||2))},roundToMultiple:function(t,n){return Math.round(t/n)*n},roundToNearest:function(t,n){const e=Et.sort(n.concat());let r=0,o=0,i=e.length;if(0===i)return NaN;if(i>2)for(;oe[r+1]))break;o=r+1}return o=r+1 in e?r+1:r,s(t,e[r],e[o])},roundToPower:function(t,n){return n**Math.round(Math.log(t)/Math.log(n))},sign:function(t){return t>=0?1:-1},summation:f};function h(t){return d(t)}function d(t){const n=m(t);let e;const r={};for(let t=0,o=n.length;t-1?t.substr(n+1):"";const r=e.indexOf("#");return r>-1&&(e=e.substring(0,r)),e}function y(){let t="";try{t=window.location.href}catch(t){}return t}var N={getDomain:function(t=y(),n){let e=t.replace(/(^\w+:|^)\/\/(www\.)?/,"");if(e=e.split(":")[0],!n)return e;let r=e.split(".");return n>r.length||n<=0?"":r[r.length-n]},getParameterByName:function(t,n,e){const r=h(t);return n in r?r[n]||e||"":e},getParameters:h,getParametersDict:d,getParametersList:m,getParametersString:p,getURL:y,hasParameter:function(t,n){return n in d(t)},isFile:function(t){return 0===(t||y()).indexOf("file://")},isHttp:function(t){return 0===(t||y()).indexOf("http://")},isHttps:function(t){return 0===(t||y()).indexOf("https://")},isLocalhost:function(t){return/^(https?:\/\/)(localhost(\.[a-z0-9-]+)*|127\.0\.0\.1)(:\d+)?(\/.*)?$/i.test(t||y())}};function b(t,n,...e){const r=[n].concat(e);let o,i,u;for(o=0,i=r.length;ot===n?0!==t||1/t==1/n:t!=t&&n!=n),Object.is(t,n)}function E(t,n){const e=Object.keys(t);return!0===n&&e.sort(),e}function v(t){return E(t).length}var O={assign:b,clean:M,clone:S,decodeBase64:function(t){return o.decode(r.decode(t))},decodeJSON:function(t){return o.decode(t)},decodeParameters:function(t){return N.getParametersDict(`?${t}`)},encodeBase64:function(t){return r.encode(o.encode(t))},encodeJSON:function(t){return o.encode(t)},encodeParameters:function(t,n){const e=M(S(t),!0),r=tt.isArray(n)?n:E(t,!0);let o,i;const u=[];for(let t=0,n=r.length;t{e[r]=n.call(null,t[r],r,t)})),e},merge:function(t,n,...e){const r=[{},t,n].concat(e);return b.apply(null,r)},search:function(t,n){const e=[];let r,o,i,u,a,c,s,l,f;for(r=0,o=t.length;rrt(t,n,...e.concat(r))}function rt(t,n,...e){return tt.isString(t)&&(t=n[t]),t.apply(n,e)}function ot(t,n,e,...r){const o=et(n,e,...r),i=setInterval(o,t);return{cancel(){clearInterval(i)},func:o,id:i}}var it={args:nt,attempt:function(t,n,...e){try{return rt(t,n,...e)}catch(t){return t}},bind:et,call:rt,debounce:function(t,n,e){let r;return function(...o){r&&(clearTimeout(r),r=null),r=setTimeout((()=>{n.apply(e,o)}),t)}},delay:function(t,n,e,...r){const o=et(n,e,...r),i=setTimeout(o,t);return{cancel(){clearTimeout(i)},func:o,id:i}},memoize:function(t,n){const e={};return function(...r){const o=String(r);return o in e||(e[o]=rt(t,n,...r)),e[o]}},noop:function(){return!0},repeat:ot,throttle:function(t,n,e){let r;return(...o)=>{r||(n.apply(e,o),r=setTimeout((()=>{clearTimeout(r),r=null}),t))}},until:function(t,n,e,...r){const o=et(n,e,...r),i=ot(t,(()=>{!1===o()&&i.cancel()}));return i},validate:function(t,...n){const e=nt(t);let r=(n=n.map((t=>Array.isArray(t)?t:[t]))).length;for(;r>0&&n[r-1].includes("undefined");)r--;if(e.length{const r=tt.of(t),o=n[Math.min(e,n.length-1)];if(!o.includes(r))throw new TypeError(`invalid argument: type of argument[${e}] is "${r}", expected "${o.join('" or "')}".`)}))}};function ut(t){return Boolean(Math.random()<(isNaN(t)?.5:t))}function at(t){return t[st(t)]}function ct(t,n){return t+Math.random()*(n-t)}function st(t){return lt(0,t.length-1)}function lt(t,n){return Math.floor(Math.round(ct(t-.5,n+.5)))}var ft={argument:function(...t){return at(t)},bit:function(t){return ut(t)?1:0},boolean:ut,color:function(){return lt(0,16777215)},element:at,float:ct,index:st,integer:lt,map:function(t,n){const e=[];for(let r=0;r1?t.substr(1):"";return e+(!0===n?r.toLowerCase():r)}var yt={contains:gt,endsWith:function(t,n){return t.substring(t.length-n.length,t.length)===n},icontains:function(t,n){return gt(t.toLowerCase(),n.toLowerCase())},levenshteinDistance:ht,levenshteinSimilarity:function(t,n){const e=ht(t,n),r=Math.max(t.length,n.length);return 0===r?1:1-e/r},padLeft:dt,padRight:function(t,n,e){let r=t.length;for(;r{u=e[0],a=n[e[1]],tt.isNone(a)&&(a=""),t=mt(t,u,a)})),t},replace:mt,reverse:function(t){const n=t.split("");return n.reverse(),n.join("")},rotate:function(t,n){let e=t.split("");return e=Et.rotate(e,n),e.join("")},slugify:function(t){const n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ő":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ű":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","þ":"th","ÿ":"y","ẞ":"SS","œ":"oe","Œ":"OE","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"h","ώ":"w","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"H","Ώ":"W","Ϊ":"I","Ϋ":"Y","ş":"s","Ş":"S","ı":"i","İ":"I","ğ":"g","Ğ":"G","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Э":"E","Ю":"Yu","Я":"Ya","Є":"Ye","І":"I","Ї":"Yi","Ґ":"G","є":"ye","і":"i","ї":"yi","ґ":"g","č":"c","ď":"d","ě":"e","ň":"n","ř":"r","š":"s","ť":"t","ů":"u","ž":"z","Č":"C","Ď":"D","Ě":"E","Ň":"N","Ř":"R","Š":"S","Ť":"T","Ů":"U","Ž":"Z","ą":"a","ć":"c","ę":"e","ł":"l","ń":"n","ś":"s","ź":"z","ż":"z","Ą":"A","Ć":"C","Ę":"e","Ł":"L","Ń":"N","Ś":"S","Ź":"Z","Ż":"Z","ā":"a","ē":"e","ģ":"g","ī":"i","ķ":"k","ļ":"l","ņ":"n","ū":"u","Ā":"A","Ē":"E","Ģ":"G","Ī":"i","Ķ":"k","Ļ":"L","Ņ":"N","Ū":"u"};for(let e=0,r=t.length;eft.boolean()?t.toUpperCase():t.toLowerCase()))},toTitleCase:function(t,n){return t.replace(/[^\'‘’\`\-\s]+/gm,(t=>pt(t,n)))},toUpperCaseFirst:pt,trim:function(t){return t.trim()},trimLeft:function(t){return t.trimStart()},trimRight:function(t){return t.trimEnd()}};function Nt(t,n){return t.getTime()>n.getTime()?t:n}function bt(t,n){return t.getTime()<=n.getTime()?t:n}function Mt(){const t=new Date;return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}var St={clone:function(t){return new Date(t.getTime())},constrain:function(t,n,e){const r=bt(n,e),o=Nt(n,e);return bt(Nt(t,r),o)},format:function(t,n){const e=yt.replace,r=yt.padZeros,o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=t.getDate(),u=t.getFullYear(),a=t.getMonth(),c=a+1,s=["January","February","March","April","May","June","July","August","September","October","November","December"][a],l=t.getDay(),f=t.getHours(),g=t.getMinutes(),h=t.getSeconds(),d=t.getMilliseconds(),m=[["YYYY",u],["YY",r(u,4).substring(2,4)],["MM",r(c,2)],["M",c],["DD",r(i,2)],["D",i],["hh",r(f,2)],["h",f],["mm",r(g,2)],["m",g],["ss",r(h,2)],["s",h],["ll",r(d,2)],["XX",s],["X",s.substring(0,3)],["ZZ",o[l]],["Z",o[l].substring(0,3)]];let p,y;for(let t=0,r=m.length;t0},max:Nt,min:bt,normalize:function(t){return{milliseconds:t%1e3,seconds:Math.floor(t/1e3)%60,minutes:Math.floor(t/1e3/60)%60,hours:Math.floor(t/1e3/60/60)%24,days:Math.floor(t/1e3/60/60/24)}},parse:function(t){let n;const e=t=>tt.isNumber(t)&&t>=0&&tt.isNumber(new Date(t).getTime());if(tt.isDate(t))return t;if(tt.isNumber(t)){if(n=t,e(n))return new Date(n)}else if(tt.isString(t)){if(n=Number(t),e(n))return new Date(n);if(n=Date.parse(t),e(n))return new Date(n)}return null},timestamp:function(t){return(t||new Date).getTime()},today:Mt,tomorrow:function(){const t=Mt();return t.setDate(t.getDate()+1),t},yesterday:function(){const t=Mt();return t.setDate(t.getDate()-1),t},yyyymmdd:function(t,n){const e=t||new Date,r=e.getFullYear(),o=e.getMonth()+1,i=e.getDate(),u=n||"";return String(r)+u+yt.padZeros(o,2)+u+yt.padZeros(i,2)}};function wt(t,n,e){let r=tt.isUndefined(e)?0:e;for(let e=0,o=t.length;e{o=0===o?t.length:Math.min(o,t.length)}));const i=[];for(let t=0;t{switch(tt.of(t)){case tt.ARRAY:return t.length>0;case tt.OBJECT:return O.length(t)>0;default:return Boolean(t)}}))},any:function(t){return t.some((t=>{switch(tt.of(t)){case tt.ARRAY:return t.length>0;case tt.OBJECT:return O.length(t)>0;default:return Boolean(t)}}))},clean:function t(n,e){let r=n.slice();return r=r.filter((t=>!tt.isNone(t))),!0===e&&(r=r.map((n=>{let r;switch(tt.of(n)){case tt.ARRAY:return r=t(n,e),r.length>0?r:null;case tt.OBJECT:return r=O.clean(n,e),O.length(r)>0?r:null;case tt.STRING:return r=yt.trim(n),""!==r?n:null;default:return n}})).filter((t=>!tt.isNone(t)))),r},clone:function t(n){const e=n.slice();let r;for(let n=0,o=e.length;ntt.isFunction(n)?Math.max(t,n(e)):Math.max(t,e)),Number.MIN_VALUE)},min:function(t,n){return wt(t,((t,e)=>tt.isFunction(n)?Math.min(t,n(e)):Math.min(t,e)),Number.MAX_VALUE)},paginate:function(t,n){const e=t.length,r=n>0?Math.ceil(e/n):0,o=[];let i,u;for(i=0,u=0;i{let a,c;if(r(t)&&r(u)&&i(n))a=n in t?t[n]:t,c=n in u?u[n]:u;else if(e(t)&&e(u)&&o(n)){const e=n;a=e>=0&&e=0&&ett.isFunction(n)?t+n(e):t+e),0)},unique:function(t){let n;const e=[],r=t=>!O.equals(n,t);for(let o=0,i=t.length;o=1?"":u(255*e))+u(r)+u(o)+u(i))},toString:function(t){return`{ r:${String(t.r)}, g:${String(t.g)}, b:${String(t.b)}, a:${String(isNaN(t.a)?1:t.a)} }`},toStringCSS:function(t){return`rgba(${String(t.r)}, ${String(t.g)}, ${String(t.b)}, ${String(isNaN(t.a)?1:t.a)})`}};function Tt(t){const n=t.c/100,e=t.m/100,r=t.y/100,o=t.k/100,i=1-o;let u=1-Math.min(1,n*i+o),a=1-Math.min(1,e*i+o),c=1-Math.min(1,r*i+o);const s=Math.round;return u=s(255*u),a=s(255*a),c=s(255*c),{r:u,g:a,b:c,a:1}}var Rt={toHex:function(t,n){return It.toHex(Tt(t),n)},toRgb:Tt,toString:function(t){return`{ c:${String(t.c)}, m:${String(t.m)}, y:${String(t.y)}, k:${String(t.k)} }`},toStringCSS:function(t){return`cmyk(${String(t.c)}%, ${String(t.m)}%, ${String(t.y)}%, ${String(t.k)}%)`}};function Ct(t){const n=vt.decodeInt,e=vt.encodeInt;let r,o,i;if(tt.isNumber(t))r=e(t);else{if(!tt.isString(t))return null;r=t.replace(/\#|0x/,"")}switch(r=r.toUpperCase(),r.length){case 3:i=/^([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),o={a:1,r:n(i[1]+i[1]),g:n(i[2]+i[2]),b:n(i[3]+i[3])};break;case 6:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:1,r:n(i[1]),g:n(i[2]),b:n(i[3])};break;case 8:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:g.roundDecimals(n(i[1])/255,2),r:n(i[2]),g:n(i[3]),b:n(i[4])};break;default:return null}return o}function kt(t,n){return It.toHex(Ct(t),n)}var qt={average:function(t){return It.toHex(It.average(t.map((t=>Ct(t)))))},distance:function(t,n){return It.distance(Ct(t),Ct(n))},gradient:function(t,n){return It.gradient(t.map((t=>Ct(t))),n).map((t=>It.toHex(t)))},gradientMatrix:function(t,n,e){return It.gradientMatrix(O.map(t,(t=>Ct(t))),n,e).map((t=>t.map((t=>It.toHex(t)))))},interpolateBilinear:function(t,n,e,r,o,i){return It.toHex(It.interpolateBilinear(Ct(t),Ct(n),Ct(e),Ct(r),o,i))},interpolateLinear:function(t,n,e){return It.toHex(It.interpolateLinear(Ct(t),Ct(n),e))},interpolateMultilinear:function(t,n){return It.toHex(It.interpolateMultilinear(t.map((t=>Ct(t))),n))},nearest:function(t,n){return It.toHex(It.nearest(Ct(t),n.map((t=>Ct(t)))))},toCmyk:function(t){return It.toCmyk(Ct(t))},toRgb:Ct,toString:kt,toStringCSS:function(t){return kt(t,"#")}},jt={cmyk:Rt,cmykToHex:Rt.toHex,cmykToRgb:Rt.toRgb,hex:qt,hexToCmyk:qt.toCmyk,hexToRgb:qt.toRgb,rgb:It,rgbToCmyk:It.toCmyk,rgbToHex:It.toRgb};var Ut={backIn:function(t,n){return t*t*(((n=isNaN(n)?1.70158:n)+1)*t-n)},backInOut:function(t,n){return n=isNaN(n)?1.70158:n,(t/=.5)<1?t*t*(((n*=1.525)+1)*t-n)*.5:.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},backOut:function(t,n){return(t-=1)*t*(((n=isNaN(n)?1.70158:n)+1)*t+n)+1},bounceIn:function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)},bounceInOut:function(t){return t<.5?(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375):t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},circularIn:function(t){return-(Math.sqrt(1-t*t)-1)},circularInOut:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):(t-=2,.5*(Math.sqrt(1-t*t)+1))},circularOut:function(t){return t-=1,Math.sqrt(1-t*t)},cubicIn:function(t){return t*t*t},cubicInOut:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},cubicOut:function(t){return(t-=1)*t*t+1},elasticIn:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),-n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)},elasticInOut:function(t,n,e){if(0===t)return 0;if(2===(t/=.5))return 1;let r;return n=isNaN(n)?0:n,.3===(e=isNaN(e)?.3:e)&&(e*=1.5),n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),t<1?n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*-.5:n*2**(-10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*.5+1},elasticOut:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),n*2**(-10*t)*Math.sin((t-r)*(2*Math.PI)/e)+1},exponentialIn:function(t){return 0===t?0:2**(10*(t-1))},exponentialInOut:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*2**(10*(t-1)):.5*(2-2**(-10*(t-=1)))},exponentialOut:function(t){return 1===t?t:1-2**(-10*t)},none:function(t){return t},quadraticIn:function(t){return t*t},quadraticInOut:function(t){return(t/=.5)<1?.5*t*t:-.5*((t-=1)*(t-2)-1)},quadraticOut:function(t){return-t*(t-2)},quarticIn:function(t){return t*t*t*t},quarticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quarticOut:function(t){return-((t-=1)*t*t*t-1)},quinticIn:function(t){return t*t*t*t*t},quinticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},quinticOut:function(t){return(t-=1)*t*t*t*t+1},sexticIn:function(t){return t*t*t*t*t*t},sexticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t*t:-.5*((t-=2)*t*t*t*t*t-2)},sexticOut:function(t){return-((t-=1)*t*t*t*t*t-1)},sineIn:function(t){return 1-Math.cos(t*(Math.PI/2))},sineInOut:function(t){return-.5*(Math.cos(Math.PI*t)-1)},sineOut:function(t){return Math.sin(t*(Math.PI/2))},waveCosine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.cos(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o},waveSawtooth:function(t,n,e,r){r=!0===r;let o=t*(n=isNaN(n)?1:n)%1;return o=(e=!0===e)?Math.abs(o):o,o=r?1-o:o,o},waveSine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.sin(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o}};const Bt=Math.PI/180,Pt=180/Math.PI;function Lt(t,n){return Math.atan2(t,n)*Pt}function Yt(t){return t*Bt}var Ft={DEG_0:0,DEG_90:90,DEG_180:180,DEG_270:270,DEG_360:360,DEG_TO_RAD:Bt,RAD_TO_DEG:Pt,acosDeg:function(t){return Math.acos(t)*Pt},angleDeg:function(t,n){return Lt(t,n)},angleRad:function(t,n){return Math.atan2(t,n)},asinDeg:function(t){return Math.asin(t)*Pt},atanDeg:function(t){return Math.atan(t)*Pt},atan2Deg:Lt,cosDeg:function(t){return Math.cos(t*Bt)},cycleDeg:function(t){return g.cycle(t,360)},degToRad:Yt,fastDeg:function(t,n){const e=n-t;return e>180?-360+e:e<-180?360+n:n},haversine:function(t,n,e,r,o){const i=Yt(t),u=Yt(n),a=Yt(e),c=a-i,s=Yt(r)-u,l=Math.sin(c/2)*Math.sin(c/2)+Math.cos(i)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2),f=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));let h;return h=!1===o?3956:6371,g.roundDecimals(h*f,3)},hypo:function(t,n){return Math.sqrt(t*t+n*n)},radToDeg:function(t){return t*Pt},sinDeg:function(t){return Math.sin(t*Bt)},tanDeg:function(t){return Math.tan(t*Bt)}};function Ht(t,n){return{x:t.x+n.x,y:t.y+n.y}}function Jt(t,n){const e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)}function Zt(t){return Jt(t,{x:0,y:0})}function zt(t,n){return{x:t.x-n.x,y:t.y-n.y}}var Gt={add:Ht,angle:function(t,n){const e=Ft.angleDeg(n.y-t.y,n.x-t.x);return Ft.cycleDeg(e)},cross:function(t,n){return t.x*n.y-t.y*n.x},distance:Jt,dot:function(t,n){return t.x*n.x+t.y*n.y},equals:function(t,n,e){const r=g.equals;return r(t.x,n.x,e)&&r(t.y,n.y,e)},interpolate:function(t,n,e){const r=a.linear;return{x:r(t.x,n.x,e),y:r(t.y,n.y,e)}},length:Zt,magnitude:function(t){return Zt(t)},project:function(t,n,e){return{x:t.x+n*Ft.cosDeg(e),y:t.y+n*Ft.sinDeg(e)}},rect:function(t){let n;const e=[],r=[];for(let o=0,i=t.length;o=n&&t<=e},isEven:function(t){return t%2==0&&!_t(t)},isFloat:_t,isNegative:function(t){return t<0},isOdd:function(t){return t%2!=0&&!_t(t)},isPositive:function(t){return t>=0},isPrime:function(t){if("number"!=typeof t||Number.isNaN(t)||_t(t))return!1;if(t<=1)return!1;if(t<=3)return!0;if(t%2==0||t%3==0)return!1;for(let n=5;n*n<=t;n+=6)if(t%n==0||t%(n+2)==0)return!1;return!0}};function Xt(t){if(!tt.isBoolean(t))throw new Error(`value is not boolean: ${String(t)}.`)}function Kt(t,n){if(!O.equals(t,n)){let e=tt.isArray(t)||tt.isObject(t)?`\n${o.encode(t)}\n`:String(t),r=tt.isArray(n)||tt.isObject(n)?`\n${o.encode(n)}`:String(n);throw e=tt.isString(t)?String(`"${e}"`):e,r=tt.isString(n)?String(`"${r}"`):r,new Error(`values are not equal: ${e} != ${r}`)}}function Vt(t){if(!tt.isFunction(t))throw new Error(`value is not function: ${String(t)}.`)}function Qt(t){if(!tt.isNumber(t))throw new Error(`value is not number: ${String(t)}.`)}var tn={assertArray:function(t,n){if(!tt.isArray(t))throw new Error(`value is not array: ${String(t)}.`);tt.isNumber(n)&&Kt(t.length,n)},assertBase64:function(t){if(!tt.isBase64(t))throw new Error(`value is not base64: ${String(t)}.`)},assertBoolean:Xt,assertDate:function(t){if(!tt.isDate(t))throw new Error(`value is not date: ${String(t)}.`)},assertEqual:Kt,assertError:function(t){if(!tt.isError(t))throw new Error(`value is not error: ${String(t)}.`)},assertFalse:function(t){if(Xt(t),!1!==t)throw new Error(`value is not false: ${String(t)}.`)},assertFunction:Vt,assertJSON:function(t){if(!tt.isJSON(t))throw new Error(`value is not json: ${String(t)}.`)},assertModule:function(t){if(!tt.isModule(t))throw new Error(`value is not module: ${String(t)}.`)},assertNaN:function(t){if(!tt.isNaN(t))throw new Error(`value is not NaN: ${String(t)}.`)},assertNone:function(t){if(!tt.isNone(t))throw new Error(`value is not none: ${String(t)}.`)},assertNotArray:function(t){if(tt.isArray(t))throw new Error(`value is array: ${String(t)}.`)},assertNotBase64:function(t){if(tt.isBase64(t))throw new Error(`value is base64: ${String(t)}.`)},assertNotBoolean:function(t){if(tt.isBoolean(t))throw new Error(`value is boolean: ${String(t)}.`)},assertNotDate:function(t){if(tt.isDate(t))throw new Error(`value is date: ${String(t)}.`)},assertNotEqual:function(t,n){if(O.equals(t,n)){const e=tt.isArray(t)||tt.isObject(t)?`\n${o.encode(t)}\n`:String(t),r=tt.isArray(n)||tt.isObject(n)?`\n${o.encode(n)}`:String(n);throw new Error(`values are equal: ${e} == ${r}`)}},assertNotError:function(t){if(tt.isError(t))throw new Error(`value is error: ${String(t)}.`)},assertNotFunction:function(t){if(tt.isFunction(t))throw new Error(`value is function: ${String(t)}.`)},assertNotJSON:function(t){if(tt.isJSON(t))throw new Error(`value is json: ${String(t)}.`)},assertNotModule:function(t){if(tt.isModule(t))throw new Error(`value is module: ${String(t)}.`)},assertNotNone:function(t){if(tt.isNone(t))throw new Error(`value is none: ${String(t)}.`)},assertNotNumber:function(t){if(tt.isNumber(t))throw new Error(`value is number: ${String(t)}.`)},assertNotNull:function(t){if(tt.isNull(t))throw new Error(`value is null: ${String(t)}.`)},assertNotObject:function(t){if(tt.isObject(t))throw new Error(`value is object: ${String(t)}.`)},assertNotRegExp:function(t){if(tt.isRegExp(t))throw new Error(`value is regexp: ${String(t)}.`)},assertNotString:function(t){if(tt.isString(t))throw new Error(`value is string: ${String(t)}.`)},assertNotUndefined:function(t){if(tt.isUndefined(t))throw new Error(`value is undefined: ${String(t)}.`)},assertNumber:Qt,assertNumberAlmostEqual:function(t,n,e){if(Qt(t),Qt(n),!g.equals(t,n,e))throw new Error(`values are not almost equals (tolerance = ${String(e)}): ${String(t)} != ${String(n)}.`)},assertNull:function(t){if(!tt.isNull(t))throw new Error(`value is not null: ${String(t)}.`)},assertObject:function(t){if(!tt.isObject(t))throw new Error(`value is not object: ${String(t)}.`)},assertRegExp:function(t){if(!tt.isRegExp(t))throw new Error(`value is not regexp: ${String(t)}.`)},assertString:function(t){if(!tt.isString(t))throw new Error(`value is not string: ${String(t)}.`)},assertThrows:function(t,...n){Vt(t);try{const e=null;FunctionUtil.call.apply(null,[t,e].concat(n))}catch(t){return}throw new Error(`value didn't throw error: ${String(t)}.`)},assertTrue:function(t){if(Xt(t),!0!==t)throw new Error(`value is not true: ${String(t)}.`)},assertUndefined:function(t){if(!tt.isUndefined(t))throw new Error(`value is not undefined: ${String(t)}.`)}};const nn={array:Et,base64:r,color:jt,date:St,ease:Ut,func:it,geom:{point:Gt},hex:vt,json:o,math:g,number:Wt,object:O,random:ft,string:yt,test:tn,trigo:Ft,type:tt,xml:{removeNamespaces:function(t){return t.replace(/<[^>]*>/g,(t=>t.replace(/(\s|<\/?)[a-zA-Z0-9]+\:/g,"$1")))}},url:N,utf8:t,version:"1.0.0"};export{nn as default,nn as utils}; diff --git a/dist/utils.js b/dist/utils.js index 164f7d1..61e8f7d 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -479,8 +479,7 @@ } function isLocalhost(url) { - const re = - /^(https?\:\/\/)(localhost(.[a-z0-9\-])*|127\.0\.0\.1)(\:[\d]+)?(\/(.)*)?$/; + const re = /^(https?:\/\/)(localhost(\.[a-z0-9-]+)*|127\.0\.0\.1)(:\d+)?(\/.*)?$/i; return re.test(url || getURL()); } @@ -3709,8 +3708,8 @@ // }; function removeNamespaces(str) { - return str.replace(/(\<(.|\n)+?\>)/g, (tag) => { - return tag.replace(/(\s|\<\/?){1}([\w]+\:){1}/g, '$1'); + return str.replace(/<[^>]*>/g, (tag) => { + return tag.replace(/(\s|<\/?)[a-zA-Z0-9]+\:/g, '$1'); }); } diff --git a/dist/utils.min.js b/dist/utils.min.js index 96679e0..6cc3afc 100644 --- a/dist/utils.min.js +++ b/dist/utils.min.js @@ -1 +1 @@ -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).utils={})}(this,(function(t){"use strict";var n={decode:function(t){return decodeURIComponent(escape(t))},encode:function(t){return unescape(encodeURIComponent(t))}};const e=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/","="],r={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63,"=":64};var o={decode:function(t){const e=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");let o="";try{o=window.atob(e)}catch(t){const n=r;let i,u,a,c,s,l,f,g=0;const h=e.length;for(;g>4,u=(15&s)<<4|l>>2,a=(3&l)<<6|f,o+=String.fromCharCode(i),64!==l&&(o+=String.fromCharCode(u)),64!==f&&(o+=String.fromCharCode(a))}return o=n.decode(o),o},encode:function(t){const r=n.encode(t);let o="";try{o=window.btoa(r)}catch(t){const n=e;let i,u,a,c,s,l,f,g=0;const h=r.length;for(;g>2,s=(3&i)<<4|u>>4,l=(15&u)<<2|a>>6,f=63&a,isNaN(u)?l=f=64:isNaN(a)&&(f=64),o+=n[c]+n[s]+n[l]+n[f]}return o}};var i={decode:function(t){let n="";try{n=JSON.parse(t)}catch(e){t=t.replace(/"/g,'"'),n=JSON.parse(t)}return n},encode:function(t){return JSON.stringify(t)}};function u(t,n,e){return t*(1-e)+n*e}function a(t,n){const e=n*t,r=Math.floor(e),o=t-1,i=h.constrain(r,0,o);return{index:i,t:e-i}}var c={bilinear:function(t,n,e,r,o,i){const a=u;return a(a(t,n,o),a(e,r,o),i)},linear:u,multilinear:function(t,n){const e=a(t.length-1,n),r=e.index;return u(t[r],t[r+1],e.t)},scalar:a};function s(t,n){return t===n?t:(t0&&(e+=1e-10):e=1e-10,Math.abs(t-n)<=e},euclideanDistance:function(t,n){return Math.sqrt(g(t.map(((t,e)=>Math.abs(t-n[e])**2))))},factorial:function(t){let n=1;for(let e=n;e<=t;e++)n*=e;return n},gcd:s,interpolation:c,lcm:function(t,n){return t*n/s(t,n)},lerp:function(t,n,e){return c.linear(t,n,e)},map:function(t,n,e,r,o){return c.linear(r,o,f(t,n,e))},nearest:l,normalize:f,proportion:function(t,n,e,r){const o=[t,n,e,r];if(3!==vt.clean(o).length)return NaN;const i=nt.isNumber;return i(t)?i(n)?i(e)?i(r)?NaN:e*n/t:r*t/n:t*r/e:n*e/r},roundDecimals:function(t,n){return Number(t.toFixed(n||2))},roundToMultiple:function(t,n){return Math.round(t/n)*n},roundToNearest:function(t,n){const e=vt.sort(n.concat());let r=0,o=0,i=e.length;if(0===i)return NaN;if(i>2)for(;oe[r+1]))break;o=r+1}return o=r+1 in e?r+1:r,l(t,e[r],e[o])},roundToPower:function(t,n){return n**Math.round(Math.log(t)/Math.log(n))},sign:function(t){return t>=0?1:-1},summation:g};function d(t){return m(t)}function m(t){const n=p(t);let e;const r={};for(let t=0,o=n.length;t-1?t.substr(n+1):"";const r=e.indexOf("#");return r>-1&&(e=e.substring(0,r)),e}function N(){let t="";try{t=window.location.href}catch(t){}return t}var b={getDomain:function(t=N(),n){let e=t.replace(/(^\w+:|^)\/\/(www\.)?/,"");if(e=e.split(":")[0],!n)return e;let r=e.split(".");return n>r.length||n<=0?"":r[r.length-n]},getParameterByName:function(t,n,e){const r=d(t);return n in r?r[n]||e||"":e},getParameters:d,getParametersDict:m,getParametersList:p,getParametersString:y,getURL:N,hasParameter:function(t,n){return n in m(t)},isFile:function(t){return 0===(t||N()).indexOf("file://")},isHttp:function(t){return 0===(t||N()).indexOf("http://")},isHttps:function(t){return 0===(t||N()).indexOf("https://")},isLocalhost:function(t){return/^(https?\:\/\/)(localhost(.[a-z0-9\-])*|127\.0\.0\.1)(\:[\d]+)?(\/(.)*)?$/.test(t||N())}};function M(t,n,...e){const r=[n].concat(e);let o,i,u;for(o=0,i=r.length;ot===n?0!==t||1/t==1/n:t!=t&&n!=n),Object.is(t,n)}function v(t,n){const e=Object.keys(t);return!0===n&&e.sort(),e}function O(t){return v(t).length}var $={assign:M,clean:S,clone:w,decodeBase64:function(t){return i.decode(o.decode(t))},decodeJSON:function(t){return i.decode(t)},decodeParameters:function(t){return b.getParametersDict(`?${t}`)},encodeBase64:function(t){return o.encode(i.encode(t))},encodeJSON:function(t){return i.encode(t)},encodeParameters:function(t,n){const e=S(w(t),!0),r=nt.isArray(n)?n:v(t,!0);let o,i;const u=[];for(let t=0,n=r.length;t{e[r]=n.call(null,t[r],r,t)})),e},merge:function(t,n,...e){const r=[{},t,n].concat(e);return M.apply(null,r)},search:function(t,n){const e=[];let r,o,i,u,a,c,s,l,f;for(r=0,o=t.length;rot(t,n,...e.concat(r))}function ot(t,n,...e){return nt.isString(t)&&(t=n[t]),t.apply(n,e)}function it(t,n,e,...r){const o=rt(n,e,...r),i=setInterval(o,t);return{cancel(){clearInterval(i)},func:o,id:i}}var ut={args:et,attempt:function(t,n,...e){try{return ot(t,n,...e)}catch(t){return t}},bind:rt,call:ot,debounce:function(t,n,e){let r;return function(...o){r&&(clearTimeout(r),r=null),r=setTimeout((()=>{n.apply(e,o)}),t)}},delay:function(t,n,e,...r){const o=rt(n,e,...r),i=setTimeout(o,t);return{cancel(){clearTimeout(i)},func:o,id:i}},memoize:function(t,n){const e={};return function(...r){const o=String(r);return o in e||(e[o]=ot(t,n,...r)),e[o]}},noop:function(){return!0},repeat:it,throttle:function(t,n,e){let r;return(...o)=>{r||(n.apply(e,o),r=setTimeout((()=>{clearTimeout(r),r=null}),t))}},until:function(t,n,e,...r){const o=rt(n,e,...r),i=it(t,(()=>{!1===o()&&i.cancel()}));return i},validate:function(t,...n){const e=et(t);let r=(n=n.map((t=>Array.isArray(t)?t:[t]))).length;for(;r>0&&n[r-1].includes("undefined");)r--;if(e.length{const r=nt.of(t),o=n[Math.min(e,n.length-1)];if(!o.includes(r))throw new TypeError(`invalid argument: type of argument[${e}] is "${r}", expected "${o.join('" or "')}".`)}))}};function at(t){return Boolean(Math.random()<(isNaN(t)?.5:t))}function ct(t){return t[lt(t)]}function st(t,n){return t+Math.random()*(n-t)}function lt(t){return ft(0,t.length-1)}function ft(t,n){return Math.floor(Math.round(st(t-.5,n+.5)))}var gt={argument:function(...t){return ct(t)},bit:function(t){return at(t)?1:0},boolean:at,color:function(){return ft(0,16777215)},element:ct,float:st,index:lt,integer:ft,map:function(t,n){const e=[];for(let r=0;r1?t.substr(1):"";return e+(!0===n?r.toLowerCase():r)}var Nt={contains:ht,endsWith:function(t,n){return t.substring(t.length-n.length,t.length)===n},icontains:function(t,n){return ht(t.toLowerCase(),n.toLowerCase())},levenshteinDistance:dt,levenshteinSimilarity:function(t,n){const e=dt(t,n),r=Math.max(t.length,n.length);return 0===r?1:1-e/r},padLeft:mt,padRight:function(t,n,e){let r=t.length;for(;r{u=e[0],a=n[e[1]],nt.isNone(a)&&(a=""),t=pt(t,u,a)})),t},replace:pt,reverse:function(t){const n=t.split("");return n.reverse(),n.join("")},rotate:function(t,n){let e=t.split("");return e=vt.rotate(e,n),e.join("")},slugify:function(t){const n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ő":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ű":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","þ":"th","ÿ":"y","ẞ":"SS","œ":"oe","Œ":"OE","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"h","ώ":"w","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"H","Ώ":"W","Ϊ":"I","Ϋ":"Y","ş":"s","Ş":"S","ı":"i","İ":"I","ğ":"g","Ğ":"G","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Э":"E","Ю":"Yu","Я":"Ya","Є":"Ye","І":"I","Ї":"Yi","Ґ":"G","є":"ye","і":"i","ї":"yi","ґ":"g","č":"c","ď":"d","ě":"e","ň":"n","ř":"r","š":"s","ť":"t","ů":"u","ž":"z","Č":"C","Ď":"D","Ě":"E","Ň":"N","Ř":"R","Š":"S","Ť":"T","Ů":"U","Ž":"Z","ą":"a","ć":"c","ę":"e","ł":"l","ń":"n","ś":"s","ź":"z","ż":"z","Ą":"A","Ć":"C","Ę":"e","Ł":"L","Ń":"N","Ś":"S","Ź":"Z","Ż":"Z","ā":"a","ē":"e","ģ":"g","ī":"i","ķ":"k","ļ":"l","ņ":"n","ū":"u","Ā":"A","Ē":"E","Ģ":"G","Ī":"i","Ķ":"k","Ļ":"L","Ņ":"N","Ū":"u"};for(let e=0,r=t.length;egt.boolean()?t.toUpperCase():t.toLowerCase()))},toTitleCase:function(t,n){return t.replace(/[^\'‘’\`\-\s]+/gm,(t=>yt(t,n)))},toUpperCaseFirst:yt,trim:function(t){return t.trim()},trimLeft:function(t){return t.trimStart()},trimRight:function(t){return t.trimEnd()}};function bt(t,n){return t.getTime()>n.getTime()?t:n}function Mt(t,n){return t.getTime()<=n.getTime()?t:n}function St(){const t=new Date;return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}var wt={clone:function(t){return new Date(t.getTime())},constrain:function(t,n,e){const r=Mt(n,e),o=bt(n,e);return Mt(bt(t,r),o)},format:function(t,n){const e=Nt.replace,r=Nt.padZeros,o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=t.getDate(),u=t.getFullYear(),a=t.getMonth(),c=a+1,s=["January","February","March","April","May","June","July","August","September","October","November","December"][a],l=t.getDay(),f=t.getHours(),g=t.getMinutes(),h=t.getSeconds(),d=t.getMilliseconds(),m=[["YYYY",u],["YY",r(u,4).substring(2,4)],["MM",r(c,2)],["M",c],["DD",r(i,2)],["D",i],["hh",r(f,2)],["h",f],["mm",r(g,2)],["m",g],["ss",r(h,2)],["s",h],["ll",r(d,2)],["XX",s],["X",s.substring(0,3)],["ZZ",o[l]],["Z",o[l].substring(0,3)]];let p,y;for(let t=0,r=m.length;t0},max:bt,min:Mt,normalize:function(t){return{milliseconds:t%1e3,seconds:Math.floor(t/1e3)%60,minutes:Math.floor(t/1e3/60)%60,hours:Math.floor(t/1e3/60/60)%24,days:Math.floor(t/1e3/60/60/24)}},parse:function(t){let n;const e=t=>nt.isNumber(t)&&t>=0&&nt.isNumber(new Date(t).getTime());if(nt.isDate(t))return t;if(nt.isNumber(t)){if(n=t,e(n))return new Date(n)}else if(nt.isString(t)){if(n=Number(t),e(n))return new Date(n);if(n=Date.parse(t),e(n))return new Date(n)}return null},timestamp:function(t){return(t||new Date).getTime()},today:St,tomorrow:function(){const t=St();return t.setDate(t.getDate()+1),t},yesterday:function(){const t=St();return t.setDate(t.getDate()-1),t},yyyymmdd:function(t,n){const e=t||new Date,r=e.getFullYear(),o=e.getMonth()+1,i=e.getDate(),u=n||"";return String(r)+u+Nt.padZeros(o,2)+u+Nt.padZeros(i,2)}};function xt(t,n,e){let r=nt.isUndefined(e)?0:e;for(let e=0,o=t.length;e{o=0===o?t.length:Math.min(o,t.length)}));const i=[];for(let t=0;t{switch(nt.of(t)){case nt.ARRAY:return t.length>0;case nt.OBJECT:return $.length(t)>0;default:return Boolean(t)}}))},any:function(t){return t.some((t=>{switch(nt.of(t)){case nt.ARRAY:return t.length>0;case nt.OBJECT:return $.length(t)>0;default:return Boolean(t)}}))},clean:function t(n,e){let r=n.slice();return r=r.filter((t=>!nt.isNone(t))),!0===e&&(r=r.map((n=>{let r;switch(nt.of(n)){case nt.ARRAY:return r=t(n,e),r.length>0?r:null;case nt.OBJECT:return r=$.clean(n,e),$.length(r)>0?r:null;case nt.STRING:return r=Nt.trim(n),""!==r?n:null;default:return n}})).filter((t=>!nt.isNone(t)))),r},clone:function t(n){const e=n.slice();let r;for(let n=0,o=e.length;nnt.isFunction(n)?Math.max(t,n(e)):Math.max(t,e)),Number.MIN_VALUE)},min:function(t,n){return xt(t,((t,e)=>nt.isFunction(n)?Math.min(t,n(e)):Math.min(t,e)),Number.MAX_VALUE)},paginate:function(t,n){const e=t.length,r=n>0?Math.ceil(e/n):0,o=[];let i,u;for(i=0,u=0;i{let a,c;if(r(t)&&r(u)&&i(n))a=n in t?t[n]:t,c=n in u?u[n]:u;else if(e(t)&&e(u)&&o(n)){const e=n;a=e>=0&&e=0&&ent.isFunction(n)?t+n(e):t+e),0)},unique:function(t){let n;const e=[],r=t=>!$.equals(n,t);for(let o=0,i=t.length;o=1?"":u(255*e))+u(r)+u(o)+u(i))},toString:function(t){return`{ r:${String(t.r)}, g:${String(t.g)}, b:${String(t.b)}, a:${String(isNaN(t.a)?1:t.a)} }`},toStringCSS:function(t){return`rgba(${String(t.r)}, ${String(t.g)}, ${String(t.b)}, ${String(isNaN(t.a)?1:t.a)})`}};function Rt(t){const n=t.c/100,e=t.m/100,r=t.y/100,o=t.k/100,i=1-o;let u=1-Math.min(1,n*i+o),a=1-Math.min(1,e*i+o),c=1-Math.min(1,r*i+o);const s=Math.round;return u=s(255*u),a=s(255*a),c=s(255*c),{r:u,g:a,b:c,a:1}}var Ct={toHex:function(t,n){return Tt.toHex(Rt(t),n)},toRgb:Rt,toString:function(t){return`{ c:${String(t.c)}, m:${String(t.m)}, y:${String(t.y)}, k:${String(t.k)} }`},toStringCSS:function(t){return`cmyk(${String(t.c)}%, ${String(t.m)}%, ${String(t.y)}%, ${String(t.k)}%)`}};function kt(t){const n=Ot.decodeInt,e=Ot.encodeInt;let r,o,i;if(nt.isNumber(t))r=e(t);else{if(!nt.isString(t))return null;r=t.replace(/\#|0x/,"")}switch(r=r.toUpperCase(),r.length){case 3:i=/^([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),o={a:1,r:n(i[1]+i[1]),g:n(i[2]+i[2]),b:n(i[3]+i[3])};break;case 6:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:1,r:n(i[1]),g:n(i[2]),b:n(i[3])};break;case 8:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:h.roundDecimals(n(i[1])/255,2),r:n(i[2]),g:n(i[3]),b:n(i[4])};break;default:return null}return o}function qt(t,n){return Tt.toHex(kt(t),n)}var jt={average:function(t){return Tt.toHex(Tt.average(t.map((t=>kt(t)))))},distance:function(t,n){return Tt.distance(kt(t),kt(n))},gradient:function(t,n){return Tt.gradient(t.map((t=>kt(t))),n).map((t=>Tt.toHex(t)))},gradientMatrix:function(t,n,e){return Tt.gradientMatrix($.map(t,(t=>kt(t))),n,e).map((t=>t.map((t=>Tt.toHex(t)))))},interpolateBilinear:function(t,n,e,r,o,i){return Tt.toHex(Tt.interpolateBilinear(kt(t),kt(n),kt(e),kt(r),o,i))},interpolateLinear:function(t,n,e){return Tt.toHex(Tt.interpolateLinear(kt(t),kt(n),e))},interpolateMultilinear:function(t,n){return Tt.toHex(Tt.interpolateMultilinear(t.map((t=>kt(t))),n))},nearest:function(t,n){return Tt.toHex(Tt.nearest(kt(t),n.map((t=>kt(t)))))},toCmyk:function(t){return Tt.toCmyk(kt(t))},toRgb:kt,toString:qt,toStringCSS:function(t){return qt(t,"#")}},Ut={cmyk:Ct,cmykToHex:Ct.toHex,cmykToRgb:Ct.toRgb,hex:jt,hexToCmyk:jt.toCmyk,hexToRgb:jt.toRgb,rgb:Tt,rgbToCmyk:Tt.toCmyk,rgbToHex:Tt.toRgb};var Bt={backIn:function(t,n){return t*t*(((n=isNaN(n)?1.70158:n)+1)*t-n)},backInOut:function(t,n){return n=isNaN(n)?1.70158:n,(t/=.5)<1?t*t*(((n*=1.525)+1)*t-n)*.5:.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},backOut:function(t,n){return(t-=1)*t*(((n=isNaN(n)?1.70158:n)+1)*t+n)+1},bounceIn:function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)},bounceInOut:function(t){return t<.5?(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375):t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},circularIn:function(t){return-(Math.sqrt(1-t*t)-1)},circularInOut:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):(t-=2,.5*(Math.sqrt(1-t*t)+1))},circularOut:function(t){return t-=1,Math.sqrt(1-t*t)},cubicIn:function(t){return t*t*t},cubicInOut:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},cubicOut:function(t){return(t-=1)*t*t+1},elasticIn:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),-n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)},elasticInOut:function(t,n,e){if(0===t)return 0;if(2===(t/=.5))return 1;let r;return n=isNaN(n)?0:n,.3===(e=isNaN(e)?.3:e)&&(e*=1.5),n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),t<1?n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*-.5:n*2**(-10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*.5+1},elasticOut:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),n*2**(-10*t)*Math.sin((t-r)*(2*Math.PI)/e)+1},exponentialIn:function(t){return 0===t?0:2**(10*(t-1))},exponentialInOut:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*2**(10*(t-1)):.5*(2-2**(-10*(t-=1)))},exponentialOut:function(t){return 1===t?t:1-2**(-10*t)},none:function(t){return t},quadraticIn:function(t){return t*t},quadraticInOut:function(t){return(t/=.5)<1?.5*t*t:-.5*((t-=1)*(t-2)-1)},quadraticOut:function(t){return-t*(t-2)},quarticIn:function(t){return t*t*t*t},quarticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quarticOut:function(t){return-((t-=1)*t*t*t-1)},quinticIn:function(t){return t*t*t*t*t},quinticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},quinticOut:function(t){return(t-=1)*t*t*t*t+1},sexticIn:function(t){return t*t*t*t*t*t},sexticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t*t:-.5*((t-=2)*t*t*t*t*t-2)},sexticOut:function(t){return-((t-=1)*t*t*t*t*t-1)},sineIn:function(t){return 1-Math.cos(t*(Math.PI/2))},sineInOut:function(t){return-.5*(Math.cos(Math.PI*t)-1)},sineOut:function(t){return Math.sin(t*(Math.PI/2))},waveCosine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.cos(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o},waveSawtooth:function(t,n,e,r){r=!0===r;let o=t*(n=isNaN(n)?1:n)%1;return o=(e=!0===e)?Math.abs(o):o,o=r?1-o:o,o},waveSine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.sin(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o}};const Pt=Math.PI/180,Lt=180/Math.PI;function Yt(t,n){return Math.atan2(t,n)*Lt}function Ft(t){return t*Pt}var Ht={DEG_0:0,DEG_90:90,DEG_180:180,DEG_270:270,DEG_360:360,DEG_TO_RAD:Pt,RAD_TO_DEG:Lt,acosDeg:function(t){return Math.acos(t)*Lt},angleDeg:function(t,n){return Yt(t,n)},angleRad:function(t,n){return Math.atan2(t,n)},asinDeg:function(t){return Math.asin(t)*Lt},atanDeg:function(t){return Math.atan(t)*Lt},atan2Deg:Yt,cosDeg:function(t){return Math.cos(t*Pt)},cycleDeg:function(t){return h.cycle(t,360)},degToRad:Ft,fastDeg:function(t,n){const e=n-t;return e>180?-360+e:e<-180?360+n:n},haversine:function(t,n,e,r,o){const i=Ft(t),u=Ft(n),a=Ft(e),c=a-i,s=Ft(r)-u,l=Math.sin(c/2)*Math.sin(c/2)+Math.cos(i)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2),f=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));let g;return g=!1===o?3956:6371,h.roundDecimals(g*f,3)},hypo:function(t,n){return Math.sqrt(t*t+n*n)},radToDeg:function(t){return t*Lt},sinDeg:function(t){return Math.sin(t*Pt)},tanDeg:function(t){return Math.tan(t*Pt)}};function Jt(t,n){return{x:t.x+n.x,y:t.y+n.y}}function Zt(t,n){const e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)}function _t(t){return Zt(t,{x:0,y:0})}function Gt(t,n){return{x:t.x-n.x,y:t.y-n.y}}var zt={add:Jt,angle:function(t,n){const e=Ht.angleDeg(n.y-t.y,n.x-t.x);return Ht.cycleDeg(e)},cross:function(t,n){return t.x*n.y-t.y*n.x},distance:Zt,dot:function(t,n){return t.x*n.x+t.y*n.y},equals:function(t,n,e){const r=h.equals;return r(t.x,n.x,e)&&r(t.y,n.y,e)},interpolate:function(t,n,e){const r=c.linear;return{x:r(t.x,n.x,e),y:r(t.y,n.y,e)}},length:_t,magnitude:function(t){return _t(t)},project:function(t,n,e){return{x:t.x+n*Ht.cosDeg(e),y:t.y+n*Ht.sinDeg(e)}},rect:function(t){let n;const e=[],r=[];for(let o=0,i=t.length;o=n&&t<=e},isEven:function(t){return t%2==0&&!Wt(t)},isFloat:Wt,isNegative:function(t){return t<0},isOdd:function(t){return t%2!=0&&!Wt(t)},isPositive:function(t){return t>=0},isPrime:function(t){if("number"!=typeof t||Number.isNaN(t)||Wt(t))return!1;if(t<=1)return!1;if(t<=3)return!0;if(t%2==0||t%3==0)return!1;for(let n=5;n*n<=t;n+=6)if(t%n==0||t%(n+2)==0)return!1;return!0}};function Kt(t){if(!nt.isBoolean(t))throw new Error(`value is not boolean: ${String(t)}.`)}function Vt(t,n){if(!$.equals(t,n)){let e=nt.isArray(t)||nt.isObject(t)?`\n${i.encode(t)}\n`:String(t),r=nt.isArray(n)||nt.isObject(n)?`\n${i.encode(n)}`:String(n);throw e=nt.isString(t)?String(`"${e}"`):e,r=nt.isString(n)?String(`"${r}"`):r,new Error(`values are not equal: ${e} != ${r}`)}}function Qt(t){if(!nt.isFunction(t))throw new Error(`value is not function: ${String(t)}.`)}function tn(t){if(!nt.isNumber(t))throw new Error(`value is not number: ${String(t)}.`)}var nn={assertArray:function(t,n){if(!nt.isArray(t))throw new Error(`value is not array: ${String(t)}.`);nt.isNumber(n)&&Vt(t.length,n)},assertBase64:function(t){if(!nt.isBase64(t))throw new Error(`value is not base64: ${String(t)}.`)},assertBoolean:Kt,assertDate:function(t){if(!nt.isDate(t))throw new Error(`value is not date: ${String(t)}.`)},assertEqual:Vt,assertError:function(t){if(!nt.isError(t))throw new Error(`value is not error: ${String(t)}.`)},assertFalse:function(t){if(Kt(t),!1!==t)throw new Error(`value is not false: ${String(t)}.`)},assertFunction:Qt,assertJSON:function(t){if(!nt.isJSON(t))throw new Error(`value is not json: ${String(t)}.`)},assertModule:function(t){if(!nt.isModule(t))throw new Error(`value is not module: ${String(t)}.`)},assertNaN:function(t){if(!nt.isNaN(t))throw new Error(`value is not NaN: ${String(t)}.`)},assertNone:function(t){if(!nt.isNone(t))throw new Error(`value is not none: ${String(t)}.`)},assertNotArray:function(t){if(nt.isArray(t))throw new Error(`value is array: ${String(t)}.`)},assertNotBase64:function(t){if(nt.isBase64(t))throw new Error(`value is base64: ${String(t)}.`)},assertNotBoolean:function(t){if(nt.isBoolean(t))throw new Error(`value is boolean: ${String(t)}.`)},assertNotDate:function(t){if(nt.isDate(t))throw new Error(`value is date: ${String(t)}.`)},assertNotEqual:function(t,n){if($.equals(t,n)){const e=nt.isArray(t)||nt.isObject(t)?`\n${i.encode(t)}\n`:String(t),r=nt.isArray(n)||nt.isObject(n)?`\n${i.encode(n)}`:String(n);throw new Error(`values are equal: ${e} == ${r}`)}},assertNotError:function(t){if(nt.isError(t))throw new Error(`value is error: ${String(t)}.`)},assertNotFunction:function(t){if(nt.isFunction(t))throw new Error(`value is function: ${String(t)}.`)},assertNotJSON:function(t){if(nt.isJSON(t))throw new Error(`value is json: ${String(t)}.`)},assertNotModule:function(t){if(nt.isModule(t))throw new Error(`value is module: ${String(t)}.`)},assertNotNone:function(t){if(nt.isNone(t))throw new Error(`value is none: ${String(t)}.`)},assertNotNumber:function(t){if(nt.isNumber(t))throw new Error(`value is number: ${String(t)}.`)},assertNotNull:function(t){if(nt.isNull(t))throw new Error(`value is null: ${String(t)}.`)},assertNotObject:function(t){if(nt.isObject(t))throw new Error(`value is object: ${String(t)}.`)},assertNotRegExp:function(t){if(nt.isRegExp(t))throw new Error(`value is regexp: ${String(t)}.`)},assertNotString:function(t){if(nt.isString(t))throw new Error(`value is string: ${String(t)}.`)},assertNotUndefined:function(t){if(nt.isUndefined(t))throw new Error(`value is undefined: ${String(t)}.`)},assertNumber:tn,assertNumberAlmostEqual:function(t,n,e){if(tn(t),tn(n),!h.equals(t,n,e))throw new Error(`values are not almost equals (tolerance = ${String(e)}): ${String(t)} != ${String(n)}.`)},assertNull:function(t){if(!nt.isNull(t))throw new Error(`value is not null: ${String(t)}.`)},assertObject:function(t){if(!nt.isObject(t))throw new Error(`value is not object: ${String(t)}.`)},assertRegExp:function(t){if(!nt.isRegExp(t))throw new Error(`value is not regexp: ${String(t)}.`)},assertString:function(t){if(!nt.isString(t))throw new Error(`value is not string: ${String(t)}.`)},assertThrows:function(t,...n){Qt(t);try{const e=null;FunctionUtil.call.apply(null,[t,e].concat(n))}catch(t){return}throw new Error(`value didn't throw error: ${String(t)}.`)},assertTrue:function(t){if(Kt(t),!0!==t)throw new Error(`value is not true: ${String(t)}.`)},assertUndefined:function(t){if(!nt.isUndefined(t))throw new Error(`value is not undefined: ${String(t)}.`)}};const en={array:vt,base64:o,color:Ut,date:wt,ease:Bt,func:ut,geom:{point:zt},hex:Ot,json:i,math:h,number:Xt,object:$,random:gt,string:Nt,test:nn,trigo:Ht,type:nt,xml:{removeNamespaces:function(t){return t.replace(/(\<(.|\n)+?\>)/g,(t=>t.replace(/(\s|\<\/?){1}([\w]+\:){1}/g,"$1")))}},url:b,utf8:n,version:"1.0.0"};t.default=en,t.utils=en,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).utils={})}(this,(function(t){"use strict";var n={decode:function(t){return decodeURIComponent(escape(t))},encode:function(t){return unescape(encodeURIComponent(t))}};const e=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/","="],r={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63,"=":64};var o={decode:function(t){const e=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");let o="";try{o=window.atob(e)}catch(t){const n=r;let i,u,a,c,s,l,f,g=0;const h=e.length;for(;g>4,u=(15&s)<<4|l>>2,a=(3&l)<<6|f,o+=String.fromCharCode(i),64!==l&&(o+=String.fromCharCode(u)),64!==f&&(o+=String.fromCharCode(a))}return o=n.decode(o),o},encode:function(t){const r=n.encode(t);let o="";try{o=window.btoa(r)}catch(t){const n=e;let i,u,a,c,s,l,f,g=0;const h=r.length;for(;g>2,s=(3&i)<<4|u>>4,l=(15&u)<<2|a>>6,f=63&a,isNaN(u)?l=f=64:isNaN(a)&&(f=64),o+=n[c]+n[s]+n[l]+n[f]}return o}};var i={decode:function(t){let n="";try{n=JSON.parse(t)}catch(e){t=t.replace(/"/g,'"'),n=JSON.parse(t)}return n},encode:function(t){return JSON.stringify(t)}};function u(t,n,e){return t*(1-e)+n*e}function a(t,n){const e=n*t,r=Math.floor(e),o=t-1,i=h.constrain(r,0,o);return{index:i,t:e-i}}var c={bilinear:function(t,n,e,r,o,i){const a=u;return a(a(t,n,o),a(e,r,o),i)},linear:u,multilinear:function(t,n){const e=a(t.length-1,n),r=e.index;return u(t[r],t[r+1],e.t)},scalar:a};function s(t,n){return t===n?t:(t0&&(e+=1e-10):e=1e-10,Math.abs(t-n)<=e},euclideanDistance:function(t,n){return Math.sqrt(g(t.map(((t,e)=>Math.abs(t-n[e])**2))))},factorial:function(t){let n=1;for(let e=n;e<=t;e++)n*=e;return n},gcd:s,interpolation:c,lcm:function(t,n){return t*n/s(t,n)},lerp:function(t,n,e){return c.linear(t,n,e)},map:function(t,n,e,r,o){return c.linear(r,o,f(t,n,e))},nearest:l,normalize:f,proportion:function(t,n,e,r){const o=[t,n,e,r];if(3!==vt.clean(o).length)return NaN;const i=nt.isNumber;return i(t)?i(n)?i(e)?i(r)?NaN:e*n/t:r*t/n:t*r/e:n*e/r},roundDecimals:function(t,n){return Number(t.toFixed(n||2))},roundToMultiple:function(t,n){return Math.round(t/n)*n},roundToNearest:function(t,n){const e=vt.sort(n.concat());let r=0,o=0,i=e.length;if(0===i)return NaN;if(i>2)for(;oe[r+1]))break;o=r+1}return o=r+1 in e?r+1:r,l(t,e[r],e[o])},roundToPower:function(t,n){return n**Math.round(Math.log(t)/Math.log(n))},sign:function(t){return t>=0?1:-1},summation:g};function d(t){return m(t)}function m(t){const n=p(t);let e;const r={};for(let t=0,o=n.length;t-1?t.substr(n+1):"";const r=e.indexOf("#");return r>-1&&(e=e.substring(0,r)),e}function N(){let t="";try{t=window.location.href}catch(t){}return t}var b={getDomain:function(t=N(),n){let e=t.replace(/(^\w+:|^)\/\/(www\.)?/,"");if(e=e.split(":")[0],!n)return e;let r=e.split(".");return n>r.length||n<=0?"":r[r.length-n]},getParameterByName:function(t,n,e){const r=d(t);return n in r?r[n]||e||"":e},getParameters:d,getParametersDict:m,getParametersList:p,getParametersString:y,getURL:N,hasParameter:function(t,n){return n in m(t)},isFile:function(t){return 0===(t||N()).indexOf("file://")},isHttp:function(t){return 0===(t||N()).indexOf("http://")},isHttps:function(t){return 0===(t||N()).indexOf("https://")},isLocalhost:function(t){return/^(https?:\/\/)(localhost(\.[a-z0-9-]+)*|127\.0\.0\.1)(:\d+)?(\/.*)?$/i.test(t||N())}};function M(t,n,...e){const r=[n].concat(e);let o,i,u;for(o=0,i=r.length;ot===n?0!==t||1/t==1/n:t!=t&&n!=n),Object.is(t,n)}function v(t,n){const e=Object.keys(t);return!0===n&&e.sort(),e}function O(t){return v(t).length}var $={assign:M,clean:S,clone:w,decodeBase64:function(t){return i.decode(o.decode(t))},decodeJSON:function(t){return i.decode(t)},decodeParameters:function(t){return b.getParametersDict(`?${t}`)},encodeBase64:function(t){return o.encode(i.encode(t))},encodeJSON:function(t){return i.encode(t)},encodeParameters:function(t,n){const e=S(w(t),!0),r=nt.isArray(n)?n:v(t,!0);let o,i;const u=[];for(let t=0,n=r.length;t{e[r]=n.call(null,t[r],r,t)})),e},merge:function(t,n,...e){const r=[{},t,n].concat(e);return M.apply(null,r)},search:function(t,n){const e=[];let r,o,i,u,a,c,s,l,f;for(r=0,o=t.length;rot(t,n,...e.concat(r))}function ot(t,n,...e){return nt.isString(t)&&(t=n[t]),t.apply(n,e)}function it(t,n,e,...r){const o=rt(n,e,...r),i=setInterval(o,t);return{cancel(){clearInterval(i)},func:o,id:i}}var ut={args:et,attempt:function(t,n,...e){try{return ot(t,n,...e)}catch(t){return t}},bind:rt,call:ot,debounce:function(t,n,e){let r;return function(...o){r&&(clearTimeout(r),r=null),r=setTimeout((()=>{n.apply(e,o)}),t)}},delay:function(t,n,e,...r){const o=rt(n,e,...r),i=setTimeout(o,t);return{cancel(){clearTimeout(i)},func:o,id:i}},memoize:function(t,n){const e={};return function(...r){const o=String(r);return o in e||(e[o]=ot(t,n,...r)),e[o]}},noop:function(){return!0},repeat:it,throttle:function(t,n,e){let r;return(...o)=>{r||(n.apply(e,o),r=setTimeout((()=>{clearTimeout(r),r=null}),t))}},until:function(t,n,e,...r){const o=rt(n,e,...r),i=it(t,(()=>{!1===o()&&i.cancel()}));return i},validate:function(t,...n){const e=et(t);let r=(n=n.map((t=>Array.isArray(t)?t:[t]))).length;for(;r>0&&n[r-1].includes("undefined");)r--;if(e.length{const r=nt.of(t),o=n[Math.min(e,n.length-1)];if(!o.includes(r))throw new TypeError(`invalid argument: type of argument[${e}] is "${r}", expected "${o.join('" or "')}".`)}))}};function at(t){return Boolean(Math.random()<(isNaN(t)?.5:t))}function ct(t){return t[lt(t)]}function st(t,n){return t+Math.random()*(n-t)}function lt(t){return ft(0,t.length-1)}function ft(t,n){return Math.floor(Math.round(st(t-.5,n+.5)))}var gt={argument:function(...t){return ct(t)},bit:function(t){return at(t)?1:0},boolean:at,color:function(){return ft(0,16777215)},element:ct,float:st,index:lt,integer:ft,map:function(t,n){const e=[];for(let r=0;r1?t.substr(1):"";return e+(!0===n?r.toLowerCase():r)}var Nt={contains:ht,endsWith:function(t,n){return t.substring(t.length-n.length,t.length)===n},icontains:function(t,n){return ht(t.toLowerCase(),n.toLowerCase())},levenshteinDistance:dt,levenshteinSimilarity:function(t,n){const e=dt(t,n),r=Math.max(t.length,n.length);return 0===r?1:1-e/r},padLeft:mt,padRight:function(t,n,e){let r=t.length;for(;r{u=e[0],a=n[e[1]],nt.isNone(a)&&(a=""),t=pt(t,u,a)})),t},replace:pt,reverse:function(t){const n=t.split("");return n.reverse(),n.join("")},rotate:function(t,n){let e=t.split("");return e=vt.rotate(e,n),e.join("")},slugify:function(t){const n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ő":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ű":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","þ":"th","ÿ":"y","ẞ":"SS","œ":"oe","Œ":"OE","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"h","ώ":"w","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"H","Ώ":"W","Ϊ":"I","Ϋ":"Y","ş":"s","Ş":"S","ı":"i","İ":"I","ğ":"g","Ğ":"G","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Э":"E","Ю":"Yu","Я":"Ya","Є":"Ye","І":"I","Ї":"Yi","Ґ":"G","є":"ye","і":"i","ї":"yi","ґ":"g","č":"c","ď":"d","ě":"e","ň":"n","ř":"r","š":"s","ť":"t","ů":"u","ž":"z","Č":"C","Ď":"D","Ě":"E","Ň":"N","Ř":"R","Š":"S","Ť":"T","Ů":"U","Ž":"Z","ą":"a","ć":"c","ę":"e","ł":"l","ń":"n","ś":"s","ź":"z","ż":"z","Ą":"A","Ć":"C","Ę":"e","Ł":"L","Ń":"N","Ś":"S","Ź":"Z","Ż":"Z","ā":"a","ē":"e","ģ":"g","ī":"i","ķ":"k","ļ":"l","ņ":"n","ū":"u","Ā":"A","Ē":"E","Ģ":"G","Ī":"i","Ķ":"k","Ļ":"L","Ņ":"N","Ū":"u"};for(let e=0,r=t.length;egt.boolean()?t.toUpperCase():t.toLowerCase()))},toTitleCase:function(t,n){return t.replace(/[^\'‘’\`\-\s]+/gm,(t=>yt(t,n)))},toUpperCaseFirst:yt,trim:function(t){return t.trim()},trimLeft:function(t){return t.trimStart()},trimRight:function(t){return t.trimEnd()}};function bt(t,n){return t.getTime()>n.getTime()?t:n}function Mt(t,n){return t.getTime()<=n.getTime()?t:n}function St(){const t=new Date;return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}var wt={clone:function(t){return new Date(t.getTime())},constrain:function(t,n,e){const r=Mt(n,e),o=bt(n,e);return Mt(bt(t,r),o)},format:function(t,n){const e=Nt.replace,r=Nt.padZeros,o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=t.getDate(),u=t.getFullYear(),a=t.getMonth(),c=a+1,s=["January","February","March","April","May","June","July","August","September","October","November","December"][a],l=t.getDay(),f=t.getHours(),g=t.getMinutes(),h=t.getSeconds(),d=t.getMilliseconds(),m=[["YYYY",u],["YY",r(u,4).substring(2,4)],["MM",r(c,2)],["M",c],["DD",r(i,2)],["D",i],["hh",r(f,2)],["h",f],["mm",r(g,2)],["m",g],["ss",r(h,2)],["s",h],["ll",r(d,2)],["XX",s],["X",s.substring(0,3)],["ZZ",o[l]],["Z",o[l].substring(0,3)]];let p,y;for(let t=0,r=m.length;t0},max:bt,min:Mt,normalize:function(t){return{milliseconds:t%1e3,seconds:Math.floor(t/1e3)%60,minutes:Math.floor(t/1e3/60)%60,hours:Math.floor(t/1e3/60/60)%24,days:Math.floor(t/1e3/60/60/24)}},parse:function(t){let n;const e=t=>nt.isNumber(t)&&t>=0&&nt.isNumber(new Date(t).getTime());if(nt.isDate(t))return t;if(nt.isNumber(t)){if(n=t,e(n))return new Date(n)}else if(nt.isString(t)){if(n=Number(t),e(n))return new Date(n);if(n=Date.parse(t),e(n))return new Date(n)}return null},timestamp:function(t){return(t||new Date).getTime()},today:St,tomorrow:function(){const t=St();return t.setDate(t.getDate()+1),t},yesterday:function(){const t=St();return t.setDate(t.getDate()-1),t},yyyymmdd:function(t,n){const e=t||new Date,r=e.getFullYear(),o=e.getMonth()+1,i=e.getDate(),u=n||"";return String(r)+u+Nt.padZeros(o,2)+u+Nt.padZeros(i,2)}};function xt(t,n,e){let r=nt.isUndefined(e)?0:e;for(let e=0,o=t.length;e{o=0===o?t.length:Math.min(o,t.length)}));const i=[];for(let t=0;t{switch(nt.of(t)){case nt.ARRAY:return t.length>0;case nt.OBJECT:return $.length(t)>0;default:return Boolean(t)}}))},any:function(t){return t.some((t=>{switch(nt.of(t)){case nt.ARRAY:return t.length>0;case nt.OBJECT:return $.length(t)>0;default:return Boolean(t)}}))},clean:function t(n,e){let r=n.slice();return r=r.filter((t=>!nt.isNone(t))),!0===e&&(r=r.map((n=>{let r;switch(nt.of(n)){case nt.ARRAY:return r=t(n,e),r.length>0?r:null;case nt.OBJECT:return r=$.clean(n,e),$.length(r)>0?r:null;case nt.STRING:return r=Nt.trim(n),""!==r?n:null;default:return n}})).filter((t=>!nt.isNone(t)))),r},clone:function t(n){const e=n.slice();let r;for(let n=0,o=e.length;nnt.isFunction(n)?Math.max(t,n(e)):Math.max(t,e)),Number.MIN_VALUE)},min:function(t,n){return xt(t,((t,e)=>nt.isFunction(n)?Math.min(t,n(e)):Math.min(t,e)),Number.MAX_VALUE)},paginate:function(t,n){const e=t.length,r=n>0?Math.ceil(e/n):0,o=[];let i,u;for(i=0,u=0;i{let a,c;if(r(t)&&r(u)&&i(n))a=n in t?t[n]:t,c=n in u?u[n]:u;else if(e(t)&&e(u)&&o(n)){const e=n;a=e>=0&&e=0&&ent.isFunction(n)?t+n(e):t+e),0)},unique:function(t){let n;const e=[],r=t=>!$.equals(n,t);for(let o=0,i=t.length;o=1?"":u(255*e))+u(r)+u(o)+u(i))},toString:function(t){return`{ r:${String(t.r)}, g:${String(t.g)}, b:${String(t.b)}, a:${String(isNaN(t.a)?1:t.a)} }`},toStringCSS:function(t){return`rgba(${String(t.r)}, ${String(t.g)}, ${String(t.b)}, ${String(isNaN(t.a)?1:t.a)})`}};function Rt(t){const n=t.c/100,e=t.m/100,r=t.y/100,o=t.k/100,i=1-o;let u=1-Math.min(1,n*i+o),a=1-Math.min(1,e*i+o),c=1-Math.min(1,r*i+o);const s=Math.round;return u=s(255*u),a=s(255*a),c=s(255*c),{r:u,g:a,b:c,a:1}}var Ct={toHex:function(t,n){return Tt.toHex(Rt(t),n)},toRgb:Rt,toString:function(t){return`{ c:${String(t.c)}, m:${String(t.m)}, y:${String(t.y)}, k:${String(t.k)} }`},toStringCSS:function(t){return`cmyk(${String(t.c)}%, ${String(t.m)}%, ${String(t.y)}%, ${String(t.k)}%)`}};function kt(t){const n=Ot.decodeInt,e=Ot.encodeInt;let r,o,i;if(nt.isNumber(t))r=e(t);else{if(!nt.isString(t))return null;r=t.replace(/\#|0x/,"")}switch(r=r.toUpperCase(),r.length){case 3:i=/^([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),o={a:1,r:n(i[1]+i[1]),g:n(i[2]+i[2]),b:n(i[3]+i[3])};break;case 6:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:1,r:n(i[1]),g:n(i[2]),b:n(i[3])};break;case 8:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:h.roundDecimals(n(i[1])/255,2),r:n(i[2]),g:n(i[3]),b:n(i[4])};break;default:return null}return o}function qt(t,n){return Tt.toHex(kt(t),n)}var jt={average:function(t){return Tt.toHex(Tt.average(t.map((t=>kt(t)))))},distance:function(t,n){return Tt.distance(kt(t),kt(n))},gradient:function(t,n){return Tt.gradient(t.map((t=>kt(t))),n).map((t=>Tt.toHex(t)))},gradientMatrix:function(t,n,e){return Tt.gradientMatrix($.map(t,(t=>kt(t))),n,e).map((t=>t.map((t=>Tt.toHex(t)))))},interpolateBilinear:function(t,n,e,r,o,i){return Tt.toHex(Tt.interpolateBilinear(kt(t),kt(n),kt(e),kt(r),o,i))},interpolateLinear:function(t,n,e){return Tt.toHex(Tt.interpolateLinear(kt(t),kt(n),e))},interpolateMultilinear:function(t,n){return Tt.toHex(Tt.interpolateMultilinear(t.map((t=>kt(t))),n))},nearest:function(t,n){return Tt.toHex(Tt.nearest(kt(t),n.map((t=>kt(t)))))},toCmyk:function(t){return Tt.toCmyk(kt(t))},toRgb:kt,toString:qt,toStringCSS:function(t){return qt(t,"#")}},Ut={cmyk:Ct,cmykToHex:Ct.toHex,cmykToRgb:Ct.toRgb,hex:jt,hexToCmyk:jt.toCmyk,hexToRgb:jt.toRgb,rgb:Tt,rgbToCmyk:Tt.toCmyk,rgbToHex:Tt.toRgb};var Bt={backIn:function(t,n){return t*t*(((n=isNaN(n)?1.70158:n)+1)*t-n)},backInOut:function(t,n){return n=isNaN(n)?1.70158:n,(t/=.5)<1?t*t*(((n*=1.525)+1)*t-n)*.5:.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},backOut:function(t,n){return(t-=1)*t*(((n=isNaN(n)?1.70158:n)+1)*t+n)+1},bounceIn:function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)},bounceInOut:function(t){return t<.5?(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375):t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},circularIn:function(t){return-(Math.sqrt(1-t*t)-1)},circularInOut:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):(t-=2,.5*(Math.sqrt(1-t*t)+1))},circularOut:function(t){return t-=1,Math.sqrt(1-t*t)},cubicIn:function(t){return t*t*t},cubicInOut:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},cubicOut:function(t){return(t-=1)*t*t+1},elasticIn:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),-n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)},elasticInOut:function(t,n,e){if(0===t)return 0;if(2===(t/=.5))return 1;let r;return n=isNaN(n)?0:n,.3===(e=isNaN(e)?.3:e)&&(e*=1.5),n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),t<1?n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*-.5:n*2**(-10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*.5+1},elasticOut:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),n*2**(-10*t)*Math.sin((t-r)*(2*Math.PI)/e)+1},exponentialIn:function(t){return 0===t?0:2**(10*(t-1))},exponentialInOut:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*2**(10*(t-1)):.5*(2-2**(-10*(t-=1)))},exponentialOut:function(t){return 1===t?t:1-2**(-10*t)},none:function(t){return t},quadraticIn:function(t){return t*t},quadraticInOut:function(t){return(t/=.5)<1?.5*t*t:-.5*((t-=1)*(t-2)-1)},quadraticOut:function(t){return-t*(t-2)},quarticIn:function(t){return t*t*t*t},quarticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quarticOut:function(t){return-((t-=1)*t*t*t-1)},quinticIn:function(t){return t*t*t*t*t},quinticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},quinticOut:function(t){return(t-=1)*t*t*t*t+1},sexticIn:function(t){return t*t*t*t*t*t},sexticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t*t:-.5*((t-=2)*t*t*t*t*t-2)},sexticOut:function(t){return-((t-=1)*t*t*t*t*t-1)},sineIn:function(t){return 1-Math.cos(t*(Math.PI/2))},sineInOut:function(t){return-.5*(Math.cos(Math.PI*t)-1)},sineOut:function(t){return Math.sin(t*(Math.PI/2))},waveCosine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.cos(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o},waveSawtooth:function(t,n,e,r){r=!0===r;let o=t*(n=isNaN(n)?1:n)%1;return o=(e=!0===e)?Math.abs(o):o,o=r?1-o:o,o},waveSine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.sin(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o}};const Pt=Math.PI/180,Lt=180/Math.PI;function Yt(t,n){return Math.atan2(t,n)*Lt}function Ft(t){return t*Pt}var Ht={DEG_0:0,DEG_90:90,DEG_180:180,DEG_270:270,DEG_360:360,DEG_TO_RAD:Pt,RAD_TO_DEG:Lt,acosDeg:function(t){return Math.acos(t)*Lt},angleDeg:function(t,n){return Yt(t,n)},angleRad:function(t,n){return Math.atan2(t,n)},asinDeg:function(t){return Math.asin(t)*Lt},atanDeg:function(t){return Math.atan(t)*Lt},atan2Deg:Yt,cosDeg:function(t){return Math.cos(t*Pt)},cycleDeg:function(t){return h.cycle(t,360)},degToRad:Ft,fastDeg:function(t,n){const e=n-t;return e>180?-360+e:e<-180?360+n:n},haversine:function(t,n,e,r,o){const i=Ft(t),u=Ft(n),a=Ft(e),c=a-i,s=Ft(r)-u,l=Math.sin(c/2)*Math.sin(c/2)+Math.cos(i)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2),f=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));let g;return g=!1===o?3956:6371,h.roundDecimals(g*f,3)},hypo:function(t,n){return Math.sqrt(t*t+n*n)},radToDeg:function(t){return t*Lt},sinDeg:function(t){return Math.sin(t*Pt)},tanDeg:function(t){return Math.tan(t*Pt)}};function Jt(t,n){return{x:t.x+n.x,y:t.y+n.y}}function Zt(t,n){const e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)}function _t(t){return Zt(t,{x:0,y:0})}function zt(t,n){return{x:t.x-n.x,y:t.y-n.y}}var Gt={add:Jt,angle:function(t,n){const e=Ht.angleDeg(n.y-t.y,n.x-t.x);return Ht.cycleDeg(e)},cross:function(t,n){return t.x*n.y-t.y*n.x},distance:Zt,dot:function(t,n){return t.x*n.x+t.y*n.y},equals:function(t,n,e){const r=h.equals;return r(t.x,n.x,e)&&r(t.y,n.y,e)},interpolate:function(t,n,e){const r=c.linear;return{x:r(t.x,n.x,e),y:r(t.y,n.y,e)}},length:_t,magnitude:function(t){return _t(t)},project:function(t,n,e){return{x:t.x+n*Ht.cosDeg(e),y:t.y+n*Ht.sinDeg(e)}},rect:function(t){let n;const e=[],r=[];for(let o=0,i=t.length;o=n&&t<=e},isEven:function(t){return t%2==0&&!Wt(t)},isFloat:Wt,isNegative:function(t){return t<0},isOdd:function(t){return t%2!=0&&!Wt(t)},isPositive:function(t){return t>=0},isPrime:function(t){if("number"!=typeof t||Number.isNaN(t)||Wt(t))return!1;if(t<=1)return!1;if(t<=3)return!0;if(t%2==0||t%3==0)return!1;for(let n=5;n*n<=t;n+=6)if(t%n==0||t%(n+2)==0)return!1;return!0}};function Kt(t){if(!nt.isBoolean(t))throw new Error(`value is not boolean: ${String(t)}.`)}function Vt(t,n){if(!$.equals(t,n)){let e=nt.isArray(t)||nt.isObject(t)?`\n${i.encode(t)}\n`:String(t),r=nt.isArray(n)||nt.isObject(n)?`\n${i.encode(n)}`:String(n);throw e=nt.isString(t)?String(`"${e}"`):e,r=nt.isString(n)?String(`"${r}"`):r,new Error(`values are not equal: ${e} != ${r}`)}}function Qt(t){if(!nt.isFunction(t))throw new Error(`value is not function: ${String(t)}.`)}function tn(t){if(!nt.isNumber(t))throw new Error(`value is not number: ${String(t)}.`)}var nn={assertArray:function(t,n){if(!nt.isArray(t))throw new Error(`value is not array: ${String(t)}.`);nt.isNumber(n)&&Vt(t.length,n)},assertBase64:function(t){if(!nt.isBase64(t))throw new Error(`value is not base64: ${String(t)}.`)},assertBoolean:Kt,assertDate:function(t){if(!nt.isDate(t))throw new Error(`value is not date: ${String(t)}.`)},assertEqual:Vt,assertError:function(t){if(!nt.isError(t))throw new Error(`value is not error: ${String(t)}.`)},assertFalse:function(t){if(Kt(t),!1!==t)throw new Error(`value is not false: ${String(t)}.`)},assertFunction:Qt,assertJSON:function(t){if(!nt.isJSON(t))throw new Error(`value is not json: ${String(t)}.`)},assertModule:function(t){if(!nt.isModule(t))throw new Error(`value is not module: ${String(t)}.`)},assertNaN:function(t){if(!nt.isNaN(t))throw new Error(`value is not NaN: ${String(t)}.`)},assertNone:function(t){if(!nt.isNone(t))throw new Error(`value is not none: ${String(t)}.`)},assertNotArray:function(t){if(nt.isArray(t))throw new Error(`value is array: ${String(t)}.`)},assertNotBase64:function(t){if(nt.isBase64(t))throw new Error(`value is base64: ${String(t)}.`)},assertNotBoolean:function(t){if(nt.isBoolean(t))throw new Error(`value is boolean: ${String(t)}.`)},assertNotDate:function(t){if(nt.isDate(t))throw new Error(`value is date: ${String(t)}.`)},assertNotEqual:function(t,n){if($.equals(t,n)){const e=nt.isArray(t)||nt.isObject(t)?`\n${i.encode(t)}\n`:String(t),r=nt.isArray(n)||nt.isObject(n)?`\n${i.encode(n)}`:String(n);throw new Error(`values are equal: ${e} == ${r}`)}},assertNotError:function(t){if(nt.isError(t))throw new Error(`value is error: ${String(t)}.`)},assertNotFunction:function(t){if(nt.isFunction(t))throw new Error(`value is function: ${String(t)}.`)},assertNotJSON:function(t){if(nt.isJSON(t))throw new Error(`value is json: ${String(t)}.`)},assertNotModule:function(t){if(nt.isModule(t))throw new Error(`value is module: ${String(t)}.`)},assertNotNone:function(t){if(nt.isNone(t))throw new Error(`value is none: ${String(t)}.`)},assertNotNumber:function(t){if(nt.isNumber(t))throw new Error(`value is number: ${String(t)}.`)},assertNotNull:function(t){if(nt.isNull(t))throw new Error(`value is null: ${String(t)}.`)},assertNotObject:function(t){if(nt.isObject(t))throw new Error(`value is object: ${String(t)}.`)},assertNotRegExp:function(t){if(nt.isRegExp(t))throw new Error(`value is regexp: ${String(t)}.`)},assertNotString:function(t){if(nt.isString(t))throw new Error(`value is string: ${String(t)}.`)},assertNotUndefined:function(t){if(nt.isUndefined(t))throw new Error(`value is undefined: ${String(t)}.`)},assertNumber:tn,assertNumberAlmostEqual:function(t,n,e){if(tn(t),tn(n),!h.equals(t,n,e))throw new Error(`values are not almost equals (tolerance = ${String(e)}): ${String(t)} != ${String(n)}.`)},assertNull:function(t){if(!nt.isNull(t))throw new Error(`value is not null: ${String(t)}.`)},assertObject:function(t){if(!nt.isObject(t))throw new Error(`value is not object: ${String(t)}.`)},assertRegExp:function(t){if(!nt.isRegExp(t))throw new Error(`value is not regexp: ${String(t)}.`)},assertString:function(t){if(!nt.isString(t))throw new Error(`value is not string: ${String(t)}.`)},assertThrows:function(t,...n){Qt(t);try{const e=null;FunctionUtil.call.apply(null,[t,e].concat(n))}catch(t){return}throw new Error(`value didn't throw error: ${String(t)}.`)},assertTrue:function(t){if(Kt(t),!0!==t)throw new Error(`value is not true: ${String(t)}.`)},assertUndefined:function(t){if(!nt.isUndefined(t))throw new Error(`value is not undefined: ${String(t)}.`)}};const en={array:vt,base64:o,color:Ut,date:wt,ease:Bt,func:ut,geom:{point:Gt},hex:Ot,json:i,math:h,number:Xt,object:$,random:gt,string:Nt,test:nn,trigo:Ht,type:nt,xml:{removeNamespaces:function(t){return t.replace(/<[^>]*>/g,(t=>t.replace(/(\s|<\/?)[a-zA-Z0-9]+\:/g,"$1")))}},url:b,utf8:n,version:"1.0.0"};t.default=en,t.utils=en,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/utils.umd.js b/dist/utils.umd.js index 164f7d1..61e8f7d 100644 --- a/dist/utils.umd.js +++ b/dist/utils.umd.js @@ -479,8 +479,7 @@ } function isLocalhost(url) { - const re = - /^(https?\:\/\/)(localhost(.[a-z0-9\-])*|127\.0\.0\.1)(\:[\d]+)?(\/(.)*)?$/; + const re = /^(https?:\/\/)(localhost(\.[a-z0-9-]+)*|127\.0\.0\.1)(:\d+)?(\/.*)?$/i; return re.test(url || getURL()); } @@ -3709,8 +3708,8 @@ // }; function removeNamespaces(str) { - return str.replace(/(\<(.|\n)+?\>)/g, (tag) => { - return tag.replace(/(\s|\<\/?){1}([\w]+\:){1}/g, '$1'); + return str.replace(/<[^>]*>/g, (tag) => { + return tag.replace(/(\s|<\/?)[a-zA-Z0-9]+\:/g, '$1'); }); } diff --git a/dist/utils.umd.min.js b/dist/utils.umd.min.js index 96679e0..6cc3afc 100644 --- a/dist/utils.umd.min.js +++ b/dist/utils.umd.min.js @@ -1 +1 @@ -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).utils={})}(this,(function(t){"use strict";var n={decode:function(t){return decodeURIComponent(escape(t))},encode:function(t){return unescape(encodeURIComponent(t))}};const e=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/","="],r={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63,"=":64};var o={decode:function(t){const e=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");let o="";try{o=window.atob(e)}catch(t){const n=r;let i,u,a,c,s,l,f,g=0;const h=e.length;for(;g>4,u=(15&s)<<4|l>>2,a=(3&l)<<6|f,o+=String.fromCharCode(i),64!==l&&(o+=String.fromCharCode(u)),64!==f&&(o+=String.fromCharCode(a))}return o=n.decode(o),o},encode:function(t){const r=n.encode(t);let o="";try{o=window.btoa(r)}catch(t){const n=e;let i,u,a,c,s,l,f,g=0;const h=r.length;for(;g>2,s=(3&i)<<4|u>>4,l=(15&u)<<2|a>>6,f=63&a,isNaN(u)?l=f=64:isNaN(a)&&(f=64),o+=n[c]+n[s]+n[l]+n[f]}return o}};var i={decode:function(t){let n="";try{n=JSON.parse(t)}catch(e){t=t.replace(/"/g,'"'),n=JSON.parse(t)}return n},encode:function(t){return JSON.stringify(t)}};function u(t,n,e){return t*(1-e)+n*e}function a(t,n){const e=n*t,r=Math.floor(e),o=t-1,i=h.constrain(r,0,o);return{index:i,t:e-i}}var c={bilinear:function(t,n,e,r,o,i){const a=u;return a(a(t,n,o),a(e,r,o),i)},linear:u,multilinear:function(t,n){const e=a(t.length-1,n),r=e.index;return u(t[r],t[r+1],e.t)},scalar:a};function s(t,n){return t===n?t:(t0&&(e+=1e-10):e=1e-10,Math.abs(t-n)<=e},euclideanDistance:function(t,n){return Math.sqrt(g(t.map(((t,e)=>Math.abs(t-n[e])**2))))},factorial:function(t){let n=1;for(let e=n;e<=t;e++)n*=e;return n},gcd:s,interpolation:c,lcm:function(t,n){return t*n/s(t,n)},lerp:function(t,n,e){return c.linear(t,n,e)},map:function(t,n,e,r,o){return c.linear(r,o,f(t,n,e))},nearest:l,normalize:f,proportion:function(t,n,e,r){const o=[t,n,e,r];if(3!==vt.clean(o).length)return NaN;const i=nt.isNumber;return i(t)?i(n)?i(e)?i(r)?NaN:e*n/t:r*t/n:t*r/e:n*e/r},roundDecimals:function(t,n){return Number(t.toFixed(n||2))},roundToMultiple:function(t,n){return Math.round(t/n)*n},roundToNearest:function(t,n){const e=vt.sort(n.concat());let r=0,o=0,i=e.length;if(0===i)return NaN;if(i>2)for(;oe[r+1]))break;o=r+1}return o=r+1 in e?r+1:r,l(t,e[r],e[o])},roundToPower:function(t,n){return n**Math.round(Math.log(t)/Math.log(n))},sign:function(t){return t>=0?1:-1},summation:g};function d(t){return m(t)}function m(t){const n=p(t);let e;const r={};for(let t=0,o=n.length;t-1?t.substr(n+1):"";const r=e.indexOf("#");return r>-1&&(e=e.substring(0,r)),e}function N(){let t="";try{t=window.location.href}catch(t){}return t}var b={getDomain:function(t=N(),n){let e=t.replace(/(^\w+:|^)\/\/(www\.)?/,"");if(e=e.split(":")[0],!n)return e;let r=e.split(".");return n>r.length||n<=0?"":r[r.length-n]},getParameterByName:function(t,n,e){const r=d(t);return n in r?r[n]||e||"":e},getParameters:d,getParametersDict:m,getParametersList:p,getParametersString:y,getURL:N,hasParameter:function(t,n){return n in m(t)},isFile:function(t){return 0===(t||N()).indexOf("file://")},isHttp:function(t){return 0===(t||N()).indexOf("http://")},isHttps:function(t){return 0===(t||N()).indexOf("https://")},isLocalhost:function(t){return/^(https?\:\/\/)(localhost(.[a-z0-9\-])*|127\.0\.0\.1)(\:[\d]+)?(\/(.)*)?$/.test(t||N())}};function M(t,n,...e){const r=[n].concat(e);let o,i,u;for(o=0,i=r.length;ot===n?0!==t||1/t==1/n:t!=t&&n!=n),Object.is(t,n)}function v(t,n){const e=Object.keys(t);return!0===n&&e.sort(),e}function O(t){return v(t).length}var $={assign:M,clean:S,clone:w,decodeBase64:function(t){return i.decode(o.decode(t))},decodeJSON:function(t){return i.decode(t)},decodeParameters:function(t){return b.getParametersDict(`?${t}`)},encodeBase64:function(t){return o.encode(i.encode(t))},encodeJSON:function(t){return i.encode(t)},encodeParameters:function(t,n){const e=S(w(t),!0),r=nt.isArray(n)?n:v(t,!0);let o,i;const u=[];for(let t=0,n=r.length;t{e[r]=n.call(null,t[r],r,t)})),e},merge:function(t,n,...e){const r=[{},t,n].concat(e);return M.apply(null,r)},search:function(t,n){const e=[];let r,o,i,u,a,c,s,l,f;for(r=0,o=t.length;rot(t,n,...e.concat(r))}function ot(t,n,...e){return nt.isString(t)&&(t=n[t]),t.apply(n,e)}function it(t,n,e,...r){const o=rt(n,e,...r),i=setInterval(o,t);return{cancel(){clearInterval(i)},func:o,id:i}}var ut={args:et,attempt:function(t,n,...e){try{return ot(t,n,...e)}catch(t){return t}},bind:rt,call:ot,debounce:function(t,n,e){let r;return function(...o){r&&(clearTimeout(r),r=null),r=setTimeout((()=>{n.apply(e,o)}),t)}},delay:function(t,n,e,...r){const o=rt(n,e,...r),i=setTimeout(o,t);return{cancel(){clearTimeout(i)},func:o,id:i}},memoize:function(t,n){const e={};return function(...r){const o=String(r);return o in e||(e[o]=ot(t,n,...r)),e[o]}},noop:function(){return!0},repeat:it,throttle:function(t,n,e){let r;return(...o)=>{r||(n.apply(e,o),r=setTimeout((()=>{clearTimeout(r),r=null}),t))}},until:function(t,n,e,...r){const o=rt(n,e,...r),i=it(t,(()=>{!1===o()&&i.cancel()}));return i},validate:function(t,...n){const e=et(t);let r=(n=n.map((t=>Array.isArray(t)?t:[t]))).length;for(;r>0&&n[r-1].includes("undefined");)r--;if(e.length{const r=nt.of(t),o=n[Math.min(e,n.length-1)];if(!o.includes(r))throw new TypeError(`invalid argument: type of argument[${e}] is "${r}", expected "${o.join('" or "')}".`)}))}};function at(t){return Boolean(Math.random()<(isNaN(t)?.5:t))}function ct(t){return t[lt(t)]}function st(t,n){return t+Math.random()*(n-t)}function lt(t){return ft(0,t.length-1)}function ft(t,n){return Math.floor(Math.round(st(t-.5,n+.5)))}var gt={argument:function(...t){return ct(t)},bit:function(t){return at(t)?1:0},boolean:at,color:function(){return ft(0,16777215)},element:ct,float:st,index:lt,integer:ft,map:function(t,n){const e=[];for(let r=0;r1?t.substr(1):"";return e+(!0===n?r.toLowerCase():r)}var Nt={contains:ht,endsWith:function(t,n){return t.substring(t.length-n.length,t.length)===n},icontains:function(t,n){return ht(t.toLowerCase(),n.toLowerCase())},levenshteinDistance:dt,levenshteinSimilarity:function(t,n){const e=dt(t,n),r=Math.max(t.length,n.length);return 0===r?1:1-e/r},padLeft:mt,padRight:function(t,n,e){let r=t.length;for(;r{u=e[0],a=n[e[1]],nt.isNone(a)&&(a=""),t=pt(t,u,a)})),t},replace:pt,reverse:function(t){const n=t.split("");return n.reverse(),n.join("")},rotate:function(t,n){let e=t.split("");return e=vt.rotate(e,n),e.join("")},slugify:function(t){const n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ő":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ű":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","þ":"th","ÿ":"y","ẞ":"SS","œ":"oe","Œ":"OE","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"h","ώ":"w","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"H","Ώ":"W","Ϊ":"I","Ϋ":"Y","ş":"s","Ş":"S","ı":"i","İ":"I","ğ":"g","Ğ":"G","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Э":"E","Ю":"Yu","Я":"Ya","Є":"Ye","І":"I","Ї":"Yi","Ґ":"G","є":"ye","і":"i","ї":"yi","ґ":"g","č":"c","ď":"d","ě":"e","ň":"n","ř":"r","š":"s","ť":"t","ů":"u","ž":"z","Č":"C","Ď":"D","Ě":"E","Ň":"N","Ř":"R","Š":"S","Ť":"T","Ů":"U","Ž":"Z","ą":"a","ć":"c","ę":"e","ł":"l","ń":"n","ś":"s","ź":"z","ż":"z","Ą":"A","Ć":"C","Ę":"e","Ł":"L","Ń":"N","Ś":"S","Ź":"Z","Ż":"Z","ā":"a","ē":"e","ģ":"g","ī":"i","ķ":"k","ļ":"l","ņ":"n","ū":"u","Ā":"A","Ē":"E","Ģ":"G","Ī":"i","Ķ":"k","Ļ":"L","Ņ":"N","Ū":"u"};for(let e=0,r=t.length;egt.boolean()?t.toUpperCase():t.toLowerCase()))},toTitleCase:function(t,n){return t.replace(/[^\'‘’\`\-\s]+/gm,(t=>yt(t,n)))},toUpperCaseFirst:yt,trim:function(t){return t.trim()},trimLeft:function(t){return t.trimStart()},trimRight:function(t){return t.trimEnd()}};function bt(t,n){return t.getTime()>n.getTime()?t:n}function Mt(t,n){return t.getTime()<=n.getTime()?t:n}function St(){const t=new Date;return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}var wt={clone:function(t){return new Date(t.getTime())},constrain:function(t,n,e){const r=Mt(n,e),o=bt(n,e);return Mt(bt(t,r),o)},format:function(t,n){const e=Nt.replace,r=Nt.padZeros,o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=t.getDate(),u=t.getFullYear(),a=t.getMonth(),c=a+1,s=["January","February","March","April","May","June","July","August","September","October","November","December"][a],l=t.getDay(),f=t.getHours(),g=t.getMinutes(),h=t.getSeconds(),d=t.getMilliseconds(),m=[["YYYY",u],["YY",r(u,4).substring(2,4)],["MM",r(c,2)],["M",c],["DD",r(i,2)],["D",i],["hh",r(f,2)],["h",f],["mm",r(g,2)],["m",g],["ss",r(h,2)],["s",h],["ll",r(d,2)],["XX",s],["X",s.substring(0,3)],["ZZ",o[l]],["Z",o[l].substring(0,3)]];let p,y;for(let t=0,r=m.length;t0},max:bt,min:Mt,normalize:function(t){return{milliseconds:t%1e3,seconds:Math.floor(t/1e3)%60,minutes:Math.floor(t/1e3/60)%60,hours:Math.floor(t/1e3/60/60)%24,days:Math.floor(t/1e3/60/60/24)}},parse:function(t){let n;const e=t=>nt.isNumber(t)&&t>=0&&nt.isNumber(new Date(t).getTime());if(nt.isDate(t))return t;if(nt.isNumber(t)){if(n=t,e(n))return new Date(n)}else if(nt.isString(t)){if(n=Number(t),e(n))return new Date(n);if(n=Date.parse(t),e(n))return new Date(n)}return null},timestamp:function(t){return(t||new Date).getTime()},today:St,tomorrow:function(){const t=St();return t.setDate(t.getDate()+1),t},yesterday:function(){const t=St();return t.setDate(t.getDate()-1),t},yyyymmdd:function(t,n){const e=t||new Date,r=e.getFullYear(),o=e.getMonth()+1,i=e.getDate(),u=n||"";return String(r)+u+Nt.padZeros(o,2)+u+Nt.padZeros(i,2)}};function xt(t,n,e){let r=nt.isUndefined(e)?0:e;for(let e=0,o=t.length;e{o=0===o?t.length:Math.min(o,t.length)}));const i=[];for(let t=0;t{switch(nt.of(t)){case nt.ARRAY:return t.length>0;case nt.OBJECT:return $.length(t)>0;default:return Boolean(t)}}))},any:function(t){return t.some((t=>{switch(nt.of(t)){case nt.ARRAY:return t.length>0;case nt.OBJECT:return $.length(t)>0;default:return Boolean(t)}}))},clean:function t(n,e){let r=n.slice();return r=r.filter((t=>!nt.isNone(t))),!0===e&&(r=r.map((n=>{let r;switch(nt.of(n)){case nt.ARRAY:return r=t(n,e),r.length>0?r:null;case nt.OBJECT:return r=$.clean(n,e),$.length(r)>0?r:null;case nt.STRING:return r=Nt.trim(n),""!==r?n:null;default:return n}})).filter((t=>!nt.isNone(t)))),r},clone:function t(n){const e=n.slice();let r;for(let n=0,o=e.length;nnt.isFunction(n)?Math.max(t,n(e)):Math.max(t,e)),Number.MIN_VALUE)},min:function(t,n){return xt(t,((t,e)=>nt.isFunction(n)?Math.min(t,n(e)):Math.min(t,e)),Number.MAX_VALUE)},paginate:function(t,n){const e=t.length,r=n>0?Math.ceil(e/n):0,o=[];let i,u;for(i=0,u=0;i{let a,c;if(r(t)&&r(u)&&i(n))a=n in t?t[n]:t,c=n in u?u[n]:u;else if(e(t)&&e(u)&&o(n)){const e=n;a=e>=0&&e=0&&ent.isFunction(n)?t+n(e):t+e),0)},unique:function(t){let n;const e=[],r=t=>!$.equals(n,t);for(let o=0,i=t.length;o=1?"":u(255*e))+u(r)+u(o)+u(i))},toString:function(t){return`{ r:${String(t.r)}, g:${String(t.g)}, b:${String(t.b)}, a:${String(isNaN(t.a)?1:t.a)} }`},toStringCSS:function(t){return`rgba(${String(t.r)}, ${String(t.g)}, ${String(t.b)}, ${String(isNaN(t.a)?1:t.a)})`}};function Rt(t){const n=t.c/100,e=t.m/100,r=t.y/100,o=t.k/100,i=1-o;let u=1-Math.min(1,n*i+o),a=1-Math.min(1,e*i+o),c=1-Math.min(1,r*i+o);const s=Math.round;return u=s(255*u),a=s(255*a),c=s(255*c),{r:u,g:a,b:c,a:1}}var Ct={toHex:function(t,n){return Tt.toHex(Rt(t),n)},toRgb:Rt,toString:function(t){return`{ c:${String(t.c)}, m:${String(t.m)}, y:${String(t.y)}, k:${String(t.k)} }`},toStringCSS:function(t){return`cmyk(${String(t.c)}%, ${String(t.m)}%, ${String(t.y)}%, ${String(t.k)}%)`}};function kt(t){const n=Ot.decodeInt,e=Ot.encodeInt;let r,o,i;if(nt.isNumber(t))r=e(t);else{if(!nt.isString(t))return null;r=t.replace(/\#|0x/,"")}switch(r=r.toUpperCase(),r.length){case 3:i=/^([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),o={a:1,r:n(i[1]+i[1]),g:n(i[2]+i[2]),b:n(i[3]+i[3])};break;case 6:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:1,r:n(i[1]),g:n(i[2]),b:n(i[3])};break;case 8:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:h.roundDecimals(n(i[1])/255,2),r:n(i[2]),g:n(i[3]),b:n(i[4])};break;default:return null}return o}function qt(t,n){return Tt.toHex(kt(t),n)}var jt={average:function(t){return Tt.toHex(Tt.average(t.map((t=>kt(t)))))},distance:function(t,n){return Tt.distance(kt(t),kt(n))},gradient:function(t,n){return Tt.gradient(t.map((t=>kt(t))),n).map((t=>Tt.toHex(t)))},gradientMatrix:function(t,n,e){return Tt.gradientMatrix($.map(t,(t=>kt(t))),n,e).map((t=>t.map((t=>Tt.toHex(t)))))},interpolateBilinear:function(t,n,e,r,o,i){return Tt.toHex(Tt.interpolateBilinear(kt(t),kt(n),kt(e),kt(r),o,i))},interpolateLinear:function(t,n,e){return Tt.toHex(Tt.interpolateLinear(kt(t),kt(n),e))},interpolateMultilinear:function(t,n){return Tt.toHex(Tt.interpolateMultilinear(t.map((t=>kt(t))),n))},nearest:function(t,n){return Tt.toHex(Tt.nearest(kt(t),n.map((t=>kt(t)))))},toCmyk:function(t){return Tt.toCmyk(kt(t))},toRgb:kt,toString:qt,toStringCSS:function(t){return qt(t,"#")}},Ut={cmyk:Ct,cmykToHex:Ct.toHex,cmykToRgb:Ct.toRgb,hex:jt,hexToCmyk:jt.toCmyk,hexToRgb:jt.toRgb,rgb:Tt,rgbToCmyk:Tt.toCmyk,rgbToHex:Tt.toRgb};var Bt={backIn:function(t,n){return t*t*(((n=isNaN(n)?1.70158:n)+1)*t-n)},backInOut:function(t,n){return n=isNaN(n)?1.70158:n,(t/=.5)<1?t*t*(((n*=1.525)+1)*t-n)*.5:.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},backOut:function(t,n){return(t-=1)*t*(((n=isNaN(n)?1.70158:n)+1)*t+n)+1},bounceIn:function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)},bounceInOut:function(t){return t<.5?(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375):t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},circularIn:function(t){return-(Math.sqrt(1-t*t)-1)},circularInOut:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):(t-=2,.5*(Math.sqrt(1-t*t)+1))},circularOut:function(t){return t-=1,Math.sqrt(1-t*t)},cubicIn:function(t){return t*t*t},cubicInOut:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},cubicOut:function(t){return(t-=1)*t*t+1},elasticIn:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),-n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)},elasticInOut:function(t,n,e){if(0===t)return 0;if(2===(t/=.5))return 1;let r;return n=isNaN(n)?0:n,.3===(e=isNaN(e)?.3:e)&&(e*=1.5),n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),t<1?n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*-.5:n*2**(-10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*.5+1},elasticOut:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),n*2**(-10*t)*Math.sin((t-r)*(2*Math.PI)/e)+1},exponentialIn:function(t){return 0===t?0:2**(10*(t-1))},exponentialInOut:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*2**(10*(t-1)):.5*(2-2**(-10*(t-=1)))},exponentialOut:function(t){return 1===t?t:1-2**(-10*t)},none:function(t){return t},quadraticIn:function(t){return t*t},quadraticInOut:function(t){return(t/=.5)<1?.5*t*t:-.5*((t-=1)*(t-2)-1)},quadraticOut:function(t){return-t*(t-2)},quarticIn:function(t){return t*t*t*t},quarticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quarticOut:function(t){return-((t-=1)*t*t*t-1)},quinticIn:function(t){return t*t*t*t*t},quinticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},quinticOut:function(t){return(t-=1)*t*t*t*t+1},sexticIn:function(t){return t*t*t*t*t*t},sexticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t*t:-.5*((t-=2)*t*t*t*t*t-2)},sexticOut:function(t){return-((t-=1)*t*t*t*t*t-1)},sineIn:function(t){return 1-Math.cos(t*(Math.PI/2))},sineInOut:function(t){return-.5*(Math.cos(Math.PI*t)-1)},sineOut:function(t){return Math.sin(t*(Math.PI/2))},waveCosine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.cos(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o},waveSawtooth:function(t,n,e,r){r=!0===r;let o=t*(n=isNaN(n)?1:n)%1;return o=(e=!0===e)?Math.abs(o):o,o=r?1-o:o,o},waveSine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.sin(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o}};const Pt=Math.PI/180,Lt=180/Math.PI;function Yt(t,n){return Math.atan2(t,n)*Lt}function Ft(t){return t*Pt}var Ht={DEG_0:0,DEG_90:90,DEG_180:180,DEG_270:270,DEG_360:360,DEG_TO_RAD:Pt,RAD_TO_DEG:Lt,acosDeg:function(t){return Math.acos(t)*Lt},angleDeg:function(t,n){return Yt(t,n)},angleRad:function(t,n){return Math.atan2(t,n)},asinDeg:function(t){return Math.asin(t)*Lt},atanDeg:function(t){return Math.atan(t)*Lt},atan2Deg:Yt,cosDeg:function(t){return Math.cos(t*Pt)},cycleDeg:function(t){return h.cycle(t,360)},degToRad:Ft,fastDeg:function(t,n){const e=n-t;return e>180?-360+e:e<-180?360+n:n},haversine:function(t,n,e,r,o){const i=Ft(t),u=Ft(n),a=Ft(e),c=a-i,s=Ft(r)-u,l=Math.sin(c/2)*Math.sin(c/2)+Math.cos(i)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2),f=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));let g;return g=!1===o?3956:6371,h.roundDecimals(g*f,3)},hypo:function(t,n){return Math.sqrt(t*t+n*n)},radToDeg:function(t){return t*Lt},sinDeg:function(t){return Math.sin(t*Pt)},tanDeg:function(t){return Math.tan(t*Pt)}};function Jt(t,n){return{x:t.x+n.x,y:t.y+n.y}}function Zt(t,n){const e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)}function _t(t){return Zt(t,{x:0,y:0})}function Gt(t,n){return{x:t.x-n.x,y:t.y-n.y}}var zt={add:Jt,angle:function(t,n){const e=Ht.angleDeg(n.y-t.y,n.x-t.x);return Ht.cycleDeg(e)},cross:function(t,n){return t.x*n.y-t.y*n.x},distance:Zt,dot:function(t,n){return t.x*n.x+t.y*n.y},equals:function(t,n,e){const r=h.equals;return r(t.x,n.x,e)&&r(t.y,n.y,e)},interpolate:function(t,n,e){const r=c.linear;return{x:r(t.x,n.x,e),y:r(t.y,n.y,e)}},length:_t,magnitude:function(t){return _t(t)},project:function(t,n,e){return{x:t.x+n*Ht.cosDeg(e),y:t.y+n*Ht.sinDeg(e)}},rect:function(t){let n;const e=[],r=[];for(let o=0,i=t.length;o=n&&t<=e},isEven:function(t){return t%2==0&&!Wt(t)},isFloat:Wt,isNegative:function(t){return t<0},isOdd:function(t){return t%2!=0&&!Wt(t)},isPositive:function(t){return t>=0},isPrime:function(t){if("number"!=typeof t||Number.isNaN(t)||Wt(t))return!1;if(t<=1)return!1;if(t<=3)return!0;if(t%2==0||t%3==0)return!1;for(let n=5;n*n<=t;n+=6)if(t%n==0||t%(n+2)==0)return!1;return!0}};function Kt(t){if(!nt.isBoolean(t))throw new Error(`value is not boolean: ${String(t)}.`)}function Vt(t,n){if(!$.equals(t,n)){let e=nt.isArray(t)||nt.isObject(t)?`\n${i.encode(t)}\n`:String(t),r=nt.isArray(n)||nt.isObject(n)?`\n${i.encode(n)}`:String(n);throw e=nt.isString(t)?String(`"${e}"`):e,r=nt.isString(n)?String(`"${r}"`):r,new Error(`values are not equal: ${e} != ${r}`)}}function Qt(t){if(!nt.isFunction(t))throw new Error(`value is not function: ${String(t)}.`)}function tn(t){if(!nt.isNumber(t))throw new Error(`value is not number: ${String(t)}.`)}var nn={assertArray:function(t,n){if(!nt.isArray(t))throw new Error(`value is not array: ${String(t)}.`);nt.isNumber(n)&&Vt(t.length,n)},assertBase64:function(t){if(!nt.isBase64(t))throw new Error(`value is not base64: ${String(t)}.`)},assertBoolean:Kt,assertDate:function(t){if(!nt.isDate(t))throw new Error(`value is not date: ${String(t)}.`)},assertEqual:Vt,assertError:function(t){if(!nt.isError(t))throw new Error(`value is not error: ${String(t)}.`)},assertFalse:function(t){if(Kt(t),!1!==t)throw new Error(`value is not false: ${String(t)}.`)},assertFunction:Qt,assertJSON:function(t){if(!nt.isJSON(t))throw new Error(`value is not json: ${String(t)}.`)},assertModule:function(t){if(!nt.isModule(t))throw new Error(`value is not module: ${String(t)}.`)},assertNaN:function(t){if(!nt.isNaN(t))throw new Error(`value is not NaN: ${String(t)}.`)},assertNone:function(t){if(!nt.isNone(t))throw new Error(`value is not none: ${String(t)}.`)},assertNotArray:function(t){if(nt.isArray(t))throw new Error(`value is array: ${String(t)}.`)},assertNotBase64:function(t){if(nt.isBase64(t))throw new Error(`value is base64: ${String(t)}.`)},assertNotBoolean:function(t){if(nt.isBoolean(t))throw new Error(`value is boolean: ${String(t)}.`)},assertNotDate:function(t){if(nt.isDate(t))throw new Error(`value is date: ${String(t)}.`)},assertNotEqual:function(t,n){if($.equals(t,n)){const e=nt.isArray(t)||nt.isObject(t)?`\n${i.encode(t)}\n`:String(t),r=nt.isArray(n)||nt.isObject(n)?`\n${i.encode(n)}`:String(n);throw new Error(`values are equal: ${e} == ${r}`)}},assertNotError:function(t){if(nt.isError(t))throw new Error(`value is error: ${String(t)}.`)},assertNotFunction:function(t){if(nt.isFunction(t))throw new Error(`value is function: ${String(t)}.`)},assertNotJSON:function(t){if(nt.isJSON(t))throw new Error(`value is json: ${String(t)}.`)},assertNotModule:function(t){if(nt.isModule(t))throw new Error(`value is module: ${String(t)}.`)},assertNotNone:function(t){if(nt.isNone(t))throw new Error(`value is none: ${String(t)}.`)},assertNotNumber:function(t){if(nt.isNumber(t))throw new Error(`value is number: ${String(t)}.`)},assertNotNull:function(t){if(nt.isNull(t))throw new Error(`value is null: ${String(t)}.`)},assertNotObject:function(t){if(nt.isObject(t))throw new Error(`value is object: ${String(t)}.`)},assertNotRegExp:function(t){if(nt.isRegExp(t))throw new Error(`value is regexp: ${String(t)}.`)},assertNotString:function(t){if(nt.isString(t))throw new Error(`value is string: ${String(t)}.`)},assertNotUndefined:function(t){if(nt.isUndefined(t))throw new Error(`value is undefined: ${String(t)}.`)},assertNumber:tn,assertNumberAlmostEqual:function(t,n,e){if(tn(t),tn(n),!h.equals(t,n,e))throw new Error(`values are not almost equals (tolerance = ${String(e)}): ${String(t)} != ${String(n)}.`)},assertNull:function(t){if(!nt.isNull(t))throw new Error(`value is not null: ${String(t)}.`)},assertObject:function(t){if(!nt.isObject(t))throw new Error(`value is not object: ${String(t)}.`)},assertRegExp:function(t){if(!nt.isRegExp(t))throw new Error(`value is not regexp: ${String(t)}.`)},assertString:function(t){if(!nt.isString(t))throw new Error(`value is not string: ${String(t)}.`)},assertThrows:function(t,...n){Qt(t);try{const e=null;FunctionUtil.call.apply(null,[t,e].concat(n))}catch(t){return}throw new Error(`value didn't throw error: ${String(t)}.`)},assertTrue:function(t){if(Kt(t),!0!==t)throw new Error(`value is not true: ${String(t)}.`)},assertUndefined:function(t){if(!nt.isUndefined(t))throw new Error(`value is not undefined: ${String(t)}.`)}};const en={array:vt,base64:o,color:Ut,date:wt,ease:Bt,func:ut,geom:{point:zt},hex:Ot,json:i,math:h,number:Xt,object:$,random:gt,string:Nt,test:nn,trigo:Ht,type:nt,xml:{removeNamespaces:function(t){return t.replace(/(\<(.|\n)+?\>)/g,(t=>t.replace(/(\s|\<\/?){1}([\w]+\:){1}/g,"$1")))}},url:b,utf8:n,version:"1.0.0"};t.default=en,t.utils=en,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).utils={})}(this,(function(t){"use strict";var n={decode:function(t){return decodeURIComponent(escape(t))},encode:function(t){return unescape(encodeURIComponent(t))}};const e=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/","="],r={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63,"=":64};var o={decode:function(t){const e=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");let o="";try{o=window.atob(e)}catch(t){const n=r;let i,u,a,c,s,l,f,g=0;const h=e.length;for(;g>4,u=(15&s)<<4|l>>2,a=(3&l)<<6|f,o+=String.fromCharCode(i),64!==l&&(o+=String.fromCharCode(u)),64!==f&&(o+=String.fromCharCode(a))}return o=n.decode(o),o},encode:function(t){const r=n.encode(t);let o="";try{o=window.btoa(r)}catch(t){const n=e;let i,u,a,c,s,l,f,g=0;const h=r.length;for(;g>2,s=(3&i)<<4|u>>4,l=(15&u)<<2|a>>6,f=63&a,isNaN(u)?l=f=64:isNaN(a)&&(f=64),o+=n[c]+n[s]+n[l]+n[f]}return o}};var i={decode:function(t){let n="";try{n=JSON.parse(t)}catch(e){t=t.replace(/"/g,'"'),n=JSON.parse(t)}return n},encode:function(t){return JSON.stringify(t)}};function u(t,n,e){return t*(1-e)+n*e}function a(t,n){const e=n*t,r=Math.floor(e),o=t-1,i=h.constrain(r,0,o);return{index:i,t:e-i}}var c={bilinear:function(t,n,e,r,o,i){const a=u;return a(a(t,n,o),a(e,r,o),i)},linear:u,multilinear:function(t,n){const e=a(t.length-1,n),r=e.index;return u(t[r],t[r+1],e.t)},scalar:a};function s(t,n){return t===n?t:(t0&&(e+=1e-10):e=1e-10,Math.abs(t-n)<=e},euclideanDistance:function(t,n){return Math.sqrt(g(t.map(((t,e)=>Math.abs(t-n[e])**2))))},factorial:function(t){let n=1;for(let e=n;e<=t;e++)n*=e;return n},gcd:s,interpolation:c,lcm:function(t,n){return t*n/s(t,n)},lerp:function(t,n,e){return c.linear(t,n,e)},map:function(t,n,e,r,o){return c.linear(r,o,f(t,n,e))},nearest:l,normalize:f,proportion:function(t,n,e,r){const o=[t,n,e,r];if(3!==vt.clean(o).length)return NaN;const i=nt.isNumber;return i(t)?i(n)?i(e)?i(r)?NaN:e*n/t:r*t/n:t*r/e:n*e/r},roundDecimals:function(t,n){return Number(t.toFixed(n||2))},roundToMultiple:function(t,n){return Math.round(t/n)*n},roundToNearest:function(t,n){const e=vt.sort(n.concat());let r=0,o=0,i=e.length;if(0===i)return NaN;if(i>2)for(;oe[r+1]))break;o=r+1}return o=r+1 in e?r+1:r,l(t,e[r],e[o])},roundToPower:function(t,n){return n**Math.round(Math.log(t)/Math.log(n))},sign:function(t){return t>=0?1:-1},summation:g};function d(t){return m(t)}function m(t){const n=p(t);let e;const r={};for(let t=0,o=n.length;t-1?t.substr(n+1):"";const r=e.indexOf("#");return r>-1&&(e=e.substring(0,r)),e}function N(){let t="";try{t=window.location.href}catch(t){}return t}var b={getDomain:function(t=N(),n){let e=t.replace(/(^\w+:|^)\/\/(www\.)?/,"");if(e=e.split(":")[0],!n)return e;let r=e.split(".");return n>r.length||n<=0?"":r[r.length-n]},getParameterByName:function(t,n,e){const r=d(t);return n in r?r[n]||e||"":e},getParameters:d,getParametersDict:m,getParametersList:p,getParametersString:y,getURL:N,hasParameter:function(t,n){return n in m(t)},isFile:function(t){return 0===(t||N()).indexOf("file://")},isHttp:function(t){return 0===(t||N()).indexOf("http://")},isHttps:function(t){return 0===(t||N()).indexOf("https://")},isLocalhost:function(t){return/^(https?:\/\/)(localhost(\.[a-z0-9-]+)*|127\.0\.0\.1)(:\d+)?(\/.*)?$/i.test(t||N())}};function M(t,n,...e){const r=[n].concat(e);let o,i,u;for(o=0,i=r.length;ot===n?0!==t||1/t==1/n:t!=t&&n!=n),Object.is(t,n)}function v(t,n){const e=Object.keys(t);return!0===n&&e.sort(),e}function O(t){return v(t).length}var $={assign:M,clean:S,clone:w,decodeBase64:function(t){return i.decode(o.decode(t))},decodeJSON:function(t){return i.decode(t)},decodeParameters:function(t){return b.getParametersDict(`?${t}`)},encodeBase64:function(t){return o.encode(i.encode(t))},encodeJSON:function(t){return i.encode(t)},encodeParameters:function(t,n){const e=S(w(t),!0),r=nt.isArray(n)?n:v(t,!0);let o,i;const u=[];for(let t=0,n=r.length;t{e[r]=n.call(null,t[r],r,t)})),e},merge:function(t,n,...e){const r=[{},t,n].concat(e);return M.apply(null,r)},search:function(t,n){const e=[];let r,o,i,u,a,c,s,l,f;for(r=0,o=t.length;rot(t,n,...e.concat(r))}function ot(t,n,...e){return nt.isString(t)&&(t=n[t]),t.apply(n,e)}function it(t,n,e,...r){const o=rt(n,e,...r),i=setInterval(o,t);return{cancel(){clearInterval(i)},func:o,id:i}}var ut={args:et,attempt:function(t,n,...e){try{return ot(t,n,...e)}catch(t){return t}},bind:rt,call:ot,debounce:function(t,n,e){let r;return function(...o){r&&(clearTimeout(r),r=null),r=setTimeout((()=>{n.apply(e,o)}),t)}},delay:function(t,n,e,...r){const o=rt(n,e,...r),i=setTimeout(o,t);return{cancel(){clearTimeout(i)},func:o,id:i}},memoize:function(t,n){const e={};return function(...r){const o=String(r);return o in e||(e[o]=ot(t,n,...r)),e[o]}},noop:function(){return!0},repeat:it,throttle:function(t,n,e){let r;return(...o)=>{r||(n.apply(e,o),r=setTimeout((()=>{clearTimeout(r),r=null}),t))}},until:function(t,n,e,...r){const o=rt(n,e,...r),i=it(t,(()=>{!1===o()&&i.cancel()}));return i},validate:function(t,...n){const e=et(t);let r=(n=n.map((t=>Array.isArray(t)?t:[t]))).length;for(;r>0&&n[r-1].includes("undefined");)r--;if(e.length{const r=nt.of(t),o=n[Math.min(e,n.length-1)];if(!o.includes(r))throw new TypeError(`invalid argument: type of argument[${e}] is "${r}", expected "${o.join('" or "')}".`)}))}};function at(t){return Boolean(Math.random()<(isNaN(t)?.5:t))}function ct(t){return t[lt(t)]}function st(t,n){return t+Math.random()*(n-t)}function lt(t){return ft(0,t.length-1)}function ft(t,n){return Math.floor(Math.round(st(t-.5,n+.5)))}var gt={argument:function(...t){return ct(t)},bit:function(t){return at(t)?1:0},boolean:at,color:function(){return ft(0,16777215)},element:ct,float:st,index:lt,integer:ft,map:function(t,n){const e=[];for(let r=0;r1?t.substr(1):"";return e+(!0===n?r.toLowerCase():r)}var Nt={contains:ht,endsWith:function(t,n){return t.substring(t.length-n.length,t.length)===n},icontains:function(t,n){return ht(t.toLowerCase(),n.toLowerCase())},levenshteinDistance:dt,levenshteinSimilarity:function(t,n){const e=dt(t,n),r=Math.max(t.length,n.length);return 0===r?1:1-e/r},padLeft:mt,padRight:function(t,n,e){let r=t.length;for(;r{u=e[0],a=n[e[1]],nt.isNone(a)&&(a=""),t=pt(t,u,a)})),t},replace:pt,reverse:function(t){const n=t.split("");return n.reverse(),n.join("")},rotate:function(t,n){let e=t.split("");return e=vt.rotate(e,n),e.join("")},slugify:function(t){const n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ő":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ű":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","þ":"th","ÿ":"y","ẞ":"SS","œ":"oe","Œ":"OE","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"h","ώ":"w","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"H","Ώ":"W","Ϊ":"I","Ϋ":"Y","ş":"s","Ş":"S","ı":"i","İ":"I","ğ":"g","Ğ":"G","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Э":"E","Ю":"Yu","Я":"Ya","Є":"Ye","І":"I","Ї":"Yi","Ґ":"G","є":"ye","і":"i","ї":"yi","ґ":"g","č":"c","ď":"d","ě":"e","ň":"n","ř":"r","š":"s","ť":"t","ů":"u","ž":"z","Č":"C","Ď":"D","Ě":"E","Ň":"N","Ř":"R","Š":"S","Ť":"T","Ů":"U","Ž":"Z","ą":"a","ć":"c","ę":"e","ł":"l","ń":"n","ś":"s","ź":"z","ż":"z","Ą":"A","Ć":"C","Ę":"e","Ł":"L","Ń":"N","Ś":"S","Ź":"Z","Ż":"Z","ā":"a","ē":"e","ģ":"g","ī":"i","ķ":"k","ļ":"l","ņ":"n","ū":"u","Ā":"A","Ē":"E","Ģ":"G","Ī":"i","Ķ":"k","Ļ":"L","Ņ":"N","Ū":"u"};for(let e=0,r=t.length;egt.boolean()?t.toUpperCase():t.toLowerCase()))},toTitleCase:function(t,n){return t.replace(/[^\'‘’\`\-\s]+/gm,(t=>yt(t,n)))},toUpperCaseFirst:yt,trim:function(t){return t.trim()},trimLeft:function(t){return t.trimStart()},trimRight:function(t){return t.trimEnd()}};function bt(t,n){return t.getTime()>n.getTime()?t:n}function Mt(t,n){return t.getTime()<=n.getTime()?t:n}function St(){const t=new Date;return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t}var wt={clone:function(t){return new Date(t.getTime())},constrain:function(t,n,e){const r=Mt(n,e),o=bt(n,e);return Mt(bt(t,r),o)},format:function(t,n){const e=Nt.replace,r=Nt.padZeros,o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],i=t.getDate(),u=t.getFullYear(),a=t.getMonth(),c=a+1,s=["January","February","March","April","May","June","July","August","September","October","November","December"][a],l=t.getDay(),f=t.getHours(),g=t.getMinutes(),h=t.getSeconds(),d=t.getMilliseconds(),m=[["YYYY",u],["YY",r(u,4).substring(2,4)],["MM",r(c,2)],["M",c],["DD",r(i,2)],["D",i],["hh",r(f,2)],["h",f],["mm",r(g,2)],["m",g],["ss",r(h,2)],["s",h],["ll",r(d,2)],["XX",s],["X",s.substring(0,3)],["ZZ",o[l]],["Z",o[l].substring(0,3)]];let p,y;for(let t=0,r=m.length;t0},max:bt,min:Mt,normalize:function(t){return{milliseconds:t%1e3,seconds:Math.floor(t/1e3)%60,minutes:Math.floor(t/1e3/60)%60,hours:Math.floor(t/1e3/60/60)%24,days:Math.floor(t/1e3/60/60/24)}},parse:function(t){let n;const e=t=>nt.isNumber(t)&&t>=0&&nt.isNumber(new Date(t).getTime());if(nt.isDate(t))return t;if(nt.isNumber(t)){if(n=t,e(n))return new Date(n)}else if(nt.isString(t)){if(n=Number(t),e(n))return new Date(n);if(n=Date.parse(t),e(n))return new Date(n)}return null},timestamp:function(t){return(t||new Date).getTime()},today:St,tomorrow:function(){const t=St();return t.setDate(t.getDate()+1),t},yesterday:function(){const t=St();return t.setDate(t.getDate()-1),t},yyyymmdd:function(t,n){const e=t||new Date,r=e.getFullYear(),o=e.getMonth()+1,i=e.getDate(),u=n||"";return String(r)+u+Nt.padZeros(o,2)+u+Nt.padZeros(i,2)}};function xt(t,n,e){let r=nt.isUndefined(e)?0:e;for(let e=0,o=t.length;e{o=0===o?t.length:Math.min(o,t.length)}));const i=[];for(let t=0;t{switch(nt.of(t)){case nt.ARRAY:return t.length>0;case nt.OBJECT:return $.length(t)>0;default:return Boolean(t)}}))},any:function(t){return t.some((t=>{switch(nt.of(t)){case nt.ARRAY:return t.length>0;case nt.OBJECT:return $.length(t)>0;default:return Boolean(t)}}))},clean:function t(n,e){let r=n.slice();return r=r.filter((t=>!nt.isNone(t))),!0===e&&(r=r.map((n=>{let r;switch(nt.of(n)){case nt.ARRAY:return r=t(n,e),r.length>0?r:null;case nt.OBJECT:return r=$.clean(n,e),$.length(r)>0?r:null;case nt.STRING:return r=Nt.trim(n),""!==r?n:null;default:return n}})).filter((t=>!nt.isNone(t)))),r},clone:function t(n){const e=n.slice();let r;for(let n=0,o=e.length;nnt.isFunction(n)?Math.max(t,n(e)):Math.max(t,e)),Number.MIN_VALUE)},min:function(t,n){return xt(t,((t,e)=>nt.isFunction(n)?Math.min(t,n(e)):Math.min(t,e)),Number.MAX_VALUE)},paginate:function(t,n){const e=t.length,r=n>0?Math.ceil(e/n):0,o=[];let i,u;for(i=0,u=0;i{let a,c;if(r(t)&&r(u)&&i(n))a=n in t?t[n]:t,c=n in u?u[n]:u;else if(e(t)&&e(u)&&o(n)){const e=n;a=e>=0&&e=0&&ent.isFunction(n)?t+n(e):t+e),0)},unique:function(t){let n;const e=[],r=t=>!$.equals(n,t);for(let o=0,i=t.length;o=1?"":u(255*e))+u(r)+u(o)+u(i))},toString:function(t){return`{ r:${String(t.r)}, g:${String(t.g)}, b:${String(t.b)}, a:${String(isNaN(t.a)?1:t.a)} }`},toStringCSS:function(t){return`rgba(${String(t.r)}, ${String(t.g)}, ${String(t.b)}, ${String(isNaN(t.a)?1:t.a)})`}};function Rt(t){const n=t.c/100,e=t.m/100,r=t.y/100,o=t.k/100,i=1-o;let u=1-Math.min(1,n*i+o),a=1-Math.min(1,e*i+o),c=1-Math.min(1,r*i+o);const s=Math.round;return u=s(255*u),a=s(255*a),c=s(255*c),{r:u,g:a,b:c,a:1}}var Ct={toHex:function(t,n){return Tt.toHex(Rt(t),n)},toRgb:Rt,toString:function(t){return`{ c:${String(t.c)}, m:${String(t.m)}, y:${String(t.y)}, k:${String(t.k)} }`},toStringCSS:function(t){return`cmyk(${String(t.c)}%, ${String(t.m)}%, ${String(t.y)}%, ${String(t.k)}%)`}};function kt(t){const n=Ot.decodeInt,e=Ot.encodeInt;let r,o,i;if(nt.isNumber(t))r=e(t);else{if(!nt.isString(t))return null;r=t.replace(/\#|0x/,"")}switch(r=r.toUpperCase(),r.length){case 3:i=/^([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),o={a:1,r:n(i[1]+i[1]),g:n(i[2]+i[2]),b:n(i[3]+i[3])};break;case 6:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:1,r:n(i[1]),g:n(i[2]),b:n(i[3])};break;case 8:i=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),o={a:h.roundDecimals(n(i[1])/255,2),r:n(i[2]),g:n(i[3]),b:n(i[4])};break;default:return null}return o}function qt(t,n){return Tt.toHex(kt(t),n)}var jt={average:function(t){return Tt.toHex(Tt.average(t.map((t=>kt(t)))))},distance:function(t,n){return Tt.distance(kt(t),kt(n))},gradient:function(t,n){return Tt.gradient(t.map((t=>kt(t))),n).map((t=>Tt.toHex(t)))},gradientMatrix:function(t,n,e){return Tt.gradientMatrix($.map(t,(t=>kt(t))),n,e).map((t=>t.map((t=>Tt.toHex(t)))))},interpolateBilinear:function(t,n,e,r,o,i){return Tt.toHex(Tt.interpolateBilinear(kt(t),kt(n),kt(e),kt(r),o,i))},interpolateLinear:function(t,n,e){return Tt.toHex(Tt.interpolateLinear(kt(t),kt(n),e))},interpolateMultilinear:function(t,n){return Tt.toHex(Tt.interpolateMultilinear(t.map((t=>kt(t))),n))},nearest:function(t,n){return Tt.toHex(Tt.nearest(kt(t),n.map((t=>kt(t)))))},toCmyk:function(t){return Tt.toCmyk(kt(t))},toRgb:kt,toString:qt,toStringCSS:function(t){return qt(t,"#")}},Ut={cmyk:Ct,cmykToHex:Ct.toHex,cmykToRgb:Ct.toRgb,hex:jt,hexToCmyk:jt.toCmyk,hexToRgb:jt.toRgb,rgb:Tt,rgbToCmyk:Tt.toCmyk,rgbToHex:Tt.toRgb};var Bt={backIn:function(t,n){return t*t*(((n=isNaN(n)?1.70158:n)+1)*t-n)},backInOut:function(t,n){return n=isNaN(n)?1.70158:n,(t/=.5)<1?t*t*(((n*=1.525)+1)*t-n)*.5:.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},backOut:function(t,n){return(t-=1)*t*(((n=isNaN(n)?1.70158:n)+1)*t+n)+1},bounceIn:function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)},bounceInOut:function(t){return t<.5?(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375):t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},circularIn:function(t){return-(Math.sqrt(1-t*t)-1)},circularInOut:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):(t-=2,.5*(Math.sqrt(1-t*t)+1))},circularOut:function(t){return t-=1,Math.sqrt(1-t*t)},cubicIn:function(t){return t*t*t},cubicInOut:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},cubicOut:function(t){return(t-=1)*t*t+1},elasticIn:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),-n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)},elasticInOut:function(t,n,e){if(0===t)return 0;if(2===(t/=.5))return 1;let r;return n=isNaN(n)?0:n,.3===(e=isNaN(e)?.3:e)&&(e*=1.5),n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),t<1?n*2**(10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*-.5:n*2**(-10*(t-=1))*Math.sin((t-r)*(2*Math.PI)/e)*.5+1},elasticOut:function(t,n,e){if(0===t)return 0;if(1===t)return 1;let r;return n=isNaN(n)?0:n,e=isNaN(e)?.3:e,n<1?(n=1,r=e/4):r=e/(2*Math.PI)*Math.asin(1/n),n*2**(-10*t)*Math.sin((t-r)*(2*Math.PI)/e)+1},exponentialIn:function(t){return 0===t?0:2**(10*(t-1))},exponentialInOut:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*2**(10*(t-1)):.5*(2-2**(-10*(t-=1)))},exponentialOut:function(t){return 1===t?t:1-2**(-10*t)},none:function(t){return t},quadraticIn:function(t){return t*t},quadraticInOut:function(t){return(t/=.5)<1?.5*t*t:-.5*((t-=1)*(t-2)-1)},quadraticOut:function(t){return-t*(t-2)},quarticIn:function(t){return t*t*t*t},quarticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quarticOut:function(t){return-((t-=1)*t*t*t-1)},quinticIn:function(t){return t*t*t*t*t},quinticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},quinticOut:function(t){return(t-=1)*t*t*t*t+1},sexticIn:function(t){return t*t*t*t*t*t},sexticInOut:function(t){return(t/=.5)<1?.5*t*t*t*t*t*t:-.5*((t-=2)*t*t*t*t*t-2)},sexticOut:function(t){return-((t-=1)*t*t*t*t*t-1)},sineIn:function(t){return 1-Math.cos(t*(Math.PI/2))},sineInOut:function(t){return-.5*(Math.cos(Math.PI*t)-1)},sineOut:function(t){return Math.sin(t*(Math.PI/2))},waveCosine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.cos(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o},waveSawtooth:function(t,n,e,r){r=!0===r;let o=t*(n=isNaN(n)?1:n)%1;return o=(e=!0===e)?Math.abs(o):o,o=r?1-o:o,o},waveSine:function(t,n,e,r){n=isNaN(n)?1:n,e=!0===e,r=!0===r;let o=Math.sin(Math.PI*t*n);return o=e?Math.abs(o):o,o=r?1-o:o,o}};const Pt=Math.PI/180,Lt=180/Math.PI;function Yt(t,n){return Math.atan2(t,n)*Lt}function Ft(t){return t*Pt}var Ht={DEG_0:0,DEG_90:90,DEG_180:180,DEG_270:270,DEG_360:360,DEG_TO_RAD:Pt,RAD_TO_DEG:Lt,acosDeg:function(t){return Math.acos(t)*Lt},angleDeg:function(t,n){return Yt(t,n)},angleRad:function(t,n){return Math.atan2(t,n)},asinDeg:function(t){return Math.asin(t)*Lt},atanDeg:function(t){return Math.atan(t)*Lt},atan2Deg:Yt,cosDeg:function(t){return Math.cos(t*Pt)},cycleDeg:function(t){return h.cycle(t,360)},degToRad:Ft,fastDeg:function(t,n){const e=n-t;return e>180?-360+e:e<-180?360+n:n},haversine:function(t,n,e,r,o){const i=Ft(t),u=Ft(n),a=Ft(e),c=a-i,s=Ft(r)-u,l=Math.sin(c/2)*Math.sin(c/2)+Math.cos(i)*Math.cos(a)*Math.sin(s/2)*Math.sin(s/2),f=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));let g;return g=!1===o?3956:6371,h.roundDecimals(g*f,3)},hypo:function(t,n){return Math.sqrt(t*t+n*n)},radToDeg:function(t){return t*Lt},sinDeg:function(t){return Math.sin(t*Pt)},tanDeg:function(t){return Math.tan(t*Pt)}};function Jt(t,n){return{x:t.x+n.x,y:t.y+n.y}}function Zt(t,n){const e=n.x-t.x,r=n.y-t.y;return Math.sqrt(e*e+r*r)}function _t(t){return Zt(t,{x:0,y:0})}function zt(t,n){return{x:t.x-n.x,y:t.y-n.y}}var Gt={add:Jt,angle:function(t,n){const e=Ht.angleDeg(n.y-t.y,n.x-t.x);return Ht.cycleDeg(e)},cross:function(t,n){return t.x*n.y-t.y*n.x},distance:Zt,dot:function(t,n){return t.x*n.x+t.y*n.y},equals:function(t,n,e){const r=h.equals;return r(t.x,n.x,e)&&r(t.y,n.y,e)},interpolate:function(t,n,e){const r=c.linear;return{x:r(t.x,n.x,e),y:r(t.y,n.y,e)}},length:_t,magnitude:function(t){return _t(t)},project:function(t,n,e){return{x:t.x+n*Ht.cosDeg(e),y:t.y+n*Ht.sinDeg(e)}},rect:function(t){let n;const e=[],r=[];for(let o=0,i=t.length;o=n&&t<=e},isEven:function(t){return t%2==0&&!Wt(t)},isFloat:Wt,isNegative:function(t){return t<0},isOdd:function(t){return t%2!=0&&!Wt(t)},isPositive:function(t){return t>=0},isPrime:function(t){if("number"!=typeof t||Number.isNaN(t)||Wt(t))return!1;if(t<=1)return!1;if(t<=3)return!0;if(t%2==0||t%3==0)return!1;for(let n=5;n*n<=t;n+=6)if(t%n==0||t%(n+2)==0)return!1;return!0}};function Kt(t){if(!nt.isBoolean(t))throw new Error(`value is not boolean: ${String(t)}.`)}function Vt(t,n){if(!$.equals(t,n)){let e=nt.isArray(t)||nt.isObject(t)?`\n${i.encode(t)}\n`:String(t),r=nt.isArray(n)||nt.isObject(n)?`\n${i.encode(n)}`:String(n);throw e=nt.isString(t)?String(`"${e}"`):e,r=nt.isString(n)?String(`"${r}"`):r,new Error(`values are not equal: ${e} != ${r}`)}}function Qt(t){if(!nt.isFunction(t))throw new Error(`value is not function: ${String(t)}.`)}function tn(t){if(!nt.isNumber(t))throw new Error(`value is not number: ${String(t)}.`)}var nn={assertArray:function(t,n){if(!nt.isArray(t))throw new Error(`value is not array: ${String(t)}.`);nt.isNumber(n)&&Vt(t.length,n)},assertBase64:function(t){if(!nt.isBase64(t))throw new Error(`value is not base64: ${String(t)}.`)},assertBoolean:Kt,assertDate:function(t){if(!nt.isDate(t))throw new Error(`value is not date: ${String(t)}.`)},assertEqual:Vt,assertError:function(t){if(!nt.isError(t))throw new Error(`value is not error: ${String(t)}.`)},assertFalse:function(t){if(Kt(t),!1!==t)throw new Error(`value is not false: ${String(t)}.`)},assertFunction:Qt,assertJSON:function(t){if(!nt.isJSON(t))throw new Error(`value is not json: ${String(t)}.`)},assertModule:function(t){if(!nt.isModule(t))throw new Error(`value is not module: ${String(t)}.`)},assertNaN:function(t){if(!nt.isNaN(t))throw new Error(`value is not NaN: ${String(t)}.`)},assertNone:function(t){if(!nt.isNone(t))throw new Error(`value is not none: ${String(t)}.`)},assertNotArray:function(t){if(nt.isArray(t))throw new Error(`value is array: ${String(t)}.`)},assertNotBase64:function(t){if(nt.isBase64(t))throw new Error(`value is base64: ${String(t)}.`)},assertNotBoolean:function(t){if(nt.isBoolean(t))throw new Error(`value is boolean: ${String(t)}.`)},assertNotDate:function(t){if(nt.isDate(t))throw new Error(`value is date: ${String(t)}.`)},assertNotEqual:function(t,n){if($.equals(t,n)){const e=nt.isArray(t)||nt.isObject(t)?`\n${i.encode(t)}\n`:String(t),r=nt.isArray(n)||nt.isObject(n)?`\n${i.encode(n)}`:String(n);throw new Error(`values are equal: ${e} == ${r}`)}},assertNotError:function(t){if(nt.isError(t))throw new Error(`value is error: ${String(t)}.`)},assertNotFunction:function(t){if(nt.isFunction(t))throw new Error(`value is function: ${String(t)}.`)},assertNotJSON:function(t){if(nt.isJSON(t))throw new Error(`value is json: ${String(t)}.`)},assertNotModule:function(t){if(nt.isModule(t))throw new Error(`value is module: ${String(t)}.`)},assertNotNone:function(t){if(nt.isNone(t))throw new Error(`value is none: ${String(t)}.`)},assertNotNumber:function(t){if(nt.isNumber(t))throw new Error(`value is number: ${String(t)}.`)},assertNotNull:function(t){if(nt.isNull(t))throw new Error(`value is null: ${String(t)}.`)},assertNotObject:function(t){if(nt.isObject(t))throw new Error(`value is object: ${String(t)}.`)},assertNotRegExp:function(t){if(nt.isRegExp(t))throw new Error(`value is regexp: ${String(t)}.`)},assertNotString:function(t){if(nt.isString(t))throw new Error(`value is string: ${String(t)}.`)},assertNotUndefined:function(t){if(nt.isUndefined(t))throw new Error(`value is undefined: ${String(t)}.`)},assertNumber:tn,assertNumberAlmostEqual:function(t,n,e){if(tn(t),tn(n),!h.equals(t,n,e))throw new Error(`values are not almost equals (tolerance = ${String(e)}): ${String(t)} != ${String(n)}.`)},assertNull:function(t){if(!nt.isNull(t))throw new Error(`value is not null: ${String(t)}.`)},assertObject:function(t){if(!nt.isObject(t))throw new Error(`value is not object: ${String(t)}.`)},assertRegExp:function(t){if(!nt.isRegExp(t))throw new Error(`value is not regexp: ${String(t)}.`)},assertString:function(t){if(!nt.isString(t))throw new Error(`value is not string: ${String(t)}.`)},assertThrows:function(t,...n){Qt(t);try{const e=null;FunctionUtil.call.apply(null,[t,e].concat(n))}catch(t){return}throw new Error(`value didn't throw error: ${String(t)}.`)},assertTrue:function(t){if(Kt(t),!0!==t)throw new Error(`value is not true: ${String(t)}.`)},assertUndefined:function(t){if(!nt.isUndefined(t))throw new Error(`value is not undefined: ${String(t)}.`)}};const en={array:vt,base64:o,color:Ut,date:wt,ease:Bt,func:ut,geom:{point:Gt},hex:Ot,json:i,math:h,number:Xt,object:$,random:gt,string:Nt,test:nn,trigo:Ht,type:nt,xml:{removeNamespaces:function(t){return t.replace(/<[^>]*>/g,(t=>t.replace(/(\s|<\/?)[a-zA-Z0-9]+\:/g,"$1")))}},url:b,utf8:n,version:"1.0.0"};t.default=en,t.utils=en,Object.defineProperty(t,"__esModule",{value:!0})}));