From 1bcb1183b9ea72cabd191b65593c52e01b2de8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Pereira=20Mu=C3=B1oz?= Date: Mon, 9 Dec 2024 00:02:18 +0100 Subject: [PATCH] Update Demo bundle --- docs/scripts/bundle.js | 2 +- docs/styles/styles.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/scripts/bundle.js b/docs/scripts/bundle.js index 5c99868..7359a16 100644 --- a/docs/scripts/bundle.js +++ b/docs/scripts/bundle.js @@ -1 +1 @@ -(()=>{var __webpack_modules__={966:(module,exports)=>{eval('var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function(){var r=null;\n(function(){function X(e){function j(){try{J.doScroll("left")}catch(e){P(j,50);return}w("poll")}function w(j){if(!(j.type=="readystatechange"&&x.readyState!="complete")&&((j.type=="load"?n:x)[z](i+j.type,w,!1),!m&&(m=!0)))e.call(n,j.type||j)}var Y=x.addEventListener,m=!1,C=!0,t=Y?"addEventListener":"attachEvent",z=Y?"removeEventListener":"detachEvent",i=Y?"":"on";if(x.readyState=="complete")e.call(n,"lazy");else{if(x.createEventObject&&J.doScroll){try{C=!n.frameElement}catch(A){}C&&j()}x[t](i+"DOMContentLoaded",\nw,!1);x[t](i+"readystatechange",w,!1);n[t](i+"load",w,!1)}}function Q(){S&&X(function(){var e=K.length;$(e?function(){for(var j=0;j=0;){var M=A[m],T=M.src.match(/^[^#?]*\\/run_prettify\\.js(\\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D=\n[],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]-\na[0]||a[1]-f[1]});b=[];g=[];for(a=0;ak[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\\[(?:[^\\\\\\]]|\\\\[\\S\\s])*]|\\\\u[\\dA-Fa-f]{4}|\\\\x[\\dA-Fa-f]{2}|\\\\\\d+|\\\\[^\\dux]|\\(\\?[!:=]|[()^]|[^()[\\\\^]+/g),c=a.length,d=[],g=0,k=0;g=2&&f==="["?a[g]=b(o):f!=="\\\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y,\ng),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\\S\\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:\'\'\'(?:[^\'\\\\]|\\\\[\\S\\s]|\'\'?(?=[^\']))*(?:\'\'\'|$)|"""(?:[^"\\\\]|\\\\[\\S\\s]|""?(?=[^"]))*(?:"""|$)|\'(?:[^\'\\\\]|\\\\[\\S\\s])*(?:\'|$)|"(?:[^"\\\\]|\\\\[\\S\\s])*(?:"|$))/,\nr,"\'\\""]):a.multiLineStrings?d.push(["str",/^(?:\'(?:[^\'\\\\]|\\\\[\\S\\s])*(?:\'|$)|"(?:[^"\\\\]|\\\\[\\S\\s])*(?:"|$)|`(?:[^\\\\`]|\\\\[\\S\\s])*(?:`|$))/,r,"\'\\"`"]):d.push(["str",/^(?:\'(?:[^\\n\\r\'\\\\]|\\\\.)*(?:\'|$)|"(?:[^\\n\\r"\\\\]|\\\\.)*(?:"|$))/,r,"\\"\'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\\b|[^\\n\\r]*)/,\nr,"#"]),h.push(["str",/^<(?:(?:(?:\\.\\.\\/)*|\\/?)(?:[\\w-]+(?:\\/[\\w-]+)+)?[\\w-]+\\.h(?:h|pp|\\+\\+)?|[a-z]\\w*)>/,r])):d.push(["com",/^#[^\\n\\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\\/\\/[^\\n\\r]*/,r]),h.push(["com",/^\\/\\*[\\S\\s]*?(?:\\*\\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\\n\\r")?".":"[\\\\S\\\\s]";h.push(["lang-regex",RegExp("^(?:^^\\\\.?|[+-]|[!=]=?=?|\\\\#|%=?|&&?=?|\\\\(|\\\\*=?|[+\\\\-]=|->|\\\\/=?|::?|<>?>?=?|,|;|\\\\?|@|\\\\[|~|{|\\\\^\\\\^?=?|\\\\|\\\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\\\s*("+\n("/(?=[^/*"+b+"])(?:[^/\\\\x5B\\\\x5C"+b+"]|\\\\x5C"+e+"|\\\\x5B(?:[^\\\\x5C\\\\x5D"+b+"]|\\\\x5C"+e+")*(?:\\\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\\s,]+/g,"|")+")\\\\b"),r]);d.push(["pln",/^\\s+/,r," \\r\\n\\t\\u00a0"]);b="^.[^\\\\s\\\\w.$@\'\\"`/\\\\\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\\w$@]*|\\w+_t\\b)/,r],["pln",/^[$_a-z][\\w$@]*/i,r],["lit",/^(?:0x[\\da-f]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+-]?\\d+)?)[a-z]*/i,\nr,"0123456789"],["pln",/^\\\\[\\S\\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}}\nfunction e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\\s)nocode(?:\\s|$)/,m=/\\r\\n?|\\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\\s*=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],\n"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],\nL=[K,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],\nN=[G,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],R=[G,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\\d*)\\b/,\nS=/\\S/,T=t({keywords:[J,L,O,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\\!--[\\S\\s]*?(?:--\\>|$)/],["lang-",/^<\\?([\\S\\s]+?)(?:\\?>|$)/],["lang-",/^<%([\\S\\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",\n/^]*>([\\S\\s]+?)<\\/xmp\\b[^>]*>/i],["lang-js",/^]*>([\\S\\s]*?)(<\\/script\\b[^>]*>)/i],["lang-css",/^]*>([\\S\\s]*?)(<\\/style\\b[^>]*>)/i],["lang-in.tag",/^(<\\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\\s+/,r," \\t\\r\\n"],["atv",/^(?:"[^"]*"?|\'[^\']*\'?)/,r,"\\"\'"]],[["tag",/^^<\\/?[a-z](?:[\\w-.:]*\\w)?|\\/?>$/i],["atn",/^(?!style[\\s=]|on)[a-z](?:[\\w:-]*\\w)?/i],["lang-uq.val",/^=\\s*([^\\s"\'>]*(?:[^\\s"\'/>]|\\/(?=\\s)))/],["pun",/^[/<->]+/],\n["lang-js",/^on\\w+\\s*=\\s*"([^"]+)"/i],["lang-js",/^on\\w+\\s*=\\s*\'([^\']+)\'/i],["lang-js",/^on\\w+\\s*=\\s*([^\\s"\'>]+)/i],["lang-css",/^style\\s*=\\s*"([^"]+)"/i],["lang-css",/^style\\s*=\\s*\'([^\']+)\'/i],["lang-css",/^style\\s*=\\s*([^\\s"\'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\\S\\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}),\n["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N,\nhashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]);\ni(C([],[["str",/^[\\S\\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="
"+a+"
";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML},\nprettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p{"use strict";eval('\n// EXTERNAL MODULE: ./node_modules/.pnpm/google-code-prettify@1.0.5/node_modules/google-code-prettify/bin/run_prettify.min.js\nvar run_prettify_min = __webpack_require__(966);\n;// CONCATENATED MODULE: ./node_modules/.pnpm/whatwg-fetch@3.6.20/node_modules/whatwg-fetch/fetch.js\n/* eslint-disable no-prototype-builtins */\nvar g =\n (typeof globalThis !== \'undefined\' && globalThis) ||\n (typeof self !== \'undefined\' && self) ||\n // eslint-disable-next-line no-undef\n (typeof __webpack_require__.g !== \'undefined\' && __webpack_require__.g) ||\n {}\n\nvar support = {\n searchParams: \'URLSearchParams\' in g,\n iterable: \'Symbol\' in g && \'iterator\' in Symbol,\n blob:\n \'FileReader\' in g &&\n \'Blob\' in g &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: \'FormData\' in g,\n arrayBuffer: \'ArrayBuffer\' in g\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n \'[object Int8Array]\',\n \'[object Uint8Array]\',\n \'[object Uint8ClampedArray]\',\n \'[object Int16Array]\',\n \'[object Uint16Array]\',\n \'[object Int32Array]\',\n \'[object Uint32Array]\',\n \'[object Float32Array]\',\n \'[object Float64Array]\'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== \'string\') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&\'*+.^_`|~!]/i.test(name) || name === \'\') {\n throw new TypeError(\'Invalid character in header field name: "\' + name + \'"\')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== \'string\') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nfunction Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n if (header.length != 2) {\n throw new TypeError(\'Headers constructor: expected name/value pair to be length 2, found\' + header.length)\n }\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + \', \' + value : value\n}\n\nHeaders.prototype[\'delete\'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body._noBody) return\n if (body.bodyUsed) {\n return Promise.reject(new TypeError(\'Already read\'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type)\n var encoding = match ? match[1] : \'utf-8\'\n reader.readAsText(blob, encoding)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join(\'\')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n // eslint-disable-next-line no-self-assign\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._noBody = true;\n this._bodyText = \'\'\n } else if (typeof body === \'string\') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can\'t handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get(\'content-type\')) {\n if (typeof body === \'string\') {\n this.headers.set(\'content-type\', \'text/plain;charset=UTF-8\')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set(\'content-type\', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set(\'content-type\', \'application/x-www-form-urlencoded;charset=UTF-8\')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error(\'could not read FormData body as blob\')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else if (support.blob) {\n return this.blob().then(readBlobAsArrayBuffer)\n } else {\n throw new Error(\'could not read as ArrayBuffer\')\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error(\'could not read FormData body as text\')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = [\'CONNECT\', \'DELETE\', \'GET\', \'HEAD\', \'OPTIONS\', \'PATCH\', \'POST\', \'PUT\', \'TRACE\']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nfunction Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError(\'Please use the "new" operator, this DOM object constructor cannot be called as a function.\')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError(\'Already read\')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || \'same-origin\'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || \'GET\')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal || (function () {\n if (\'AbortController\' in g) {\n var ctrl = new AbortController();\n return ctrl.signal;\n }\n }());\n this.referrer = null\n\n if ((this.method === \'GET\' || this.method === \'HEAD\') && body) {\n throw new TypeError(\'Body not allowed for GET or HEAD requests\')\n }\n this._initBody(body)\n\n if (this.method === \'GET\' || this.method === \'HEAD\') {\n if (options.cache === \'no-store\' || options.cache === \'no-cache\') {\n // Search for a \'_\' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, \'$1_=\' + new Date().getTime())\n } else {\n // Otherwise add a new \'_\' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? \'&\' : \'?\') + \'_=\' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split(\'&\')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split(\'=\')\n var name = split.shift().replace(/\\+/g, \' \')\n var value = split.join(\'=\').replace(/\\+/g, \' \')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, \' \')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split(\'\\r\')\n .map(function(header) {\n return header.indexOf(\'\\n\') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(\':\')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(\':\').trim()\n try {\n headers.append(key, value)\n } catch (error) {\n console.warn(\'Response \' + error.message)\n }\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nfunction Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError(\'Please use the "new" operator, this DOM object constructor cannot be called as a function.\')\n }\n if (!options) {\n options = {}\n }\n\n this.type = \'default\'\n this.status = options.status === undefined ? 200 : options.status\n if (this.status < 200 || this.status > 599) {\n throw new RangeError("Failed to construct \'Response\': The status provided (0) is outside the range [200, 599].")\n }\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? \'\' : \'\' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || \'\'\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 200, statusText: \'\'})\n response.ok = false\n response.status = 0\n response.type = \'error\'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError(\'Invalid status code\')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nvar DOMException = g.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nfunction fetch_fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException(\'Aborted\', \'AbortError\'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || \'\')\n }\n // This check if specifically for when a user fetches a file locally from the file system\n // Only if the status is out of a normal range\n if (request.url.indexOf(\'file://\') === 0 && (xhr.status < 200 || xhr.status > 599)) {\n options.status = 200;\n } else {\n options.status = xhr.status;\n }\n options.url = \'responseURL\' in xhr ? xhr.responseURL : options.headers.get(\'X-Request-URL\')\n var body = \'response\' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError(\'Network request failed\'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError(\'Network request timed out\'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException(\'Aborted\', \'AbortError\'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === \'\' && g.location.href ? g.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === \'include\') {\n xhr.withCredentials = true\n } else if (request.credentials === \'omit\') {\n xhr.withCredentials = false\n }\n\n if (\'responseType\' in xhr) {\n if (support.blob) {\n xhr.responseType = \'blob\'\n } else if (\n support.arrayBuffer\n ) {\n xhr.responseType = \'arraybuffer\'\n }\n }\n\n if (init && typeof init.headers === \'object\' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {\n var names = [];\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n names.push(normalizeName(name))\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n request.headers.forEach(function(value, name) {\n if (names.indexOf(name) === -1) {\n xhr.setRequestHeader(name, value)\n }\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener(\'abort\', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener(\'abort\', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === \'undefined\' ? null : request._bodyInit)\n })\n}\n\nfetch_fetch.polyfill = true\n\nif (!g.fetch) {\n g.fetch = fetch_fetch\n g.Headers = Headers\n g.Request = Request\n g.Response = Response\n}\n\n;// CONCATENATED MODULE: ./src/constants/numbers.ts\nconst MAX_DECIMALS = 6;\nconst DEFAULT_BLEND_STEPS = 5;\nconst DEFAULT_SHADES_TINTS_STEPS = 5;\n\n;// CONCATENATED MODULE: ./src/constants/enums.ts\nvar ColorModel;\n(function (ColorModel) {\n ColorModel["HEX"] = "HEX";\n ColorModel["RGB"] = "RGB";\n ColorModel["HSL"] = "HSL";\n ColorModel["CIELab"] = "CIELab";\n ColorModel["CMYK"] = "CMYK";\n})(ColorModel || (ColorModel = {}));\nvar Harmony;\n(function (Harmony) {\n Harmony["ANALOGOUS"] = "ANALOGOUS";\n Harmony["COMPLEMENTARY"] = "COMPLEMENTARY";\n Harmony["SPLIT_COMPLEMENTARY"] = "SPLIT_COMPLEMENTARY";\n Harmony["TRIADIC"] = "TRIADIC";\n Harmony["TETRADIC"] = "TETRADIC";\n Harmony["SQUARE"] = "SQUARE";\n})(Harmony || (Harmony = {}));\nvar Mix;\n(function (Mix) {\n Mix["ADDITIVE"] = "ADDITIVE";\n Mix["SUBTRACTIVE"] = "SUBTRACTIVE";\n})(Mix || (Mix = {}));\nvar ColorKeywords;\n(function (ColorKeywords) {\n ColorKeywords["black"] = "#000000";\n ColorKeywords["silver"] = "#C0C0C0";\n ColorKeywords["gray"] = "#808080";\n ColorKeywords["white"] = "#FFFFFF";\n ColorKeywords["maroon"] = "#800000";\n ColorKeywords["red"] = "#FF0000";\n ColorKeywords["purple"] = "#800080";\n ColorKeywords["fuchsia"] = "#FF00FF";\n ColorKeywords["green"] = "#008000";\n ColorKeywords["lime"] = "#00FF00";\n ColorKeywords["olive"] = "#808000";\n ColorKeywords["yellow"] = "#FFFF00";\n ColorKeywords["navy"] = "#000080";\n ColorKeywords["blue"] = "#0000FF";\n ColorKeywords["teal"] = "#008080";\n ColorKeywords["aqua"] = "#00FFFF";\n ColorKeywords["orange"] = "#FFA500";\n ColorKeywords["aliceblue"] = "#F0F8FF";\n ColorKeywords["antiquewhite"] = "#FAEBD7";\n ColorKeywords["aquamarine"] = "#7FFFD4";\n ColorKeywords["azure"] = "#F0FFFF";\n ColorKeywords["beige"] = "#F5F5DC";\n ColorKeywords["bisque"] = "#FFE4C4";\n ColorKeywords["blanchedalmond"] = "#FFEBCD";\n ColorKeywords["blueviolet"] = "#8A2BE2";\n ColorKeywords["brown"] = "#A52A2A";\n ColorKeywords["burlywood"] = "#DEB887";\n ColorKeywords["cadetblue"] = "#5F9EA0";\n ColorKeywords["chartreuse"] = "#7FFF00";\n ColorKeywords["chocolate"] = "#D2691E";\n ColorKeywords["coral"] = "#FF7F50";\n ColorKeywords["cornflowerblue"] = "#6495ED";\n ColorKeywords["cornsilk"] = "#FFF8DC";\n ColorKeywords["crimson"] = "#DC143C";\n ColorKeywords["cyan"] = "#00FFFF";\n ColorKeywords["darkblue"] = "#00008B";\n ColorKeywords["darkcyan"] = "#008B8B";\n ColorKeywords["darkgoldenrod"] = "#B8860B";\n ColorKeywords["darkgray"] = "#A9A9A9";\n ColorKeywords["darkgreen"] = "#006400";\n ColorKeywords["darkgrey"] = "#A9A9A9";\n ColorKeywords["darkkhaki"] = "#BDB76B";\n ColorKeywords["darkmagenta"] = "#8B008B";\n ColorKeywords["darkolivegreen"] = "#556B2F";\n ColorKeywords["darkorange"] = "#FF8C00";\n ColorKeywords["darkorchid"] = "#9932CC";\n ColorKeywords["darkred"] = "#8B0000";\n ColorKeywords["darksalmon"] = "#E9967A";\n ColorKeywords["darkseagreen"] = "#8FBC8F";\n ColorKeywords["darkslateblue"] = "#483D8B";\n ColorKeywords["darkslategray"] = "#2F4F4F";\n ColorKeywords["darkslategrey"] = "#2F4F4F";\n ColorKeywords["darkturquoise"] = "#00CED1";\n ColorKeywords["darkviolet"] = "#9400D3";\n ColorKeywords["deeppink"] = "#FF1493";\n ColorKeywords["deepskyblue"] = "#00BFFF";\n ColorKeywords["dimgray"] = "#696969";\n ColorKeywords["dimgrey"] = "#696969";\n ColorKeywords["dodgerblue"] = "#1E90FF";\n ColorKeywords["firebrick"] = "#B22222";\n ColorKeywords["floralwhite"] = "#FFFAF0";\n ColorKeywords["forestgreen"] = "#228B22";\n ColorKeywords["gainsboro"] = "#DCDCDC";\n ColorKeywords["ghostwhite"] = "#F8F8FF";\n ColorKeywords["gold"] = "#FFD700";\n ColorKeywords["goldenrod"] = "#DAA520";\n ColorKeywords["greenyellow"] = "#ADFF2F";\n ColorKeywords["grey"] = "#808080";\n ColorKeywords["honeydew"] = "#F0FFF0";\n ColorKeywords["hotpink"] = "#FF69B4";\n ColorKeywords["indianred"] = "#CD5C5C";\n ColorKeywords["indigo"] = "#4B0082";\n ColorKeywords["ivory"] = "#FFFFF0";\n ColorKeywords["khaki"] = "#F0E68C";\n ColorKeywords["lavender"] = "#E6E6FA";\n ColorKeywords["lavenderblush"] = "#FFF0F5";\n ColorKeywords["lawngreen"] = "#7CFC00";\n ColorKeywords["lemonchiffon"] = "#FFFACD";\n ColorKeywords["lightblue"] = "#ADD8E6";\n ColorKeywords["lightcoral"] = "#F08080";\n ColorKeywords["lightcyan"] = "#E0FFFF";\n ColorKeywords["lightgoldenrodyellow"] = "#FAFAD2";\n ColorKeywords["lightgray"] = "#D3D3D3";\n ColorKeywords["lightgreen"] = "#90EE90";\n ColorKeywords["lightgrey"] = "#D3D3D3";\n ColorKeywords["lightpink"] = "#FFB6C1";\n ColorKeywords["lightsalmon"] = "#FFA07A";\n ColorKeywords["lightseagreen"] = "#20B2AA";\n ColorKeywords["lightskyblue"] = "#87CEFA";\n ColorKeywords["lightslategray"] = "#778899";\n ColorKeywords["lightslategrey"] = "#778899";\n ColorKeywords["lightsteelblue"] = "#B0C4DE";\n ColorKeywords["lightyellow"] = "#FFFFE0";\n ColorKeywords["limegreen"] = "#32CD32";\n ColorKeywords["linen"] = "#FAF0E6";\n ColorKeywords["magenta"] = "#FF00FF";\n ColorKeywords["mediumaquamarine"] = "#66CDAA";\n ColorKeywords["mediumblue"] = "#0000CD";\n ColorKeywords["mediumorchid"] = "#BA55D3";\n ColorKeywords["mediumpurple"] = "#9370DB";\n ColorKeywords["mediumseagreen"] = "#3CB371";\n ColorKeywords["mediumslateblue"] = "#7B68EE";\n ColorKeywords["mediumspringgreen"] = "#00FA9A";\n ColorKeywords["mediumturquoise"] = "#48D1CC";\n ColorKeywords["mediumvioletred"] = "#C71585";\n ColorKeywords["midnightblue"] = "#191970";\n ColorKeywords["mintcream"] = "#F5FFFA";\n ColorKeywords["mistyrose"] = "#FFE4E1";\n ColorKeywords["moccasin"] = "#FFE4B5";\n ColorKeywords["navajowhite"] = "#FFDEAD";\n ColorKeywords["oldlace"] = "#FDF5E6";\n ColorKeywords["olivedrab"] = "#6B8E23";\n ColorKeywords["orangered"] = "#FF4500";\n ColorKeywords["orchid"] = "#DA70D6";\n ColorKeywords["palegoldenrod"] = "#EEE8AA";\n ColorKeywords["palegreen"] = "#98FB98";\n ColorKeywords["paleturquoise"] = "#AFEEEE";\n ColorKeywords["palevioletred"] = "#DB7093";\n ColorKeywords["papayawhip"] = "#FFEFD5";\n ColorKeywords["peachpuff"] = "#FFDAB9";\n ColorKeywords["peru"] = "#CD853F";\n ColorKeywords["pink"] = "#FFC0CB";\n ColorKeywords["plum"] = "#DDA0DD";\n ColorKeywords["powderblue"] = "#B0E0E6";\n ColorKeywords["rosybrown"] = "#BC8F8F";\n ColorKeywords["royalblue"] = "#4169E1";\n ColorKeywords["saddlebrown"] = "#8B4513";\n ColorKeywords["salmon"] = "#FA8072";\n ColorKeywords["sandybrown"] = "#F4A460";\n ColorKeywords["seagreen"] = "#2E8B57";\n ColorKeywords["seashell"] = "#FFF5EE";\n ColorKeywords["sienna"] = "#A0522D";\n ColorKeywords["skyblue"] = "#87CEEB";\n ColorKeywords["slateblue"] = "#6A5ACD";\n ColorKeywords["slategray"] = "#708090";\n ColorKeywords["slategrey"] = "#708090";\n ColorKeywords["snow"] = "#FFFAFA";\n ColorKeywords["springgreen"] = "#00FF7F";\n ColorKeywords["steelblue"] = "#4682B4";\n ColorKeywords["tan"] = "#D2B48C";\n ColorKeywords["thistle"] = "#D8BFD8";\n ColorKeywords["tomato"] = "#FF6347";\n ColorKeywords["turquoise"] = "#40E0D0";\n ColorKeywords["violet"] = "#EE82EE";\n ColorKeywords["wheat"] = "#F5DEB3";\n ColorKeywords["whitesmoke"] = "#F5F5F5";\n ColorKeywords["yellowgreen"] = "#9ACD32";\n ColorKeywords["rebeccapurple"] = "#663399";\n})(ColorKeywords || (ColorKeywords = {}));\nconst COLOR_KEYS = Object.keys(ColorKeywords);\nconst COLOR_PROPS = {\n HEX: [\'R\', \'G\', \'B\', \'A\'],\n RGB: [\'R\', \'G\', \'B\', \'A\'],\n HSL: [\'H\', \'S\', \'L\', \'A\'],\n CIELab: [\'L\', \'a\', \'b\', \'A\'],\n CMYK: [\'C\', \'M\', \'Y\', \'K\', \'A\']\n};\nconst VALID_COLOR_OBJECTS = {\n BGR: ColorModel.RGB,\n ABGR: ColorModel.RGB,\n HLS: ColorModel.HSL,\n AHLS: ColorModel.HSL,\n LAB: ColorModel.CIELab,\n ALAB: ColorModel.CIELab,\n CKMY: ColorModel.CMYK,\n ACKMY: ColorModel.CMYK\n};\nvar TypeOf;\n(function (TypeOf) {\n TypeOf["NUMBER"] = "number";\n TypeOf["BOOLEAN"] = "boolean";\n})(TypeOf || (TypeOf = {}));\n\n;// CONCATENATED MODULE: ./src/constants/regexps.ts\n\nconst COLORREGS = {\n [ColorModel.HEX]: /^#(?:([a-f\\d])([a-f\\d])([a-f\\d])([a-f\\d])?|([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?)$/i,\n [ColorModel.RGB]: /^rgba?\\s*\\(\\s*(?:((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)(?:\\s*,\\s*((?:\\d*\\.)?\\d+))?|((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)(?:\\s*\\/\\s*((?:\\d*\\.)?\\d+%?))?)\\s*\\)$/,\n [ColorModel.HSL]: /^hsla?\\s*\\(\\s*(?:(-?(?:\\d*\\.)?\\d+(?:deg|grad|rad|turn)?)\\s*,\\s*((?:\\d*\\.)?\\d+)%\\s*,\\s*((?:\\d*\\.)?\\d+)%(?:\\s*,\\s*((?:\\d*\\.)?\\d+))?|(-?(?:\\d*\\.)?\\d+(?:deg|grad|rad|turn)?)\\s*((?:\\d*\\.)?\\d+)%\\s*((?:\\d*\\.)?\\d+)%(?:\\s*\\/\\s*((?:\\d*\\.)?\\d+%?))?)\\s*\\)$/,\n [ColorModel.CIELab]: /^lab\\s*\\(\\s*(?:((?:\\d*\\.)?\\d+%?)\\s*(-?(?:\\d*\\.)?\\d+%?)\\s*(-?(?:\\d*\\.)?\\d+%?)(?:\\s*\\/\\s*((?:\\d*\\.)?\\d+%?))?)\\s*\\)$/,\n [ColorModel.CMYK]: /^(?:device-cmyk|cmyk)\\s*\\(\\s*(?:((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)(?:\\s*,\\s*((?:\\d*\\.)?\\d+))?|((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)(?:\\s*\\/\\s*((?:\\d*\\.)?\\d+%?))?)\\s*\\)$/\n};\nconst HSL_HUE = /^(-?(?:\\d*\\.)?\\d+)((?:deg|grad|rad|turn)?)$/;\nconst PCENT = /^(-?\\d+(?:\\.\\d+)?|-?\\.\\d+)%$/;\nconst HEX = /^0x([a-f\\d]{1,2})$/i;\nconst TEMPLATE_VAR = /\\{(\\d+)\\}/g;\nconst COMMAS_AND_NEXT_CHARS = /,( +|\\d+)/g;\nconst SPACES = / +/;\n\n;// CONCATENATED MODULE: ./src/constants/errors.ts\nconst ERRORS = {\n NOT_ACCEPTED_STRING_INPUT: \'The provided string color doesn\\\'t have a correct format\',\n NOT_ACCEPTED_OBJECT_INPUT: \'The provided color object doesn\\\'t have the proper keys or format\'\n};\n\n;// CONCATENATED MODULE: ./src/@types/index.ts\nvar AnglesUnitEnum;\n(function (AnglesUnitEnum) {\n AnglesUnitEnum["NONE"] = "none";\n AnglesUnitEnum["DEGREES"] = "deg";\n AnglesUnitEnum["GRADIANS"] = "grad";\n AnglesUnitEnum["RADIANS"] = "rad";\n AnglesUnitEnum["TURNS"] = "turn";\n})(AnglesUnitEnum || (AnglesUnitEnum = {}));\nvar ColorUnitEnum;\n(function (ColorUnitEnum) {\n ColorUnitEnum["NONE"] = "none";\n ColorUnitEnum["PERCENT"] = "percent";\n})(ColorUnitEnum || (ColorUnitEnum = {}));\nvar CMYKFunctionEnum;\n(function (CMYKFunctionEnum) {\n CMYKFunctionEnum["DEVICE_CMYK"] = "device-cmyk";\n CMYKFunctionEnum["CMYK"] = "cmyk";\n})(CMYKFunctionEnum || (CMYKFunctionEnum = {}));\n\n;// CONCATENATED MODULE: ./src/constants/options.ts\n\n\nconst DEFAULT_OPTIONS = {\n decimals: MAX_DECIMALS,\n legacyCSS: false,\n spacesAfterCommas: false,\n anglesUnit: AnglesUnitEnum.NONE,\n rgbUnit: ColorUnitEnum.NONE,\n labUnit: ColorUnitEnum.NONE,\n cmykUnit: ColorUnitEnum.PERCENT,\n alphaUnit: ColorUnitEnum.NONE,\n cmykFunction: CMYKFunctionEnum.DEVICE_CMYK\n};\n\n;// CONCATENATED MODULE: ./src/constants/index.ts\n\n\n\n\n\n\n\n;// CONCATENATED MODULE: ./src/helpers/index.ts\n\n\nconst hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nconst percentNumber = (percent) => {\n return +`${percent}`.replace(PCENT, \'$1\');\n};\nconst percent = (percent) => PCENT.test(`${percent}`)\n ? percentNumber(percent)\n : Math.min(+percent, 100);\nconst getDEC = (hex) => {\n if (hex.length === 1) {\n hex += hex;\n }\n return parseInt(hex, 16);\n};\nconst getHEX = (number) => {\n const hex = round(number, 0).toString(16).toUpperCase();\n if (hex.length === 1) {\n return `0x0${hex}`;\n }\n return `0x${hex}`;\n};\nconst toHEX = (h) => {\n let hex = round(h, 0).toString(16).toUpperCase();\n if (hex.length === 1) {\n hex = `0${hex}`;\n }\n return hex;\n};\nconst from255NumberToPercent = (value, decimals) => round(value / 255 * 100, decimals);\nconst from125NumberToPercent = (value, decimals) => round(value / 125 * 100, decimals);\nconst getBase255Number = (color, alpha = false) => {\n if (!alpha && PCENT.test(color)) {\n return Math.min(255 * percentNumber(color) / 100, 255);\n }\n if (HEX.test(color)) {\n if (color.length === 3) {\n color += color.slice(-1);\n }\n return alpha\n ? round(color) / 255\n : round(color);\n }\n return Math.min(+color, alpha ? 1 : 255);\n};\nconst getBase125Number = (color) => {\n if (PCENT.test(color)) {\n return minmax(125 * percentNumber(color) / 100, -125, 125);\n }\n return minmax(+color, -125, 125);\n};\nconst getCMYKNumber = (color) => Math.min(PCENT.test(color) ? percentNumber(color) / 100 : +color, 1);\nconst getOrderedArrayString = (keys) => [...keys].sort().join(\'\').toUpperCase();\nconst round = (value, decimals = MAX_DECIMALS) => {\n const exp = Math.pow(10, decimals);\n return Math.round(+value * exp) / exp;\n};\nconst minmax = (n, min, max) => Math.max(min, Math.min(n, max));\nconst degrees = (radian) => radian * 180 / Math.PI;\nconst radians = (degrees) => degrees * Math.PI / 180;\nconst pi2 = 360;\nconst normalizeHue = (hue) => {\n if (typeof hue === \'string\') {\n const matches = hue.match(HSL_HUE);\n const value = +matches[1];\n const units = matches[2];\n switch (units) {\n case AnglesUnitEnum.RADIANS:\n hue = round(degrees(value));\n break;\n case AnglesUnitEnum.TURNS:\n hue = round(value * pi2);\n break;\n case AnglesUnitEnum.GRADIANS:\n hue = round(9 / 10 * value);\n break;\n case AnglesUnitEnum.DEGREES:\n default:\n hue = value;\n }\n }\n if (hue > 360 || hue < 0) {\n hue -= Math.floor(hue / pi2) * pi2;\n }\n return hue;\n};\nconst translateDegrees = (degrees, units) => {\n let hue;\n switch (units) {\n case AnglesUnitEnum.RADIANS:\n hue = round(radians(degrees));\n break;\n case AnglesUnitEnum.TURNS:\n hue = round(degrees / pi2);\n break;\n case AnglesUnitEnum.GRADIANS:\n hue = round(10 / 9 * degrees);\n break;\n case AnglesUnitEnum.DEGREES:\n case AnglesUnitEnum.NONE:\n default:\n hue = degrees;\n }\n return hue;\n};\nconst getOptionsFromColorInput = (options, ...colors) => {\n const cssColors = [];\n const hslColors = [];\n const rgbColors = [];\n const labColors = [];\n const cmykColors = [];\n const alphaValues = [];\n const anglesUnitValues = Object.values(AnglesUnitEnum);\n const colorUnitValues = Object.values(ColorUnitEnum);\n const cmykFunctionValues = Object.values(CMYKFunctionEnum);\n const matchOptions = {\n legacyCSS: 0,\n spacesAfterCommas: 0,\n cmykFunction: 0\n };\n for (const color of colors) {\n if (typeof color === \'string\') {\n cssColors.push(color);\n if (color.includes(\',\')) {\n matchOptions.legacyCSS++;\n const commasWithNextCharacter = color.match(COMMAS_AND_NEXT_CHARS);\n if (new Set(commasWithNextCharacter).size === 1 &&\n SPACES.test(commasWithNextCharacter[0].slice(1))) {\n matchOptions.spacesAfterCommas++;\n }\n }\n if (color.match(COLORREGS.HSL)) {\n const match = color.match(COLORREGS.HSL);\n const angle = match[1] || match[5];\n const alpha = match[8];\n const angleUnit = angle.match(HSL_HUE)[2];\n hslColors.push(angleUnit === \'\'\n ? AnglesUnitEnum.NONE\n : angleUnit);\n alphaValues.push(PCENT.test(alpha));\n continue;\n }\n if (COLORREGS.RGB.test(color)) {\n const match = color.match(COLORREGS.RGB);\n const R = match[1] || match[5];\n const G = match[2] || match[6];\n const B = match[3] || match[7];\n const A = match[8];\n rgbColors.push(PCENT.test(R) &&\n PCENT.test(G) &&\n PCENT.test(B));\n alphaValues.push(PCENT.test(A));\n continue;\n }\n if (COLORREGS.CIELab.test(color)) {\n const match = color.match(COLORREGS.CIELab);\n const L = match[1];\n const a = match[2];\n const b = match[3];\n const A = match[4];\n labColors.push(PCENT.test(L) &&\n PCENT.test(a) &&\n PCENT.test(b));\n alphaValues.push(PCENT.test(A));\n continue;\n }\n if (color.match(COLORREGS.CMYK)) {\n const match = color.match(COLORREGS.CMYK);\n const C = match[1] || match[6];\n const M = match[2] || match[7];\n const Y = match[3] || match[8];\n const K = match[4] || match[9];\n const A = match[10];\n cmykColors.push(PCENT.test(C) &&\n PCENT.test(M) &&\n PCENT.test(Y) &&\n PCENT.test(K));\n if (color.startsWith(\'cmyk\')) {\n matchOptions.cmykFunction++;\n }\n alphaValues.push(PCENT.test(A));\n }\n }\n }\n return {\n decimals: typeof options.decimals === TypeOf.NUMBER\n ? options.decimals\n : DEFAULT_OPTIONS.decimals,\n legacyCSS: typeof options.legacyCSS === TypeOf.BOOLEAN\n ? options.legacyCSS\n : Boolean(cssColors.length &&\n matchOptions.legacyCSS === cssColors.length) || DEFAULT_OPTIONS.legacyCSS,\n spacesAfterCommas: typeof options.spacesAfterCommas === TypeOf.BOOLEAN\n ? options.spacesAfterCommas\n : Boolean(cssColors.length &&\n matchOptions.spacesAfterCommas === cssColors.length) || DEFAULT_OPTIONS.spacesAfterCommas,\n anglesUnit: options.anglesUnit && anglesUnitValues.includes(options.anglesUnit)\n ? options.anglesUnit\n : (new Set(hslColors).size === 1\n ? hslColors[0]\n : DEFAULT_OPTIONS.anglesUnit),\n rgbUnit: options.rgbUnit && colorUnitValues.includes(options.rgbUnit)\n ? options.rgbUnit\n : (new Set(rgbColors).size === 1 && rgbColors[0]\n ? ColorUnitEnum.PERCENT\n : DEFAULT_OPTIONS.rgbUnit),\n labUnit: options.labUnit && colorUnitValues.includes(options.labUnit)\n ? options.labUnit\n : (new Set(labColors).size === 1 && labColors[0]\n ? ColorUnitEnum.PERCENT\n : DEFAULT_OPTIONS.labUnit),\n cmykUnit: options.cmykUnit && colorUnitValues.includes(options.cmykUnit)\n ? options.cmykUnit\n : (new Set(cmykColors).size === 1 && !cmykColors[0]\n ? ColorUnitEnum.NONE\n : DEFAULT_OPTIONS.cmykUnit),\n alphaUnit: options.alphaUnit && colorUnitValues.includes(options.alphaUnit)\n ? options.alphaUnit\n : (new Set(alphaValues).size === 1 && alphaValues[0]\n ? ColorUnitEnum.PERCENT\n : DEFAULT_OPTIONS.alphaUnit),\n cmykFunction: options.cmykFunction && cmykFunctionValues.includes(options.cmykFunction)\n ? options.cmykFunction\n : (cmykColors.length && cmykColors.length === matchOptions.cmykFunction\n ? CMYKFunctionEnum.CMYK\n : DEFAULT_OPTIONS.cmykFunction)\n };\n};\nconst isHarmony = (param) => {\n return `${param}` in Harmony;\n};\nconst isMix = (param) => {\n return `${param}` in Mix;\n};\n\n;// CONCATENATED MODULE: ./src/color/translators.ts\n\nconst MATRIX_LRGB_XYZ_D50 = [\n [0.4360747, 0.3850649, 0.1430804],\n [0.2225045, 0.7168786, 0.0606169],\n [0.0139322, 0.0971045, 0.7141733]\n];\nconst MATRIX_XYZ_D50_LRGB = [\n [3.1338561, -1.6168667, -0.4906146],\n [-0.9787684, 1.9161415, 0.033454],\n [0.0719453, -0.2289914, 1.4052427]\n];\nconst TRISTIMULUS_D50 = MATRIX_LRGB_XYZ_D50.map((matrix) => {\n return matrix.reduce((sum, value) => sum + value, 0);\n});\nconst hueToRGB = (t1, t2, hue) => {\n if (hue < 0) {\n hue += 6;\n }\n if (hue >= 6) {\n hue -= 6;\n }\n if (hue < 1) {\n return round(((t2 - t1) * hue + t1) * 255);\n }\n else if (hue < 3) {\n return round(t2 * 255);\n }\n else if (hue < 4) {\n return round(((t2 - t1) * (4 - hue) + t1) * 255);\n }\n else {\n return round(t1 * 255);\n }\n};\nconst rgbToLinearLightRGB = (value) => {\n return value <= 0.04045\n ? value / 12.92\n : ((value + 0.055) / 1.055) ** 2.4;\n};\nconst linearLightRGBToRGB = (value) => {\n return value <= 0.0031308\n ? 12.92 * value\n : 1.055 * (value ** (1 / 2.4)) - 0.055;\n};\nconst matrixVectorMultiplication = (v1, v2, v3, matrix) => {\n const result = [0, 0, 0];\n const linearRGB = [v1, v2, v3];\n matrix.forEach((array, index) => {\n array.forEach((value, mindex) => {\n result[index] += value * linearRGB[mindex];\n });\n });\n return result;\n};\nconst from_CIE_XYZ_D50_to_CIE_LAB = (x, y, z) => {\n const f = (t) => {\n return t > (6 / 29) ** 3\n ? Math.cbrt(t)\n : t / (3 * (6 / 29) ** 2) + (4 / 29);\n };\n const fx = f(x / TRISTIMULUS_D50[0]);\n const fy = f(y / TRISTIMULUS_D50[1]);\n const fz = f(z / TRISTIMULUS_D50[2]);\n return [\n 116 * fy - 16,\n 500 * (fx - fy),\n 200 * (fy - fz)\n ];\n};\nconst from_CIE_LAB_to_CIE_XYZ_D50 = (L, a, b) => {\n const f = (t) => {\n return t > 6 / 29\n ? t ** 3\n : 3 * (6 / 29) ** 2 * (t - 4 / 29);\n };\n const fl = (L + 16) / 116;\n const fa = a / 500;\n const fb = b / 200;\n return [\n TRISTIMULUS_D50[0] * f(fl + fa),\n TRISTIMULUS_D50[1] * f(fl),\n TRISTIMULUS_D50[2] * f(fl - fb)\n ];\n};\nconst hslToRGB = (H, S, L) => {\n H /= 60;\n S /= 100;\n L /= 100;\n const t2 = (L <= .5)\n ? L * (S + 1)\n : L + S - (L * S);\n const t1 = L * 2 - t2;\n const R = hueToRGB(t1, t2, H + 2);\n const G = hueToRGB(t1, t2, H);\n const B = hueToRGB(t1, t2, H - 2);\n return { R, G, B };\n};\nconst rgbToHSL = (R, G, B, A = 1) => {\n R /= 255;\n G /= 255;\n B /= 255;\n A = Math.min(A, 1);\n const MAX = Math.max(R, G, B);\n const MIN = Math.min(R, G, B);\n const D = MAX - MIN;\n let H = 0;\n let S = 0;\n const L = (MAX + MIN) / 2;\n if (D !== 0) {\n switch (MAX) {\n case R:\n H = ((G - B) / D) % 6;\n break;\n case G:\n H = (B - R) / D + 2;\n break;\n case B:\n H = (R - G) / D + 4;\n break;\n }\n H = round(H * 60);\n if (H < 0) {\n H += 360;\n }\n S = D / (1 - Math.abs(2 * L - 1));\n }\n return {\n H,\n S: round(S * 100),\n L: round(L * 100),\n A\n };\n};\nconst rgbToLab = (R, G, B) => {\n const LINEAR_LIGHT_RGB = [\n R / 255,\n G / 255,\n B / 255\n ].map(rgbToLinearLightRGB);\n const CIE_XYZ_D50 = matrixVectorMultiplication(LINEAR_LIGHT_RGB[0], LINEAR_LIGHT_RGB[1], LINEAR_LIGHT_RGB[2], MATRIX_LRGB_XYZ_D50);\n const CIE_LAB = from_CIE_XYZ_D50_to_CIE_LAB(CIE_XYZ_D50[0], CIE_XYZ_D50[1], CIE_XYZ_D50[2]);\n return {\n L: CIE_LAB[0],\n a: CIE_LAB[1],\n b: CIE_LAB[2]\n };\n};\nconst labToRgb = (L, a, b) => {\n const CIE_XYZ_D50 = from_CIE_LAB_to_CIE_XYZ_D50(L, a, b);\n const LINEAR_LIGHT_RGB = matrixVectorMultiplication(CIE_XYZ_D50[0], CIE_XYZ_D50[1], CIE_XYZ_D50[2], MATRIX_XYZ_D50_LRGB);\n const RGB = LINEAR_LIGHT_RGB.map(linearLightRGBToRGB);\n return {\n R: minmax(RGB[0] * 255, 0, 255),\n G: minmax(RGB[1] * 255, 0, 255),\n B: minmax(RGB[2] * 255, 0, 255)\n };\n};\nconst cmykToRGB = (C, M, Y, K) => {\n K = 1 - K;\n const R = round(255 * (1 - C) * K);\n const G = round(255 * (1 - M) * K);\n const B = round(255 * (1 - Y) * K);\n return { R, G, B };\n};\nconst rgbToCMYK = (R, G, B) => {\n R /= 255;\n G /= 255;\n B /= 255;\n const K = 1 - Math.max(R, G, B);\n const K1 = 1 - K;\n const C = K1 && (K1 - R) / K1;\n const M = K1 && (K1 - G) / K1;\n const Y = K1 && (K1 - B) / K1;\n return {\n C: round(C * 100),\n M: round(M * 100),\n Y: round(Y * 100),\n K: round(K * 100)\n };\n};\nconst rgbToRYB = (R, G, B) => {\n const Iw = Math.min(R, G, B);\n const Ib = Math.min(255 - R, 255 - G, 255 - B);\n const rRGB = R - Iw;\n const gRGB = G - Iw;\n const bRGB = B - Iw;\n const minRG = Math.min(rRGB, gRGB);\n const rRYB = rRGB - minRG;\n const yRYB = (gRGB + minRG) / 2;\n const bRYB = (bRGB + gRGB - minRG) / 2;\n const n = Math.max(rRYB, yRYB, bRYB) / Math.max(rRGB, gRGB, bRGB);\n const N = isNaN(n) || n === Infinity || n <= 0 ? 1 : n;\n return {\n R: rRYB / N + Ib,\n Y: yRYB / N + Ib,\n B: bRYB / N + Ib\n };\n};\nconst rybToRGB = (R, Y, B) => {\n const Iw = Math.min(R, Y, B);\n const Ib = Math.min(255 - R, 255 - Y, 255 - B);\n const rRYB = R - Iw;\n const yRYB = Y - Iw;\n const bRYB = B - Iw;\n const minYB = Math.min(yRYB, bRYB);\n const rRGB = rRYB + yRYB - minYB;\n const gRGB = yRYB + minYB;\n const bRGB = 2 * (bRYB - minYB);\n const n = Math.max(rRGB, gRGB, bRGB) / Math.max(rRYB, yRYB, bRYB);\n const N = isNaN(n) || n === Infinity || n <= 0 ? 1 : n;\n return {\n R: rRGB / N + Ib,\n G: gRGB / N + Ib,\n B: bRGB / N + Ib\n };\n};\nconst hueRYB = (hue, toRYB) => {\n if (hue < 0)\n hue += 360;\n if (hue > 360)\n hue -= 360;\n if (hue === 360 || hue === 0)\n return hue;\n const map1 = [\n [0, 120],\n [120, 180],\n [180, 240],\n [240, 360]\n ];\n const map2 = [\n [0, 60],\n [60, 120],\n [120, 240],\n [240, 360]\n ];\n const from = toRYB ? map1 : map2;\n const to = toRYB ? map2 : map1;\n let A = 0;\n let B = 0;\n let C = 0;\n let D = 0;\n from.find((arr, index) => {\n if (hue >= arr[0] && hue < arr[1]) {\n A = arr[0];\n B = arr[1];\n C = to[index][0];\n D = to[index][1];\n return true;\n }\n return false;\n });\n return C + (hue - A) * ((D - C) / (B - A));\n};\n\n;// CONCATENATED MODULE: ./src/color/css.ts\n\n\n\nconst getComma = (withSpace) => withSpace\n ? \', \'\n : \',\';\nconst prepareColorForCss = (color, transformer) => {\n const props = getOrderedArrayString(Object.keys(color));\n const model = VALID_COLOR_OBJECTS[props];\n const keys = COLOR_PROPS[model];\n return keys.reduce((result, key, index) => {\n const value = color[key];\n if (typeof value !== \'undefined\') {\n result.push(transformer(value, index));\n }\n return result;\n }, []);\n};\nconst getResultFromTemplate = (template, vars) => {\n return template.replace(TEMPLATE_VAR, (__match, indexStr) => {\n const index = +indexStr - 1;\n return `${vars[index]}`;\n });\n};\nconst getAlpha = (value, options, ignoreLegacy = false) => {\n const { alphaUnit, legacyCSS, decimals } = options;\n if (alphaUnit === ColorUnitEnum.PERCENT &&\n (!legacyCSS ||\n ignoreLegacy)) {\n return `${round(value * 100, decimals)}%`;\n }\n return round(value, decimals);\n};\nconst CSS = {\n [ColorModel.HEX]: (color) => {\n const transformer = (value) => toHEX(round(value));\n const values = prepareColorForCss(color, transformer);\n const template = values.length === 4\n ? \'#{1}{2}{3}{4}\'\n : \'#{1}{2}{3}\';\n return getResultFromTemplate(template, values);\n },\n [ColorModel.RGB]: (color, options) => {\n const { decimals, legacyCSS, spacesAfterCommas, rgbUnit } = options;\n const comma = getComma(spacesAfterCommas);\n const transformer = (value, index) => {\n return rgbUnit === ColorUnitEnum.PERCENT && index < 3\n ? `${from255NumberToPercent(value, decimals)}%`\n : (index === 3\n ? getAlpha(value, options)\n : round(value, decimals));\n };\n const values = prepareColorForCss(color, transformer);\n const template = legacyCSS\n ? (values.length === 4\n ? `rgba({1}${comma}{2}${comma}{3}${comma}{4})`\n : `rgb({1}${comma}{2}${comma}{3})`)\n : (values.length === 4\n ? `rgb({1} {2} {3} / {4})`\n : `rgb({1} {2} {3})`);\n return getResultFromTemplate(template, values);\n },\n [ColorModel.HSL]: (color, options) => {\n const { decimals, legacyCSS, spacesAfterCommas, anglesUnit } = options;\n const comma = getComma(spacesAfterCommas);\n const transformer = (value, index) => {\n if (index === 0 &&\n anglesUnit !== AnglesUnitEnum.NONE) {\n const translated = round(translateDegrees(value, anglesUnit), decimals);\n return `${translated}${anglesUnit}`;\n }\n return index === 3\n ? getAlpha(value, options)\n : round(value, decimals);\n };\n const values = prepareColorForCss(color, transformer);\n const template = legacyCSS\n ? (values.length === 4\n ? `hsla({1}${comma}{2}%${comma}{3}%${comma}{4})`\n : `hsl({1}${comma}{2}%${comma}{3}%)`)\n : (values.length === 4\n ? `hsl({1} {2}% {3}% / {4})`\n : `hsl({1} {2}% {3}%)`);\n return getResultFromTemplate(template, values);\n },\n [ColorModel.CIELab]: (color, options) => {\n const { decimals, labUnit } = options;\n const transformer = (value, index) => {\n if (index === 0) {\n const L = round(percent(value), decimals);\n return labUnit === ColorUnitEnum.PERCENT\n ? `${L}%`\n : `${L}`;\n }\n if (index < 3) {\n return labUnit === ColorUnitEnum.PERCENT\n ? `${from125NumberToPercent(value, decimals)}%`\n : round(value, decimals);\n }\n return getAlpha(value, options, true);\n };\n const values = prepareColorForCss(color, transformer);\n const template = values.length === 4\n ? `lab({1} {2} {3} / {4})`\n : `lab({1} {2} {3})`;\n return getResultFromTemplate(template, values);\n },\n [ColorModel.CMYK]: (color, options) => {\n const { decimals, legacyCSS, spacesAfterCommas, cmykUnit, cmykFunction } = options;\n const comma = getComma(spacesAfterCommas);\n const transformer = (value, index) => {\n if (cmykUnit === ColorUnitEnum.PERCENT &&\n index < 4) {\n return `${round(value, decimals)}%`;\n }\n return index === 4\n ? getAlpha(value, options)\n : round(value / 100, decimals);\n };\n const values = prepareColorForCss(color, transformer);\n const template = legacyCSS\n ? (values.length === 5\n ? `${cmykFunction}({1}${comma}{2}${comma}{3}${comma}{4}${comma}{5})`\n : `${cmykFunction}({1}${comma}{2}${comma}{3}${comma}{4})`)\n : (values.length === 5\n ? `${cmykFunction}({1} {2} {3} {4} / {5})`\n : `${cmykFunction}({1} {2} {3} {4})`);\n return getResultFromTemplate(template, values);\n }\n};\n\n;// CONCATENATED MODULE: ./src/color/utils.ts\n\n\n\n\nconst normalizeAlpha = (alpha) => {\n if (typeof alpha === \'string\') {\n if (PCENT.test(alpha)) {\n alpha = percentNumber(alpha) / 100;\n }\n else {\n alpha = +alpha;\n }\n }\n return (isNaN(+alpha) || alpha > 1) ? 1 : round(alpha);\n};\nconst harmony = (color, angles, mode) => angles.reduce((arr, num) => ([\n ...arr,\n {\n ...color,\n H: mode === Mix.ADDITIVE\n ? normalizeHue(color.H + num)\n : normalizeHue(hueRYB(hueRYB(color.H, false) + num, true))\n }\n]), [{ ...color }]);\nconst analogous = (color, mode) => harmony(color, [30, -30], mode);\nconst complementary = (color, mode) => harmony(color, [180], mode);\nconst splitComplementary = (color, mode) => harmony(color, [150, -150], mode);\nconst triadic = (color, mode) => harmony(color, [120, -120], mode);\nconst tetradic = (color, mode) => harmony(color, [60, -120, 180], mode);\nconst square = (color, mode) => harmony(color, [90, -90, 180], mode);\nconst getColorModelFromString = (color) => {\n let model;\n Object.keys(ColorModel).some((p) => {\n const reg = COLORREGS[p];\n if (reg.test(color)) {\n model = p;\n return true;\n }\n });\n if (!model &&\n !!~COLOR_KEYS.indexOf(color)) {\n model = ColorModel.HEX;\n }\n if (!model) {\n throw new Error(ERRORS.NOT_ACCEPTED_STRING_INPUT);\n }\n return model;\n};\nconst getColorModelFromObject = (color) => {\n let model;\n let invalid = false;\n const props = getOrderedArrayString(Object.keys(color));\n if (VALID_COLOR_OBJECTS[props]) {\n model = VALID_COLOR_OBJECTS[props];\n }\n if (model && model === ColorModel.RGB) {\n const hasInvalidHex = Object.entries(color).some((item) => {\n return !HEX.test(`${item[1]}`);\n });\n const hasInvalidRegb = Object.entries(color).some((item) => {\n return !(PCENT.test(`${item[1]}`) ||\n (!HEX.test(`${item[1]}`) &&\n !isNaN(+item[1]) &&\n +item[1] <= 255));\n });\n if (hasInvalidHex && hasInvalidRegb) {\n invalid = true;\n }\n if (!hasInvalidHex) {\n model = ColorModel.HEX;\n }\n }\n if (!model || invalid) {\n throw new Error(ERRORS.NOT_ACCEPTED_OBJECT_INPUT);\n }\n return model;\n};\nconst getColorModel = (color) => typeof color === \'string\'\n ? getColorModelFromString(color)\n : getColorModelFromObject(color);\nconst getRGBObjectFromString = {\n [ColorModel.HEX](color) {\n const colorStr = !~COLOR_KEYS.indexOf(color)\n ? color\n : ColorKeywords[color];\n const match = colorStr.match(COLORREGS.HEX);\n const object = {\n R: getDEC(match[1] || match[5]),\n G: getDEC(match[2] || match[6]),\n B: getDEC(match[3] || match[7])\n };\n const A = match[4] || match[8];\n if (A !== undefined) {\n object.A = getDEC(A) / 255;\n }\n return object;\n },\n [ColorModel.RGB](color) {\n const match = color.match(COLORREGS.RGB);\n const R = getBase255Number(match[1] || match[5]);\n const G = getBase255Number(match[2] || match[6]);\n const B = getBase255Number(match[3] || match[7]);\n const A = match[4] || match[8];\n const object = {\n R: Math.min(R, 255),\n G: Math.min(G, 255),\n B: Math.min(B, 255)\n };\n if (A !== undefined) {\n object.A = normalizeAlpha(A);\n }\n return object;\n },\n [ColorModel.HSL](color) {\n const match = color.match(COLORREGS.HSL);\n const H = normalizeHue(match[1] || match[5]);\n const S = percent(match[2] || match[6]);\n const L = percent(match[3] || match[7]);\n const A = match[4] || match[8];\n const RGB = hslToRGB(H, S, L);\n if (A !== undefined) {\n RGB.A = normalizeAlpha(A);\n }\n return RGB;\n },\n [ColorModel.CIELab](color) {\n const match = color.match(COLORREGS.CIELab);\n const L = percent(match[1]);\n const a = getBase125Number(match[2]);\n const b = getBase125Number(match[3]);\n const A = match[4];\n const RGB = labToRgb(L, a, b);\n if (A !== undefined) {\n RGB.A = normalizeAlpha(A);\n }\n return RGB;\n },\n [ColorModel.CMYK](color) {\n const match = color.match(COLORREGS.CMYK);\n const C = getCMYKNumber(match[1] || match[6]);\n const M = getCMYKNumber(match[2] || match[7]);\n const Y = getCMYKNumber(match[3] || match[8]);\n const K = getCMYKNumber(match[4] || match[9]);\n const A = match[5] || match[10];\n const RGB = cmykToRGB(C, M, Y, K);\n if (A !== undefined) {\n RGB.A = normalizeAlpha(A);\n }\n return RGB;\n }\n};\nconst getRGBObjectFromObject = {\n [ColorModel.HEX](color) {\n const object = {\n R: getBase255Number(`${color.R}`),\n G: getBase255Number(`${color.G}`),\n B: getBase255Number(`${color.B}`)\n };\n if (hasProp(color, \'A\')) {\n object.A = Math.min(getBase255Number(`${color.A}`, true), 1);\n }\n return object;\n },\n [ColorModel.RGB](color) {\n return this.HEX(color);\n },\n [ColorModel.HSL](color) {\n const S = percent(`${color.S}`);\n const L = percent(`${color.L}`);\n const RGB = hslToRGB(normalizeHue(color.H), S, L);\n if (hasProp(color, \'A\')) {\n RGB.A = normalizeAlpha(color.A);\n }\n return RGB;\n },\n [ColorModel.CIELab](color) {\n const L = percent(`${color.L}`);\n const a = getBase125Number(`${color.a}`);\n const b = getBase125Number(`${color.b}`);\n const RGB = labToRgb(L, a, b);\n if (hasProp(color, \'A\')) {\n RGB.A = normalizeAlpha(color.A);\n }\n return RGB;\n },\n [ColorModel.CMYK](color) {\n const C = getCMYKNumber(`${color.C}`);\n const M = getCMYKNumber(`${color.M}`);\n const Y = getCMYKNumber(`${color.Y}`);\n const K = getCMYKNumber(`${color.K}`);\n const RGB = cmykToRGB(C, M, Y, K);\n if (hasProp(color, \'A\')) {\n RGB.A = normalizeAlpha(color.A);\n }\n return RGB;\n }\n};\nconst getRGBObject = (color, model = getColorModel(color)) => {\n return typeof color === \'string\'\n ? getRGBObjectFromString[model](color)\n : getRGBObjectFromObject[model](color);\n};\nconst translateColor = {\n [ColorModel.HEX](color) {\n return {\n R: getHEX(color.R),\n G: getHEX(color.G),\n B: getHEX(color.B)\n };\n },\n HEXA(color) {\n const RGB = translateColor.HEX(color);\n RGB.A = hasProp(color, \'A\')\n ? getHEX(color.A * 255)\n : \'0xFF\';\n return RGB;\n },\n [ColorModel.RGB](color, decimals) {\n const RGB = roundRGBObject(color, decimals);\n if (hasProp(RGB, \'A\')) {\n delete RGB.A;\n }\n return RGB;\n },\n RGBA(color, decimals) {\n const RGB = translateColor.RGB(color, decimals);\n RGB.A = hasProp(color, \'A\')\n ? round(color.A)\n : 1;\n return RGB;\n },\n [ColorModel.HSL](color, decimals) {\n const HSL = rgbToHSL(color.R, color.G, color.B);\n delete HSL.A;\n return roundHSLObject(HSL, decimals);\n },\n HSLA(color, decimals) {\n const HSL = translateColor.HSL(color, decimals);\n HSL.A = hasProp(color, \'A\')\n ? round(color.A, decimals)\n : 1;\n return HSL;\n },\n [ColorModel.CIELab](color, decimals) {\n const Lab = rgbToLab(color.R, color.G, color.B);\n return roundCIELabObject(Lab, decimals);\n },\n CIELabA(color, decimals) {\n const Lab = translateColor.CIELab(color, decimals);\n Lab.A = hasProp(color, \'A\')\n ? round(color.A, decimals)\n : 1;\n return Lab;\n },\n [ColorModel.CMYK](color, decimals) {\n return roundCMYKObject(rgbToCMYK(color.R, color.G, color.B), decimals);\n },\n CMYKA(color, decimals) {\n const CMYK = translateColor.CMYK(color, decimals);\n CMYK.A = hasProp(color, \'A\')\n ? round(color.A, decimals)\n : 1;\n return CMYK;\n }\n};\nconst blend = (from, to, steps) => {\n const div = steps - 1;\n const diffR = (to.R - from.R) / div;\n const diffG = (to.G - from.G) / div;\n const diffB = (to.B - from.B) / div;\n const fromA = normalizeAlpha(from.A);\n const toA = normalizeAlpha(to.A);\n const diffA = (toA - fromA) / div;\n return Array(steps).fill(null).map((__n, i) => {\n if (i === 0) {\n return from;\n }\n if (i === div) {\n return to;\n }\n return {\n R: round(from.R + diffR * i),\n G: round(from.G + diffG * i),\n B: round(from.B + diffB * i),\n A: round(fromA + diffA * i)\n };\n });\n};\nconst getColorMixture = (color, steps, shades, options) => {\n const model = getColorModel(color);\n const isCSS = typeof color === \'string\';\n const RGB = getRGBObject(color, model);\n const hasAlpha = ((typeof color === \'string\' && hasProp(RGB, \'A\')) ||\n (typeof color !== \'string\' && hasProp(color, \'A\')));\n const HSL = rgbToHSL(RGB.R, RGB.G, RGB.B, RGB.A);\n if (!hasAlpha)\n delete HSL.A;\n const increment = shades\n ? HSL.L / (steps + 1)\n : (100 - HSL.L) / (steps + 1);\n const hslMap = Array(steps).fill(null).map((__n, i) => ({\n ...HSL,\n L: HSL.L + increment * (i + 1) * (1 - +shades * 2)\n }));\n switch (model) {\n case ColorModel.HEX:\n default:\n return hslMap.map((HSLColor) => {\n const RGBColor = hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L);\n if (hasAlpha)\n RGBColor.A = HSLColor.A;\n return isCSS\n ? hasAlpha\n ? CSS.HEX({\n ...RGBColor,\n A: round(RGBColor.A * 255)\n })\n : CSS.HEX(RGBColor)\n : hasAlpha\n ? translateColor.HEXA(RGBColor)\n : translateColor.HEX(RGBColor);\n });\n case ColorModel.RGB:\n return hslMap.map((HSLColor) => {\n const RGBColor = hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L);\n if (hasAlpha)\n RGBColor.A = HSLColor.A;\n return isCSS\n ? CSS.RGB(RGBColor, options)\n : hasAlpha\n ? translateColor.RGBA(RGBColor, options.decimals)\n : translateColor.RGB(RGBColor, options.decimals);\n });\n case ColorModel.HSL:\n return hslMap.map((HSLColor) => {\n return isCSS\n ? CSS.HSL(HSLColor, options)\n : hasAlpha\n ? translateColor.HSLA({\n ...hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L),\n A: HSLColor.A\n }, options.decimals)\n : translateColor.HSL(hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L), options.decimals);\n });\n case ColorModel.CIELab:\n return hslMap.map((HSLColor) => {\n const RGBColor = hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L);\n return isCSS\n ? CSS.CIELab(hasAlpha\n ? translateColor.CIELabA(RGBColor, options.decimals)\n : translateColor.CIELab(RGBColor, options.decimals), options)\n : hasAlpha\n ? translateColor.CIELabA({\n ...RGBColor,\n A: HSLColor.A\n }, options.decimals)\n : translateColor.CIELab(RGBColor, options.decimals);\n });\n }\n};\nconst colorHarmony = {\n buildHarmony(color, harmonyFunction, mode, options) {\n const model = getColorModel(color);\n const RGB = getRGBObject(color, model);\n const HSL = rgbToHSL(RGB.R, RGB.G, RGB.B, RGB.A);\n const hasAlpha = ((typeof color === \'string\' && hasProp(RGB, \'A\')) ||\n (typeof color !== \'string\' && hasProp(color, \'A\')));\n const isCSS = typeof color === \'string\';\n switch (model) {\n case ColorModel.HEX:\n default:\n return hasAlpha\n ? this.HEXA(roundHSLObject(HSL, 0), harmonyFunction, mode, isCSS)\n : this.HEX(roundHSLObject(HSL, 0), harmonyFunction, mode, isCSS);\n case ColorModel.HSL:\n return hasAlpha\n ? this.HSLA(HSL, harmonyFunction, mode, isCSS, options)\n : this.HSL(HSL, harmonyFunction, mode, isCSS, options);\n case ColorModel.RGB:\n return hasAlpha\n ? this.RGBA(HSL, harmonyFunction, mode, isCSS, options)\n : this.RGB(HSL, harmonyFunction, mode, isCSS, options);\n case ColorModel.CIELab:\n return hasAlpha\n ? this.CIELabA(HSL, harmonyFunction, mode, isCSS, options)\n : this.CIELab(HSL, harmonyFunction, mode, isCSS, options);\n }\n },\n [ColorModel.HEX](color, harmonyFunction, mode, css) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.HEX(hslToRGB(c.H, c.S, c.L))\n : translateColor.HEX(hslToRGB(c.H, c.S, c.L))));\n },\n HEXA(color, harmonyFunction, mode, css) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.HEX({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A) * 255\n })\n : translateColor.HEXA({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A)\n })));\n },\n [ColorModel.RGB](color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.RGB(hslToRGB(c.H, c.S, c.L), options)\n : translateColor.RGB(hslToRGB(c.H, c.S, c.L), options.decimals)));\n },\n RGBA(color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.RGB({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A)\n }, options)\n : translateColor.RGBA({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A)\n }, options.decimals)));\n },\n [ColorModel.HSL](color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.HSL({\n H: c.H,\n S: c.S,\n L: c.L\n }, options)\n : translateColor.HSL(hslToRGB(c.H, c.S, c.L), options.decimals)));\n },\n HSLA(color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.HSL({\n ...c,\n A: normalizeAlpha(c.A)\n }, options)\n : translateColor.HSLA({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A)\n }, options.decimals)));\n },\n [ColorModel.CIELab](color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => {\n const RGB = hslToRGB(c.H, c.S, c.L);\n return (css\n ? CSS.CIELab(rgbToLab(RGB.R, RGB.G, RGB.B), options)\n : translateColor.CIELab(RGB, options.decimals));\n });\n },\n CIELabA(color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => {\n const RGB = hslToRGB(c.H, c.S, c.L);\n return (css\n ? CSS.CIELab({\n ...rgbToLab(RGB.R, RGB.G, RGB.B),\n A: normalizeAlpha(c.A)\n }, options)\n : translateColor.CIELabA({\n ...RGB,\n A: normalizeAlpha(c.A)\n }, options.decimals));\n });\n }\n};\nconst colorMixer = {\n mix(colors, mode) {\n const rgbMap = colors.map((color) => {\n const model = getColorModel(color);\n return getRGBObject(color, model);\n });\n const rybMap = mode === Mix.SUBTRACTIVE\n ? rgbMap.map((color) => {\n const RYB = rgbToRYB(color.R, color.G, color.B);\n if (hasProp(color, \'A\')) {\n RYB.A = color.A;\n }\n return RYB;\n })\n : null;\n function createMix(items) {\n const initial = mode === Mix.ADDITIVE\n ? { R: 0, G: 0, B: 0, A: 0 }\n : { R: 0, Y: 0, B: 0, A: 0 };\n return items.reduce((mix, color) => {\n const colorA = hasProp(color, \'A\') ? color.A : 1;\n const common = {\n R: Math.min(mix.R + color.R * colorA, 255),\n B: Math.min(mix.B + color.B * colorA, 255),\n A: 1 - (1 - colorA) * (1 - mix.A)\n };\n const mixGY = \'G\' in mix\n ? mix.G\n : mix.Y;\n const colorGY = \'G\' in color\n ? color.G\n : color.Y;\n return {\n ...common,\n ...(mode === Mix.ADDITIVE\n ? { G: Math.min(mixGY + colorGY * colorA, 255) }\n : { Y: Math.min(mixGY + colorGY * colorA, 255) })\n };\n }, initial);\n }\n let mix;\n if (mode === Mix.ADDITIVE) {\n mix = createMix(rgbMap);\n }\n else {\n const RYB = createMix(rybMap);\n mix = rybToRGB(RYB.R, RYB.Y, RYB.B);\n mix.A = RYB.A;\n }\n return {\n R: round(mix.R),\n G: round(mix.G),\n B: round(mix.B),\n A: minmax(mix.A, 0, 1)\n };\n },\n [ColorModel.HEX](colors, mode, css) {\n const mix = this.mix(colors, mode);\n delete mix.A;\n return (css\n ? CSS.HEX(mix)\n : translateColor.HEX(mix));\n },\n HEXA(colors, mode, css) {\n const mix = this.mix(colors, mode);\n mix.A = css\n ? normalizeAlpha(mix.A) * 255\n : normalizeAlpha(mix.A);\n return (css\n ? CSS.HEX(mix)\n : translateColor.HEXA(mix));\n },\n [ColorModel.RGB](colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n delete mix.A;\n return (css\n ? CSS.RGB(mix, options)\n : translateColor.RGB(mix, options.decimals));\n },\n RGBA(colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n return (css\n ? CSS.RGB(mix, options)\n : translateColor.RGBA(mix, options.decimals));\n },\n [ColorModel.HSL](colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n const HSL = rgbToHSL(mix.R, mix.G, mix.B);\n delete mix.A;\n delete HSL.A;\n return (css\n ? CSS.HSL(HSL, options)\n : translateColor.HSL(mix, options.decimals));\n },\n HSLA(colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n const HSL = rgbToHSL(mix.R, mix.G, mix.B, mix.A);\n return (css\n ? CSS.HSL(HSL, options)\n : translateColor.HSLA(mix, options.decimals));\n },\n [ColorModel.CIELab](colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n const Lab = rgbToLab(mix.R, mix.G, mix.B);\n delete mix.A;\n return (css\n ? CSS.CIELab(Lab, options)\n : translateColor.CIELabA(mix, options.decimals));\n },\n CIELabA(colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n const Lab = rgbToLab(mix.R, mix.G, mix.B);\n if (hasProp(mix, \'A\')) {\n Lab.A = mix.A;\n }\n return (css\n ? CSS.CIELab(Lab, options)\n : translateColor.CIELabA(mix, options.decimals));\n }\n};\nconst roundRGBObject = (color, decimals) => {\n const R = round(color.R, decimals);\n const G = round(color.G, decimals);\n const B = round(color.B, decimals);\n return {\n R,\n G,\n B,\n ...(hasProp(color, \'A\')\n ? {\n A: round(color.A, decimals)\n }\n : {})\n };\n};\nconst roundHSLObject = (color, decimals) => {\n return {\n H: round(color.H, decimals),\n S: round(color.S, decimals),\n L: round(color.L, decimals),\n ...(hasProp(color, \'A\')\n ? {\n A: round(color.A, decimals)\n }\n : {})\n };\n};\nconst roundCIELabObject = (color, decimals) => {\n return {\n L: round(color.L, decimals),\n a: round(color.a, decimals),\n b: round(color.b, decimals)\n };\n};\nconst roundCMYKObject = (color, decimals) => {\n return {\n C: round(color.C, decimals),\n M: round(color.M, decimals),\n Y: round(color.Y, decimals),\n K: round(color.K, decimals)\n };\n};\n\n;// CONCATENATED MODULE: ./src/index.ts\n\n\n\n\n\nconst getColorReturn = (color, model, decimals, translateFunction) => {\n const rgbObject = getRGBObject(color, model);\n return translateFunction(rgbObject, decimals);\n};\nconst getBlendReturn = (from, to, steps, decimals, translateFunction) => {\n if (steps < 1)\n steps = DEFAULT_BLEND_STEPS;\n const fromRGBObject = getRGBObject(from);\n const toRGBObject = getRGBObject(to);\n const blendArray = blend(fromRGBObject, toRGBObject, steps);\n return blendArray.map((color) => {\n return translateFunction(color, decimals);\n });\n};\nconst getHarmonyReturn = (harmony, color, mode, options) => {\n return ({\n [Harmony.ANALOGOUS]: colorHarmony.buildHarmony(color, analogous, mode, options),\n [Harmony.COMPLEMENTARY]: colorHarmony.buildHarmony(color, complementary, mode, options),\n [Harmony.SPLIT_COMPLEMENTARY]: colorHarmony.buildHarmony(color, splitComplementary, mode, options),\n [Harmony.TRIADIC]: colorHarmony.buildHarmony(color, triadic, mode, options),\n [Harmony.TETRADIC]: colorHarmony.buildHarmony(color, tetradic, mode, options),\n [Harmony.SQUARE]: colorHarmony.buildHarmony(color, square, mode, options)\n })[harmony];\n};\nclass ColorTranslator {\n constructor(color, options = {}) {\n this._options = getOptionsFromColorInput(options, color);\n this.rgb = getRGBObject(color);\n this.updateHSL();\n this.updateLab();\n this.updateCMYK();\n }\n updateRGB() {\n this.rgb = {\n ...hslToRGB(this.hsl.H, this.hsl.S, this.hsl.L),\n A: this.hsl.A\n };\n }\n updateRGBFromCMYK() {\n this.rgb = {\n ...cmykToRGB(this.cmyk.C, this.cmyk.M, this.cmyk.Y, this.cmyk.K),\n A: this.rgb.A\n };\n }\n updateRGBFromLab() {\n this.rgb = {\n ...labToRgb(this.lab.L, this.lab.a, this.lab.b),\n A: this.rgb.A\n };\n }\n updateHSL() {\n this.hsl = rgbToHSL(this.rgb.R, this.rgb.G, this.rgb.B, this.rgb.A);\n }\n updateLab() {\n this.lab = {\n ...rgbToLab(this.rgb.R, this.rgb.G, this.rgb.B),\n A: this.rgb.A\n };\n }\n updateCMYK() {\n this.cmyk = rgbToCMYK(this.rgb.R, this.rgb.G, this.rgb.B);\n }\n setOptions(options = {}) {\n this._options = {\n ...this._options,\n ...options\n };\n return this;\n }\n setH(H) {\n this.hsl.H = normalizeHue(H);\n this.updateRGB();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setS(S) {\n this.hsl.S = minmax(S, 0, 100);\n this.updateRGB();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setL(L) {\n this.hsl.L = minmax(L, 0, 100);\n this.updateRGB();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setR(R) {\n this.rgb.R = minmax(R, 0, 255);\n this.updateHSL();\n this.updateLab();\n this.updateCMYK();\n return;\n }\n setG(G) {\n this.rgb.G = minmax(G, 0, 255);\n this.updateHSL();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setB(B) {\n this.rgb.B = minmax(B, 0, 255);\n this.updateHSL();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setCIEL(L) {\n this.lab.L = minmax(L, 0, 100);\n this.updateRGBFromLab();\n this.updateHSL();\n this.updateCMYK();\n return this;\n }\n setCIEa(a) {\n this.lab.a = minmax(a, -125, 125);\n this.updateRGBFromLab();\n this.updateHSL();\n this.updateCMYK();\n return this;\n }\n setCIEb(b) {\n this.lab.b = minmax(b, -125, 125);\n this.updateRGBFromLab();\n this.updateHSL();\n this.updateCMYK();\n return this;\n }\n setA(A) {\n this.hsl.A = this.rgb.A = minmax(A, 0, 1);\n return this;\n }\n setC(C) {\n this.cmyk.C = minmax(C, 0, 100);\n this.updateRGBFromCMYK();\n this.updateHSL();\n this.updateLab();\n return this;\n }\n setM(M) {\n this.cmyk.M = minmax(M, 0, 100);\n this.updateRGBFromCMYK();\n this.updateHSL();\n this.updateLab();\n return this;\n }\n setY(Y) {\n this.cmyk.Y = minmax(Y, 0, 100);\n this.updateRGBFromCMYK();\n this.updateHSL();\n this.updateLab();\n return this;\n }\n setK(K) {\n this.cmyk.K = minmax(K, 0, 100);\n this.updateRGBFromCMYK();\n this.updateHSL();\n this.updateLab();\n return this;\n }\n get options() {\n return this._options;\n }\n get H() {\n return round(this.hsl.H, this.options.decimals);\n }\n get S() {\n return round(this.hsl.S, this.options.decimals);\n }\n get L() {\n return round(this.hsl.L, this.options.decimals);\n }\n get CIEL() {\n return round(this.lab.L, this.options.decimals);\n }\n get CIEa() {\n return round(this.lab.a, this.options.decimals);\n }\n get CIEb() {\n return round(this.lab.b, this.options.decimals);\n }\n get R() {\n return round(this.rgb.R, this.options.decimals);\n }\n get G() {\n return round(this.rgb.G, this.options.decimals);\n }\n get B() {\n return round(this.rgb.B, this.options.decimals);\n }\n get A() {\n return round(this.hsl.A, this.options.decimals);\n }\n get C() {\n return round(this.cmyk.C, this.options.decimals);\n }\n get M() {\n return round(this.cmyk.M, this.options.decimals);\n }\n get Y() {\n return round(this.cmyk.Y, this.options.decimals);\n }\n get K() {\n return round(this.cmyk.K, this.options.decimals);\n }\n get HEXObject() {\n return translateColor.HEX(this.rgb);\n }\n get HEXAObject() {\n return translateColor.HEXA(this.rgb);\n }\n get RGBObject() {\n return {\n R: this.R,\n G: this.G,\n B: this.B\n };\n }\n get RGBAObject() {\n return {\n ...this.RGBObject,\n A: this.A\n };\n }\n get HSLObject() {\n return {\n H: this.H,\n S: this.S,\n L: this.L\n };\n }\n get HSLAObject() {\n return {\n ...this.HSLObject,\n A: this.A\n };\n }\n get CIELabObject() {\n return {\n L: this.CIEL,\n a: this.CIEa,\n b: this.CIEb\n };\n }\n get CIELabAObject() {\n return {\n ...this.CIELabObject,\n A: this.A\n };\n }\n get CMYKObject() {\n return {\n C: this.C,\n M: this.M,\n Y: this.Y,\n K: this.K\n };\n }\n get CMYKAObject() {\n return {\n ...this.CMYKObject,\n A: this.A\n };\n }\n get HEX() {\n return CSS.HEX({\n R: this.R,\n G: this.G,\n B: this.B\n });\n }\n get HEXA() {\n return CSS.HEX({\n R: this.R,\n G: this.G,\n B: this.B,\n A: this.A * 255\n });\n }\n get RGB() {\n return CSS.RGB({\n R: this.R,\n G: this.G,\n B: this.B\n }, this.options);\n }\n get RGBA() {\n return CSS.RGB({\n R: this.R,\n G: this.G,\n B: this.B,\n A: this.A\n }, this.options);\n }\n get HSL() {\n return CSS.HSL({\n H: this.H,\n S: this.S,\n L: this.L\n }, this.options);\n }\n get HSLA() {\n return CSS.HSL({\n H: this.H,\n S: this.S,\n L: this.L,\n A: this.A\n }, this.options);\n }\n get CIELab() {\n return CSS.CIELab({\n L: this.CIEL,\n a: this.CIEa,\n b: this.CIEb\n }, this.options);\n }\n get CIELabA() {\n return CSS.CIELab({\n L: this.CIEL,\n a: this.CIEa,\n b: this.CIEb,\n A: this.A\n }, this.options);\n }\n get CMYK() {\n return CSS.CMYK({\n C: this.C,\n M: this.M,\n Y: this.Y,\n K: this.K\n }, this.options);\n }\n get CMYKA() {\n return CSS.CMYK({\n C: this.C,\n M: this.M,\n Y: this.Y,\n K: this.K,\n A: this.A\n }, this.options);\n }\n static toHEXObject(color) {\n const model = getColorModel(color);\n return getColorReturn(color, model, 0, translateColor.HEX);\n }\n static toHEX(color) {\n return CSS.HEX(ColorTranslator.toHEXObject(color));\n }\n static toHEXAObject(color) {\n const model = getColorModel(color);\n return getColorReturn(color, model, 0, translateColor.HEXA);\n }\n static toHEXA(color) {\n return CSS.HEX(ColorTranslator.toHEXAObject(color));\n }\n static toRGBObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.RGB);\n }\n static toRGB(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const rgb = getColorReturn(color, model, options.decimals, translateColor.RGB);\n return CSS.RGB(rgb, detectedOptions);\n }\n static toRGBAObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.RGBA);\n }\n static toRGBA(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const rgba = getColorReturn(color, model, options.decimals, translateColor.RGBA);\n return CSS.RGB(rgba, detectedOptions);\n }\n static toHSLObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.HSL);\n }\n static toHSL(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const hsl = getColorReturn(color, model, options.decimals, translateColor.HSL);\n return CSS.HSL(hsl, detectedOptions);\n }\n static toHSLAObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.HSLA);\n }\n static toHSLA(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const hsla = getColorReturn(color, model, options.decimals, translateColor.HSLA);\n return CSS.HSL(hsla, detectedOptions);\n }\n static toCIELabObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.CIELab);\n }\n static toCIELab(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const lab = getColorReturn(color, model, options.decimals, translateColor.CIELab);\n return CSS.CIELab(lab, detectedOptions);\n }\n static toCIELabAObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.CIELabA);\n }\n static toCIELabA(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const lab = getColorReturn(color, model, options.decimals, translateColor.CIELabA);\n return CSS.CIELab(lab, detectedOptions);\n }\n static toCMYKObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.CMYK);\n }\n static toCMYK(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const cmyk = getColorReturn(color, model, options.decimals, translateColor.CMYK);\n return CSS.CMYK(cmyk, detectedOptions);\n }\n static toCMYKAObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.CMYKA);\n }\n static toCMYKA(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const cmyka = getColorReturn(color, model, options.decimals, translateColor.CMYKA);\n return CSS.CMYK(cmyka, detectedOptions);\n }\n static getBlendHEXObject(from, to, steps = DEFAULT_BLEND_STEPS) {\n return getBlendReturn(from, to, steps, 0, translateColor.HEX);\n }\n static getBlendHEX(from, to, steps = DEFAULT_BLEND_STEPS) {\n return ColorTranslator.getBlendHEXObject(from, to, steps)\n .map((color) => CSS.HEX(color));\n }\n static getBlendHEXAObject(from, to, steps = DEFAULT_BLEND_STEPS) {\n return getBlendReturn(from, to, steps, 0, translateColor.HEXA);\n }\n static getBlendHEXA(from, to, steps = DEFAULT_BLEND_STEPS) {\n return ColorTranslator.getBlendHEXAObject(from, to, steps)\n .map((color) => CSS.HEX(color));\n }\n static getBlendRGBObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.RGB);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.RGB);\n }\n static getBlendRGB(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.RGB)\n .map((color) => {\n return CSS.RGB(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.RGB)\n .map((color) => {\n return CSS.RGB(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendRGBAObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.RGBA);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.RGBA);\n }\n static getBlendRGBA(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.RGBA)\n .map((color) => {\n return CSS.RGB(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.RGBA)\n .map((color) => {\n return CSS.RGB(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendHSLObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.HSL);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, fourthParameter?.decimals, translateColor.HSL);\n }\n static getBlendHSL(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.HSL)\n .map((color) => {\n return CSS.HSL(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.HSL)\n .map((color) => {\n return CSS.HSL(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendHSLAObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.HSLA);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.HSLA);\n }\n static getBlendHSLA(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.HSLA)\n .map((color) => {\n return CSS.HSL(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.HSLA)\n .map((color) => {\n return CSS.HSL(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendCIELabObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.CIELab);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.CIELab);\n }\n static getBlendCIELab(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.CIELab)\n .map((color) => {\n return CSS.CIELab(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.CIELab)\n .map((color) => {\n return CSS.CIELab(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendCIELabAObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.CIELabA);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.CIELabA);\n }\n static getBlendCIELabA(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.CIELabA)\n .map((color) => {\n return CSS.CIELab(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.CIELabA)\n .map((color) => {\n return CSS.CIELab(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getMixHEXObject(colors, mode = Mix.ADDITIVE) {\n return colorMixer.HEX(colors, mode, false);\n }\n static getMixHEX(colors, mode = Mix.ADDITIVE) {\n return colorMixer.HEX(colors, mode, true);\n }\n static getMixHEXAObject(colors, mode = Mix.ADDITIVE) {\n return colorMixer.HEXA(colors, mode, false);\n }\n static getMixHEXA(colors, mode = Mix.ADDITIVE) {\n return colorMixer.HEXA(colors, mode, true);\n }\n static getMixRGBObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.RGB(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.RGB(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixRGB(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.RGB(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.RGB(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixRGBAObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.RGBA(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.RGBA(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixRGBA(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.RGBA(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.RGBA(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixHSLObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.HSL(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.HSL(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixHSL(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.HSL(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.HSL(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixHSLAObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.HSLA(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.HSLA(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixHSLA(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.HSLA(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.HSLA(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixCIELabObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.CIELab(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.CIELab(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixCIELab(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.CIELab(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.CIELab(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixCIELabAObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.CIELabA(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.CIELabA(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixCIELabA(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.CIELabA(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.CIELabA(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getShades(color, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'number\') {\n return getColorMixture(color, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, color));\n }\n return getColorMixture(color, DEFAULT_SHADES_TINTS_STEPS, true, getOptionsFromColorInput(secondParameter || {}, color));\n }\n static getTints(color, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'number\') {\n return getColorMixture(color, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, color));\n }\n return getColorMixture(color, DEFAULT_SHADES_TINTS_STEPS, false, getOptionsFromColorInput(secondParameter || {}, color));\n }\n static getHarmony(color, secondParam, thirdParam, fourthParam) {\n if (isHarmony(secondParam)) {\n return getHarmonyReturn(secondParam, color, isMix(thirdParam)\n ? thirdParam\n : Mix.ADDITIVE, getOptionsFromColorInput(isMix(thirdParam)\n ? (fourthParam || {})\n : thirdParam || {}, color));\n }\n else if (isMix(secondParam)) {\n return getHarmonyReturn(Harmony.COMPLEMENTARY, color, secondParam, getOptionsFromColorInput(thirdParam || {}, color));\n }\n return getHarmonyReturn(Harmony.COMPLEMENTARY, color, Mix.ADDITIVE, getOptionsFromColorInput(secondParam || {}, color));\n }\n}\n\n\n;// CONCATENATED MODULE: ./src/@demo/demo1/index.js\n\n\n/* harmony default export */ const demo1 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const color = new ColorTranslator(\'hsl(180 100% 50%)\', { decimals: 0 });\n\n for (let row = 0; row < 10; row++) {\n\n for (let col = 0; col < 10; col++) {\n\n color\n .setS(row * 10)\n .setL(col * 5 + 30);\n\n const box = document.createElement(\'div\');\n\n box.classList.add(\'box\');\n box.style.background = color.HEX;\n\n box.innerText =\n `R:${color.R}\n G:${color.G}\n B:${color.B}`;\n container.appendChild(box);\n\n }\n }\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo2/index.js\n\n\n/* harmony default export */ const demo2 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const color = new ColorTranslator({ R: 255, G: 0, B: 0 });\n const hue = [0, 30, 60, 120, 240, 280, 320, 0];\n let rainbow;\n\n for (let r = 0; r < hue.length; r++) {\n\n color.setH(hue[r]);\n\n const bow = document.createElement(\'div\');\n\n bow.classList.add(\'rainbow\');\n bow.style.background = color.HEX;\n\n if (rainbow) {\n rainbow.appendChild(bow);\n } else {\n container.appendChild(bow);\n }\n\n rainbow = bow;\n }\n\n rainbow.style.background = \'#333\';\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo3/index.js\n\n\n/* harmony default export */ const demo3 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const hsl = { H: 0, S: \'90%\', L: \'50%\' };\n const hue = [undefined, 55, 30, 0, 290, 220, 130];\n const total = hue.length;\n\n for (let row = 0; row < total; row++) {\n\n for (let col = 0; col < total; col++) {\n\n let index = total - row + col;\n if (index >= total) {\n index -= total;\n }\n hsl.H = hue[index];\n const rgb = hue[index] === undefined\n ? \'#FFF\'\n : ColorTranslator.toHEX(hsl);\n const box = document.createElement(\'div\');\n\n box.classList.add(\'flag\');\n box.style.background = rgb;\n\n container.appendChild(box);\n\n }\n }\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo4/index.js\n\n\n/* harmony default export */ const demo4 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const hexColors = [\n \'#FE2712\', \'#FE5409\', \'#FB9902\',\n \'#FABD03\', \'#FFFE32\', \'#D1EA2C\',\n \'#66B132\', \'#0392CE\', \'#0247FE\',\n \'#3D00A5\', \'#8601B0\', \'#A7194B\'\n ];\n\n hexColors.forEach((color) => {\n\n const rgb = ColorTranslator.toRGB(color);\n const hsl = ColorTranslator.toHSL(color, { decimals: 0 });\n const lab = ColorTranslator.toCIELab(color, { decimals: 0 });\n\n const rgbDiv = document.createElement(\'div\');\n const hslDiv = document.createElement(\'div\');\n const labDiv = document.createElement(\'div\');\n\n rgbDiv.style.backgroundColor = rgb;\n rgbDiv.textContent = rgb;\n\n hslDiv.style.backgroundColor = hsl;\n hslDiv.textContent = hsl;\n\n labDiv.style.backgroundColor = lab;\n labDiv.textContent = lab;\n\n container.appendChild(rgbDiv);\n container.appendChild(hslDiv);\n container.appendChild(labDiv);\n\n });\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo5/index.js\n\n\n/* harmony default export */ const demo5 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const colors = [\n \'red\',\n \'lime\',\n \'blue\',\n \'aqua\',\n \'yellow\',\n \'fuchsia\'\n ];\n const total = colors.length;\n\n for (let row = 0; row < total; row++) {\n\n const hsl = ColorTranslator.toHSLObject(colors[row]);\n const step = hsl.S / (total - 1);\n\n for (let col = 0; col < total; col++) {\n\n const rgb = ColorTranslator.toHEX(hsl);\n const cmyk = ColorTranslator.toCMYKObject(hsl, { decimals: 0 });\n\n const box = document.createElement(\'div\');\n box.classList.add(\'box\');\n box.style.background = rgb;\n box.innerText = `C:${cmyk.C}\n M:${cmyk.M}\n Y:${cmyk.Y}\n K:${cmyk.K}`;\n\n container.appendChild(box);\n\n hsl.S -= step;\n\n }\n }\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo6/index.js\n\n\n/* harmony default export */ const demo6 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const rows = 11;\n const mult = 3;\n\n for (let i = 0; i < rows; i++) {\n\n const blends = ColorTranslator.getBlendHEX(\'#F00\', \'#FF0\', mult + i * mult);\n\n blends.forEach((blend, index) => {\n const box = document.createElement(\'div\');\n box.classList.add(\'box\', `file${i}`);\n box.style.background = blend;\n box.innerText = index + 1;\n container.appendChild(box);\n });\n\n }\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo7/index.js\n\n\n/* harmony default export */ const demo7 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n\n const colors = [\'#F00\', \'#FF8000\', \'#FF0\', \'#0F0\', \'#00F\', \'#A0F\', \'#F0A\'];\n\n const createBox = (color, type) => {\n const box = document.createElement(\'div\');\n box.classList.add(\'box\');\n box.style.backgroundColor = color;\n if (type) box.dataset.type = type;\n container.appendChild(box);\n };\n\n colors.forEach((color) => {\n const shades = ColorTranslator.getShades(color, 3).reverse();\n const tints = ColorTranslator.getTints(color, 3);\n shades.forEach((shade) => createBox(shade, \'shade\'));\n createBox(color);\n tints.forEach((tint) => createBox(tint, \'tint\'));\n });\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo8/index.js\n\n\n\n/* harmony default export */ const demo8 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n\n const mixes = [\n \'#F00\',\n \'#0F0\',\n \'#00F\',\n [1, 3],\n [1, 2],\n [2, 3],\n [1, 2, 3]\n ];\n\n const fillPlanes = () => {\n const planes = container.querySelectorAll(\'#planes path\');\n planes.forEach((plane, index) => {\n let color = \'#CCC\';\n if (typeof mixes[index] === \'string\') {\n color = mixes[index];\n } else if(mixes[index]) {\n const colors = mixes[index].map((i) => mixes[i - 1]);\n color = mixes[index] = ColorTranslator.getMixHEX(colors);\n }\n plane.setAttribute(\'fill\', color);\n });\n };\n\n fetch(\'images/color-mixes.svg\')\n .then(result => result.text())\n .then((svgCode) => {\n container.innerHTML = svgCode;\n fillPlanes();\n });\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo9/index.js\n\n\n/* harmony default export */ const demo9 = ((ColorTranslator, { Mix }) => {\n\n const container = document.createElement(\'div\');\n\n const mixes = [\n \'#F00\',\n \'#FF0\',\n \'#00F\',\n [1, 3],\n [1, 2],\n [2, 3],\n [1, 2, 3]\n ];\n\n const fillPlanes = () => {\n const planes = container.querySelectorAll(\'#planes path\');\n planes.forEach((plane, index) => {\n let color = \'#CCC\';\n if (typeof mixes[index] === \'string\') {\n color = mixes[index];\n } else if(mixes[index]) {\n const colors = mixes[index].map((i) => mixes[i - 1]);\n color = mixes[index] = ColorTranslator.getMixHEX(colors, Mix.SUBTRACTIVE);\n }\n plane.setAttribute(\'fill\', color);\n });\n };\n\n fetch(\'images/color-mixes.svg\')\n .then(result => result.text())\n .then((svgCode) => {\n container.innerHTML = svgCode;\n fillPlanes();\n });\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo10/index.js\n\n\n/* harmony default export */ const demo10 = ((ColorTranslator, { Harmony }) => {\n\n const container = document.createElement(\'div\');\n\n const harmonies = [\n { label: \'Complementary\', value: Harmony.COMPLEMENTARY },\n { label: \'Split Complementary\', value: Harmony.SPLIT_COMPLEMENTARY },\n { label: \'Analogous\', value: Harmony.ANALOGOUS },\n { label: \'Triadic\', value: Harmony.TRIADIC },\n { label: \'Tetradic\', value: Harmony.TETRADIC },\n { label: \'Square\', value: Harmony.SQUARE }\n ];\n\n const baseColor = \'#F00\';\n\n const createElement = (className, parent) => {\n const div = document.createElement(\'div\');\n div.classList.add(className);\n parent.appendChild(div);\n return div;\n };\n\n const createHarmony = (item) => {\n\n const wrapper = createElement(\'wrapper\', container);\n const wheel = createElement(\'wheel\', wrapper);\n const harmony = createElement(\'harmony\', wrapper);\n createElement(\'label\', wrapper).innerText = item.label;\n\n fetch(\'images/wheel-additive.svg\')\n .then(result => result.text())\n .then((svgCode) => {\n const harmonyColors = ColorTranslator.getHarmony(baseColor, item.value);\n const selector = \'path\' + harmonyColors.map((color) => `:not([fill="${color}"])`).join(\'\');\n wheel.innerHTML = svgCode;\n harmonyColors.forEach((hex) => createElement(\'box\', harmony).style.background = hex);\n wheel.querySelectorAll(selector).forEach((path) => path.setAttribute(\'fill-opacity\', \'0.25\'));\n });\n\n };\n\n harmonies.forEach((item) => createHarmony(item));\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo11/index.js\n\n\n/* harmony default export */ const demo11 = ((ColorTranslator, { Harmony, Mix }) => {\n\n const container = document.createElement(\'div\');\n\n const harmonies = [\n { label: \'Complementary\', value: Harmony.COMPLEMENTARY },\n { label: \'Split Complementary\', value: Harmony.SPLIT_COMPLEMENTARY },\n { label: \'Analogous\', value: Harmony.ANALOGOUS },\n { label: \'Triadic\', value: Harmony.TRIADIC },\n { label: \'Tetradic\', value: Harmony.TETRADIC },\n { label: \'Square\', value: Harmony.SQUARE }\n ];\n\n const baseColor = \'#F00\';\n\n const createElement = (className, parent) => {\n const div = document.createElement(\'div\');\n div.classList.add(className);\n parent.appendChild(div);\n return div;\n };\n\n const createHarmony = (item) => {\n\n const wrapper = createElement(\'wrapper\', container);\n const wheel = createElement(\'wheel\', wrapper);\n const harmony = createElement(\'harmony\', wrapper);\n createElement(\'label\', wrapper).innerText = item.label;\n\n fetch(\'images/wheel-subtractive.svg\')\n .then(result => result.text())\n .then((svgCode) => {\n const harmonyColors = ColorTranslator.getHarmony(baseColor, item.value, Mix.SUBTRACTIVE);\n const selector = \'path\' + harmonyColors.map((color) => `:not([fill="${color}"])`).join(\'\');\n wheel.innerHTML = svgCode;\n harmonyColors.forEach((hex) => createElement(\'box\', harmony).style.background = hex);\n wheel.querySelectorAll(selector).forEach((path) => path.setAttribute(\'fill-opacity\', \'0.25\'));\n });\n\n };\n\n harmonies.forEach((item) => createHarmony(item));\n\n return container;\n\n});\n;// CONCATENATED MODULE: ./src/@demo/demo.js\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst functioToString = (fn) => {\n const article = document.createElement(\'article\');\n const pre = document.createElement(\'pre\');\n article.classList.add(\'function-container\');\n pre.classList.add(\'prettyprint\');\n article.appendChild(pre);\n pre.innerHTML = fn.toString().replace(\'(ColorTranslator)\', \'()\');\n return article;\n};\n\nconst demos = new Map([\n [\'demo1\', demo1],\n [\'demo2\', demo2],\n [\'demo3\', demo3],\n [\'demo4\', demo4],\n [\'demo5\', demo5],\n [\'demo6\', demo6],\n [\'demo7\', demo7],\n [\'demo8\', demo8],\n [\'demo9\', demo9],\n [\'demo10\', demo10],\n [\'demo11\', demo11]\n]);\n\ndocument.addEventListener(\'DOMContentLoaded\', () => {\n demos.forEach((module, div) => {\n const demo = document.getElementById(div);\n const container = document.createElement(\'div\');\n const wrapper = document.createElement(\'div\');\n\n container.classList.add(\'demo-container\');\n wrapper.classList.add(\'demo-wrapper\');\n\n wrapper.appendChild(module(ColorTranslator, { Harmony: Harmony, Mix: Mix }));\n container.appendChild(wrapper);\n demo.appendChild(container);\n demo.appendChild(functioToString(module));\n });\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODYxLmpzIiwibWFwcGluZ3MiOiI7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsVUFBVSxxQkFBTSxvQkFBb0IscUJBQU07QUFDMUM7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxRQUFRO0FBQ1I7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7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gICB2YXIgYm9keSA9ICdyZXNwb25zZScgaW4geGhyID8geGhyLnJlc3BvbnNlIDogeGhyLnJlc3BvbnNlVGV4dFxuICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgcmVzb2x2ZShuZXcgUmVzcG9uc2UoYm9keSwgb3B0aW9ucykpXG4gICAgICB9LCAwKVxuICAgIH1cblxuICAgIHhoci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAgICAgfSwgMClcbiAgICB9XG5cbiAgICB4aHIub250aW1lb3V0ID0gZnVuY3Rpb24oKSB7XG4gICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IHRpbWVkIG91dCcpKVxuICAgICAgfSwgMClcbiAgICB9XG5cbiAgICB4aHIub25hYm9ydCA9IGZ1bmN0aW9uKCkge1xuICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgcmVqZWN0KG5ldyBET01FeGNlcHRpb24oJ0Fib3J0ZWQnLCAnQWJvcnRFcnJvcicpKVxuICAgICAgfSwgMClcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBmaXhVcmwodXJsKSB7XG4gICAgICB0cnkge1xuICAgICAgICByZXR1cm4gdXJsID09PSAnJyAmJiBnLmxvY2F0aW9uLmhyZWYgPyBnLmxvY2F0aW9uLmhyZWYgOiB1cmxcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgcmV0dXJuIHVybFxuICAgICAgfVxuICAgIH1cblxuICAgIHhoci5vcGVuKHJlcXVlc3QubWV0aG9kLCBmaXhVcmwocmVxdWVzdC51cmwpLCB0cnVlKVxuXG4gICAgaWYgKHJlcXVlc3QuY3J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B7XG4gICAgICAgICAgICBjYXNlIEFuZ2xlc1VuaXRFbnVtLlJBRElBTlM6XG4gICAgICAgICAgICAgICAgaHVlID0gcm91bmQoZGVncmVlcyh2YWx1ZSkpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBBbmdsZXNVbml0RW51bS5UVVJOUzpcbiAgICAgICAgICAgICAgICBodWUgPSByb3VuZCh2YWx1ZSAqIHBpMik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIEFuZ2xlc1VuaXRFbnVtLkdSQURJQU5TOlxuICAgICAgICAgICAgICAgIGh1ZSA9IHJvdW5kKDkgLyAxMCAqIHZhbHVlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgQW5nbGVzVW5pdEVudW0uREVHUkVFUzpcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgaHVlID0gdmFsdWU7XG4gICAgICAgIH1cbiAgICB9XG4gICAgaWYgKGh1ZSA+IDM2MCB8fCBodWUgPCAwKSB7XG4gICAgICAgIGh1ZSAtPSBNYXRoLmZsb29yKGh1ZSAvIHBpMikgKiBwaTI7XG4gICAgfVxuICAgIHJldHVybiBodWU7XG59O1xuZXhwb3J0IGNvbnN0IHRyYW5zbGF0ZURlZ3JlZXMgPSAoZGVncmVlcywgdW5pdHMpID0+IHtcbiAgICBsZXQgaHVlO1xuICAgIHN3aXRjaCAodW5pdHMpIHtcbiAgICAgICAgY2FzZSBBbmdsZXNVbml0RW51bS5SQURJQU5TOlxuICAgICAgICAgICAgaHVlID0gcm91bmQocmFkaWFucyhkZWdyZWVzKSk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBBbmdsZXNVbml0RW51bS5UVVJOUzpcbiAgICAgICAgICAgIGh1ZSA9IHJvdW5kKGRlZ3JlZXMgLyBwaTIpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICA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9mIGNvbG9yID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgY3NzQ29sb3JzLnB1c2goY29sb3IpO1xuICAgICAgICAgICAgaWYgKGNvbG9yLmluY2x1ZGVzKCcsJykpIHtcbiAgICAgICAgICAgICAgICBtYXRjaE9wdGlvbnMubGVnYWN5Q1NTKys7XG4gICAgICAgICAgICAgICAgY29uc3QgY29tbWFzV2l0aE5leHRDaGFyYWN0ZXIgPSBjb2xvci5tYXRjaChDT01NQVNfQU5EX05FWFRfQ0hBUlMpO1xuICAgICAgICAgICAgICAgIGlmIChuZXcgU2V0KGNvbW1hc1dpdGhOZXh0Q2hhcmFjdGVyKS5zaXplID09PSAxICYmXG4gICAgICAgICAgICAgICAgICAgIFNQQUNFUy50ZXN0KGNvbW1hc1dpdGhOZXh0Q2hhcmFjdGVyWzBdLnNsaWNlKDEpKSkge1xuICAgICAgICAgICAgICAgICAgICBtYXRjaE9wdGlvbnMuc3BhY2VzQWZ0ZXJDb21tYXMrKztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY29sb3IubWF0Y2goQ09MT1JSRUdTLkhTTCkpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRjaCA9IGNvbG9yLm1hdGNoKENPTE9SUkVHUy5IU0wpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGFuZ2xlID0gbWF0Y2hbMV0gfHwgbWF0Y2hbNV07XG4gICAgICAgICAgICAgICAgY29uc3QgYWxwaGEgPSBtYXRjaFs4XTtcbiAgICAgICAgICAgICAgICBjb25zdCBhbmdsZVVuaXQgPSBhbmdsZS5tYXRjaChIU0xfSFVFKVsyXTtcbiAgICAgICAgICAgICAgICBoc2xDb2xvcnMucHVzaChhbmdsZVVuaXQgPT09ICcnXG4gICAgICAgICAgICAgICAgICAgID8gQW5nbGVzVW5pdEVudW0uTk9ORVxuICAgICAgICAgICAgICAgICAgICA6IGFuZ2xlVW5pdCk7XG4gICAgICAgICAgICAgICAgYWxwaGFWYWx1ZXMucHVzaChQQ0VOVC50ZXN0KGFscGhhKSk7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoQ09MT1JSRUdTLlJHQi50ZXN0KGNvbG9yKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdGNoID0gY29sb3IubWF0Y2goQ09MT1JSRUdTLlJHQik7XG4gICAgICAgICAgICAgICAgY29uc3QgUiA9IG1hdGNoWzFdIHx8IG1hdGNoWzVdO1xuICAgICAgICAgICAgICAgIGNvbnN0IEcgPSBtYXRjaFsyXSB8fCBtYXRjaFs2XTtcbiAgICAgICAgICAgICAgICBjb25zdCBCID0gbWF0Y2hbM10gfHwgbWF0Y2hbN107XG4gICAgICAgICAgICAgICAgY29uc3QgQSA9IG1hdGNoWzhdO1xuICAgICAgICAgICAgICAgIHJnYkNvbG9ycy5wdXNoKFBDRU5ULnRlc3QoUikgJiZcbiAgICAgICAgICAgICAgICAgICAgUENFTlQudGVzdChHKSAmJlxuICAgICAgICAgICAgICAgICAgICBQQ0VOVC50ZXN0KEIpKTtcbiAgICAgICAgICAgICAgICBhbHBoYVZhbHVlcy5wdXNoKFBDRU5ULnRlc3QoQSkpO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKENPTE9SUkVHUy5DSUVMYWIudGVzdChjb2xvcikpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRjaCA9IGNvbG9yLm1hdGNoKENPTE9SUkVHUy5DSUVMYWIpO1xuICAgICAgICAgICAgICAgIGNvbnN0IEwgPSBtYXRjaFsxXTtcbiAgICAgICAgICAgICAgICBjb25zdCBhID0gbWF0Y2hbMl07XG4gICAgICAgICAgICAgICAgY29uc3QgYiA9IG1hdGNoWzNdO1xuICAgICAgICAgICAgICAgIGNvbnN0IEEgPSBtYXRjaFs0XTtcbiAgICAgICAgICAgICAgICBsYWJDb2xvcnMucHVzaChQQ0VOVC50ZXN0KEwpICYmXG4gICAgICAgICAgICAgICAgICAgIFBDRU5ULnRlc3QoYSkgJiZcbiAgICAgICAgICAgICAgICAgICAgUENFTlQudGVzdChiKSk7XG4gICAgICAgICAgICAgICAgYWxwaGFWYWx1ZXMucHVzaChQQ0VOVC50ZXN0KEEpKTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb2xvci5tYXRjaChDT0xPUlJFR1MuQ01ZSykpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRjaCA9IGNvbG9yLm1hdGNoKENPTE9SUkVHUy5DTVlLKTtcbiAgICAgICAgICAgICAgICBjb25zdCBDID0gbWF0Y2hbMV0gfHwgbWF0Y2hbNl07XG4gICAgICAgICAgICAgICAgY29uc3QgTSA9IG1hdGNoWzJdIHx8IG1hdGNoWzddO1xuICAgICAgICAgICAgICAgIGNvbnN0IFkgPSBtYXRjaFszXSB8fCBtYXRjaFs4XTtcbiAgICAgICAgICAgICAgICBjb25zdCBLID0gbWF0Y2hbNF0gfHwgbWF0Y2hbOV07XG4gICAgICAgICAgICAgICAgY29uc3QgQSA9IG1hdGNoWzEwXTtcbiAgICAgICAgICAgICAgICBjbXlrQ29sb3JzLnB1c2goUENFTlQudGVzdChDKSAmJlxuICAgICAgICAgICAgICAgICAgICBQQ0VOVC50ZXN0KE0pICYmXG4gICAgICAgICAgICAgICAgICAgIFBDRU5ULnRlc3QoWSkgJiZcbiAgICAgICAgICAgICAgICAgICAgUENFTlQudGVzdChLKSk7XG4gICAgICAgICAgICAgICAgaWYgKGNvbG9yLnN0YXJ0c1dpdGgoJ2NteWsnKSkge1xuICAgICAgICAgICAgICAgICAgICBtYXRjaE9wdGlvbnMuY215a0Z1bmN0aW9uKys7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFscGhhVmFsdWVzLnB1c2goUENFTlQudGVzdChBKSk7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AobmV3IFNldChoc2xDb2xvcnMpLnNpemUgPT09IDFcbiAgICAgICAgICAgICAgICA/IGhzbENvbG9yc1swXVxuICAgICAgICAgICAgICAgIDogREVGQVVMVF9PUFRJT05TLmFuZ2xlc1VuaXQpLFxuICAgICAgICByZ2JVbml0OiBvcHRpb25zLnJnYlVuaXQgJiYgY29sb3JVbml0VmFsdWVzLmluY2x1ZGVzKG9wdGlvbnMucmdiVW5pdClcbiAgICAgICAgICAgID8gb3B0aW9ucy5yZ2JVbml0XG4gICAgICAgICAgICA6IChuZXcgU2V0KHJnYkNvbG9ycykuc2l6ZSA9PT0gMSAmJiByZ2JDb2xvcnNbMF1cbiAgICAgICAgICAgICAgICA/IENvbG9yVW5pdEVudW0uUEVSQ0VOVFxuICAgICAgICAgICAgICAgIDogREVGQVVMVF9PUFRJT05TLnJnYlVuaXQpLFxuICAgICAgICBsYWJVbml0OiBvcHRpb25zLmxhYlVuaXQgJiYgY29sb3JVbml0VmFsdWVzLmluY2x1ZGVzKG9wdGlvbnMubGFiVW5pdClcbiAgICAgICAgICAgID8gb3B0aW9ucy5sYWJVbml0XG4gICAgICAgICAgICA6IChuZXcgU2V0KGxhYkNvbG9ycykuc2l6ZSA9PT0gMSAmJiBsYWJDb2xvcnNbMF1cbiAgICAgICAgICAgICAgICA/IENvbG9yVW5pdEVudW0uUEVSQ0VOVFxuICAgICAgICAgICAgICAgIDogREVGQVVMVF9PUFRJT05TLmxhYlVuaXQpLFxuICAgICAgICBjbXlrVW5pdDogb3B0aW9ucy5jbXlrVW5pdCAmJiBjb2xvclVuaXRWYWx1ZXMuaW5jbHVkZXMob3B0aW9ucy5jbXlrVW5pdClcbiAgICAgICAgICAgID8gb3B0aW9ucy5jbXlrVW5pdFxuICAgICAgICAgICAgOiAobmV3IFNldChjbXlrQ29sb3JzKS5zaXplID09PSAxICYmICFjbXlrQ29sb3JzWzBdXG4gICAgICAgICAgICAgICAgPyBDb2xvclVuaXRFbnVtLk5PTkVcbiAgICAgICAg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4gICAgY29uc3QgUiA9IGh1ZVRvUkdCKHQxLCB0MiwgSCArIDIpO1xuICAgIGNvbnN0IEcgPSBodWVUb1JHQih0MSwgdDIsIEgpO1xuICAgIGNvbnN0IEIgPSBodWVUb1JHQih0MSwgdDIsIEggLSAyKTtcbiAgICByZXR1cm4geyBSLCBHLCBCIH07XG59O1xuZXhwb3J0IGNvbnN0IHJnYlRvSFNMID0gKFIsIEcsIEIsIEEgPSAxKSA9PiB7XG4gICAgUiAvPSAyNTU7XG4gICAgRyAvPSAyNTU7XG4gICAgQiAvPSAyNTU7XG4gICAgQSA9IE1hdGgubWluKEEsIDEpO1xuICAgIGNvbnN0IE1BWCA9IE1hdGgubWF4KFIsIEcsIEIpO1xuICAgIGNvbnN0IE1JTiA9IE1hdGgubWluKFIsIEcsIEIpO1xuICAgIGNvbnN0IEQgPSBNQVggLSBNSU47XG4gICAgbGV0IEggPSAwO1xuICAgIGxldCBTID0gMDtcbiAgICBjb25zdCBMID0gKE1BWCArIE1JTikgLyAyO1xuICAgIGlmIChEICE9PSAwKSB7XG4gICAgICAgIHN3aXRjaCAoTUFYKSB7XG4gICAgICAgICAgICBjYXNlIFI6XG4gICAgICAgICAgICAgICAgSCA9ICgoRyAtIEIpIC8gRCkgJSA2O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBHOlxuICAgICAgICAgICAgICAgIEggPSAoQiAtIFIpIC8gRCArIDI7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIEI6XG4gICAgICAgICAgICAgICAgSCA9IChSIC0gRykgLyBEICsgNDtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBIID0gcm91bmQoSCAqIDYwKTtcbiAgICAgICAgaWYgKEggPCAwKSB7XG4gICAgICAgICAgICBIICs9IDM2MDtcbiAgICAgICAgfVxuICAgICAgICBTID0gRCAvICgxIC0gTWF0aC5hYnMoMiAqIEwgLSAxK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dGVEZWdyZWVzKHZhbHVlLCBhbmdsZXNVbml0KSwgZGVjaW1hbHMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBgJHt0cmFuc2xhdGVkfSR7YW5nbGVzVW5pdH1gO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGluZGV4ID09PSAzXG4gICAgICAgICAgICAgICAgPyBnZXRBbHBoYSh2YWx1ZSwgb3B0aW9ucylcbiAgICAgICAgICAgICAgICA6IHJvdW5kKHZhbHVlLCBkZWNpbWFscyk7XG4gICAgICAgIH07XG4gICAgICAgIGNvbnN0IHZhbHVlcyA9IHByZXBhcmVDb2xvckZvckNzcyhjb2xvciwgdHJhbnNmb3JtZXIpO1xuICAgICAgICBjb25zdCB0ZW1wbGF0ZSA9IGxlZ2FjeUNTU1xuICAgICAgICAgICAgPyAodmFsdWVzLmxlbmd0aCA9PT0gNFxuICAgICAgICAgICAgICAgID8gYGhzbGEoezF9JHtjb21tYX17Mn0lJHtjb21tYX17M30lJHtjb21tYX17NH0pYFxuICAgICAgICAgICAgICAgIDogYGhzbCh7MX0ke2NvbW1hfXsyfSUke2NvbW1hfXszfSUpYClcbiAgICAgICAgICAgIDogKHZhbHVlcy5sZW5ndGggPT09IDRcbiAgICAgICAgICAgICAgICA/IGBoc2woezF9IHsyfSUgezN9JSAvIHs0fSlgXG4gICAgICAgICAgICAgICAgOiBgaHNsKHsxfSB7Mn0lIHszfSUpYCk7XG4gICAgICAgIHJldHVybiBnZXRSZXN1bHRGcm9tVGVtcGxhdGUodGVtcGxhdGUsIHZhbHVlcyk7XG4gICAgfSxcbiAgICBbQ29sb3JNb2RlbC5DSUVMYWJdOiAoY29sb3IsIG9wdGlvbnMpID0+IHtcbiAgICAgICAgY29uc3QgeyBkZWNpbWFscywgbGFiVW5pdCB9ID0gb3B0aW9ucztcbiAgICAgICAgY29uc3QgdHJhbnNmb3JtZXIgPSAodmFsdWUsIGluZGV4KSA9PiB7XG4gICAgICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICBjb25zdCBMID0gcm91bmQocGVyY2VudCh2YWx1ZSksIGRlY2ltYWxzKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbGFiVW5pdCA9PT0gQ29sb3JVbml0RW51bS5QRVJDRU5UXG4gICAgICAgICAgICAgICAgICAgID8gYCR7TH0lYFxuICAgICAgICAgICAgICAgICAgICA6IGAke0x9YDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpbmRleCA8IDMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbGFiVW5pdCA9PT0gQ29sb3JVbml0RW51bS5QRVJDRU5UXG4gICAgICAgICAgICAgICAgICAgID8gYCR7ZnJvbTEyNU51bWJlclRvUGVyY2VudCh2YWx1ZSwgZGVjaW1hbHMpfSVgXG4gICAgICAgICAgICAgICAgICAgIDogcm91bmQodmFsdWUsIGRlY2ltYWxzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBnZXRBbHBoYSh2YWx1ZSwgb3B0aW9ucywgdHJ1ZSk7XG4gICAgICAgIH07XG4gICAgICAgIGNvbnN0IHZhbHVlcyA9IHByZXBhcmVDb2xvckZvckNzcyhjb2xvciwgdHJhbnNmb3JtZXIpO1xuICAgICAgICBjb25zdCB0ZW1wbGF0ZSA9IHZhbHVlcy5sZW5ndGggPT09IDRcbiAgICAgICAgICAgID8gYGxhYih7MX0gezJ9IHszfSAvIHs0fSlgXG4gICAgICAgICAgICA6IGBsYWIoezF9IHsyfSB7M30pYDtcbiAgICAgICAgcmV0dXJuIGdldFJlc3VsdEZyb21UZW1wbGF0ZSh0ZW1wbGF0ZSwgdmFsdWVzKTtcbiAgICB9LFxuICAgIFtDb2xvck1vZGVsLkNNWUtdOiAoY29sb3IsIG9wdGlvbnMpID0+IHtcbiAgICAgICAgY29uc3QgeyBkZWNpbWFscywgbGVnYWN5Q1NTLCBzcGFjZXNBZnRlckNvbW1hcywgY215a1VuaXQsIGNteWtGdW5jdGlvbiB9ID0gb3B0aW9ucztcbiAgICAgICAgY29uc3QgY29tbWEgPSBnZXRDb21tYShzcGFjZXNBZnRlckNvbW1hcyk7XG4gICAgICAgIGNvbnN0IHRyYW5zZm9ybWVyID0gKHZhbHVlLCBpbmRleCkgPT4ge1xuICAgICAgICAgICAgaWYgKGNteWtVbml0ID09PSBDb2xvclVuaXRFbnVtLlBFUkNFTlQgJiZcbiAgICAgICAgICAgICAgICBpbmRleCA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gYCR7cm91bmQodmFsdWUsIGRlY2ltYWxzKX0lYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbmRleCA9PT0gNFxuICAgICAgICAgICAgICAgID8gZ2V0QWxwaGEodmFsdWUsIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgOiByb3VuZCh2YWx1ZSAvIDEwMCwgZGVjaW1hbHMpO1xuICAgICAgICB9O1xuICAgICAgICBjb25zdCB2YWx1ZXMgPSBwcmVwYXJlQ29sb3JGb3JDc3MoY29sb3IsIHRyYW5zZm9ybWVyKTtcbiAgICAgICAgY29uc3QgdGVtcGxhdGUgPSBsZWdhY3lDU1NcbiAgICAgICAgICAgID8gKHZhbHVlcy5sZW5ndGggPT09IDVcbiAgICAgICAgICAgICAgICA/IGAke2NteWtGdW5jdGlvbn0oezF9JHtjb21tYX17Mn0ke2NvbW1hfXszfSR7Y29tbWF9ezR9JHtjb21tYX17NX0pYFxuICAgICAgICAgICAgICAgIDogYCR7Y215a0Z1bmN0aW9ufSh7MX0ke2NvbW1hfXsyfSR7Y29tbWF9ezN9JHtjb21tYX17NH0pYClcbiAgICAgICAgICAgIDogKHZhbHVlcy5sZW5ndGggPT09IDVcbiAgICAgICAgICAgICAgICA/IGAke2NteWtGdW5jdGlvbn0oezF9IHsyfSB7M30gezR9IC8gezV9KWBcbiAgICAgICAgICAgICAgICA6IGAke2NteWtGdW5jdGlvbn0oezF9IHsy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vci5SKSxcbiAgICAgICAgICAgIEc6IGdldEhFWChjb2xvci5HKSxcbiAgICAgICAgICAgIEI6IGdldEhFWChjb2xvci5CKVxuICAgICAgICB9O1xuICAgIH0sXG4gICAgSEVYQShjb2xvcikge1xuICAgICAgICBjb25zdCBSR0IgPSB0cmFuc2xhdGVDb2xvci5IRVgoY29sb3IpO1xuICAgICAgICBSR0IuQSA9IGhhc1Byb3AoY29sb3IsICdBJylcbiAgICAgICAgICAgID8gZ2V0SEVYKGNvbG9yLkEgKiAyNTUpXG4gICAgICAgICAgICA6ICcweEZGJztcbiAgICAgICAgcmV0dXJuIFJHQjtcbiAgICB9LFxuICAgIFtDb2xvck1vZGVsLlJHQl0oY29sb3IsIGRlY2ltYWxzKSB7XG4gICAgICAgIGNvbnN0IFJHQiA9IHJvdW5kUkdCT2JqZWN0KGNvbG9yLCBkZWNpbWFscyk7XG4gICAgICAgIGlmIChoYXNQcm9wKFJHQiwgJ0EnKSkge1xuICAgICAgICAgICAgZGVsZXRlIFJHQi5BO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBSR0I7XG4gICAgfSxcbiAgICBSR0JBKGNvbG9yLCBkZWNpbWFscykge1xuICAgICAgICBjb25zdCBSR0IgPSB0cmFuc2xhdGVDb2xvci5SR0IoY29sb3IsIGRlY2ltYWxzKTtcbiAgICAgICAgUkdCLkEgPSBoYXNQcm9wKGNvbG9yLCAnQScpXG4gICAgICAgICAgICA/IHJvdW5kKGNvbG9yLkEpXG4gICAgICAgICAgICA6IDE7XG4gICAgICAgIHJldHVybiBSR0I7XG4gICAgfSxcbiAgICBbQ29sb3JNb2RlbC5IU0xdKGNvbG9yLCBkZWNpbWFscykge1xuICAgICAgICBjb25zdCBIU0wgPSByZ2JUb0hTTChjb2xvci5SLCBjb2xvci5HLCBjb2xvci5CKTtcbiAgICAgICAgZGVsZXRlIEhTTC5BO1xuICAgICAgICByZXR1cm4gcm91bmRIU0xPYmplY3QoSFNMLCBkZWNpbWFscyk7XG4g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G9yLCAnQScpXG4gICAgICAgICAgICA/IHJvdW5kKGNvbG9yLkEsIGRlY2ltYWxzKVxuICAgICAgICAgICAgOiAxO1xuICAgICAgICByZXR1cm4gQ01ZSztcbiAgICB9XG59O1xuZXhwb3J0IGNvbnN0IGJsZW5kID0gKGZyb20sIHRvLCBzdGVwcykgPT4ge1xuICAgIGNvbnN0IGRpdiA9IHN0ZXBzIC0gMTtcbiAgICBjb25zdCBkaWZmUiA9ICh0by5SIC0gZnJvbS5SKSAvIGRpdjtcbiAgICBjb25zdCBkaWZmRyA9ICh0by5HIC0gZnJvbS5HKSAvIGRpdjtcbiAgICBjb25zdCBkaWZmQiA9ICh0by5CIC0gZnJvbS5CKSAvIGRpdjtcbiAgICBjb25zdCBmcm9tQSA9IG5vcm1hbGl6ZUFscGhhKGZyb20uQSk7XG4gICAgY29uc3QgdG9BID0gbm9ybWFsaXplQWxwaGEodG8uQSk7XG4gICAgY29uc3QgZGlmZkEgPSAodG9BIC0gZnJvbUEpIC8gZGl2O1xuICAgIHJldHVybiBBcnJheShzdGVwcykuZmlsbChudWxsKS5tYXAoKF9fbiwgaSkgPT4ge1xuICAgICAgICBpZiAoaSA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIGZyb207XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGkgPT09IGRpdikge1xuICAgICAgICAgICAgcmV0dXJuIHRvO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBSOiByb3VuZChmcm9tLlIgKyBkaWZmUiAqIGkpLFxuICAgICAgICAgICAgRzogcm91bmQoZnJvbS5HICsgZGlmZkcgKiBpKSxcbiAgICAgICAgICAgIEI6IHJvdW5kKGZyb20uQiArIGRpZmZCICogaSksXG4gICAgICAgICAgICBBOiByb3VuZChmcm9tQSArIGRpZmZBICogaSlcbiAgICAgICAgfTtcbiAgICB9KTtcbn07XG5leHBvcnQgY29uc3QgZ2V0Q29sb3JNaXh0dXJlID0gKGNvbG9yLCB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U0xDb2xvci5MKTtcbiAgICAgICAgICAgICAgICBpZiAoaGFzQWxwaGEpXG4gICAgICAgICAgICAgICAgICAgIFJHQkNvbG9yLkEgPSBIU0xDb2xvci5BO1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0NTU1xuICAgICAgICAgICAgICAgICAgICA/IGhhc0FscGhhXG4gICAgICAgICAgICAgICAgICAgICAgICA/IENTUy5IRVgoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4uLlJHQkNvbG9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEE6IHJvdW5kKFJHQkNvbG9yLkEgKiAyNTUpXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgOiBDU1MuSEVYKFJHQkNvbG9yKVxuICAgICAgICAgICAgICAgICAgICA6IGhhc0FscGhhXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHRyYW5zbGF0ZUNvbG9yLkhFWEEoUkdCQ29sb3IpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLkhFWChSR0JDb2xvcik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgY2FzZSBDb2xvck1vZGVsLlJHQjpcbiAgICAgICAgICAgIHJldHVybiBoc2xNYXAubWFwKChIU0xDb2xvcikgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IFJHQkNvbG9yID0gaHNsVG9SR0IoSFNMQ29sb3IuSCwgSFNMQ29sb3IuUywgSFNMQ29sb3IuTCk7XG4gICAgICAgICAgICAgICAgaWYgKGhhc0FscGhhKVxuICAgICAgICAgICAgICAgICAgICBSR0JDb2xvci5BID0gSFNMQ29sb3IuQTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNDU1NcbiAgICAgICAgICAgICAgICAgICAgPyBDU1MuUkdCKFJHQkNvbG9yLCBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICA6IGhhc0FscGhhXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHRyYW5zbGF0ZUNvbG9yLlJHQkEoUkdCQ29sb3IsIG9wdGlvbnMuZGVjaW1hbHMpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLlJHQihSR0JDb2xvciwgb3B0aW9ucy5kZWNpbWFscyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgY2FzZSBDb2xvck1vZGVsLkhTTDpcbiAgICAgICAgICAgIHJldHVybiBoc2xNYXAubWFwKChIU0xDb2xvcikgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0NTU1xuICAgICAgICAgICAgICAgICAgICA/IENTUy5IU0woSFNMQ29sb3IsIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgIDogaGFzQWxwaGFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gdHJhbnNsYXRlQ29sb3IuSFNMQSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4uaHNsVG9SR0IoSFNMQ29sb3IuSCwgSFNMQ29sb3IuUywgSFNMQ29sb3IuTCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQTogSFNMQ29sb3IuQVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgb3B0aW9ucy5kZWNpbWFscylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogdHJhbnNsYXRlQ29sb3IuSFNMKGhzbFRvUkdCKEhTTENvbG9yLkgsIEhTTENvbG9yLlMsIEhTTENvbG9yLkwpLCBvcHRpb25zLmRlY2ltYWxzKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICBjYXNlIENvbG9yTW9kZWwuQ0lFTGFiOlxuICAgICAgICAgICAgcmV0dXJuIGhzbE1hcC5tYXAoKEhTTENvbG9yKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgUkdCQ29sb3IgPSBoc2xUb1JHQihIU0xDb2xvci5ILCBIU0xDb2xvci5TLCBIU0xDb2xvci5MKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNDU1NcbiAgICAgICAgICAgICAgICAgICAgPyBDU1MuQ0lFTGFiKGhhc0FscGhhXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHRyYW5zbGF0ZUNvbG9yLkNJRUxhYkEoUkdCQ29sb3IsIG9wdGlvbnMuZGVjaW1hbHMpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLkNJRUxhYihSR0JDb2xvciwgb3B0aW9ucy5kZWNpbWFscyksIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgIDogaGFzQWxwaGFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gdHJhbnNsYXRlQ29sb3IuQ0lFTGFiQSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4uUkdCQ29sb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQTogSFNMQ29sb3IuQVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgb3B0aW9ucy5kZWNpbWFscylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogdHJhbnNsYXRlQ29sb3IuQ0lFTGFiKFJHQkNvbG9yLCBvcHRpb25zLmRlY2ltYWxzKTtcbiAgICAgICAgICAgIH0pO1xuICAgIH1cbn07XG5leHBvcnQgY29uc3QgY29sb3JIYXJtb255ID0ge1xuICAgIGJ1aWxkSGFybW9ueShjb2xvciwgaGFybW9ueUZ1bmN0aW9uLCBtb2RlLCBvcHRpb25zKSB7XG4gICAgICAgIGNvbnN0IG1vZGVsID0gZ2V0Q29sb3JNb2RlbChjb2xvcik7XG4gICAgICAgIGNvbnN0IFJHQiA9IGdldFJHQk9iamVjdChjb2xvciwgbW9kZWwpO1xuICAgICAgICBjb25zdCBIU0wgPSByZ2JUb0hTTChSR0IuUiwgUkdCLkcsIFJHQi5CLCBSR0IuQSk7XG4gICAgICAgIGNvbnN0IGhhc0FscGhhID0gKCh0eXBlb2YgY29sb3IgPT09ICdzdHJpbmcnICYmIGhhc1Byb3AoUkdCLCAnQScpKSB8fFxuICAgICAgICAgICAgKHR5cGVvZiBjb2xvciAhPT0gJ3N0cmluZycgJiYgaGFzUHJvcChjb2xvciwgJ0EnKSkpO1xuICAgICAgICBjb25zdCBpc0NTUyA9IHR5cGVvZiBjb2xvciA9PT0gJ3N0cmluZyc7XG4gICAgICAgIHN3aXRjaCAobW9kZWwpIHtcbiAgICAgICAgICAgIGNhc2UgQ29sb3JNb2RlbC5IRVg6XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHJldHVybiBoYXNBbHBoYVxuICAgICAgICAgICAgICAgICAgICA/IHRoaXMuSEVYQShyb3VuZEhTTE9iamVjdChIU0wsIDApLCBoYXJtb255RnVuY3Rpb24sIG1vZGUsIGlzQ1NTKVxuICAgICAgICAgICAgICAgICAgICA6IHRoaXMuSEVYKHJvdW5kSFNMT2JqZWN0KEhTTCwgMCksIGhhcm1vbnlGdW5jdGlvbiwgbW9kZSwgaXNDU1MpO1xuICAgICAgICAgICAgY2FzZSBDb2xvck1vZGVsLkhTTDpcbiAgICAgICAgICAgICAgICByZXR1cm4gaGFzQWxwaGFcbiAgICAgICAgICAgICAgICAgICAgPyB0aGlzLkhTTEEoSFNMLCBoYXJtb255RnVuY3Rpb24sIG1vZGUsIGlzQ1NTLCBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICA6IHRoaXMuSFNMKEhTTCwgaGFybW9ueUZ1bmN0aW9uLCBtb2RlLCBpc0NTUywgb3B0aW9ucyk7XG4gICAgICAgICAgICBjYXNlIENvbG9yTW9kZWwuUkdCOlxuICAgICAgICAgICAgICAgIHJldHVybiBoYXNBbHBoYVxuICAgICAgICAgICAgICAgICAgICA/IHRoaXMuUkdCQShIU0wsIGhhcm1vbnlGdW5jdGlvbiwgbW9kZSwgaXNDU1MsIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgIDogdGhpcy5SR0IoSFNMLCBoYXJtb255RnVuY3Rpb24sIG1vZGUsIGlzQ1NTLCBvcH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GNvbG9yLCBoYXJtb255RnVuY3Rpb24sIG1vZGUsIGNzcywgb3B0aW9ucykge1xuICAgICAgICBjb25zdCBhcnJheSA9IGhhcm1vbnlGdW5jdGlvbihjb2xvciwgbW9kZSk7XG4gICAgICAgIHJldHVybiBhcnJheS5tYXAoKGMpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IFJHQiA9IGhzbFRvUkdCKGMuSCwgYy5TLCBjLkwpO1xuICAgICAgICAgICAgcmV0dXJuIChjc3NcbiAgICAgICAgICAgICAgICA/IENTUy5DSUVMYWIocmdiVG9MYWIoUkdCLlIsIFJHQi5HLCBSR0IuQiksIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgOiB0cmFuc2xhdGVDb2xvci5DSUVMYWIoUkdCLCBvcHRpb25zLmRlY2ltYWxzKSk7XG4gICAgICAgIH0pO1xuICAgIH0sXG4gICAgQ0lFTGFiQShjb2xvciwgaGFybW9ueUZ1bmN0aW9uLCBtb2RlLCBjc3MsIG9wdGlvbnMpIHtcbiAgICAgICAgY29uc3QgYXJyYXkgPSBoYXJtb255RnVuY3Rpb24oY29sb3IsIG1vZGUpO1xuICAgICAgICByZXR1cm4gYXJyYXkubWFwKChjKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBSR0IgPSBoc2xUb1JHQihjLkgsIGMuUywgYy5MKTtcbiAgICAgICAgICAgIHJldHVybiAoY3NzXG4gICAgICAgICAgICAgICAgPyBDU1MuQ0lFTGFiKHtcbiAgICAgICAgICAgICAgICAgICAgLi4ucmdiVG9MYWIoUkdCLlIsIFJHQi5HLCBSR0IuQiksXG4gICAgICAgICAgICAgICAgICAgIEE6IG5vcm1hbGl6ZUFscGhhKGMuQSlcbiAgICAgICAgICAgICAgICB9LCBvcHRpb25zKVxuICAgICAgICAgICAgICAgIDogdHJhbnNsYXRlQ29sb3IuQ0lFTGFiQSh7XG4gICAgICAgICAgICAgICAgICAgIC4uLlJHQixcbiAgICAgICAgICAgICAgICAgICAgQTogbm9ybWFsaXplQWxwaGEoYy5BKVxuICAgICAgICAgICAgICAgIH0sIG9wdGlvbnMuZGVjaW1hbHMpKTtcbiAgICAgICAgfSk7XG4gICAgfVxufTtcbmV4cG9ydCBjb25zdCBjb2xvck1peGVyID0ge1xuICAgIG1peChjb2xvcnMsIG1vZGUpIHtcbiAgICAgICAgY29uc3QgcmdiTWFwID0gY29sb3JzLm1hcCgoY29sb3IpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG1vZGVsID0gZ2V0Q29sb3JNb2RlbChjb2xvcik7XG4gICAgICAgICAgICByZXR1cm4gZ2V0UkdCT2JqZWN0KGNvbG9yLCBtb2RlbCk7XG4gICAgICAgIH0pO1xuICAgICAgICBjb25zdCByeWJNYXAgPSBtb2RlID09PSBNaXguU1VCVFJBQ1RJVkVcbiAgICAgICAgICAgID8gcmdiTWFwLm1hcCgoY29sb3IpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBSWUIgPSByZ2JUb1JZQihjb2xvci5SLCBjb2xvci5HLCBjb2xvci5CKTtcbiAgICAgICAgICAgICAgICBpZiAoaGFzUHJvcChjb2xvciwgJ0EnKSkge1xuICAgICAgICAgICAgICAgICAgICBSWUIuQSA9IGNvbG9yLkE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBSWUI7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgOiBudWxsO1xuICAgICAgICBmdW5jdGlvbiBjcmVhdGVNaXgoaXRlbXMpIHtcbiAgICAgICAgICAgIGNvbnN0IGluaXRpYWwgPSBtb2RlID09PSBNaXguQURESVRJVkVcbiAgICAgICAgICAgICAgICA/IHsgUjogMCwgRzogMCwgQjogMCwgQTogMCB9XG4gICAgICAgICAgICAgICAgOiB7IFI6IDAsIFk6IDAsIEI6IDAsIEE6IDAgfTtcbiAgICAgICAgICAgIHJldHVybiBpdGVtcy5yZWR1Y2UoKG1peCwgY29sb3IpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBjb2xvckEgPSBoYXNQcm9wKGNvbG9yLCAnQScpID8gY29sb3IuQSA6IDE7XG4gICAgICAgICAgICAgICAgY29uc3QgY29tbW9uID0ge1xuICAgICAgICAgICAgICAgICAgICBSOiBNYXRoLm1pbihtaXguUiArIGNvbG9yLlIgKiBjb2xvckEsIDI1NSksXG4gICAgICAgICAgICAgICAgICAgIEI6IE1hdGgubWluKG1peC5CICsgY29sb3IuQiAqIGNvbG9yQSwgMjU1KSxcbiAgICAgICAgICAgICAgICAgICAgQTogMSAtICgxIC0gY29sb3JBKSAqICgxIC0gbWl4LkEpXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBjb25zdCBtaXhHWSA9ICdHJyBpbiBtaXhcbiAgICAgICAgICAgICAgICAgICAgPyBtaXguR1xuICAgICAgICAgICAgICAgICAgICA6IG1peC5ZO1xuICAgICAgICAgICAgICAgIGNvbnN0IGNvbG9yR1kgPSAnRycgaW4gY29sb3JcbiAgICAgICAgICAgICAgICAgICAgPyBjb2xvci5HXG4gICAgICAgICAgICAgICAgICAgIDogY29sb3IuWTtcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAuLi5jb21tb24sXG4gICAgICAgICAgICAgICAgICAgIC4uLihtb2RlID09PSBNaXguQURESVRJVkVcbiAgICAgICAgICAgICAgICAgICAgICAgID8geyBHOiBNYXRoLm1pbihtaXhHWSArIGNvbG9yR1kgKiBjb2xvckEsIDI1NSkgfVxuICAgICAgICAgICAgICAgICAgICAgICAgOiB7IFk6IE1hdGgubWluKG1peEdZICsgY29sb3JHWSAqIGNvbG9yQSwgMjU1KSB9KVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9LCBpbml0aWFsKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgbWl4O1xuICAgICAgICBpZiAobW9kZSA9PT0gTWl4LkFERElUSVZFKSB7XG4gICAgICAgICAgICBtaXggPSBjcmVhdGVNaXgocmdiTWFwKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IFJZQiA9IGNyZWF0ZU1peChyeWJNYXApO1xuICAgICAgICAgICAgbWl4ID0gcnliVG9SR0IoUllCLlIsIFJZQi5ZLCBSWUIuQik7XG4gICAgICAgICAgICBtaXguQSA9IFJZQi5BO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBSOiByb3VuZChtaXguUiksXG4gICAgICAgICAgICBHOiByb3VuZChtaXguRyksXG4gICAgICAgICAgICBCOiByb3VuZChtaXguQiksXG4gICAgICAgICAgICBBOiBtaW5tYXgobWl4LkEsIDAsIDEpXG4gICAgICAgIH07XG4gICAgfSxcbiAgICBbQ29sb3JNb2RlbC5IRVhdKGNvbG9ycywgbW9kZSwgY3NzKSB7XG4gICAgICAgIGNvbnN0IG1peCA9IHRoaXMubWl4KGNvbG9ycywgbW9kZSk7XG4gICAgICAgIGRlbGV0ZSBtaXguQTtcbiAgICAgICAgcmV0dXJuIChjc3NcbiAgICAgICAgICAgID8gQ1NTLkhFWChtaXgpXG4gICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLkhFWChtaXgpKTtcbiAgICB9LFxuICAgIEhFWEEoY29sb3JzLCBtb2RlLCBjc3MpIHtcbiAgICAgICAgY29uc3QgbWl4ID0gdGhpcy5taXgoY29sb3JzLCBtb2RlKTtcbiAgICAgICAgbWl4LkEgPSBjc3NcbiAgICAgICAgICAgID8gbm9ybWFsaXplQWxwaGEobWl4LkEpICogMjU1XG4gICAgICAgICAgICA6IG5vcm1hbGl6ZUFscGhhKG1peC5BKTtcbiAgICAgICAgcmV0dXJuIChjc3NcbiAgICAgICAgICAgID8gQ1NTLkhFWChtaXgpXG4gICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLkhFWEEobWl4KSk7XG4gICAgfSxcbiAgICBbQ29sb3JNb2RlbC5SR0JdKGNvbG9ycywgbW9kZSwgY3NzLCBvcHRpb25z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zdCByb3VuZFJHQk9iamVjdCA9IChjb2xvciwgZGVjaW1hbHMpID0+IHtcbiAgICBjb25zdCBSID0gcm91bmQoY29sb3IuUiwgZGVjaW1hbHMpO1xuICAgIGNvbnN0IEcgPSByb3VuZChjb2xvci5HLCBkZWNpbWFscyk7XG4gICAgY29uc3QgQiA9IHJvdW5kKGNvbG9yLkIsIGRlY2ltYWxzKTtcbiAgICByZXR1cm4ge1xuICAgICAgICBSLFxuICAgICAgICBHLFxuICAgICAgICBCLFxuICAgICAgICAuLi4oaGFzUHJvcChjb2xvciwgJ0EnKVxuICAgICAgICAgICAgPyB7XG4gICAgICAgICAgICAgICAgQTogcm91bmQoY29sb3IuQSwgZGVjaW1hbHMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICA6IHt9KVxuICAgIH07XG59O1xuZXhwb3J0IGNvbnN0IHJvdW5kSFNMT2JqZWN0ID0gKGNvbG9yLCBkZWNpbWFscykgPT4ge1xuICAgIHJldHVybiB7XG4gICAgICAgIEg6IHJvdW5kKGNvbG9yLkgsIGRlY2ltYWxzKSxcbiAgICAgICAgUzogcm91bmQoY29sb3IuUywgZGVjaW1hbHMpLFxuICAgICAgICBMOiByb3VuZChjb2xvci5MLCBkZWNpbWFscyksXG4gICAgICAgIC4uLihoYXNQcm9wKGNvbG9yLCAnQScpXG4gICAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgICBBOiByb3VuZChjb2xvci5BLCBkZWNpbWFscylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIDoge30pXG4gICAgfTtcbn07XG5leHBvcnQgY29uc3Qgcm91bmRDSUVMYWJPYmplY3QgPSAoY29sb3IsIGRlY2ltYWxzKSA9PiB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgTDogcm91bmQoY29sb3IuTCwgZGVjaW1hbHMpLFxuICAgICAgICBhOiByb3VuZChjb2xvci5hLCBkZWNpbWFscyksXG4gICAgICAgIGI6IHJvdW5kKGNvbG9yLmIsIGRlY2ltYWx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iAgICAgICAgcmV0dXJuIHJvdW5kKHRoaXMuY215ay5LLCB0aGlzLm9wdGlvbnMuZGVjaW1hbHMpO1xuICAgIH1cbiAgICBnZXQgSEVYT2JqZWN0KCkge1xuICAgICAgICByZXR1cm4gdXRpbHMudHJhbnNsYXRlQ29sb3IuSEVYKHRoaXMucmdiKTtcbiAgICB9XG4gICAgZ2V0IEhFWEFPYmplY3QoKSB7XG4gICAgICAgIHJldHVybiB1dGlscy50cmFuc2xhdGVDb2xvci5IRVhBKHRoaXMucmdiKTtcbiAgICB9XG4gICAgZ2V0IFJHQk9iamVjdCgpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIFI6IHRoaXMuUixcbiAgICAgICAgICAgIEc6IHRoaXMuRyxcbiAgICAgICAgICAgIEI6IHRoaXMuQlxuICAgICAgICB9O1xuICAgIH1cbiAgICBnZXQgUkdCQU9iamVjdCgpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIC4uLnRoaXMuUkdCT2JqZWN0LFxuICAgICAgICAgICAgQTogdGhpcy5BXG4gICAgICAgIH07XG4gICAgfVxuICAgIGdldCBIU0xPYmplY3QoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBIOiB0aGlzLkgsXG4gICAgICAgICAgICBTOiB0aGlzLlMsXG4gICAgICAgICAgICBMOiB0aGlzLkxcbiAgICAgICAgfTtcbiAgICB9XG4gICAgZ2V0IEhTTEFPYmplY3QoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAuLi50aGlzLkhTTE9iamVjdCxcbiAgICAgICAgICAgIEE6IHRoaXMuQVxuICAgICAgICB9O1xuICAgIH1cbiAgICBnZXQgQ0lFTGFiT2JqZWN0KCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgTDogdGhpcy5DSUVMLFxuICAgICAgICAgICAgYTogdGhpcy5DSUVhLFxuICAgICAgICAgICAgYjogdGhpcy5DSUViXG4gICAgICAgIH07XG4gICAgfVxuICAgIGdldCBDSUVMYWJBT2JqZWN0KCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgLi4udGhpcy5DSUVMYWJPYmplY3QsXG4gICAgICAgICAgICBBOiB0aGlzLkFcbiAgICAgICAgfTtcbiAgICB9XG4gICAgZ2V0IENNWUtPYmplY3QoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBDOiB0aGlzLkMsXG4gICAgICAgICAgICBNOiB0aGlzLk0sXG4gICAgICAgICAgICBZOiB0aGlzLlksXG4gICAgICAgICAgICBLOiB0aGlzLktcbiAgICAgICAgfTtcbiAgICB9XG4gICAgZ2V0IENNWUtBT2JqZWN0KCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgLi4udGhpcy5DTVlLT2JqZWN0LFxuICAgICAgICAgICAgQTogdGhpcy5BXG4gICAgICAgIH07XG4gICAgfVxuICAgIGdldCBIRVgoKSB7XG4gICAgICAgIHJldHVybiBDU1MuSEVYKHtcbiAgICAgICAgICAgIFI6IHRoaXMuUixcbiAgICAgICAgICAgIEc6IHRoaXMuRyxcbiAgICAgICAgICAgIEI6IHRoaXMuQlxuICAgICAgICB9KTtcbiAgICB9XG4gICAgZ2V0IEhFWEEoKSB7XG4gICAgICAgIHJldHVybiBDU1MuSEVYKHtcbiAgICAgICAgICAgIFI6IHRoaXMuUixcbiAgICAgICAgICAgIEc6IHRoaXMuRyxcbiAgICAgICAgICAgIEI6IHRoaXMuQixcbiAgICAgICAgICAgIEE6IHRoaXMuQSAqIDI1NVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgZ2V0IFJHQigpIHtcbiAgICAgICAgcmV0dXJuIENTUy5SR0Ioe1xuICAgICAgICAgICAgUjogdGhpcy5SLFxuICAgICAgICAgICAgRzogdGhpcy5HLFxuICAgICAgICAgICAgQjogdGhpcy5CXG4gICAgICAgIH0sIHRoaXMub3B0aW9ucyk7XG4gICAgfVxuICAgIGdldCBSR0JBKCkge1xuICAgICAgICByZXR1cm4gQ1NTLlJHQih7XG4gICAgICAgICAgICBSOiB0aGlzLlIsXG4gICAgICAgICAgICBHOiB0aGlzLkcsXG4gICAgICAgICAgICBCOiB0aGlzLkIsXG4gICAgICAgICAgICBBOiB0aGlzLkFcbiAgICAgICAgfSwgdGhpcy5vcHRpb25zKTtcbiAgICB9XG4gICAgZ2V0IEhTTCgpIHtcbiAgICAgICAgcmV0dXJuIENTUy5IU0woe1xuICAgICAgICAgICAgSDogdGhpcy5ILFxuICAgICAgICAgICAgUzogdGhpcy5TLFxuICAgICAgICAgICAgTDogdGhpcy5MXG4gICAgICAgIH0sIHRoaXMub3B0aW9ucyk7XG4gICAgfVxuICAgIGdldCBIU0xBKCkge1xuICAgICAgICByZXR1cm4gQ1NTLkhTTCh7XG4gICAgICAgICAgICBIOiB0aGlzLkgsXG4gICAgICAgICAgICBTOiB0aGlzLlMsXG4gICAgICAgICAgICBMOiB0aGlzLkwsXG4gICAgICAgICAgICBBOiB0aGlzLkFcbiAgICAgICAgfSwgdGhpcy5vcHRpb25zKTtcbiAgICB9XG4gICAgZ2V0IENJRUxhYigpIHtcbiAgICAgICAgcmV0dXJuIENTUy5DSUVMYWIoe1xuICAgICAgICAgICAgTDogdGhpcy5DSUVMLFxuICAgICAgICAgICAgYTogdGhpcy5DSUVhLFxuICAgICAgICAgICAgYjogdGhpcy5DSUViXG4gICAgICAgIH0sIHRoaXMub3B0aW9ucyk7XG4gICAgfVxuICAgIGdldCBDSUVMYWJBKCkge1xuICAgICAgICByZXR1cm4gQ1NTLkNJRUxhYih7XG4gICAgICAgICAgICBMOiB0aGlzLkNJRUwsXG4gICAgICAgICAgICBhOiB0aGlzLkNJRWEsXG4gICAgICAgICAgICBiOiB0aGlzLkNJRWIsXG4gICAgICAgICAgICBBOiB0aGlzLkFcbiAgICAgICAgfSwgdGhpcy5vcHRpb25zKTtcbiAgICB9XG4gICAgZ2V0IENNWUsoKSB7XG4gICAgICAgIHJldHVybiBDU1M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ZGVjaW1hbHM6IDAgfSk7XG5cbiAgICBmb3IgKGxldCByb3cgPSAwOyByb3cgPCAxMDsgcm93KyspIHtcblxuICAgICAgICBmb3IgKGxldCBjb2wgPSAwOyBjb2wgPCAxMDsgY29sKyspIHtcblxuICAgICAgICAgICAgY29sb3JcbiAgICAgICAgICAgICAgICAuc2V0Uyhyb3cgKiAxMClcbiAgICAgICAgICAgICAgICAuc2V0TChjb2wgKiA1ICsgMzApO1xuXG4gICAgICAgICAgICBjb25zdCBib3ggPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcblxuICAgICAgICAgICAgYm94LmNsYXNzTGlzdC5hZGQoJ2JveCcpO1xuICAgICAgICAgICAgYm94LnN0eWxlLmJhY2tncm91bmQgPSBjb2xvci5IRVg7XG5cbiAgICAgICAgICAgIGJveC5pbm5lclRleHQgPVxuICAgICAgICAgICAgICAgIGBSOiR7Y29sb3IuUn1cbiAgICAgICAgICAgICAgICAgRzoke2NvbG9yLkd9XG4gICAgICAgICAgICAgICAgIEI6JHtjb2xvci5CfWA7XG4gICAgICAgICAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQoYm94KTtcblxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbnRhaW5lcjtcblxufTsiLCJpbXBvcnQgJy4vc3R5bGVzLnNjc3MnO1xuXG5leHBvcnQgZGVmYXVsdCAoQ29sb3JUcmFuc2xhdG9yKSA9PiB7XG5cbiAgICBjb25zdCBjb250YWluZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcbiAgICBjb25zdCBjb2xvciA9IG5ldyBDb2xvclRyYW5zbGF0b3IoeyBSOiAyNTUsIEc6IDAsIEI6IDAgfSk7XG4gICAgY29uc3QgaHVlID0gWzAsIDMwLCA2MCwgMTIwLCAyNDAsIDI4MCwgMzIwLCAwXTtcbiAgICBsZXQgcmFpbmJvdztcblxuICAgIGZvciAobGV0IHIgPSAwOyByIDwgaHVlL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gICAgICAgICAgaWYgKGluZGV4ID49IHRvdGFsKSB7XG4gICAgICAgICAgICAgICAgaW5kZXggLT0gdG90YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoc2wuSCA9IGh1ZVtpbmRleF07XG4gICAgICAgICAgICBjb25zdCByZ2IgPSBodWVbaW5kZXhdID09PSB1bmRlZmluZWRcbiAgICAgICAgICAgICAgICA/ICcjRkZGJ1xuICAgICAgICAgICAgICAgIDogQ29sb3JUcmFuc2xhdG9yLnRvSEVYKGhzbCk7XG4gICAgICAgICAgICBjb25zdCBib3ggPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcblxuICAgICAgICAgICAgYm94LmNsYXNzTGlzdC5hZGQoJ2ZsYWcnKTtcbiAgICAgICAgICAgIGJveC5zdHlsZS5iYWNrZ3JvdW5kID0gcmdiO1xuXG4gICAgICAgICAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQoYm94KTtcblxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbnRhaW5lcjtcblxufTsiLCJpbXBvcnQgJy4vc3R5bGVzLnNjc3MnO1xuXG5leHBvcnQgZGVmYXVsdCAoQ29sb3JUcmFuc2xhdG9yKSA9PiB7XG5cbiAgICBjb25zdCBjb250YWluZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcbiAgICBjb25zdCBoZXhDb2xvcnMgPSBbXG4gICAgICAgICcjRkUyNzEyJywgJyNGRTU0MDknLCAnI0ZCOTkwMicsXG4gICAgICAgICcjRkFCRDAzJywgJyNGRkZFMzInLCAnI0QxRUEyQycsXG4gICAgICAgICcjNjZCMTMyJywgJyMwMzkyQ0UnLCAnIzAyNDdGRScsXG4gICAgICAgICcjM0QwMEE1JywgJyM4NjAxQjAnLCAnI0E3MTk0QidcbiAgICBdO1xuXG4gICAgaGV4Q29sb3JzLmZvckVhY2goKGNvbG9yKSA9PiB7XG5cbiAgICAgICAgY29uc3Qgcmd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IGNvbnRhaW5lciA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpO1xuICAgIGNvbnN0IGNvbG9ycyA9IFtcbiAgICAgICAgJ3JlZCcsXG4gICAgICAgICdsaW1lJyxcbiAgICAgICAgJ2JsdWUnLFxuICAgICAgICAnYXF1YScsXG4gICAgICAgICd5ZWxsb3cnLFxuICAgICAgICAnZnVjaHNpYSdcbiAgICBdO1xuICAgIGNvbnN0IHRvdGFsID0gY29sb3JzLmxlbmd0aDtcblxuICAgIGZvciAobGV0IHJvdyA9IDA7IHJvdyA8IHRvdGFsOyByb3crKykge1xuXG4gICAgICAgIGNvbnN0IGhzbCA9IENvbG9yVHJhbnNsYXRvci50b0hTTE9iamVjdChjb2xvcnNbcm93XSk7XG4gICAgICAgIGNvbnN0IHN0ZXAgPSBoc2wuUyAvICh0b3RhbCAtIDEpO1xuXG4gICAgICAgIGZvciAobGV0IGNvbCA9IDA7IGNvbCA8IHRvdGFsOyBjb2wrKykge1xuXG4gICAgICAgICAgICBjb25zdCByZ2IgPSBDb2xvclRyYW5zbGF0b3IudG9IRVgoaHNsKTtcbiAgICAgICAgICAgIGNvbnN0IGNteWsgPSBDb2xvclRyYW5zbGF0b3IudG9DTVlLT2JqZWN0KGhzbCwgeyBkZWNpbWFsczogMCB9KTtcblxuICAgICAgICAgICAgY29uc3QgYm94ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7XG4gICAgICAgICAgICBib3guY2xhc3NMaXN0LmFkZCgnYm94Jyk7XG4gICAgICAgICAgICBib3guc3R5bGUuYmFja2dyb3VuZCA9IHJnYjtcbiAgICAgICAgICAgIGJveC5pbm5lclRleHQgPSBgQzoke2NteWsuQ31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTToke2NteWsuTX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWToke2NteWsuWX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSzoke2NteWsuS31gO1x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aWxkKGNvbnRhaW5lcik7XG4gICAgICAgIGRlbW8uYXBwZW5kQ2hpbGQoZnVuY3Rpb1RvU3RyaW5nKG1vZHVsZSkpO1xuICAgIH0pO1xufSk7Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///861\n')}},__webpack_module_cache__={};function __webpack_require__(I){var g=__webpack_module_cache__[I];if(void 0!==g)return g.exports;var C=__webpack_module_cache__[I]={exports:{}};return __webpack_modules__[I](C,C.exports,__webpack_require__),C.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(I){if("object"==typeof window)return window}}();var __webpack_exports__=__webpack_require__(861),__webpack_export_target__=window;for(var i in __webpack_exports__)__webpack_export_target__[i]=__webpack_exports__[i];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var __webpack_modules__={966:(module,exports)=>{eval('var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function(){var r=null;\n(function(){function X(e){function j(){try{J.doScroll("left")}catch(e){P(j,50);return}w("poll")}function w(j){if(!(j.type=="readystatechange"&&x.readyState!="complete")&&((j.type=="load"?n:x)[z](i+j.type,w,!1),!m&&(m=!0)))e.call(n,j.type||j)}var Y=x.addEventListener,m=!1,C=!0,t=Y?"addEventListener":"attachEvent",z=Y?"removeEventListener":"detachEvent",i=Y?"":"on";if(x.readyState=="complete")e.call(n,"lazy");else{if(x.createEventObject&&J.doScroll){try{C=!n.frameElement}catch(A){}C&&j()}x[t](i+"DOMContentLoaded",\nw,!1);x[t](i+"readystatechange",w,!1);n[t](i+"load",w,!1)}}function Q(){S&&X(function(){var e=K.length;$(e?function(){for(var j=0;j=0;){var M=A[m],T=M.src.match(/^[^#?]*\\/run_prettify\\.js(\\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D=\n[],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]-\na[0]||a[1]-f[1]});b=[];g=[];for(a=0;ak[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\\[(?:[^\\\\\\]]|\\\\[\\S\\s])*]|\\\\u[\\dA-Fa-f]{4}|\\\\x[\\dA-Fa-f]{2}|\\\\\\d+|\\\\[^\\dux]|\\(\\?[!:=]|[()^]|[^()[\\\\^]+/g),c=a.length,d=[],g=0,k=0;g=2&&f==="["?a[g]=b(o):f!=="\\\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y,\ng),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\\S\\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:\'\'\'(?:[^\'\\\\]|\\\\[\\S\\s]|\'\'?(?=[^\']))*(?:\'\'\'|$)|"""(?:[^"\\\\]|\\\\[\\S\\s]|""?(?=[^"]))*(?:"""|$)|\'(?:[^\'\\\\]|\\\\[\\S\\s])*(?:\'|$)|"(?:[^"\\\\]|\\\\[\\S\\s])*(?:"|$))/,\nr,"\'\\""]):a.multiLineStrings?d.push(["str",/^(?:\'(?:[^\'\\\\]|\\\\[\\S\\s])*(?:\'|$)|"(?:[^"\\\\]|\\\\[\\S\\s])*(?:"|$)|`(?:[^\\\\`]|\\\\[\\S\\s])*(?:`|$))/,r,"\'\\"`"]):d.push(["str",/^(?:\'(?:[^\\n\\r\'\\\\]|\\\\.)*(?:\'|$)|"(?:[^\\n\\r"\\\\]|\\\\.)*(?:"|$))/,r,"\\"\'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\\b|[^\\n\\r]*)/,\nr,"#"]),h.push(["str",/^<(?:(?:(?:\\.\\.\\/)*|\\/?)(?:[\\w-]+(?:\\/[\\w-]+)+)?[\\w-]+\\.h(?:h|pp|\\+\\+)?|[a-z]\\w*)>/,r])):d.push(["com",/^#[^\\n\\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\\/\\/[^\\n\\r]*/,r]),h.push(["com",/^\\/\\*[\\S\\s]*?(?:\\*\\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\\n\\r")?".":"[\\\\S\\\\s]";h.push(["lang-regex",RegExp("^(?:^^\\\\.?|[+-]|[!=]=?=?|\\\\#|%=?|&&?=?|\\\\(|\\\\*=?|[+\\\\-]=|->|\\\\/=?|::?|<>?>?=?|,|;|\\\\?|@|\\\\[|~|{|\\\\^\\\\^?=?|\\\\|\\\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\\\s*("+\n("/(?=[^/*"+b+"])(?:[^/\\\\x5B\\\\x5C"+b+"]|\\\\x5C"+e+"|\\\\x5B(?:[^\\\\x5C\\\\x5D"+b+"]|\\\\x5C"+e+")*(?:\\\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\\s,]+/g,"|")+")\\\\b"),r]);d.push(["pln",/^\\s+/,r," \\r\\n\\t\\u00a0"]);b="^.[^\\\\s\\\\w.$@\'\\"`/\\\\\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\\w$@]*|\\w+_t\\b)/,r],["pln",/^[$_a-z][\\w$@]*/i,r],["lit",/^(?:0x[\\da-f]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+-]?\\d+)?)[a-z]*/i,\nr,"0123456789"],["pln",/^\\\\[\\S\\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}}\nfunction e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\\s)nocode(?:\\s|$)/,m=/\\r\\n?|\\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\\s*=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],\n"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],\nL=[K,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],\nN=[G,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],R=[G,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\\d*)\\b/,\nS=/\\S/,T=t({keywords:[J,L,O,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\\!--[\\S\\s]*?(?:--\\>|$)/],["lang-",/^<\\?([\\S\\s]+?)(?:\\?>|$)/],["lang-",/^<%([\\S\\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",\n/^]*>([\\S\\s]+?)<\\/xmp\\b[^>]*>/i],["lang-js",/^]*>([\\S\\s]*?)(<\\/script\\b[^>]*>)/i],["lang-css",/^]*>([\\S\\s]*?)(<\\/style\\b[^>]*>)/i],["lang-in.tag",/^(<\\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\\s+/,r," \\t\\r\\n"],["atv",/^(?:"[^"]*"?|\'[^\']*\'?)/,r,"\\"\'"]],[["tag",/^^<\\/?[a-z](?:[\\w-.:]*\\w)?|\\/?>$/i],["atn",/^(?!style[\\s=]|on)[a-z](?:[\\w:-]*\\w)?/i],["lang-uq.val",/^=\\s*([^\\s"\'>]*(?:[^\\s"\'/>]|\\/(?=\\s)))/],["pun",/^[/<->]+/],\n["lang-js",/^on\\w+\\s*=\\s*"([^"]+)"/i],["lang-js",/^on\\w+\\s*=\\s*\'([^\']+)\'/i],["lang-js",/^on\\w+\\s*=\\s*([^\\s"\'>]+)/i],["lang-css",/^style\\s*=\\s*"([^"]+)"/i],["lang-css",/^style\\s*=\\s*\'([^\']+)\'/i],["lang-css",/^style\\s*=\\s*([^\\s"\'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\\S\\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}),\n["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N,\nhashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]);\ni(C([],[["str",/^[\\S\\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="
"+a+"
";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML},\nprettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p{"use strict";eval('\n// EXTERNAL MODULE: ./node_modules/.pnpm/google-code-prettify@1.0.5/node_modules/google-code-prettify/bin/run_prettify.min.js\nvar run_prettify_min = __webpack_require__(966);\n;// ./node_modules/.pnpm/whatwg-fetch@3.6.20/node_modules/whatwg-fetch/fetch.js\n/* eslint-disable no-prototype-builtins */\nvar g =\n (typeof globalThis !== \'undefined\' && globalThis) ||\n (typeof self !== \'undefined\' && self) ||\n // eslint-disable-next-line no-undef\n (typeof __webpack_require__.g !== \'undefined\' && __webpack_require__.g) ||\n {}\n\nvar support = {\n searchParams: \'URLSearchParams\' in g,\n iterable: \'Symbol\' in g && \'iterator\' in Symbol,\n blob:\n \'FileReader\' in g &&\n \'Blob\' in g &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: \'FormData\' in g,\n arrayBuffer: \'ArrayBuffer\' in g\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n \'[object Int8Array]\',\n \'[object Uint8Array]\',\n \'[object Uint8ClampedArray]\',\n \'[object Int16Array]\',\n \'[object Uint16Array]\',\n \'[object Int32Array]\',\n \'[object Uint32Array]\',\n \'[object Float32Array]\',\n \'[object Float64Array]\'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== \'string\') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&\'*+.^_`|~!]/i.test(name) || name === \'\') {\n throw new TypeError(\'Invalid character in header field name: "\' + name + \'"\')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== \'string\') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nfunction Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n if (header.length != 2) {\n throw new TypeError(\'Headers constructor: expected name/value pair to be length 2, found\' + header.length)\n }\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + \', \' + value : value\n}\n\nHeaders.prototype[\'delete\'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body._noBody) return\n if (body.bodyUsed) {\n return Promise.reject(new TypeError(\'Already read\'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type)\n var encoding = match ? match[1] : \'utf-8\'\n reader.readAsText(blob, encoding)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join(\'\')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n // eslint-disable-next-line no-self-assign\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._noBody = true;\n this._bodyText = \'\'\n } else if (typeof body === \'string\') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can\'t handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get(\'content-type\')) {\n if (typeof body === \'string\') {\n this.headers.set(\'content-type\', \'text/plain;charset=UTF-8\')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set(\'content-type\', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set(\'content-type\', \'application/x-www-form-urlencoded;charset=UTF-8\')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error(\'could not read FormData body as blob\')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else if (support.blob) {\n return this.blob().then(readBlobAsArrayBuffer)\n } else {\n throw new Error(\'could not read as ArrayBuffer\')\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error(\'could not read FormData body as text\')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = [\'CONNECT\', \'DELETE\', \'GET\', \'HEAD\', \'OPTIONS\', \'PATCH\', \'POST\', \'PUT\', \'TRACE\']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nfunction Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError(\'Please use the "new" operator, this DOM object constructor cannot be called as a function.\')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError(\'Already read\')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || \'same-origin\'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || \'GET\')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal || (function () {\n if (\'AbortController\' in g) {\n var ctrl = new AbortController();\n return ctrl.signal;\n }\n }());\n this.referrer = null\n\n if ((this.method === \'GET\' || this.method === \'HEAD\') && body) {\n throw new TypeError(\'Body not allowed for GET or HEAD requests\')\n }\n this._initBody(body)\n\n if (this.method === \'GET\' || this.method === \'HEAD\') {\n if (options.cache === \'no-store\' || options.cache === \'no-cache\') {\n // Search for a \'_\' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, \'$1_=\' + new Date().getTime())\n } else {\n // Otherwise add a new \'_\' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? \'&\' : \'?\') + \'_=\' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split(\'&\')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split(\'=\')\n var name = split.shift().replace(/\\+/g, \' \')\n var value = split.join(\'=\').replace(/\\+/g, \' \')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, \' \')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split(\'\\r\')\n .map(function(header) {\n return header.indexOf(\'\\n\') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(\':\')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(\':\').trim()\n try {\n headers.append(key, value)\n } catch (error) {\n console.warn(\'Response \' + error.message)\n }\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nfunction Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError(\'Please use the "new" operator, this DOM object constructor cannot be called as a function.\')\n }\n if (!options) {\n options = {}\n }\n\n this.type = \'default\'\n this.status = options.status === undefined ? 200 : options.status\n if (this.status < 200 || this.status > 599) {\n throw new RangeError("Failed to construct \'Response\': The status provided (0) is outside the range [200, 599].")\n }\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? \'\' : \'\' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || \'\'\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 200, statusText: \'\'})\n response.ok = false\n response.status = 0\n response.type = \'error\'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError(\'Invalid status code\')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nvar DOMException = g.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nfunction fetch_fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException(\'Aborted\', \'AbortError\'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || \'\')\n }\n // This check if specifically for when a user fetches a file locally from the file system\n // Only if the status is out of a normal range\n if (request.url.indexOf(\'file://\') === 0 && (xhr.status < 200 || xhr.status > 599)) {\n options.status = 200;\n } else {\n options.status = xhr.status;\n }\n options.url = \'responseURL\' in xhr ? xhr.responseURL : options.headers.get(\'X-Request-URL\')\n var body = \'response\' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError(\'Network request failed\'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError(\'Network request timed out\'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException(\'Aborted\', \'AbortError\'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === \'\' && g.location.href ? g.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === \'include\') {\n xhr.withCredentials = true\n } else if (request.credentials === \'omit\') {\n xhr.withCredentials = false\n }\n\n if (\'responseType\' in xhr) {\n if (support.blob) {\n xhr.responseType = \'blob\'\n } else if (\n support.arrayBuffer\n ) {\n xhr.responseType = \'arraybuffer\'\n }\n }\n\n if (init && typeof init.headers === \'object\' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {\n var names = [];\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n names.push(normalizeName(name))\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n request.headers.forEach(function(value, name) {\n if (names.indexOf(name) === -1) {\n xhr.setRequestHeader(name, value)\n }\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener(\'abort\', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener(\'abort\', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === \'undefined\' ? null : request._bodyInit)\n })\n}\n\nfetch_fetch.polyfill = true\n\nif (!g.fetch) {\n g.fetch = fetch_fetch\n g.Headers = Headers\n g.Request = Request\n g.Response = Response\n}\n\n;// ./src/constants/numbers.ts\nconst MAX_DECIMALS = 6;\nconst DEFAULT_BLEND_STEPS = 5;\nconst DEFAULT_SHADES_TINTS_STEPS = 5;\n\n;// ./src/constants/enums.ts\nvar ColorModel;\n(function (ColorModel) {\n ColorModel["HEX"] = "HEX";\n ColorModel["RGB"] = "RGB";\n ColorModel["HSL"] = "HSL";\n ColorModel["CIELab"] = "CIELab";\n ColorModel["CMYK"] = "CMYK";\n})(ColorModel || (ColorModel = {}));\nvar Harmony;\n(function (Harmony) {\n Harmony["ANALOGOUS"] = "ANALOGOUS";\n Harmony["COMPLEMENTARY"] = "COMPLEMENTARY";\n Harmony["SPLIT_COMPLEMENTARY"] = "SPLIT_COMPLEMENTARY";\n Harmony["TRIADIC"] = "TRIADIC";\n Harmony["TETRADIC"] = "TETRADIC";\n Harmony["SQUARE"] = "SQUARE";\n})(Harmony || (Harmony = {}));\nvar Mix;\n(function (Mix) {\n Mix["ADDITIVE"] = "ADDITIVE";\n Mix["SUBTRACTIVE"] = "SUBTRACTIVE";\n})(Mix || (Mix = {}));\nvar ColorKeywords;\n(function (ColorKeywords) {\n ColorKeywords["black"] = "#000000";\n ColorKeywords["silver"] = "#C0C0C0";\n ColorKeywords["gray"] = "#808080";\n ColorKeywords["white"] = "#FFFFFF";\n ColorKeywords["maroon"] = "#800000";\n ColorKeywords["red"] = "#FF0000";\n ColorKeywords["purple"] = "#800080";\n ColorKeywords["fuchsia"] = "#FF00FF";\n ColorKeywords["green"] = "#008000";\n ColorKeywords["lime"] = "#00FF00";\n ColorKeywords["olive"] = "#808000";\n ColorKeywords["yellow"] = "#FFFF00";\n ColorKeywords["navy"] = "#000080";\n ColorKeywords["blue"] = "#0000FF";\n ColorKeywords["teal"] = "#008080";\n ColorKeywords["aqua"] = "#00FFFF";\n ColorKeywords["orange"] = "#FFA500";\n ColorKeywords["aliceblue"] = "#F0F8FF";\n ColorKeywords["antiquewhite"] = "#FAEBD7";\n ColorKeywords["aquamarine"] = "#7FFFD4";\n ColorKeywords["azure"] = "#F0FFFF";\n ColorKeywords["beige"] = "#F5F5DC";\n ColorKeywords["bisque"] = "#FFE4C4";\n ColorKeywords["blanchedalmond"] = "#FFEBCD";\n ColorKeywords["blueviolet"] = "#8A2BE2";\n ColorKeywords["brown"] = "#A52A2A";\n ColorKeywords["burlywood"] = "#DEB887";\n ColorKeywords["cadetblue"] = "#5F9EA0";\n ColorKeywords["chartreuse"] = "#7FFF00";\n ColorKeywords["chocolate"] = "#D2691E";\n ColorKeywords["coral"] = "#FF7F50";\n ColorKeywords["cornflowerblue"] = "#6495ED";\n ColorKeywords["cornsilk"] = "#FFF8DC";\n ColorKeywords["crimson"] = "#DC143C";\n ColorKeywords["cyan"] = "#00FFFF";\n ColorKeywords["darkblue"] = "#00008B";\n ColorKeywords["darkcyan"] = "#008B8B";\n ColorKeywords["darkgoldenrod"] = "#B8860B";\n ColorKeywords["darkgray"] = "#A9A9A9";\n ColorKeywords["darkgreen"] = "#006400";\n ColorKeywords["darkgrey"] = "#A9A9A9";\n ColorKeywords["darkkhaki"] = "#BDB76B";\n ColorKeywords["darkmagenta"] = "#8B008B";\n ColorKeywords["darkolivegreen"] = "#556B2F";\n ColorKeywords["darkorange"] = "#FF8C00";\n ColorKeywords["darkorchid"] = "#9932CC";\n ColorKeywords["darkred"] = "#8B0000";\n ColorKeywords["darksalmon"] = "#E9967A";\n ColorKeywords["darkseagreen"] = "#8FBC8F";\n ColorKeywords["darkslateblue"] = "#483D8B";\n ColorKeywords["darkslategray"] = "#2F4F4F";\n ColorKeywords["darkslategrey"] = "#2F4F4F";\n ColorKeywords["darkturquoise"] = "#00CED1";\n ColorKeywords["darkviolet"] = "#9400D3";\n ColorKeywords["deeppink"] = "#FF1493";\n ColorKeywords["deepskyblue"] = "#00BFFF";\n ColorKeywords["dimgray"] = "#696969";\n ColorKeywords["dimgrey"] = "#696969";\n ColorKeywords["dodgerblue"] = "#1E90FF";\n ColorKeywords["firebrick"] = "#B22222";\n ColorKeywords["floralwhite"] = "#FFFAF0";\n ColorKeywords["forestgreen"] = "#228B22";\n ColorKeywords["gainsboro"] = "#DCDCDC";\n ColorKeywords["ghostwhite"] = "#F8F8FF";\n ColorKeywords["gold"] = "#FFD700";\n ColorKeywords["goldenrod"] = "#DAA520";\n ColorKeywords["greenyellow"] = "#ADFF2F";\n ColorKeywords["grey"] = "#808080";\n ColorKeywords["honeydew"] = "#F0FFF0";\n ColorKeywords["hotpink"] = "#FF69B4";\n ColorKeywords["indianred"] = "#CD5C5C";\n ColorKeywords["indigo"] = "#4B0082";\n ColorKeywords["ivory"] = "#FFFFF0";\n ColorKeywords["khaki"] = "#F0E68C";\n ColorKeywords["lavender"] = "#E6E6FA";\n ColorKeywords["lavenderblush"] = "#FFF0F5";\n ColorKeywords["lawngreen"] = "#7CFC00";\n ColorKeywords["lemonchiffon"] = "#FFFACD";\n ColorKeywords["lightblue"] = "#ADD8E6";\n ColorKeywords["lightcoral"] = "#F08080";\n ColorKeywords["lightcyan"] = "#E0FFFF";\n ColorKeywords["lightgoldenrodyellow"] = "#FAFAD2";\n ColorKeywords["lightgray"] = "#D3D3D3";\n ColorKeywords["lightgreen"] = "#90EE90";\n ColorKeywords["lightgrey"] = "#D3D3D3";\n ColorKeywords["lightpink"] = "#FFB6C1";\n ColorKeywords["lightsalmon"] = "#FFA07A";\n ColorKeywords["lightseagreen"] = "#20B2AA";\n ColorKeywords["lightskyblue"] = "#87CEFA";\n ColorKeywords["lightslategray"] = "#778899";\n ColorKeywords["lightslategrey"] = "#778899";\n ColorKeywords["lightsteelblue"] = "#B0C4DE";\n ColorKeywords["lightyellow"] = "#FFFFE0";\n ColorKeywords["limegreen"] = "#32CD32";\n ColorKeywords["linen"] = "#FAF0E6";\n ColorKeywords["magenta"] = "#FF00FF";\n ColorKeywords["mediumaquamarine"] = "#66CDAA";\n ColorKeywords["mediumblue"] = "#0000CD";\n ColorKeywords["mediumorchid"] = "#BA55D3";\n ColorKeywords["mediumpurple"] = "#9370DB";\n ColorKeywords["mediumseagreen"] = "#3CB371";\n ColorKeywords["mediumslateblue"] = "#7B68EE";\n ColorKeywords["mediumspringgreen"] = "#00FA9A";\n ColorKeywords["mediumturquoise"] = "#48D1CC";\n ColorKeywords["mediumvioletred"] = "#C71585";\n ColorKeywords["midnightblue"] = "#191970";\n ColorKeywords["mintcream"] = "#F5FFFA";\n ColorKeywords["mistyrose"] = "#FFE4E1";\n ColorKeywords["moccasin"] = "#FFE4B5";\n ColorKeywords["navajowhite"] = "#FFDEAD";\n ColorKeywords["oldlace"] = "#FDF5E6";\n ColorKeywords["olivedrab"] = "#6B8E23";\n ColorKeywords["orangered"] = "#FF4500";\n ColorKeywords["orchid"] = "#DA70D6";\n ColorKeywords["palegoldenrod"] = "#EEE8AA";\n ColorKeywords["palegreen"] = "#98FB98";\n ColorKeywords["paleturquoise"] = "#AFEEEE";\n ColorKeywords["palevioletred"] = "#DB7093";\n ColorKeywords["papayawhip"] = "#FFEFD5";\n ColorKeywords["peachpuff"] = "#FFDAB9";\n ColorKeywords["peru"] = "#CD853F";\n ColorKeywords["pink"] = "#FFC0CB";\n ColorKeywords["plum"] = "#DDA0DD";\n ColorKeywords["powderblue"] = "#B0E0E6";\n ColorKeywords["rosybrown"] = "#BC8F8F";\n ColorKeywords["royalblue"] = "#4169E1";\n ColorKeywords["saddlebrown"] = "#8B4513";\n ColorKeywords["salmon"] = "#FA8072";\n ColorKeywords["sandybrown"] = "#F4A460";\n ColorKeywords["seagreen"] = "#2E8B57";\n ColorKeywords["seashell"] = "#FFF5EE";\n ColorKeywords["sienna"] = "#A0522D";\n ColorKeywords["skyblue"] = "#87CEEB";\n ColorKeywords["slateblue"] = "#6A5ACD";\n ColorKeywords["slategray"] = "#708090";\n ColorKeywords["slategrey"] = "#708090";\n ColorKeywords["snow"] = "#FFFAFA";\n ColorKeywords["springgreen"] = "#00FF7F";\n ColorKeywords["steelblue"] = "#4682B4";\n ColorKeywords["tan"] = "#D2B48C";\n ColorKeywords["thistle"] = "#D8BFD8";\n ColorKeywords["tomato"] = "#FF6347";\n ColorKeywords["turquoise"] = "#40E0D0";\n ColorKeywords["violet"] = "#EE82EE";\n ColorKeywords["wheat"] = "#F5DEB3";\n ColorKeywords["whitesmoke"] = "#F5F5F5";\n ColorKeywords["yellowgreen"] = "#9ACD32";\n ColorKeywords["rebeccapurple"] = "#663399";\n})(ColorKeywords || (ColorKeywords = {}));\nconst COLOR_KEYS = Object.keys(ColorKeywords);\nconst COLOR_PROPS = {\n HEX: [\'R\', \'G\', \'B\', \'A\'],\n RGB: [\'R\', \'G\', \'B\', \'A\'],\n HSL: [\'H\', \'S\', \'L\', \'A\'],\n CIELab: [\'L\', \'a\', \'b\', \'A\'],\n CMYK: [\'C\', \'M\', \'Y\', \'K\', \'A\']\n};\nconst VALID_COLOR_OBJECTS = {\n BGR: ColorModel.RGB,\n ABGR: ColorModel.RGB,\n HLS: ColorModel.HSL,\n AHLS: ColorModel.HSL,\n LAB: ColorModel.CIELab,\n ALAB: ColorModel.CIELab,\n CKMY: ColorModel.CMYK,\n ACKMY: ColorModel.CMYK\n};\nvar TypeOf;\n(function (TypeOf) {\n TypeOf["NUMBER"] = "number";\n TypeOf["BOOLEAN"] = "boolean";\n})(TypeOf || (TypeOf = {}));\n\n;// ./src/constants/regexps.ts\n\nconst COLORREGS = {\n [ColorModel.HEX]: /^#(?:([a-f\\d])([a-f\\d])([a-f\\d])([a-f\\d])?|([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?)$/i,\n [ColorModel.RGB]: /^rgba?\\s*\\(\\s*(?:((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)(?:\\s*,\\s*((?:\\d*\\.)?\\d+))?|((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)(?:\\s*\\/\\s*((?:\\d*\\.)?\\d+%?))?)\\s*\\)$/,\n [ColorModel.HSL]: /^hsla?\\s*\\(\\s*(?:(-?(?:\\d*\\.)?\\d+(?:deg|grad|rad|turn)?)\\s*,\\s*((?:\\d*\\.)?\\d+)%\\s*,\\s*((?:\\d*\\.)?\\d+)%(?:\\s*,\\s*((?:\\d*\\.)?\\d+))?|(-?(?:\\d*\\.)?\\d+(?:deg|grad|rad|turn)?)\\s*((?:\\d*\\.)?\\d+)%\\s*((?:\\d*\\.)?\\d+)%(?:\\s*\\/\\s*((?:\\d*\\.)?\\d+%?))?)\\s*\\)$/,\n [ColorModel.CIELab]: /^lab\\s*\\(\\s*(?:((?:\\d*\\.)?\\d+%?)\\s*(-?(?:\\d*\\.)?\\d+%?)\\s*(-?(?:\\d*\\.)?\\d+%?)(?:\\s*\\/\\s*((?:\\d*\\.)?\\d+%?))?)\\s*\\)$/,\n [ColorModel.CMYK]: /^(?:device-cmyk|cmyk)\\s*\\(\\s*(?:((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)\\s*,\\s*((?:\\d*\\.)?\\d+%?)(?:\\s*,\\s*((?:\\d*\\.)?\\d+))?|((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)\\s*((?:\\d*\\.)?\\d+%?)(?:\\s*\\/\\s*((?:\\d*\\.)?\\d+%?))?)\\s*\\)$/\n};\nconst HSL_HUE = /^(-?(?:\\d*\\.)?\\d+)((?:deg|grad|rad|turn)?)$/;\nconst PCENT = /^(-?\\d+(?:\\.\\d+)?|-?\\.\\d+)%$/;\nconst HEX = /^0x([a-f\\d]{1,2})$/i;\nconst TEMPLATE_VAR = /\\{(\\d+)\\}/g;\nconst COMMAS_AND_NEXT_CHARS = /,( +|\\d+)/g;\nconst SPACES = / +/;\n\n;// ./src/constants/errors.ts\nconst ERRORS = {\n NOT_ACCEPTED_STRING_INPUT: \'The provided string color doesn\\\'t have a correct format\',\n NOT_ACCEPTED_OBJECT_INPUT: \'The provided color object doesn\\\'t have the proper keys or format\'\n};\n\n;// ./src/@types/index.ts\nvar AnglesUnitEnum;\n(function (AnglesUnitEnum) {\n AnglesUnitEnum["NONE"] = "none";\n AnglesUnitEnum["DEGREES"] = "deg";\n AnglesUnitEnum["GRADIANS"] = "grad";\n AnglesUnitEnum["RADIANS"] = "rad";\n AnglesUnitEnum["TURNS"] = "turn";\n})(AnglesUnitEnum || (AnglesUnitEnum = {}));\nvar ColorUnitEnum;\n(function (ColorUnitEnum) {\n ColorUnitEnum["NONE"] = "none";\n ColorUnitEnum["PERCENT"] = "percent";\n})(ColorUnitEnum || (ColorUnitEnum = {}));\nvar CMYKFunctionEnum;\n(function (CMYKFunctionEnum) {\n CMYKFunctionEnum["DEVICE_CMYK"] = "device-cmyk";\n CMYKFunctionEnum["CMYK"] = "cmyk";\n})(CMYKFunctionEnum || (CMYKFunctionEnum = {}));\n\n;// ./src/constants/options.ts\n\n\nconst DEFAULT_OPTIONS = {\n decimals: MAX_DECIMALS,\n legacyCSS: false,\n spacesAfterCommas: false,\n anglesUnit: AnglesUnitEnum.NONE,\n rgbUnit: ColorUnitEnum.NONE,\n labUnit: ColorUnitEnum.NONE,\n cmykUnit: ColorUnitEnum.PERCENT,\n alphaUnit: ColorUnitEnum.NONE,\n cmykFunction: CMYKFunctionEnum.DEVICE_CMYK\n};\n\n;// ./src/constants/index.ts\n\n\n\n\n\n\n\n;// ./src/helpers/index.ts\n\n\nconst hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nconst percentNumber = (percent) => {\n return +`${percent}`.replace(PCENT, \'$1\');\n};\nconst percent = (percent) => PCENT.test(`${percent}`)\n ? percentNumber(percent)\n : Math.min(+percent, 100);\nconst getDEC = (hex) => {\n if (hex.length === 1) {\n hex += hex;\n }\n return parseInt(hex, 16);\n};\nconst getHEX = (number) => {\n const hex = round(number, 0).toString(16).toUpperCase();\n if (hex.length === 1) {\n return `0x0${hex}`;\n }\n return `0x${hex}`;\n};\nconst toHEX = (h) => {\n let hex = round(h, 0).toString(16).toUpperCase();\n if (hex.length === 1) {\n hex = `0${hex}`;\n }\n return hex;\n};\nconst from255NumberToPercent = (value, decimals) => round(value / 255 * 100, decimals);\nconst from125NumberToPercent = (value, decimals) => round(value / 125 * 100, decimals);\nconst getBase255Number = (color, alpha = false) => {\n if (!alpha && PCENT.test(color)) {\n return Math.min(255 * percentNumber(color) / 100, 255);\n }\n if (HEX.test(color)) {\n if (color.length === 3) {\n color += color.slice(-1);\n }\n return alpha\n ? round(color) / 255\n : round(color);\n }\n return Math.min(+color, alpha ? 1 : 255);\n};\nconst getBase125Number = (color) => {\n if (PCENT.test(color)) {\n return minmax(125 * percentNumber(color) / 100, -125, 125);\n }\n return minmax(+color, -125, 125);\n};\nconst getCMYKNumber = (color) => Math.min(PCENT.test(color) ? percentNumber(color) / 100 : +color, 1);\nconst getOrderedArrayString = (keys) => [...keys].sort().join(\'\').toUpperCase();\nconst round = (value, decimals = MAX_DECIMALS) => {\n const exp = Math.pow(10, decimals);\n return Math.round(+value * exp) / exp;\n};\nconst minmax = (n, min, max) => Math.max(min, Math.min(n, max));\nconst degrees = (radian) => radian * 180 / Math.PI;\nconst radians = (degrees) => degrees * Math.PI / 180;\nconst pi2 = 360;\nconst normalizeHue = (hue) => {\n if (typeof hue === \'string\') {\n const matches = hue.match(HSL_HUE);\n const value = +matches[1];\n const units = matches[2];\n switch (units) {\n case AnglesUnitEnum.RADIANS:\n hue = round(degrees(value));\n break;\n case AnglesUnitEnum.TURNS:\n hue = round(value * pi2);\n break;\n case AnglesUnitEnum.GRADIANS:\n hue = round(9 / 10 * value);\n break;\n case AnglesUnitEnum.DEGREES:\n default:\n hue = value;\n }\n }\n if (hue > 360 || hue < 0) {\n hue -= Math.floor(hue / pi2) * pi2;\n }\n return hue;\n};\nconst translateDegrees = (degrees, units) => {\n let hue;\n switch (units) {\n case AnglesUnitEnum.RADIANS:\n hue = round(radians(degrees));\n break;\n case AnglesUnitEnum.TURNS:\n hue = round(degrees / pi2);\n break;\n case AnglesUnitEnum.GRADIANS:\n hue = round(10 / 9 * degrees);\n break;\n case AnglesUnitEnum.DEGREES:\n case AnglesUnitEnum.NONE:\n default:\n hue = degrees;\n }\n return hue;\n};\nconst getOptionsFromColorInput = (options, ...colors) => {\n const cssColors = [];\n const hslColors = [];\n const rgbColors = [];\n const labColors = [];\n const cmykColors = [];\n const alphaValues = [];\n const anglesUnitValues = Object.values(AnglesUnitEnum);\n const colorUnitValues = Object.values(ColorUnitEnum);\n const cmykFunctionValues = Object.values(CMYKFunctionEnum);\n const matchOptions = {\n legacyCSS: 0,\n spacesAfterCommas: 0,\n cmykFunction: 0\n };\n for (const color of colors) {\n if (typeof color === \'string\') {\n cssColors.push(color);\n if (color.includes(\',\')) {\n matchOptions.legacyCSS++;\n const commasWithNextCharacter = color.match(COMMAS_AND_NEXT_CHARS);\n if (new Set(commasWithNextCharacter).size === 1 &&\n SPACES.test(commasWithNextCharacter[0].slice(1))) {\n matchOptions.spacesAfterCommas++;\n }\n }\n if (color.match(COLORREGS.HSL)) {\n const match = color.match(COLORREGS.HSL);\n const angle = match[1] || match[5];\n const alpha = match[8];\n const angleUnit = angle.match(HSL_HUE)[2];\n hslColors.push(angleUnit === \'\'\n ? AnglesUnitEnum.NONE\n : angleUnit);\n alphaValues.push(PCENT.test(alpha));\n continue;\n }\n if (COLORREGS.RGB.test(color)) {\n const match = color.match(COLORREGS.RGB);\n const R = match[1] || match[5];\n const G = match[2] || match[6];\n const B = match[3] || match[7];\n const A = match[8];\n rgbColors.push(PCENT.test(R) &&\n PCENT.test(G) &&\n PCENT.test(B));\n alphaValues.push(PCENT.test(A));\n continue;\n }\n if (COLORREGS.CIELab.test(color)) {\n const match = color.match(COLORREGS.CIELab);\n const L = match[1];\n const a = match[2];\n const b = match[3];\n const A = match[4];\n labColors.push(PCENT.test(L) &&\n PCENT.test(a) &&\n PCENT.test(b));\n alphaValues.push(PCENT.test(A));\n continue;\n }\n if (color.match(COLORREGS.CMYK)) {\n const match = color.match(COLORREGS.CMYK);\n const C = match[1] || match[6];\n const M = match[2] || match[7];\n const Y = match[3] || match[8];\n const K = match[4] || match[9];\n const A = match[10];\n cmykColors.push(PCENT.test(C) &&\n PCENT.test(M) &&\n PCENT.test(Y) &&\n PCENT.test(K));\n if (color.startsWith(\'cmyk\')) {\n matchOptions.cmykFunction++;\n }\n alphaValues.push(PCENT.test(A));\n }\n }\n }\n return {\n decimals: typeof options.decimals === TypeOf.NUMBER\n ? options.decimals\n : DEFAULT_OPTIONS.decimals,\n legacyCSS: typeof options.legacyCSS === TypeOf.BOOLEAN\n ? options.legacyCSS\n : Boolean(cssColors.length &&\n matchOptions.legacyCSS === cssColors.length) || DEFAULT_OPTIONS.legacyCSS,\n spacesAfterCommas: typeof options.spacesAfterCommas === TypeOf.BOOLEAN\n ? options.spacesAfterCommas\n : Boolean(cssColors.length &&\n matchOptions.spacesAfterCommas === cssColors.length) || DEFAULT_OPTIONS.spacesAfterCommas,\n anglesUnit: options.anglesUnit && anglesUnitValues.includes(options.anglesUnit)\n ? options.anglesUnit\n : (new Set(hslColors).size === 1\n ? hslColors[0]\n : DEFAULT_OPTIONS.anglesUnit),\n rgbUnit: options.rgbUnit && colorUnitValues.includes(options.rgbUnit)\n ? options.rgbUnit\n : (new Set(rgbColors).size === 1 && rgbColors[0]\n ? ColorUnitEnum.PERCENT\n : DEFAULT_OPTIONS.rgbUnit),\n labUnit: options.labUnit && colorUnitValues.includes(options.labUnit)\n ? options.labUnit\n : (new Set(labColors).size === 1 && labColors[0]\n ? ColorUnitEnum.PERCENT\n : DEFAULT_OPTIONS.labUnit),\n cmykUnit: options.cmykUnit && colorUnitValues.includes(options.cmykUnit)\n ? options.cmykUnit\n : (new Set(cmykColors).size === 1 && !cmykColors[0]\n ? ColorUnitEnum.NONE\n : DEFAULT_OPTIONS.cmykUnit),\n alphaUnit: options.alphaUnit && colorUnitValues.includes(options.alphaUnit)\n ? options.alphaUnit\n : (new Set(alphaValues).size === 1 && alphaValues[0]\n ? ColorUnitEnum.PERCENT\n : DEFAULT_OPTIONS.alphaUnit),\n cmykFunction: options.cmykFunction && cmykFunctionValues.includes(options.cmykFunction)\n ? options.cmykFunction\n : (cmykColors.length && cmykColors.length === matchOptions.cmykFunction\n ? CMYKFunctionEnum.CMYK\n : DEFAULT_OPTIONS.cmykFunction)\n };\n};\nconst isHarmony = (param) => {\n return `${param}` in Harmony;\n};\nconst isMix = (param) => {\n return `${param}` in Mix;\n};\n\n;// ./src/color/translators.ts\n\nconst MATRIX_LRGB_XYZ_D50 = [\n [0.4360747, 0.3850649, 0.1430804],\n [0.2225045, 0.7168786, 0.0606169],\n [0.0139322, 0.0971045, 0.7141733]\n];\nconst MATRIX_XYZ_D50_LRGB = [\n [3.1338561, -1.6168667, -0.4906146],\n [-0.9787684, 1.9161415, 0.033454],\n [0.0719453, -0.2289914, 1.4052427]\n];\nconst TRISTIMULUS_D50 = MATRIX_LRGB_XYZ_D50.map((matrix) => {\n return matrix.reduce((sum, value) => sum + value, 0);\n});\nconst hueToRGB = (t1, t2, hue) => {\n if (hue < 0) {\n hue += 6;\n }\n if (hue >= 6) {\n hue -= 6;\n }\n if (hue < 1) {\n return round(((t2 - t1) * hue + t1) * 255);\n }\n else if (hue < 3) {\n return round(t2 * 255);\n }\n else if (hue < 4) {\n return round(((t2 - t1) * (4 - hue) + t1) * 255);\n }\n else {\n return round(t1 * 255);\n }\n};\nconst rgbToLinearLightRGB = (value) => {\n return value <= 0.04045\n ? value / 12.92\n : ((value + 0.055) / 1.055) ** 2.4;\n};\nconst linearLightRGBToRGB = (value) => {\n return value <= 0.0031308\n ? 12.92 * value\n : 1.055 * (value ** (1 / 2.4)) - 0.055;\n};\nconst matrixVectorMultiplication = (v1, v2, v3, matrix) => {\n const result = [0, 0, 0];\n const linearRGB = [v1, v2, v3];\n matrix.forEach((array, index) => {\n array.forEach((value, mindex) => {\n result[index] += value * linearRGB[mindex];\n });\n });\n return result;\n};\nconst from_CIE_XYZ_D50_to_CIE_LAB = (x, y, z) => {\n const f = (t) => {\n return t > (6 / 29) ** 3\n ? Math.cbrt(t)\n : t / (3 * (6 / 29) ** 2) + (4 / 29);\n };\n const fx = f(x / TRISTIMULUS_D50[0]);\n const fy = f(y / TRISTIMULUS_D50[1]);\n const fz = f(z / TRISTIMULUS_D50[2]);\n return [\n 116 * fy - 16,\n 500 * (fx - fy),\n 200 * (fy - fz)\n ];\n};\nconst from_CIE_LAB_to_CIE_XYZ_D50 = (L, a, b) => {\n const f = (t) => {\n return t > 6 / 29\n ? t ** 3\n : 3 * (6 / 29) ** 2 * (t - 4 / 29);\n };\n const fl = (L + 16) / 116;\n const fa = a / 500;\n const fb = b / 200;\n return [\n TRISTIMULUS_D50[0] * f(fl + fa),\n TRISTIMULUS_D50[1] * f(fl),\n TRISTIMULUS_D50[2] * f(fl - fb)\n ];\n};\nconst hslToRGB = (H, S, L) => {\n H /= 60;\n S /= 100;\n L /= 100;\n const t2 = (L <= .5)\n ? L * (S + 1)\n : L + S - (L * S);\n const t1 = L * 2 - t2;\n const R = hueToRGB(t1, t2, H + 2);\n const G = hueToRGB(t1, t2, H);\n const B = hueToRGB(t1, t2, H - 2);\n return { R, G, B };\n};\nconst rgbToHSL = (R, G, B, A = 1) => {\n R /= 255;\n G /= 255;\n B /= 255;\n A = Math.min(A, 1);\n const MAX = Math.max(R, G, B);\n const MIN = Math.min(R, G, B);\n const D = MAX - MIN;\n let H = 0;\n let S = 0;\n const L = (MAX + MIN) / 2;\n if (D !== 0) {\n switch (MAX) {\n case R:\n H = ((G - B) / D) % 6;\n break;\n case G:\n H = (B - R) / D + 2;\n break;\n case B:\n H = (R - G) / D + 4;\n break;\n }\n H = round(H * 60);\n if (H < 0) {\n H += 360;\n }\n S = D / (1 - Math.abs(2 * L - 1));\n }\n return {\n H,\n S: round(S * 100),\n L: round(L * 100),\n A\n };\n};\nconst rgbToLab = (R, G, B) => {\n const LINEAR_LIGHT_RGB = [\n R / 255,\n G / 255,\n B / 255\n ].map(rgbToLinearLightRGB);\n const CIE_XYZ_D50 = matrixVectorMultiplication(LINEAR_LIGHT_RGB[0], LINEAR_LIGHT_RGB[1], LINEAR_LIGHT_RGB[2], MATRIX_LRGB_XYZ_D50);\n const CIE_LAB = from_CIE_XYZ_D50_to_CIE_LAB(CIE_XYZ_D50[0], CIE_XYZ_D50[1], CIE_XYZ_D50[2]);\n return {\n L: CIE_LAB[0],\n a: CIE_LAB[1],\n b: CIE_LAB[2]\n };\n};\nconst labToRgb = (L, a, b) => {\n const CIE_XYZ_D50 = from_CIE_LAB_to_CIE_XYZ_D50(L, a, b);\n const LINEAR_LIGHT_RGB = matrixVectorMultiplication(CIE_XYZ_D50[0], CIE_XYZ_D50[1], CIE_XYZ_D50[2], MATRIX_XYZ_D50_LRGB);\n const RGB = LINEAR_LIGHT_RGB.map(linearLightRGBToRGB);\n return {\n R: minmax(RGB[0] * 255, 0, 255),\n G: minmax(RGB[1] * 255, 0, 255),\n B: minmax(RGB[2] * 255, 0, 255)\n };\n};\nconst cmykToRGB = (C, M, Y, K) => {\n K = 1 - K;\n const R = round(255 * (1 - C) * K);\n const G = round(255 * (1 - M) * K);\n const B = round(255 * (1 - Y) * K);\n return { R, G, B };\n};\nconst rgbToCMYK = (R, G, B) => {\n R /= 255;\n G /= 255;\n B /= 255;\n const K = 1 - Math.max(R, G, B);\n const K1 = 1 - K;\n const C = K1 && (K1 - R) / K1;\n const M = K1 && (K1 - G) / K1;\n const Y = K1 && (K1 - B) / K1;\n return {\n C: round(C * 100),\n M: round(M * 100),\n Y: round(Y * 100),\n K: round(K * 100)\n };\n};\nconst rgbToRYB = (R, G, B) => {\n const Iw = Math.min(R, G, B);\n const Ib = Math.min(255 - R, 255 - G, 255 - B);\n const rRGB = R - Iw;\n const gRGB = G - Iw;\n const bRGB = B - Iw;\n const minRG = Math.min(rRGB, gRGB);\n const rRYB = rRGB - minRG;\n const yRYB = (gRGB + minRG) / 2;\n const bRYB = (bRGB + gRGB - minRG) / 2;\n const n = Math.max(rRYB, yRYB, bRYB) / Math.max(rRGB, gRGB, bRGB);\n const N = isNaN(n) || n === Infinity || n <= 0 ? 1 : n;\n return {\n R: rRYB / N + Ib,\n Y: yRYB / N + Ib,\n B: bRYB / N + Ib\n };\n};\nconst rybToRGB = (R, Y, B) => {\n const Iw = Math.min(R, Y, B);\n const Ib = Math.min(255 - R, 255 - Y, 255 - B);\n const rRYB = R - Iw;\n const yRYB = Y - Iw;\n const bRYB = B - Iw;\n const minYB = Math.min(yRYB, bRYB);\n const rRGB = rRYB + yRYB - minYB;\n const gRGB = yRYB + minYB;\n const bRGB = 2 * (bRYB - minYB);\n const n = Math.max(rRGB, gRGB, bRGB) / Math.max(rRYB, yRYB, bRYB);\n const N = isNaN(n) || n === Infinity || n <= 0 ? 1 : n;\n return {\n R: rRGB / N + Ib,\n G: gRGB / N + Ib,\n B: bRGB / N + Ib\n };\n};\nconst hueRYB = (hue, toRYB) => {\n if (hue < 0)\n hue += 360;\n if (hue > 360)\n hue -= 360;\n if (hue === 360 || hue === 0)\n return hue;\n const map1 = [\n [0, 120],\n [120, 180],\n [180, 240],\n [240, 360]\n ];\n const map2 = [\n [0, 60],\n [60, 120],\n [120, 240],\n [240, 360]\n ];\n const from = toRYB ? map1 : map2;\n const to = toRYB ? map2 : map1;\n let A = 0;\n let B = 0;\n let C = 0;\n let D = 0;\n from.find((arr, index) => {\n if (hue >= arr[0] && hue < arr[1]) {\n A = arr[0];\n B = arr[1];\n C = to[index][0];\n D = to[index][1];\n return true;\n }\n return false;\n });\n return C + (hue - A) * ((D - C) / (B - A));\n};\n\n;// ./src/color/css.ts\n\n\n\nconst getComma = (withSpace) => withSpace\n ? \', \'\n : \',\';\nconst prepareColorForCss = (color, transformer) => {\n const props = getOrderedArrayString(Object.keys(color));\n const model = VALID_COLOR_OBJECTS[props];\n const keys = COLOR_PROPS[model];\n return keys.reduce((result, key, index) => {\n const value = color[key];\n if (typeof value !== \'undefined\') {\n result.push(transformer(value, index));\n }\n return result;\n }, []);\n};\nconst getResultFromTemplate = (template, vars) => {\n return template.replace(TEMPLATE_VAR, (__match, indexStr) => {\n const index = +indexStr - 1;\n return `${vars[index]}`;\n });\n};\nconst getAlpha = (value, options, ignoreLegacy = false) => {\n const { alphaUnit, legacyCSS, decimals } = options;\n if (alphaUnit === ColorUnitEnum.PERCENT &&\n (!legacyCSS ||\n ignoreLegacy)) {\n return `${round(value * 100, decimals)}%`;\n }\n return round(value, decimals);\n};\nconst CSS = {\n [ColorModel.HEX]: (color) => {\n const transformer = (value) => toHEX(round(value));\n const values = prepareColorForCss(color, transformer);\n const template = values.length === 4\n ? \'#{1}{2}{3}{4}\'\n : \'#{1}{2}{3}\';\n return getResultFromTemplate(template, values);\n },\n [ColorModel.RGB]: (color, options) => {\n const { decimals, legacyCSS, spacesAfterCommas, rgbUnit } = options;\n const comma = getComma(spacesAfterCommas);\n const transformer = (value, index) => {\n return rgbUnit === ColorUnitEnum.PERCENT && index < 3\n ? `${from255NumberToPercent(value, decimals)}%`\n : (index === 3\n ? getAlpha(value, options)\n : round(value, decimals));\n };\n const values = prepareColorForCss(color, transformer);\n const template = legacyCSS\n ? (values.length === 4\n ? `rgba({1}${comma}{2}${comma}{3}${comma}{4})`\n : `rgb({1}${comma}{2}${comma}{3})`)\n : (values.length === 4\n ? `rgb({1} {2} {3} / {4})`\n : `rgb({1} {2} {3})`);\n return getResultFromTemplate(template, values);\n },\n [ColorModel.HSL]: (color, options) => {\n const { decimals, legacyCSS, spacesAfterCommas, anglesUnit } = options;\n const comma = getComma(spacesAfterCommas);\n const transformer = (value, index) => {\n if (index === 0 &&\n anglesUnit !== AnglesUnitEnum.NONE) {\n const translated = round(translateDegrees(value, anglesUnit), decimals);\n return `${translated}${anglesUnit}`;\n }\n return index === 3\n ? getAlpha(value, options)\n : round(value, decimals);\n };\n const values = prepareColorForCss(color, transformer);\n const template = legacyCSS\n ? (values.length === 4\n ? `hsla({1}${comma}{2}%${comma}{3}%${comma}{4})`\n : `hsl({1}${comma}{2}%${comma}{3}%)`)\n : (values.length === 4\n ? `hsl({1} {2}% {3}% / {4})`\n : `hsl({1} {2}% {3}%)`);\n return getResultFromTemplate(template, values);\n },\n [ColorModel.CIELab]: (color, options) => {\n const { decimals, labUnit } = options;\n const transformer = (value, index) => {\n if (index === 0) {\n const L = round(percent(value), decimals);\n return labUnit === ColorUnitEnum.PERCENT\n ? `${L}%`\n : `${L}`;\n }\n if (index < 3) {\n return labUnit === ColorUnitEnum.PERCENT\n ? `${from125NumberToPercent(value, decimals)}%`\n : round(value, decimals);\n }\n return getAlpha(value, options, true);\n };\n const values = prepareColorForCss(color, transformer);\n const template = values.length === 4\n ? `lab({1} {2} {3} / {4})`\n : `lab({1} {2} {3})`;\n return getResultFromTemplate(template, values);\n },\n [ColorModel.CMYK]: (color, options) => {\n const { decimals, legacyCSS, spacesAfterCommas, cmykUnit, cmykFunction } = options;\n const comma = getComma(spacesAfterCommas);\n const transformer = (value, index) => {\n if (cmykUnit === ColorUnitEnum.PERCENT &&\n index < 4) {\n return `${round(value, decimals)}%`;\n }\n return index === 4\n ? getAlpha(value, options)\n : round(value / 100, decimals);\n };\n const values = prepareColorForCss(color, transformer);\n const template = legacyCSS\n ? (values.length === 5\n ? `${cmykFunction}({1}${comma}{2}${comma}{3}${comma}{4}${comma}{5})`\n : `${cmykFunction}({1}${comma}{2}${comma}{3}${comma}{4})`)\n : (values.length === 5\n ? `${cmykFunction}({1} {2} {3} {4} / {5})`\n : `${cmykFunction}({1} {2} {3} {4})`);\n return getResultFromTemplate(template, values);\n }\n};\n\n;// ./src/color/utils.ts\n\n\n\n\nconst normalizeAlpha = (alpha) => {\n if (typeof alpha === \'string\') {\n if (PCENT.test(alpha)) {\n alpha = percentNumber(alpha) / 100;\n }\n else {\n alpha = +alpha;\n }\n }\n return (isNaN(+alpha) || alpha > 1) ? 1 : round(alpha);\n};\nconst harmony = (color, angles, mode) => angles.reduce((arr, num) => ([\n ...arr,\n {\n ...color,\n H: mode === Mix.ADDITIVE\n ? normalizeHue(color.H + num)\n : normalizeHue(hueRYB(hueRYB(color.H, false) + num, true))\n }\n]), [{ ...color }]);\nconst analogous = (color, mode) => harmony(color, [30, -30], mode);\nconst complementary = (color, mode) => harmony(color, [180], mode);\nconst splitComplementary = (color, mode) => harmony(color, [150, -150], mode);\nconst triadic = (color, mode) => harmony(color, [120, -120], mode);\nconst tetradic = (color, mode) => harmony(color, [60, -120, 180], mode);\nconst square = (color, mode) => harmony(color, [90, -90, 180], mode);\nconst getColorModelFromString = (color) => {\n let model;\n Object.keys(ColorModel).some((p) => {\n const reg = COLORREGS[p];\n if (reg.test(color)) {\n model = p;\n return true;\n }\n });\n if (!model &&\n !!~COLOR_KEYS.indexOf(color)) {\n model = ColorModel.HEX;\n }\n if (!model) {\n throw new Error(ERRORS.NOT_ACCEPTED_STRING_INPUT);\n }\n return model;\n};\nconst getColorModelFromObject = (color) => {\n let model;\n let invalid = false;\n const props = getOrderedArrayString(Object.keys(color));\n if (VALID_COLOR_OBJECTS[props]) {\n model = VALID_COLOR_OBJECTS[props];\n }\n if (model && model === ColorModel.RGB) {\n const hasInvalidHex = Object.entries(color).some((item) => {\n return !HEX.test(`${item[1]}`);\n });\n const hasInvalidRegb = Object.entries(color).some((item) => {\n return !(PCENT.test(`${item[1]}`) ||\n (!HEX.test(`${item[1]}`) &&\n !isNaN(+item[1]) &&\n +item[1] <= 255));\n });\n if (hasInvalidHex && hasInvalidRegb) {\n invalid = true;\n }\n if (!hasInvalidHex) {\n model = ColorModel.HEX;\n }\n }\n if (!model || invalid) {\n throw new Error(ERRORS.NOT_ACCEPTED_OBJECT_INPUT);\n }\n return model;\n};\nconst getColorModel = (color) => typeof color === \'string\'\n ? getColorModelFromString(color)\n : getColorModelFromObject(color);\nconst getRGBObjectFromString = {\n [ColorModel.HEX](color) {\n const colorStr = !~COLOR_KEYS.indexOf(color)\n ? color\n : ColorKeywords[color];\n const match = colorStr.match(COLORREGS.HEX);\n const object = {\n R: getDEC(match[1] || match[5]),\n G: getDEC(match[2] || match[6]),\n B: getDEC(match[3] || match[7])\n };\n const A = match[4] || match[8];\n if (A !== undefined) {\n object.A = getDEC(A) / 255;\n }\n return object;\n },\n [ColorModel.RGB](color) {\n const match = color.match(COLORREGS.RGB);\n const R = getBase255Number(match[1] || match[5]);\n const G = getBase255Number(match[2] || match[6]);\n const B = getBase255Number(match[3] || match[7]);\n const A = match[4] || match[8];\n const object = {\n R: Math.min(R, 255),\n G: Math.min(G, 255),\n B: Math.min(B, 255)\n };\n if (A !== undefined) {\n object.A = normalizeAlpha(A);\n }\n return object;\n },\n [ColorModel.HSL](color) {\n const match = color.match(COLORREGS.HSL);\n const H = normalizeHue(match[1] || match[5]);\n const S = percent(match[2] || match[6]);\n const L = percent(match[3] || match[7]);\n const A = match[4] || match[8];\n const RGB = hslToRGB(H, S, L);\n if (A !== undefined) {\n RGB.A = normalizeAlpha(A);\n }\n return RGB;\n },\n [ColorModel.CIELab](color) {\n const match = color.match(COLORREGS.CIELab);\n const L = percent(match[1]);\n const a = getBase125Number(match[2]);\n const b = getBase125Number(match[3]);\n const A = match[4];\n const RGB = labToRgb(L, a, b);\n if (A !== undefined) {\n RGB.A = normalizeAlpha(A);\n }\n return RGB;\n },\n [ColorModel.CMYK](color) {\n const match = color.match(COLORREGS.CMYK);\n const C = getCMYKNumber(match[1] || match[6]);\n const M = getCMYKNumber(match[2] || match[7]);\n const Y = getCMYKNumber(match[3] || match[8]);\n const K = getCMYKNumber(match[4] || match[9]);\n const A = match[5] || match[10];\n const RGB = cmykToRGB(C, M, Y, K);\n if (A !== undefined) {\n RGB.A = normalizeAlpha(A);\n }\n return RGB;\n }\n};\nconst getRGBObjectFromObject = {\n [ColorModel.HEX](color) {\n const object = {\n R: getBase255Number(`${color.R}`),\n G: getBase255Number(`${color.G}`),\n B: getBase255Number(`${color.B}`)\n };\n if (hasProp(color, \'A\')) {\n object.A = Math.min(getBase255Number(`${color.A}`, true), 1);\n }\n return object;\n },\n [ColorModel.RGB](color) {\n return this.HEX(color);\n },\n [ColorModel.HSL](color) {\n const S = percent(`${color.S}`);\n const L = percent(`${color.L}`);\n const RGB = hslToRGB(normalizeHue(color.H), S, L);\n if (hasProp(color, \'A\')) {\n RGB.A = normalizeAlpha(color.A);\n }\n return RGB;\n },\n [ColorModel.CIELab](color) {\n const L = percent(`${color.L}`);\n const a = getBase125Number(`${color.a}`);\n const b = getBase125Number(`${color.b}`);\n const RGB = labToRgb(L, a, b);\n if (hasProp(color, \'A\')) {\n RGB.A = normalizeAlpha(color.A);\n }\n return RGB;\n },\n [ColorModel.CMYK](color) {\n const C = getCMYKNumber(`${color.C}`);\n const M = getCMYKNumber(`${color.M}`);\n const Y = getCMYKNumber(`${color.Y}`);\n const K = getCMYKNumber(`${color.K}`);\n const RGB = cmykToRGB(C, M, Y, K);\n if (hasProp(color, \'A\')) {\n RGB.A = normalizeAlpha(color.A);\n }\n return RGB;\n }\n};\nconst getRGBObject = (color, model = getColorModel(color)) => {\n return typeof color === \'string\'\n ? getRGBObjectFromString[model](color)\n : getRGBObjectFromObject[model](color);\n};\nconst translateColor = {\n [ColorModel.HEX](color) {\n return {\n R: getHEX(color.R),\n G: getHEX(color.G),\n B: getHEX(color.B)\n };\n },\n HEXA(color) {\n const RGB = translateColor.HEX(color);\n RGB.A = hasProp(color, \'A\')\n ? getHEX(color.A * 255)\n : \'0xFF\';\n return RGB;\n },\n [ColorModel.RGB](color, decimals) {\n const RGB = roundRGBObject(color, decimals);\n if (hasProp(RGB, \'A\')) {\n delete RGB.A;\n }\n return RGB;\n },\n RGBA(color, decimals) {\n const RGB = translateColor.RGB(color, decimals);\n RGB.A = hasProp(color, \'A\')\n ? round(color.A)\n : 1;\n return RGB;\n },\n [ColorModel.HSL](color, decimals) {\n const HSL = rgbToHSL(color.R, color.G, color.B);\n delete HSL.A;\n return roundHSLObject(HSL, decimals);\n },\n HSLA(color, decimals) {\n const HSL = translateColor.HSL(color, decimals);\n HSL.A = hasProp(color, \'A\')\n ? round(color.A, decimals)\n : 1;\n return HSL;\n },\n [ColorModel.CIELab](color, decimals) {\n const Lab = rgbToLab(color.R, color.G, color.B);\n return roundCIELabObject(Lab, decimals);\n },\n CIELabA(color, decimals) {\n const Lab = translateColor.CIELab(color, decimals);\n Lab.A = hasProp(color, \'A\')\n ? round(color.A, decimals)\n : 1;\n return Lab;\n },\n [ColorModel.CMYK](color, decimals) {\n return roundCMYKObject(rgbToCMYK(color.R, color.G, color.B), decimals);\n },\n CMYKA(color, decimals) {\n const CMYK = translateColor.CMYK(color, decimals);\n CMYK.A = hasProp(color, \'A\')\n ? round(color.A, decimals)\n : 1;\n return CMYK;\n }\n};\nconst blend = (from, to, steps) => {\n const div = steps - 1;\n const diffR = (to.R - from.R) / div;\n const diffG = (to.G - from.G) / div;\n const diffB = (to.B - from.B) / div;\n const fromA = normalizeAlpha(from.A);\n const toA = normalizeAlpha(to.A);\n const diffA = (toA - fromA) / div;\n return Array(steps).fill(null).map((__n, i) => {\n if (i === 0) {\n return from;\n }\n if (i === div) {\n return to;\n }\n return {\n R: round(from.R + diffR * i),\n G: round(from.G + diffG * i),\n B: round(from.B + diffB * i),\n A: round(fromA + diffA * i)\n };\n });\n};\nconst getColorMixture = (color, steps, shades, options) => {\n const model = getColorModel(color);\n const isCSS = typeof color === \'string\';\n const RGB = getRGBObject(color, model);\n const hasAlpha = ((typeof color === \'string\' && hasProp(RGB, \'A\')) ||\n (typeof color !== \'string\' && hasProp(color, \'A\')));\n const HSL = rgbToHSL(RGB.R, RGB.G, RGB.B, RGB.A);\n if (!hasAlpha)\n delete HSL.A;\n const increment = shades\n ? HSL.L / (steps + 1)\n : (100 - HSL.L) / (steps + 1);\n const hslMap = Array(steps).fill(null).map((__n, i) => ({\n ...HSL,\n L: HSL.L + increment * (i + 1) * (1 - +shades * 2)\n }));\n switch (model) {\n case ColorModel.HEX:\n default:\n return hslMap.map((HSLColor) => {\n const RGBColor = hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L);\n if (hasAlpha)\n RGBColor.A = HSLColor.A;\n return isCSS\n ? hasAlpha\n ? CSS.HEX({\n ...RGBColor,\n A: round(RGBColor.A * 255)\n })\n : CSS.HEX(RGBColor)\n : hasAlpha\n ? translateColor.HEXA(RGBColor)\n : translateColor.HEX(RGBColor);\n });\n case ColorModel.RGB:\n return hslMap.map((HSLColor) => {\n const RGBColor = hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L);\n if (hasAlpha)\n RGBColor.A = HSLColor.A;\n return isCSS\n ? CSS.RGB(RGBColor, options)\n : hasAlpha\n ? translateColor.RGBA(RGBColor, options.decimals)\n : translateColor.RGB(RGBColor, options.decimals);\n });\n case ColorModel.HSL:\n return hslMap.map((HSLColor) => {\n return isCSS\n ? CSS.HSL(HSLColor, options)\n : hasAlpha\n ? translateColor.HSLA({\n ...hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L),\n A: HSLColor.A\n }, options.decimals)\n : translateColor.HSL(hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L), options.decimals);\n });\n case ColorModel.CIELab:\n return hslMap.map((HSLColor) => {\n const RGBColor = hslToRGB(HSLColor.H, HSLColor.S, HSLColor.L);\n return isCSS\n ? CSS.CIELab(hasAlpha\n ? translateColor.CIELabA(RGBColor, options.decimals)\n : translateColor.CIELab(RGBColor, options.decimals), options)\n : hasAlpha\n ? translateColor.CIELabA({\n ...RGBColor,\n A: HSLColor.A\n }, options.decimals)\n : translateColor.CIELab(RGBColor, options.decimals);\n });\n }\n};\nconst colorHarmony = {\n buildHarmony(color, harmonyFunction, mode, options) {\n const model = getColorModel(color);\n const RGB = getRGBObject(color, model);\n const HSL = rgbToHSL(RGB.R, RGB.G, RGB.B, RGB.A);\n const hasAlpha = ((typeof color === \'string\' && hasProp(RGB, \'A\')) ||\n (typeof color !== \'string\' && hasProp(color, \'A\')));\n const isCSS = typeof color === \'string\';\n switch (model) {\n case ColorModel.HEX:\n default:\n return hasAlpha\n ? this.HEXA(roundHSLObject(HSL, 0), harmonyFunction, mode, isCSS)\n : this.HEX(roundHSLObject(HSL, 0), harmonyFunction, mode, isCSS);\n case ColorModel.HSL:\n return hasAlpha\n ? this.HSLA(HSL, harmonyFunction, mode, isCSS, options)\n : this.HSL(HSL, harmonyFunction, mode, isCSS, options);\n case ColorModel.RGB:\n return hasAlpha\n ? this.RGBA(HSL, harmonyFunction, mode, isCSS, options)\n : this.RGB(HSL, harmonyFunction, mode, isCSS, options);\n case ColorModel.CIELab:\n return hasAlpha\n ? this.CIELabA(HSL, harmonyFunction, mode, isCSS, options)\n : this.CIELab(HSL, harmonyFunction, mode, isCSS, options);\n }\n },\n [ColorModel.HEX](color, harmonyFunction, mode, css) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.HEX(hslToRGB(c.H, c.S, c.L))\n : translateColor.HEX(hslToRGB(c.H, c.S, c.L))));\n },\n HEXA(color, harmonyFunction, mode, css) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.HEX({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A) * 255\n })\n : translateColor.HEXA({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A)\n })));\n },\n [ColorModel.RGB](color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.RGB(hslToRGB(c.H, c.S, c.L), options)\n : translateColor.RGB(hslToRGB(c.H, c.S, c.L), options.decimals)));\n },\n RGBA(color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.RGB({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A)\n }, options)\n : translateColor.RGBA({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A)\n }, options.decimals)));\n },\n [ColorModel.HSL](color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.HSL({\n H: c.H,\n S: c.S,\n L: c.L\n }, options)\n : translateColor.HSL(hslToRGB(c.H, c.S, c.L), options.decimals)));\n },\n HSLA(color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => (css\n ? CSS.HSL({\n ...c,\n A: normalizeAlpha(c.A)\n }, options)\n : translateColor.HSLA({\n ...hslToRGB(c.H, c.S, c.L),\n A: normalizeAlpha(c.A)\n }, options.decimals)));\n },\n [ColorModel.CIELab](color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => {\n const RGB = hslToRGB(c.H, c.S, c.L);\n return (css\n ? CSS.CIELab(rgbToLab(RGB.R, RGB.G, RGB.B), options)\n : translateColor.CIELab(RGB, options.decimals));\n });\n },\n CIELabA(color, harmonyFunction, mode, css, options) {\n const array = harmonyFunction(color, mode);\n return array.map((c) => {\n const RGB = hslToRGB(c.H, c.S, c.L);\n return (css\n ? CSS.CIELab({\n ...rgbToLab(RGB.R, RGB.G, RGB.B),\n A: normalizeAlpha(c.A)\n }, options)\n : translateColor.CIELabA({\n ...RGB,\n A: normalizeAlpha(c.A)\n }, options.decimals));\n });\n }\n};\nconst colorMixer = {\n mix(colors, mode) {\n const rgbMap = colors.map((color) => {\n const model = getColorModel(color);\n return getRGBObject(color, model);\n });\n const rybMap = mode === Mix.SUBTRACTIVE\n ? rgbMap.map((color) => {\n const RYB = rgbToRYB(color.R, color.G, color.B);\n if (hasProp(color, \'A\')) {\n RYB.A = color.A;\n }\n return RYB;\n })\n : null;\n function createMix(items) {\n const initial = mode === Mix.ADDITIVE\n ? { R: 0, G: 0, B: 0, A: 0 }\n : { R: 0, Y: 0, B: 0, A: 0 };\n return items.reduce((mix, color) => {\n const colorA = hasProp(color, \'A\') ? color.A : 1;\n const common = {\n R: Math.min(mix.R + color.R * colorA, 255),\n B: Math.min(mix.B + color.B * colorA, 255),\n A: 1 - (1 - colorA) * (1 - mix.A)\n };\n const mixGY = \'G\' in mix\n ? mix.G\n : mix.Y;\n const colorGY = \'G\' in color\n ? color.G\n : color.Y;\n return {\n ...common,\n ...(mode === Mix.ADDITIVE\n ? { G: Math.min(mixGY + colorGY * colorA, 255) }\n : { Y: Math.min(mixGY + colorGY * colorA, 255) })\n };\n }, initial);\n }\n let mix;\n if (mode === Mix.ADDITIVE) {\n mix = createMix(rgbMap);\n }\n else {\n const RYB = createMix(rybMap);\n mix = rybToRGB(RYB.R, RYB.Y, RYB.B);\n mix.A = RYB.A;\n }\n return {\n R: round(mix.R),\n G: round(mix.G),\n B: round(mix.B),\n A: minmax(mix.A, 0, 1)\n };\n },\n [ColorModel.HEX](colors, mode, css) {\n const mix = this.mix(colors, mode);\n delete mix.A;\n return (css\n ? CSS.HEX(mix)\n : translateColor.HEX(mix));\n },\n HEXA(colors, mode, css) {\n const mix = this.mix(colors, mode);\n mix.A = css\n ? normalizeAlpha(mix.A) * 255\n : normalizeAlpha(mix.A);\n return (css\n ? CSS.HEX(mix)\n : translateColor.HEXA(mix));\n },\n [ColorModel.RGB](colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n delete mix.A;\n return (css\n ? CSS.RGB(mix, options)\n : translateColor.RGB(mix, options.decimals));\n },\n RGBA(colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n return (css\n ? CSS.RGB(mix, options)\n : translateColor.RGBA(mix, options.decimals));\n },\n [ColorModel.HSL](colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n const HSL = rgbToHSL(mix.R, mix.G, mix.B);\n delete mix.A;\n delete HSL.A;\n return (css\n ? CSS.HSL(HSL, options)\n : translateColor.HSL(mix, options.decimals));\n },\n HSLA(colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n const HSL = rgbToHSL(mix.R, mix.G, mix.B, mix.A);\n return (css\n ? CSS.HSL(HSL, options)\n : translateColor.HSLA(mix, options.decimals));\n },\n [ColorModel.CIELab](colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n const Lab = rgbToLab(mix.R, mix.G, mix.B);\n delete mix.A;\n return (css\n ? CSS.CIELab(Lab, options)\n : translateColor.CIELabA(mix, options.decimals));\n },\n CIELabA(colors, mode, css, options) {\n const mix = this.mix(colors, mode);\n const Lab = rgbToLab(mix.R, mix.G, mix.B);\n if (hasProp(mix, \'A\')) {\n Lab.A = mix.A;\n }\n return (css\n ? CSS.CIELab(Lab, options)\n : translateColor.CIELabA(mix, options.decimals));\n }\n};\nconst roundRGBObject = (color, decimals) => {\n const R = round(color.R, decimals);\n const G = round(color.G, decimals);\n const B = round(color.B, decimals);\n return {\n R,\n G,\n B,\n ...(hasProp(color, \'A\')\n ? {\n A: round(color.A, decimals)\n }\n : {})\n };\n};\nconst roundHSLObject = (color, decimals) => {\n return {\n H: round(color.H, decimals),\n S: round(color.S, decimals),\n L: round(color.L, decimals),\n ...(hasProp(color, \'A\')\n ? {\n A: round(color.A, decimals)\n }\n : {})\n };\n};\nconst roundCIELabObject = (color, decimals) => {\n return {\n L: round(color.L, decimals),\n a: round(color.a, decimals),\n b: round(color.b, decimals)\n };\n};\nconst roundCMYKObject = (color, decimals) => {\n return {\n C: round(color.C, decimals),\n M: round(color.M, decimals),\n Y: round(color.Y, decimals),\n K: round(color.K, decimals)\n };\n};\n\n;// ./src/index.ts\n\n\n\n\n\nconst getColorReturn = (color, model, decimals, translateFunction) => {\n const rgbObject = getRGBObject(color, model);\n return translateFunction(rgbObject, decimals);\n};\nconst getBlendReturn = (from, to, steps, decimals, translateFunction) => {\n if (steps < 1)\n steps = DEFAULT_BLEND_STEPS;\n const fromRGBObject = getRGBObject(from);\n const toRGBObject = getRGBObject(to);\n const blendArray = blend(fromRGBObject, toRGBObject, steps);\n return blendArray.map((color) => {\n return translateFunction(color, decimals);\n });\n};\nconst getHarmonyReturn = (harmony, color, mode, options) => {\n return ({\n [Harmony.ANALOGOUS]: colorHarmony.buildHarmony(color, analogous, mode, options),\n [Harmony.COMPLEMENTARY]: colorHarmony.buildHarmony(color, complementary, mode, options),\n [Harmony.SPLIT_COMPLEMENTARY]: colorHarmony.buildHarmony(color, splitComplementary, mode, options),\n [Harmony.TRIADIC]: colorHarmony.buildHarmony(color, triadic, mode, options),\n [Harmony.TETRADIC]: colorHarmony.buildHarmony(color, tetradic, mode, options),\n [Harmony.SQUARE]: colorHarmony.buildHarmony(color, square, mode, options)\n })[harmony];\n};\nclass ColorTranslator {\n constructor(color, options = {}) {\n this._options = getOptionsFromColorInput(options, color);\n this.rgb = getRGBObject(color);\n this.updateHSL();\n this.updateLab();\n this.updateCMYK();\n }\n updateRGB() {\n this.rgb = {\n ...hslToRGB(this.hsl.H, this.hsl.S, this.hsl.L),\n A: this.hsl.A\n };\n }\n updateRGBFromCMYK() {\n this.rgb = {\n ...cmykToRGB(this.cmyk.C, this.cmyk.M, this.cmyk.Y, this.cmyk.K),\n A: this.rgb.A\n };\n }\n updateRGBFromLab() {\n this.rgb = {\n ...labToRgb(this.lab.L, this.lab.a, this.lab.b),\n A: this.rgb.A\n };\n }\n updateHSL() {\n this.hsl = rgbToHSL(this.rgb.R, this.rgb.G, this.rgb.B, this.rgb.A);\n }\n updateLab() {\n this.lab = {\n ...rgbToLab(this.rgb.R, this.rgb.G, this.rgb.B),\n A: this.rgb.A\n };\n }\n updateCMYK() {\n this.cmyk = rgbToCMYK(this.rgb.R, this.rgb.G, this.rgb.B);\n }\n setOptions(options = {}) {\n this._options = {\n ...this._options,\n ...options\n };\n return this;\n }\n setH(H) {\n this.hsl.H = normalizeHue(H);\n this.updateRGB();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setS(S) {\n this.hsl.S = minmax(S, 0, 100);\n this.updateRGB();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setL(L) {\n this.hsl.L = minmax(L, 0, 100);\n this.updateRGB();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setR(R) {\n this.rgb.R = minmax(R, 0, 255);\n this.updateHSL();\n this.updateLab();\n this.updateCMYK();\n return;\n }\n setG(G) {\n this.rgb.G = minmax(G, 0, 255);\n this.updateHSL();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setB(B) {\n this.rgb.B = minmax(B, 0, 255);\n this.updateHSL();\n this.updateLab();\n this.updateCMYK();\n return this;\n }\n setCIEL(L) {\n this.lab.L = minmax(L, 0, 100);\n this.updateRGBFromLab();\n this.updateHSL();\n this.updateCMYK();\n return this;\n }\n setCIEa(a) {\n this.lab.a = minmax(a, -125, 125);\n this.updateRGBFromLab();\n this.updateHSL();\n this.updateCMYK();\n return this;\n }\n setCIEb(b) {\n this.lab.b = minmax(b, -125, 125);\n this.updateRGBFromLab();\n this.updateHSL();\n this.updateCMYK();\n return this;\n }\n setA(A) {\n this.hsl.A = this.rgb.A = minmax(A, 0, 1);\n return this;\n }\n setC(C) {\n this.cmyk.C = minmax(C, 0, 100);\n this.updateRGBFromCMYK();\n this.updateHSL();\n this.updateLab();\n return this;\n }\n setM(M) {\n this.cmyk.M = minmax(M, 0, 100);\n this.updateRGBFromCMYK();\n this.updateHSL();\n this.updateLab();\n return this;\n }\n setY(Y) {\n this.cmyk.Y = minmax(Y, 0, 100);\n this.updateRGBFromCMYK();\n this.updateHSL();\n this.updateLab();\n return this;\n }\n setK(K) {\n this.cmyk.K = minmax(K, 0, 100);\n this.updateRGBFromCMYK();\n this.updateHSL();\n this.updateLab();\n return this;\n }\n get options() {\n return this._options;\n }\n get H() {\n return round(this.hsl.H, this.options.decimals);\n }\n get S() {\n return round(this.hsl.S, this.options.decimals);\n }\n get L() {\n return round(this.hsl.L, this.options.decimals);\n }\n get CIEL() {\n return round(this.lab.L, this.options.decimals);\n }\n get CIEa() {\n return round(this.lab.a, this.options.decimals);\n }\n get CIEb() {\n return round(this.lab.b, this.options.decimals);\n }\n get R() {\n return round(this.rgb.R, this.options.decimals);\n }\n get G() {\n return round(this.rgb.G, this.options.decimals);\n }\n get B() {\n return round(this.rgb.B, this.options.decimals);\n }\n get A() {\n return round(this.hsl.A, this.options.decimals);\n }\n get C() {\n return round(this.cmyk.C, this.options.decimals);\n }\n get M() {\n return round(this.cmyk.M, this.options.decimals);\n }\n get Y() {\n return round(this.cmyk.Y, this.options.decimals);\n }\n get K() {\n return round(this.cmyk.K, this.options.decimals);\n }\n get HEXObject() {\n return translateColor.HEX(this.rgb);\n }\n get HEXAObject() {\n return translateColor.HEXA(this.rgb);\n }\n get RGBObject() {\n return {\n R: this.R,\n G: this.G,\n B: this.B\n };\n }\n get RGBAObject() {\n return {\n ...this.RGBObject,\n A: this.A\n };\n }\n get HSLObject() {\n return {\n H: this.H,\n S: this.S,\n L: this.L\n };\n }\n get HSLAObject() {\n return {\n ...this.HSLObject,\n A: this.A\n };\n }\n get CIELabObject() {\n return {\n L: this.CIEL,\n a: this.CIEa,\n b: this.CIEb\n };\n }\n get CIELabAObject() {\n return {\n ...this.CIELabObject,\n A: this.A\n };\n }\n get CMYKObject() {\n return {\n C: this.C,\n M: this.M,\n Y: this.Y,\n K: this.K\n };\n }\n get CMYKAObject() {\n return {\n ...this.CMYKObject,\n A: this.A\n };\n }\n get HEX() {\n return CSS.HEX({\n R: this.R,\n G: this.G,\n B: this.B\n });\n }\n get HEXA() {\n return CSS.HEX({\n R: this.R,\n G: this.G,\n B: this.B,\n A: this.A * 255\n });\n }\n get RGB() {\n return CSS.RGB({\n R: this.R,\n G: this.G,\n B: this.B\n }, this.options);\n }\n get RGBA() {\n return CSS.RGB({\n R: this.R,\n G: this.G,\n B: this.B,\n A: this.A\n }, this.options);\n }\n get HSL() {\n return CSS.HSL({\n H: this.H,\n S: this.S,\n L: this.L\n }, this.options);\n }\n get HSLA() {\n return CSS.HSL({\n H: this.H,\n S: this.S,\n L: this.L,\n A: this.A\n }, this.options);\n }\n get CIELab() {\n return CSS.CIELab({\n L: this.CIEL,\n a: this.CIEa,\n b: this.CIEb\n }, this.options);\n }\n get CIELabA() {\n return CSS.CIELab({\n L: this.CIEL,\n a: this.CIEa,\n b: this.CIEb,\n A: this.A\n }, this.options);\n }\n get CMYK() {\n return CSS.CMYK({\n C: this.C,\n M: this.M,\n Y: this.Y,\n K: this.K\n }, this.options);\n }\n get CMYKA() {\n return CSS.CMYK({\n C: this.C,\n M: this.M,\n Y: this.Y,\n K: this.K,\n A: this.A\n }, this.options);\n }\n static toHEXObject(color) {\n const model = getColorModel(color);\n return getColorReturn(color, model, 0, translateColor.HEX);\n }\n static toHEX(color) {\n return CSS.HEX(ColorTranslator.toHEXObject(color));\n }\n static toHEXAObject(color) {\n const model = getColorModel(color);\n return getColorReturn(color, model, 0, translateColor.HEXA);\n }\n static toHEXA(color) {\n return CSS.HEX(ColorTranslator.toHEXAObject(color));\n }\n static toRGBObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.RGB);\n }\n static toRGB(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const rgb = getColorReturn(color, model, options.decimals, translateColor.RGB);\n return CSS.RGB(rgb, detectedOptions);\n }\n static toRGBAObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.RGBA);\n }\n static toRGBA(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const rgba = getColorReturn(color, model, options.decimals, translateColor.RGBA);\n return CSS.RGB(rgba, detectedOptions);\n }\n static toHSLObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.HSL);\n }\n static toHSL(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const hsl = getColorReturn(color, model, options.decimals, translateColor.HSL);\n return CSS.HSL(hsl, detectedOptions);\n }\n static toHSLAObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.HSLA);\n }\n static toHSLA(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const hsla = getColorReturn(color, model, options.decimals, translateColor.HSLA);\n return CSS.HSL(hsla, detectedOptions);\n }\n static toCIELabObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.CIELab);\n }\n static toCIELab(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const lab = getColorReturn(color, model, options.decimals, translateColor.CIELab);\n return CSS.CIELab(lab, detectedOptions);\n }\n static toCIELabAObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.CIELabA);\n }\n static toCIELabA(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const lab = getColorReturn(color, model, options.decimals, translateColor.CIELabA);\n return CSS.CIELab(lab, detectedOptions);\n }\n static toCMYKObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.CMYK);\n }\n static toCMYK(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const cmyk = getColorReturn(color, model, options.decimals, translateColor.CMYK);\n return CSS.CMYK(cmyk, detectedOptions);\n }\n static toCMYKAObject(color, options = {}) {\n const model = getColorModel(color);\n return getColorReturn(color, model, options.decimals, translateColor.CMYKA);\n }\n static toCMYKA(color, options = {}) {\n const model = getColorModel(color);\n const detectedOptions = getOptionsFromColorInput(options, color);\n const cmyka = getColorReturn(color, model, options.decimals, translateColor.CMYKA);\n return CSS.CMYK(cmyka, detectedOptions);\n }\n static getBlendHEXObject(from, to, steps = DEFAULT_BLEND_STEPS) {\n return getBlendReturn(from, to, steps, 0, translateColor.HEX);\n }\n static getBlendHEX(from, to, steps = DEFAULT_BLEND_STEPS) {\n return ColorTranslator.getBlendHEXObject(from, to, steps)\n .map((color) => CSS.HEX(color));\n }\n static getBlendHEXAObject(from, to, steps = DEFAULT_BLEND_STEPS) {\n return getBlendReturn(from, to, steps, 0, translateColor.HEXA);\n }\n static getBlendHEXA(from, to, steps = DEFAULT_BLEND_STEPS) {\n return ColorTranslator.getBlendHEXAObject(from, to, steps)\n .map((color) => CSS.HEX(color));\n }\n static getBlendRGBObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.RGB);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.RGB);\n }\n static getBlendRGB(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.RGB)\n .map((color) => {\n return CSS.RGB(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.RGB)\n .map((color) => {\n return CSS.RGB(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendRGBAObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.RGBA);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.RGBA);\n }\n static getBlendRGBA(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.RGBA)\n .map((color) => {\n return CSS.RGB(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.RGBA)\n .map((color) => {\n return CSS.RGB(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendHSLObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.HSL);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, fourthParameter?.decimals, translateColor.HSL);\n }\n static getBlendHSL(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.HSL)\n .map((color) => {\n return CSS.HSL(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.HSL)\n .map((color) => {\n return CSS.HSL(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendHSLAObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.HSLA);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.HSLA);\n }\n static getBlendHSLA(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.HSLA)\n .map((color) => {\n return CSS.HSL(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.HSLA)\n .map((color) => {\n return CSS.HSL(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendCIELabObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.CIELab);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.CIELab);\n }\n static getBlendCIELab(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.CIELab)\n .map((color) => {\n return CSS.CIELab(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.CIELab)\n .map((color) => {\n return CSS.CIELab(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getBlendCIELabAObject(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.CIELabA);\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.CIELabA);\n }\n static getBlendCIELabA(from, to, thirdParameter, fourthParameter) {\n if (typeof thirdParameter === \'number\') {\n return getBlendReturn(from, to, thirdParameter, fourthParameter?.decimals, translateColor.CIELabA)\n .map((color) => {\n return CSS.CIELab(color, getOptionsFromColorInput(fourthParameter || {}, from, to));\n });\n }\n return getBlendReturn(from, to, DEFAULT_BLEND_STEPS, thirdParameter?.decimals, translateColor.CIELabA)\n .map((color) => {\n return CSS.CIELab(color, getOptionsFromColorInput(thirdParameter || {}, from, to));\n });\n }\n static getMixHEXObject(colors, mode = Mix.ADDITIVE) {\n return colorMixer.HEX(colors, mode, false);\n }\n static getMixHEX(colors, mode = Mix.ADDITIVE) {\n return colorMixer.HEX(colors, mode, true);\n }\n static getMixHEXAObject(colors, mode = Mix.ADDITIVE) {\n return colorMixer.HEXA(colors, mode, false);\n }\n static getMixHEXA(colors, mode = Mix.ADDITIVE) {\n return colorMixer.HEXA(colors, mode, true);\n }\n static getMixRGBObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.RGB(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.RGB(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixRGB(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.RGB(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.RGB(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixRGBAObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.RGBA(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.RGBA(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixRGBA(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.RGBA(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.RGBA(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixHSLObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.HSL(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.HSL(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixHSL(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.HSL(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.HSL(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixHSLAObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.HSLA(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.HSLA(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixHSLA(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.HSLA(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.HSLA(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixCIELabObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.CIELab(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.CIELab(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixCIELab(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.CIELab(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.CIELab(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixCIELabAObject(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.CIELabA(colors, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.CIELabA(colors, Mix.ADDITIVE, false, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getMixCIELabA(colors, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'string\') {\n return colorMixer.CIELabA(colors, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, ...colors));\n }\n return colorMixer.CIELabA(colors, Mix.ADDITIVE, true, getOptionsFromColorInput(secondParameter || {}, ...colors));\n }\n static getShades(color, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'number\') {\n return getColorMixture(color, secondParameter, true, getOptionsFromColorInput(thirdParameter || {}, color));\n }\n return getColorMixture(color, DEFAULT_SHADES_TINTS_STEPS, true, getOptionsFromColorInput(secondParameter || {}, color));\n }\n static getTints(color, secondParameter, thirdParameter) {\n if (typeof secondParameter === \'number\') {\n return getColorMixture(color, secondParameter, false, getOptionsFromColorInput(thirdParameter || {}, color));\n }\n return getColorMixture(color, DEFAULT_SHADES_TINTS_STEPS, false, getOptionsFromColorInput(secondParameter || {}, color));\n }\n static getHarmony(color, secondParam, thirdParam, fourthParam) {\n if (isHarmony(secondParam)) {\n return getHarmonyReturn(secondParam, color, isMix(thirdParam)\n ? thirdParam\n : Mix.ADDITIVE, getOptionsFromColorInput(isMix(thirdParam)\n ? (fourthParam || {})\n : thirdParam || {}, color));\n }\n else if (isMix(secondParam)) {\n return getHarmonyReturn(Harmony.COMPLEMENTARY, color, secondParam, getOptionsFromColorInput(thirdParam || {}, color));\n }\n return getHarmonyReturn(Harmony.COMPLEMENTARY, color, Mix.ADDITIVE, getOptionsFromColorInput(secondParam || {}, color));\n }\n}\n\n\n;// ./src/@demo/demo1/index.js\n\n\n/* harmony default export */ const demo1 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const color = new ColorTranslator(\'hsl(180 100% 50%)\', { decimals: 0 });\n\n for (let row = 0; row < 10; row++) {\n\n for (let col = 0; col < 10; col++) {\n\n color\n .setS(row * 10)\n .setL(col * 5 + 30);\n\n const box = document.createElement(\'div\');\n\n box.classList.add(\'box\');\n box.style.background = color.HEX;\n\n box.innerText =\n `R:${color.R}\n G:${color.G}\n B:${color.B}`;\n container.appendChild(box);\n\n }\n }\n\n return container;\n\n});\n;// ./src/@demo/demo2/index.js\n\n\n/* harmony default export */ const demo2 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const color = new ColorTranslator({ R: 255, G: 0, B: 0 });\n const hue = [0, 30, 60, 120, 240, 280, 320, 0];\n let rainbow;\n\n for (let r = 0; r < hue.length; r++) {\n\n color.setH(hue[r]);\n\n const bow = document.createElement(\'div\');\n\n bow.classList.add(\'rainbow\');\n bow.style.background = color.HEX;\n\n if (rainbow) {\n rainbow.appendChild(bow);\n } else {\n container.appendChild(bow);\n }\n\n rainbow = bow;\n }\n\n rainbow.style.background = \'#333\';\n\n return container;\n\n});\n;// ./src/@demo/demo3/index.js\n\n\n/* harmony default export */ const demo3 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const hsl = { H: 0, S: \'90%\', L: \'50%\' };\n const hue = [undefined, 55, 30, 0, 290, 220, 130];\n const total = hue.length;\n\n for (let row = 0; row < total; row++) {\n\n for (let col = 0; col < total; col++) {\n\n let index = total - row + col;\n if (index >= total) {\n index -= total;\n }\n hsl.H = hue[index];\n const rgb = hue[index] === undefined\n ? \'#FFF\'\n : ColorTranslator.toHEX(hsl);\n const box = document.createElement(\'div\');\n\n box.classList.add(\'flag\');\n box.style.background = rgb;\n\n container.appendChild(box);\n\n }\n }\n\n return container;\n\n});\n;// ./src/@demo/demo4/index.js\n\n\n/* harmony default export */ const demo4 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const hexColors = [\n \'#FE2712\', \'#FE5409\', \'#FB9902\',\n \'#FABD03\', \'#FFFE32\', \'#D1EA2C\',\n \'#66B132\', \'#0392CE\', \'#0247FE\',\n \'#3D00A5\', \'#8601B0\', \'#A7194B\'\n ];\n\n hexColors.forEach((color) => {\n\n const rgb = ColorTranslator.toRGB(color);\n const hsl = ColorTranslator.toHSL(color, { decimals: 0 });\n const lab = ColorTranslator.toCIELab(color, { decimals: 0 });\n\n const rgbDiv = document.createElement(\'div\');\n const hslDiv = document.createElement(\'div\');\n const labDiv = document.createElement(\'div\');\n\n rgbDiv.style.backgroundColor = rgb;\n rgbDiv.textContent = rgb;\n\n hslDiv.style.backgroundColor = hsl;\n hslDiv.textContent = hsl;\n\n labDiv.style.backgroundColor = lab;\n labDiv.textContent = lab;\n\n container.appendChild(rgbDiv);\n container.appendChild(hslDiv);\n container.appendChild(labDiv);\n\n });\n\n return container;\n\n});\n;// ./src/@demo/demo5/index.js\n\n\n/* harmony default export */ const demo5 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const colors = [\n \'red\',\n \'lime\',\n \'blue\',\n \'aqua\',\n \'yellow\',\n \'fuchsia\'\n ];\n const total = colors.length;\n\n for (let row = 0; row < total; row++) {\n\n const hsl = ColorTranslator.toHSLObject(colors[row]);\n const step = hsl.S / (total - 1);\n\n for (let col = 0; col < total; col++) {\n\n const rgb = ColorTranslator.toHEX(hsl);\n const cmyk = ColorTranslator.toCMYKObject(hsl, { decimals: 0 });\n\n const box = document.createElement(\'div\');\n box.classList.add(\'box\');\n box.style.background = rgb;\n box.innerText = `C:${cmyk.C}\n M:${cmyk.M}\n Y:${cmyk.Y}\n K:${cmyk.K}`;\n\n container.appendChild(box);\n\n hsl.S -= step;\n\n }\n }\n\n return container;\n\n});\n;// ./src/@demo/demo6/index.js\n\n\n/* harmony default export */ const demo6 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n const rows = 11;\n const mult = 3;\n\n for (let i = 0; i < rows; i++) {\n\n const blends = ColorTranslator.getBlendHEX(\'#F00\', \'#FF0\', mult + i * mult);\n\n blends.forEach((blend, index) => {\n const box = document.createElement(\'div\');\n box.classList.add(\'box\', `file${i}`);\n box.style.background = blend;\n box.innerText = index + 1;\n container.appendChild(box);\n });\n\n }\n\n return container;\n\n});\n;// ./src/@demo/demo7/index.js\n\n\n/* harmony default export */ const demo7 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n\n const colors = [\'#F00\', \'#FF8000\', \'#FF0\', \'#0F0\', \'#00F\', \'#A0F\', \'#F0A\'];\n\n const createBox = (color, type) => {\n const box = document.createElement(\'div\');\n box.classList.add(\'box\');\n box.style.backgroundColor = color;\n if (type) box.dataset.type = type;\n container.appendChild(box);\n };\n\n colors.forEach((color) => {\n const shades = ColorTranslator.getShades(color, 3).reverse();\n const tints = ColorTranslator.getTints(color, 3);\n shades.forEach((shade) => createBox(shade, \'shade\'));\n createBox(color);\n tints.forEach((tint) => createBox(tint, \'tint\'));\n });\n\n return container;\n\n});\n;// ./src/@demo/demo8/index.js\n\n\n\n/* harmony default export */ const demo8 = ((ColorTranslator) => {\n\n const container = document.createElement(\'div\');\n\n const mixes = [\n \'#F00\',\n \'#0F0\',\n \'#00F\',\n [1, 3],\n [1, 2],\n [2, 3],\n [1, 2, 3]\n ];\n\n const fillPlanes = () => {\n const planes = container.querySelectorAll(\'#planes path\');\n planes.forEach((plane, index) => {\n let color = \'#CCC\';\n if (typeof mixes[index] === \'string\') {\n color = mixes[index];\n } else if(mixes[index]) {\n const colors = mixes[index].map((i) => mixes[i - 1]);\n color = mixes[index] = ColorTranslator.getMixHEX(colors);\n }\n plane.setAttribute(\'fill\', color);\n });\n };\n\n fetch(\'images/color-mixes.svg\')\n .then(result => result.text())\n .then((svgCode) => {\n container.innerHTML = svgCode;\n fillPlanes();\n });\n\n return container;\n\n});\n;// ./src/@demo/demo9/index.js\n\n\n/* harmony default export */ const demo9 = ((ColorTranslator, { Mix }) => {\n\n const container = document.createElement(\'div\');\n\n const mixes = [\n \'#F00\',\n \'#FF0\',\n \'#00F\',\n [1, 3],\n [1, 2],\n [2, 3],\n [1, 2, 3]\n ];\n\n const fillPlanes = () => {\n const planes = container.querySelectorAll(\'#planes path\');\n planes.forEach((plane, index) => {\n let color = \'#CCC\';\n if (typeof mixes[index] === \'string\') {\n color = mixes[index];\n } else if(mixes[index]) {\n const colors = mixes[index].map((i) => mixes[i - 1]);\n color = mixes[index] = ColorTranslator.getMixHEX(colors, Mix.SUBTRACTIVE);\n }\n plane.setAttribute(\'fill\', color);\n });\n };\n\n fetch(\'images/color-mixes.svg\')\n .then(result => result.text())\n .then((svgCode) => {\n container.innerHTML = svgCode;\n fillPlanes();\n });\n\n return container;\n\n});\n;// ./src/@demo/demo10/index.js\n\n\n/* harmony default export */ const demo10 = ((ColorTranslator, { Harmony }) => {\n\n const container = document.createElement(\'div\');\n\n const harmonies = [\n { label: \'Complementary\', value: Harmony.COMPLEMENTARY },\n { label: \'Split Complementary\', value: Harmony.SPLIT_COMPLEMENTARY },\n { label: \'Analogous\', value: Harmony.ANALOGOUS },\n { label: \'Triadic\', value: Harmony.TRIADIC },\n { label: \'Tetradic\', value: Harmony.TETRADIC },\n { label: \'Square\', value: Harmony.SQUARE }\n ];\n\n const baseColor = \'#F00\';\n\n const createElement = (className, parent) => {\n const div = document.createElement(\'div\');\n div.classList.add(className);\n parent.appendChild(div);\n return div;\n };\n\n const createHarmony = (item) => {\n\n const wrapper = createElement(\'wrapper\', container);\n const wheel = createElement(\'wheel\', wrapper);\n const harmony = createElement(\'harmony\', wrapper);\n createElement(\'label\', wrapper).innerText = item.label;\n\n fetch(\'images/wheel-additive.svg\')\n .then(result => result.text())\n .then((svgCode) => {\n const harmonyColors = ColorTranslator.getHarmony(baseColor, item.value);\n const selector = \'path\' + harmonyColors.map((color) => `:not([fill="${color}"])`).join(\'\');\n wheel.innerHTML = svgCode;\n harmonyColors.forEach((hex) => createElement(\'box\', harmony).style.background = hex);\n wheel.querySelectorAll(selector).forEach((path) => path.setAttribute(\'fill-opacity\', \'0.25\'));\n });\n\n };\n\n harmonies.forEach((item) => createHarmony(item));\n\n return container;\n\n});\n;// ./src/@demo/demo11/index.js\n\n\n/* harmony default export */ const demo11 = ((ColorTranslator, { Harmony, Mix }) => {\n\n const container = document.createElement(\'div\');\n\n const harmonies = [\n { label: \'Complementary\', value: Harmony.COMPLEMENTARY },\n { label: \'Split Complementary\', value: Harmony.SPLIT_COMPLEMENTARY },\n { label: \'Analogous\', value: Harmony.ANALOGOUS },\n { label: \'Triadic\', value: Harmony.TRIADIC },\n { label: \'Tetradic\', value: Harmony.TETRADIC },\n { label: \'Square\', value: Harmony.SQUARE }\n ];\n\n const baseColor = \'#F00\';\n\n const createElement = (className, parent) => {\n const div = document.createElement(\'div\');\n div.classList.add(className);\n parent.appendChild(div);\n return div;\n };\n\n const createHarmony = (item) => {\n\n const wrapper = createElement(\'wrapper\', container);\n const wheel = createElement(\'wheel\', wrapper);\n const harmony = createElement(\'harmony\', wrapper);\n createElement(\'label\', wrapper).innerText = item.label;\n\n fetch(\'images/wheel-subtractive.svg\')\n .then(result => result.text())\n .then((svgCode) => {\n const harmonyColors = ColorTranslator.getHarmony(baseColor, item.value, Mix.SUBTRACTIVE);\n const selector = \'path\' + harmonyColors.map((color) => `:not([fill="${color}"])`).join(\'\');\n wheel.innerHTML = svgCode;\n harmonyColors.forEach((hex) => createElement(\'box\', harmony).style.background = hex);\n wheel.querySelectorAll(selector).forEach((path) => path.setAttribute(\'fill-opacity\', \'0.25\'));\n });\n\n };\n\n harmonies.forEach((item) => createHarmony(item));\n\n return container;\n\n});\n;// ./src/@demo/demo.js\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst functioToString = (fn) => {\n const article = document.createElement(\'article\');\n const pre = document.createElement(\'pre\');\n article.classList.add(\'function-container\');\n pre.classList.add(\'prettyprint\');\n article.appendChild(pre);\n pre.innerHTML = fn.toString().replace(\'(ColorTranslator)\', \'()\');\n return article;\n};\n\nconst demos = new Map([\n [\'demo1\', demo1],\n [\'demo2\', demo2],\n [\'demo3\', demo3],\n [\'demo4\', demo4],\n [\'demo5\', demo5],\n [\'demo6\', demo6],\n [\'demo7\', demo7],\n [\'demo8\', demo8],\n [\'demo9\', demo9],\n [\'demo10\', demo10],\n [\'demo11\', demo11]\n]);\n\ndocument.addEventListener(\'DOMContentLoaded\', () => {\n demos.forEach((module, div) => {\n const demo = document.getElementById(div);\n const container = document.createElement(\'div\');\n const wrapper = document.createElement(\'div\');\n\n container.classList.add(\'demo-container\');\n wrapper.classList.add(\'demo-wrapper\');\n\n wrapper.appendChild(module(ColorTranslator, { Harmony: Harmony, Mix: Mix }));\n container.appendChild(wrapper);\n demo.appendChild(container);\n demo.appendChild(functioToString(module));\n });\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY2LmpzIiwibWFwcGluZ3MiOiI7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsVUFBVSxxQkFBTSxvQkFBb0IscUJBQU07QUFDMUM7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxRQUFRO0FBQ1I7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0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gICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBBbmdsZXNVbml0RW51bS5UVVJOUzpcbiAgICAgICAgICAgICAgICBodWUgPSByb3VuZCh2YWx1ZSAqIHBpMik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIEFuZ2xlc1VuaXRFbnVtLkdSQURJQU5TOlxuICAgICAgICAgICAgICAgIGh1ZSA9IHJvdW5kKDkgLyAxMCAqIHZhbHVlKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgQW5nbGVzVW5pdEVudW0uREVHUkVFUzpcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgaHVlID0gdmFsdWU7XG4gICAgICAgIH1cbiAgICB9XG4gICAgaWYgKGh1ZSA+IDM2MCB8fCBodWUgPCAwKSB7XG4gICAgICAgIGh1ZSAtPSBNYXRoLmZsb29yKGh1ZSAvIHBpMikgKiBwaTI7XG4gICAgfVxuICAgIHJldHVybiBodWU7XG59O1xuZXhwb3J0IGNvbnN0IHRyYW5zbGF0ZURlZ3JlZXMgPSAoZGVncmVlcywgdW5pdHMpID0+IHtcbiAgICBsZXQgaHVlO1xuICAgIHN3aXRjaCAodW5pdHMpIHtcbiAgICAgICAgY2FzZSBBbmdsZXNVbml0RW51bS5SQURJQU5TOlxuICAgICAgICAgICAgaHVlID0gcm91bmQocmFkaWFucyhkZWdyZWVzKSk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSBBbmdsZXNVbml0RW51bS5UVVJOUzpcbiAgICAgICAgICAgIGh1ZSA9IHJvdW5kKGRlZ3JlZXMgLyBwaTIpO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgQW5nbGVzVW5pdEVudW0uR1JBRElBTlM6XG4gICAgICAgICAgICBodWUgPSByb3VuZCgxMCAvIDkgKiBkZWdyZWVzKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgIC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gICAgICAgICAgICAgICBtYXRjaE9wdGlvbnMubGVnYWN5Q1NTKys7XG4gICAgICAgICAgICAgICAgY29uc3QgY29tbWFzV2l0aE5leHRDaGFyYWN0ZXIgPSBjb2xvci5tYXRjaChDT01NQVNfQU5EX05FWFRfQ0hBUlMpO1xuICAgICAgICAgICAgICAgIGlmIChuZXcgU2V0KGNvbW1hc1dpdGhOZXh0Q2hhcmFjdGVyKS5zaXplID09PSAxICYmXG4gICAgICAgICAgICAgICAgICAgIFNQQUNFUy50ZXN0KGNvbW1hc1dpdGhOZXh0Q2hhcmFjdGVyWzBdLnNsaWNlKDEpKSkge1xuICAgICAgICAgICAgICAgICAgICBtYXRjaE9wdGlvbnMuc3BhY2VzQWZ0ZXJDb21tYXMrKztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY29sb3IubWF0Y2goQ09MT1JSRUdTLkhTTCkpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRjaCA9IGNvbG9yLm1hdGNoKENPTE9SUkVHUy5IU0wpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGFuZ2xlID0gbWF0Y2hbMV0gfHwgbWF0Y2hbNV07XG4gICAgICAgICAgICAgICAgY29uc3QgYWxwaGEgPSBtYXRjaFs4XTtcbiAgICAgICAgICAgICAgICBjb25zdCBhbmdsZVVuaXQgPSBhbmdsZS5tYXRjaChIU0xfSFVFKVsyXTtcbiAgICAgICAgICAgICAgICBoc2xDb2xvcnMucHVzaChhbmdsZVVuaXQgPT09ICcnXG4gICAgICAgICAgICAgICAgICAgID8gQW5nbGVzVW5pdEVudW0uTk9ORVxuICAgICAgICAgICAgICAgICAgICA6IGFuZ2xlVW5pdCk7XG4gICAgICAgICAgICAgICAgYWxwaGFWYWx1ZXMucHVzaChQQ0VOVC50ZXN0KGFscGhhKSk7XG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoQ09MT1JSRUdTLlJHQi50ZXN0KGNvbG9yKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IG1hdGNoID0gY29sb3IubWF0Y2goQ09MT1JSRUdTLlJHQik7XG4gICAgICAgICAgICAgICAgY29uc3QgUiA9IG1hdGNoWzFdIHx8IG1hdGNoWzVdO1xuICAgICAgICAgICAgICAgIGNvbnN0IEcgPSBtYXRjaFsyXSB8fCBtYXRjaFs2XTtcbiAgICAgICAgICAgICAgICBjb25zdCBCID0gbWF0Y2hbM10gfHwgbWF0Y2hbN107XG4gICAgICAgICAgICAgICAgY29uc3QgQSA9IG1hdGNoWzhdO1xuICAgICAgICAgICAgICAgIHJnYkNvbG9ycy5wdXNoKFBDRU5ULnRlc3QoUikgJiZcbiAgICAgICAgICAgICAgICAgICAgUENFTlQudGVzdChHKSAmJlxuICAgICAgICAgICAgICAgICAgICBQQ0VOVC50ZXN0KEIpKTtcbiAgICAgICAgICAgICAgICBhbHBoYVZhbHVlcy5wdXNoKFBDRU5ULnRlc3QoQSkpO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKENPTE9SUkVHUy5DSUVMYWIudGVzdChjb2xvcikpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRjaCA9IGNvbG9yLm1hdGNoKENPTE9SUkVHUy5DSUVMYWIpO1xuICAgICAgICAgICAgICAgIGNvbnN0IEwgPSBtYXRjaFsxXTtcbiAgICAgICAgICAgICAgICBjb25zdCBhID0gbWF0Y2hbMl07XG4gICAgICAgICAgICAgICAgY29uc3QgYiA9IG1hdGNoWzNdO1xuICAgICAgICAgICAgICAgIGNvbnN0IEEgPSBtYXRjaFs0XTtcbiAgICAgICAgICAgICAgICBsYWJDb2xvcnMucHVzaChQQ0VOVC50ZXN0KEwpICYmXG4gICAgICAgICAgICAgICAgICAgIFBDRU5ULnRlc3QoYSkgJiZcbiAgICAgICAgICAgICAgICAgICAgUENFTlQudGVzdChiKSk7XG4gICAgICAgICAgICAgICAgYWxwaGFWYWx1ZXMucHVzaChQQ0VOVC50ZXN0KEEpKTtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb2xvci5tYXRjaChDT0xPUlJFR1MuQ01ZSykpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBtYXRjaCA9IGNvbG9yLm1hdGNoKENPTE9SUkVHUy5DTVlLKTtcbiAgICAgICAgICAgICAgICBjb25zdCBDID0gbWF0Y2hbMV0gfHwgbWF0Y2hbNl07XG4gICAgICAgICAgICAgICAgY29uc3QgTSA9IG1hdGNoWzJdIHx8IG1hdGNoWzddO1xuICAgICAgICAgICAgICAgIGNvbnN0IFkgPSBtYXRjaFszXSB8fCBtYXRjaFs4XTtcbiAgICAgICAgICAgICAgICBjb25zdCBLID0gbWF0Y2hbNF0gfHwgbWF0Y2hbOV07XG4gICAgICAgICAgICAgICAgY29uc3QgQSA9IG1hdGNoWzEwXTtcbiAgICAgICAgICAgICAgICBjbXlrQ29sb3JzLnB1c2goUENFTlQudGVzdChDKSAmJlxuICAgICAgICAgICAgICAgICAgICBQQ0VOVC50ZXN0KE0pICYmXG4gICAgICAgICAgICAgICAgICAgIFBDRU5ULnRlc3QoWSkgJiZcbiAgICAgICAgICAgICAgICAgICAgUENFTlQudGVzdChLKSk7XG4gICAgICAgICAgICAgICAgaWYgKGNvbG9yLnN0YXJ0c1dpdGgoJ2NteWsnKSkge1xuICAgICAgICAgICAgICAgICAgICBtYXRjaE9wdGlvbnMuY215a0Z1bmN0aW9uKys7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFscGhhVmFsdWVzLnB1c2goUENFTlQudGVzdChBKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHtcbiAgICAgICAgZGVjaW1hbHM6IHR5cGVvZiBvcHRpb25zLmRlY2ltYWxzID09PSBUeXBlT2Y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uaXQpLFxuICAgICAgICByZ2JVbml0OiBvcHRpb25zLnJnYlVuaXQgJiYgY29sb3JVbml0VmFsdWVzLmluY2x1ZGVzKG9wdGlvbnMucmdiVW5pdClcbiAgICAgICAgICAgID8gb3B0aW9ucy5yZ2JVbml0XG4gICAgICAgICAgICA6IChuZXcgU2V0KHJnYkNvbG9ycykuc2l6ZSA9PT0gMSAmJiByZ2JDb2xvcnNbMF1cbiAgICAgICAgICAgICAgICA/IENvbG9yVW5pdEVudW0uUEVSQ0VOVFxuICAgICAgICAgICAgICAgIDogREVGQVVMVF9PUFRJT05TLnJnYlVuaXQpLFxuICAgICAgICBsYWJVbml0OiBvcHRpb25zLmxhYlVuaXQgJiYgY29sb3JVbml0VmFsdWVzLmluY2x1ZGVzKG9wdGlvbnMubGFiVW5pdClcbiAgICAgICAgICAgID8gb3B0aW9ucy5sYWJVbml0XG4gICAgICAgICAgICA6IChuZXcgU2V0KGxhYkNvbG9ycykuc2l6ZSA9PT0gMSAmJiBsYWJDb2xvcnNbMF1cbiAgICAgICAgICAgICAgICA/IENvbG9yVW5pdEVudW0uUEVSQ0VOVFxuICAgICAgICAgICAgICAgIDogREVGQVVMVF9PUFRJT05TLmxhYlVuaXQpLFxuICAgICAgICBjbXlrVW5pdDogb3B0aW9ucy5jbXlrVW5pdCAmJiBjb2xvclVuaXRWYWx1ZXMuaW5jbHVkZXMob3B0aW9ucy5jbXlrVW5pdClcbiAgICAgICAgICAgID8gb3B0aW9ucy5jbXlrVW5pdFxuICAgICAgICAgICAgOiAobmV3IFNldChjbXlrQ29sb3JzKS5zaXplID09PSAxICYmICFjbXlrQ29sb3JzWzBdXG4gICAgICAgICAgICAgICAgPyBDb2xvclVuaXRFbnVtLk5PTkVcbiAgICAgICAgICAgICAgICA6IERFRkFVTFRfT1BUSU9OUy5jbXlrVW5pdCksXG4gICAgICAgIGFscGhhVW5pdDogb3B0aW9ucy5hbHBoYVVuaXQgJiYgY29sb3JVbml0VmFsdWVzLmluY2x1Z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HQih0MSwgdDIsIEggLSAyKTtcbiAgICByZXR1cm4geyBSLCBHLCBCIH07XG59O1xuZXhwb3J0IGNvbnN0IHJnYlRvSFNMID0gKFIsIEcsIEIsIEEgPSAxKSA9PiB7XG4gICAgUiAvPSAyNTU7XG4gICAgRyAvPSAyNTU7XG4gICAgQiAvPSAyNTU7XG4gICAgQSA9IE1hdGgubWluKEEsIDEpO1xuICAgIGNvbnN0IE1BWCA9IE1hdGgubWF4KFIsIEcsIEIpO1xuICAgIGNvbnN0IE1JTiA9IE1hdGgubWluKFIsIEcsIEIpO1xuICAgIGNvbnN0IEQgPSBNQVggLSBNSU47XG4gICAgbGV0IEggPSAwO1xuICAgIGxldCBTID0gMDtcbiAgICBjb25zdCBMID0gKE1BWCArIE1JTikgLyAyO1xuICAgIGlmIChEICE9PSAwKSB7XG4gICAgICAgIHN3aXRjaCAoTUFYKSB7XG4gICAgICAgICAgICBjYXNlIFI6XG4gICAgICAgICAgICAgICAgSCA9ICgoRyAtIEIpIC8gRCkgJSA2O1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSBHOlxuICAgICAgICAgICAgICAgIEggPSAoQiAtIFIpIC8gRCArIDI7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIEI6XG4gICAgICAgICAgICAgICAgSCA9IChSIC0gRykgLyBEICsgNDtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBIID0gcm91bmQoSCAqIDYwKTtcbiAgICAgICAgaWYgKEggPCAwKSB7XG4gICAgICAgICAgICBIICs9IDM2MDtcbiAgICAgICAgfVxuICAgICAgICBTID0gRCAvICgxIC0gTWF0aC5hYnMoMiAqIEwgLSAxKSk7XG4gICAgfVxuICAgIHJldHVybiB7XG4gICAgICAgIEgsXG4gICAgICAgIFM6IHJvdW5kKFMgKiAxMDApLFxuICAgICAgICBMOiByb3VuZChMICogMTAwKSxcbiAgICAgICAgQVxuIC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gICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGluZGV4ID09PSAzXG4gICAgICAgICAgICAgICAgPyBnZXRBbHBoYSh2YWx1ZSwgb3B0aW9ucylcbiAgICAgICAgICAgICAgICA6IHJvdW5kKHZhbHVlLCBkZWNpbWFscyk7XG4gICAgICAgIH07XG4gICAgICAgIGNvbnN0IHZhbHVlcyA9IHByZXBhcmVDb2xvckZvckNzcyhjb2xvciwgdHJhbnNmb3JtZXIpO1xuICAgICAgICBjb25zdCB0ZW1wbGF0ZSA9IGxlZ2FjeUNTU1xuICAgICAgICAgICAgPyAodmFsdWVzLmxlbmd0aCA9PT0gNFxuICAgICAgICAgICAgICAgID8gYGhzbGEoezF9JHtjb21tYX17Mn0lJHtjb21tYX17M30lJHtjb21tYX17NH0pYFxuICAgICAgICAgICAgICAgIDogYGhzbCh7MX0ke2NvbW1hfXsyfSUke2NvbW1hfXszfSUpYClcbiAgICAgICAgICAgIDogKHZhbHVlcy5sZW5ndGggPT09IDRcbiAgICAgICAgICAgICAgICA/IGBoc2woezF9IHsyfSUgezN9JSAvIHs0fSlgXG4gICAgICAgICAgICAgICAgOiBgaHNsKHsxfSB7Mn0lIHszfSUpYCk7XG4gICAgICAgIHJldHVybiBnZXRSZXN1bHRGcm9tVGVtcGxhdGUodGVtcGxhdGUsIHZhbHVlcyk7XG4gICAgfSxcbiAgICBbQ29sb3JNb2RlbC5DSUVMYWJdOiAoY29sb3IsIG9wdGlvbnMpID0+IHtcbiAgICAgICAgY29uc3QgeyBkZWNpbWFscywgbGFiVW5pdCB9ID0gb3B0aW9ucztcbiAgICAgICAgY29uc3QgdHJhbnNmb3JtZXIgPSAodmFsdWUsIGluZGV4KSA9PiB7XG4gICAgICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICBjb25zdCBMID0gcm91bmQocGVyY2VudCh2YWx1ZSksIGRlY2ltYWxzKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbGFiVW5pdCA9PT0gQ29sb3JVbml0RW51bS5QRVJDRU5UXG4gICAgICAgICAgICAgICAgICAgID8gYCR7TH0lYFxuICAgICAgICAgICAgICAgICAgICA6IGAke0x9YDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpbmRleCA8IDMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbGFiVW5pdCA9PT0gQ29sb3JVbml0RW51bS5QRVJDRU5UXG4gICAgICAgICAgICAgICAgICAgID8gYCR7ZnJvbTEyNU51bWJlclRvUGVyY2VudCh2YWx1ZSwgZGVjaW1hbHMpfSVgXG4gICAgICAgICAgICAgICAgICAgIDogcm91bmQodmFsdWUsIGRlY2ltYWxzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBnZXRBbHBoYSh2YWx1ZSwgb3B0aW9ucywgdHJ1ZSk7XG4gICAgICAgIH07XG4gICAgICAgIGNvbnN0IHZhbHVlcyA9IHByZXBhcmVDb2xvckZvckNzcyhjb2xvciwgdHJhbnNmb3JtZXIpO1xuICAgICAgICBjb25zdCB0ZW1wbGF0ZSA9IHZhbHVlcy5sZW5ndGggPT09IDRcbiAgICAgICAgICAgID8gYGxhYih7MX0gezJ9IHszfSAvIHs0fSlgXG4gICAgICAgICAgICA6IGBsYWIoezF9IHsyfSB7M30pYDtcbiAgICAgICAgcmV0dXJuIGdldFJlc3VsdEZyb21UZW1wbGF0ZSh0ZW1wbGF0ZSwgdmFsdWVzKTtcbiAgICB9LFxuICAgIFtDb2xvck1vZGVsLkNNWUtdOiAoY29sb3IsIG9wdGlvbnMpID0+IHtcbiAgICAgICAgY29uc3QgeyBkZWNpbWFscywgbGVnYWN5Q1NTLCBzcGFjZXNBZnRlckNvbW1hcywgY215a1VuaXQsIGNteWtGdW5jdGlvbiB9ID0gb3B0aW9ucztcbiAgICAgICAgY29uc3QgY29tbWEgPSBnZXRDb21tYShzcGFjZXNBZnRlckNvbW1hcyk7XG4gICAgICAgIGNvbnN0IHRyYW5zZm9ybWVyID0gKHZhbHVlLCBpbmRleCkgPT4ge1xuICAgICAgICAgICAgaWYgKGNteWtVbml0ID09PSBDb2xvclVuaXRFbnVtLlBFUkNFTlQgJiZcbiAgICAgICAgICAgICAgICBpbmRleCA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gYCR7cm91bmQodmFsdWUsIGRlY2ltYWxzKX0lYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbmRleCA9PT0gNFxuICAgICAgICAgICAgICAgID8gZ2V0QWxwaGEodmFsdWUsIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgOiByb3VuZCh2YWx1ZSAvIDEwMCwgZGVjaW1hbHMpO1xuICAgICAgICB9O1xuICAgICAgICBjb25zdCB2YWx1ZXMgPSBwcmVwYXJlQ29sb3JGb3JDc3MoY29sb3IsIHRyYW5zZm9ybWVyKTtcbiAgICAgICAgY29uc3QgdGVtcGxhdGUgPSBsZWdhY3lDU1NcbiAgICAgICAgICAgID8gKHZhbHVlcy5sZW5ndGggPT09IDVcbiAgICAgICAgICAgICAgICA/IGAke2NteWtGdW5jdGlvbn0oezF9JHtjb21tYX17Mn0ke2NvbW1hfXszfSR7Y29tbWF9ezR9JHtjb21tYX17NX0pYFxuICAgICAgICAgICAgICAgIDogYCR7Y215a0Z1bmN0aW9ufSh7MX0ke2NvbW1hfXsyfSR7Y29tbWF9ezN9JHtjb21tYX17NH0pYClcbiAgICAgICAgICAgIDogKHZhbHVlcy5sZW5ndGggPT09IDVcbiAgICAgICAgICAgICAgICA/IGAke2NteWtGdW5jdGlvbn0oezF9IHsyfSB7M30gezR9IC8gezV9KWBcbiAgICAgICAgICAgICAgICA6IGAke2NteWtGdW5jdGlvbn0oezF9IHsyfSB7M30gezR9KWApO1xuICAgICAgICByZXR1cm4gZ2V0UmVzdWx0RnJvbVRlbXBsYXRlKHRlbXBsYXRlLCB2YWx1ZXMpO1xuICAgIH1cbn07XG4iLCJpbXBvcnQgeyBIR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gICAgIHJldHVybiAhKFBDRU5ULnRlc3QoYCR7aXRlbVsxXX1gKSB8fFxuICAgICAgICAgICAgICAgICghSEVYLnRlc3QoYCR7aXRlbVsxXX1gKSAmJlxuICAgICAgICAgICAgICAgICAgICAhaXNOYU4oK2l0ZW1bMV0pICYmXG4gICAgICAgICAgICAgICAgICAgICtpdGVtWzFdIDw9IDI1NSkpO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKGhhc0ludmFsaWRIZXggJiYgaGFzSW52YWxpZFJlZ2IpIHtcbiAgICAgICAgICAgIGludmFsaWQgPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGlmICghaGFzSW52YWxpZEhleCkge1xuICAgICAgICAgICAgbW9kZWwgPSBDb2xvck1vZGVsLkhFWDtcbiAgICAgICAgfVxuICAgIH1cbiAgICBpZiAoIW1vZGVsIHx8IGludmFsaWQpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKEVSUk9SUy5OT1RfQUNDRVBURURfT0JKRUNUX0lOUFVUKTtcbiAgICB9XG4gICAgcmV0dXJuIG1vZGVsO1xufTtcbmV4cG9ydCBjb25zdCBnZXRDb2xvck1vZGVsID0gKGNvbG9yKSA9PiB0eXBlb2YgY29sb3IgPT09ICdzdHJpbmcnXG4gICAgPyBnZXRDb2xvck1vZGVsRnJvbVN0cmluZyhjb2xvcilcbiAgICA6IGdldENvbG9yTW9kZWxGcm9tT2JqZWN0KGNvbG9yKTtcbmV4cG9ydCBjb25zdCBnZXRSR0JPYmplY3RGcm9tU3RyaW5nID0ge1xuICAgIFtDb2xvck1vZGVsLkhFWF0oY29sb3IpIHtcbiAgICAgICAgY29uc3QgY29sb3JTdHIgPSAhfkNPTE9SX0tFWVMuaW5kZXhPZihjb2xvcilcbiAgICAgICAgICAgID8gY29sb3JcbiAgICAgICAgICAgIDogQ29sb3JLZXl3b3Jkc1tjb2xvcl07XG4gICAgICAgIGNvbnN0IG1hdGNoID0gY29sb3JTdHIubWF0Y2goQ09MT1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xuICAgICAgICByZXR1cm4gUkdCO1xuICAgIH0sXG4gICAgW0NvbG9yTW9kZWwuQ01ZS10oY29sb3IpIHtcbiAgICAgICAgY29uc3QgQyA9IGdldENNWUtOdW1iZXIoYCR7Y29sb3IuQ31gKTtcbiAgICAgICAgY29uc3QgTSA9IGdldENNWUtOdW1iZXIoYCR7Y29sb3IuTX1gKTtcbiAgICAgICAgY29uc3QgWSA9IGdldENNWUtOdW1iZXIoYCR7Y29sb3IuWX1gKTtcbiAgICAgICAgY29uc3QgSyA9IGdldENNWUtOdW1iZXIoYCR7Y29sb3IuS31gKTtcbiAgICAgICAgY29uc3QgUkdCID0gY215a1RvUkdCKEMsIE0sIFksIEspO1xuICAgICAgICBpZiAoaGFzUHJvcChjb2xvciwgJ0EnKSkge1xuICAgICAgICAgICAgUkdCLkEgPSBub3JtYWxpemVBbHBoYShjb2xvci5BKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gUkdCO1xuICAgIH1cbn07XG5leHBvcnQgY29uc3QgZ2V0UkdCT2JqZWN0ID0gKGNvbG9yLCBtb2RlbCA9IGdldENvbG9yTW9kZWwoY29sb3IpKSA9PiB7XG4gICAgcmV0dXJuIHR5cGVvZiBjb2xvciA9PT0gJ3N0cmluZydcbiAgICAgICAgPyBnZXRSR0JPYmplY3RGcm9tU3RyaW5nW21vZGVsXShjb2xvcilcbiAgICAgICAgOiBnZXRSR0JPYmplY3RGcm9tT2JqZWN0W21vZGVsXShjb2xvcik7XG59O1xuZXhwb3J0IGNvbnN0IHRyYW5zbGF0ZUNvbG9yID0ge1xuICAgIFtDb2xvck1vZGVsLkhFWF0oY29sb3IpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIFI6IGdldEhFWChjb2xvci5SKSxcbiAgICAgICAgICAgIEc6IGdldEhFWChjb2xvci5HKSxcbiAgICAgICAgICAgIEI6IGdldEhFWChjb2xvci5CKVxuICAgICAgICB9O1xuICAgIH0sXG4gICAgSEVYQShjb2xvcikge1xuICAgICAgICBjb25zdCBSR0IgPSB0cmFuc2xhdGVDb2xvci5IRVgoY29sb3IpO1xuICAgICAgICBSR0IuQSA9IGhhc1Byb3AoY29sb3IsICdBJylcbiAgICAgICAgICAgID8gZ2V0SEVYKGNvbG9yLkEgKiAyNTUpXG4gICAgICAgICAgICA6ICcweEZGJztcbiAgICAgICAgcmV0dXJuIFJHQjtcbiAgICB9LFxuICAgIFtDb2xvck1vZGVsLlJHQl0oY29sb3IsIGRlY2ltYWxzKSB7XG4gICAgICAgIGNvbnN0IFJHQiA9IHJvdW5kUkdCT2JqZWN0KGNvbG9yLCBkZWNpbWFscyk7XG4gICAgICAgIGlmIChoYXNQcm9wKFJHQiwgJ0EnKSkge1xuICAgICAgICAgICAgZGVsZXRlIFJHQi5BO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBSR0I7XG4gICAgfSxcbiAgICBSR0JBKGNvbG9yLCBkZWNpbWFscykge1xuICAgICAgICBjb25zdCBSR0IgPSB0cmFuc2xhdGVDb2xvci5SR0IoY29sb3IsIGRlY2ltYWxzKTtcbiAgICAgICAgUkdCLkEgPSBoYXNQcm9wKGNvbG9yLCAnQScpXG4gICAgICAgICAgICA/IHJvdW5kKGNvbG9yLkEpXG4gICAgICAgICAgICA6IDE7XG4gICAgICAgIHJldHVybiBSR0I7XG4gICAgfSxcbiAgICBbQ29sb3JNb2RlbC5IU0xdKGNvbG9yLCBkZWNpbWFscykge1xuICAgICAgICBjb25zdCBIU0wgPSByZ2JUb0hTTChjb2xvci5SLCBjb2xvci5HLCBjb2xvci5CKTtcbiAgICAgICAgZGVsZXRlIEhTTC5BO1xuICAgICAgICByZXR1cm4gcm91bmRIU0xPYmplY3QoSFNMLCBkZWNpbWFscyk7XG4gICAgfSxcbiAgICBIU0xBKGNvbG9yLCBkZWNpbWFscykge1xuICAgICAgICBjb25zdCBIU0wgPSB0cmFuc2xhdGVDb2xvci5IU0woY29sb3IsIGRlY2ltYWxzKTtcbiAgICAgICAg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IHJldHVybiBpc0NTU1xuICAgICAgICAgICAgICAgICAgICA/IGhhc0FscGhhXG4gICAgICAgICAgICAgICAgICAgICAgICA/IENTUy5IRVgoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4uLlJHQkNvbG9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEE6IHJvdW5kKFJHQkNvbG9yLkEgKiAyNTUpXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgOiBDU1MuSEVYKFJHQkNvbG9yKVxuICAgICAgICAgICAgICAgICAgICA6IGhhc0FscGhhXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHRyYW5zbGF0ZUNvbG9yLkhFWEEoUkdCQ29sb3IpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLkhFWChSR0JDb2xvcik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgY2FzZSBDb2xvck1vZGVsLlJHQjpcbiAgICAgICAgICAgIHJldHVybiBoc2xNYXAubWFwKChIU0xDb2xvcikgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IFJHQkNvbG9yID0gaHNsVG9SR0IoSFNMQ29sb3IuSCwgSFNMQ29sb3IuUywgSFNMQ29sb3IuTCk7XG4gICAgICAgICAgICAgICAgaWYgKGhhc0FscGhhKVxuICAgICAgICAgICAgICAgICAgICBSR0JDb2xvci5BID0gSFNMQ29sb3IuQTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNDU1NcbiAgICAgICAgICAgICAgICAgICAgPyBDU1MuUkdCKFJHQkNvbG9yLCBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICA6IGhhc0FscGhhXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHRyYW5zbGF0ZUNvbG9yLlJHQkEoUkdCQ29sb3IsIG9wdGlvbnMuZGVjaW1hbHMpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLlJHQihSR0JDb2xvciwgb3B0aW9ucy5kZWNpbWFscyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgY2FzZSBDb2xvck1vZGVsLkhTTDpcbiAgICAgICAgICAgIHJldHVybiBoc2xNYXAubWFwKChIU0xDb2xvcikgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0NTU1xuICAgICAgICAgICAgICAgICAgICA/IENTUy5IU0woSFNMQ29sb3IsIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgIDogaGFzQWxwaGFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gdHJhbnNsYXRlQ29sb3IuSFNMQSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4uaHNsVG9SR0IoSFNMQ29sb3IuSCwgSFNMQ29sb3IuUywgSFNMQ29sb3IuTCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQTogSFNMQ29sb3IuQVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgb3B0aW9ucy5kZWNpbWFscylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogdHJhbnNsYXRlQ29sb3IuSFNMKGhzbFRvUkdCKEhTTENvbG9yLkgsIEhTTENvbG9yLlMsIEhTTENvbG9yLkwpLCBvcHRpb25zLmRlY2ltYWxzKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICBjYXNlIENvbG9yTW9kZWwuQ0lFTGFiOlxuICAgICAgICAgICAgcmV0dXJuIGhzbE1hcC5tYXAoKEhTTENvbG9yKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgUkdCQ29sb3IgPSBoc2xUb1JHQihIU0xDb2xvci5ILCBIU0xDb2xvci5TLCBIU0xDb2xvci5MKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNDU1NcbiAgICAgICAgICAgICAgICAgICAgPyBDU1MuQ0lFTGFiKGhhc0FscGhhXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHRyYW5zbGF0ZUNvbG9yLkNJRUxhYkEoUkdCQ29sb3IsIG9wdGlvbnMuZGVjaW1hbHMpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLkNJRUxhYihSR0JDb2xvciwgb3B0aW9ucy5kZWNpbWFscyksIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgIDogaGFzQWxwaGFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gdHJhbnNsYXRlQ29sb3IuQ0lFTGFiQSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLi4uUkdCQ29sb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQTogSFNMQ29sb3IuQVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgb3B0aW9ucy5kZWNpbWFscylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogdHJhbnNsYXRlQ29sb3IuQ0lFTGFiKFJHQkNvbG9yLCBvcHRpb25zLmRlY2ltYWxzKTtcbiAgICAgICAgICAgIH0pO1xuICAgIH1cbn07XG5leHBvcnQgY29uc3QgY29sb3JIYXJtb255ID0ge1xuICAgIGJ1aWxkSGFybW9ueShjb2xvciwgaGFybW9ueUZ1bmN0aW9uLCBtb2RlLCBvcHRpb25zKSB7XG4gICAgICAgIGNvbnN0IG1vZGVsID0gZ2V0Q29sb3JNb2RlbChjb2xvcik7XG4gICAgICAgIGNvbnN0IFJHQiA9IGdldFJHQk9iamVjdChjb2xvciwgbW9kZWwpO1xuICAgICAgICBjb25zdCBIU0wgPSByZ2JUb0hTTChSR0IuUiwgUkdCLkcsIFJHQi5CLCBSR0IuQSk7XG4gICAgICAgIGNvbnN0IGhhc0FscGhhID0gKCh0eXBlb2YgY29sb3IgPT09ICdzdHJpbmcnICYmIGhhc1Byb3AoUkdCLCAnQScpKSB8fFxuICAgICAgICAgICAgKHR5cGVvZiBjb2xvciAhPT0gJ3N0cmluZycgJiYgaGFzUHJvcChjb2xvciwgJ0EnKSkpO1xuICAgICAgICBjb25zdCBpc0NTUyA9IHR5cGVvZiBjb2xvciA9PT0gJ3N0cmluZyc7XG4gICAgICAgIHN3aXRjaCAobW9kZWwpIHtcbiAgICAgICAgICAgIGNhc2UgQ29sb3JNb2RlbC5IRVg6XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHJldHVybiBoYXNBbHBoYVxuICAgICAgICAgICAgICAgICAgICA/IHRoaXMuSEVYQShyb3VuZEhTTE9iamVjdChIU0wsIDApLCBoYXJtb255RnVuY3Rpb24sIG1vZGUsIGlzQ1NTKVxuICAgICAgICAgICAgICAgICAgICA6IHRoaXMuSEVYKHJvdW5kSFNMT2JqZWN0KEhTTCwgMCksIGhhcm1vbnlGdW5jdGlvbiwgbW9kZSwgaXNDU1MpO1xuICAgICAgICAgICAgY2FzZSBDb2xvck1vZGVsLkhTTDpcbiAgICAgICAgICAgICAgICByZXR1cm4gaGFzQWxwaGFcbiAgICAgICAgICAgICAgICAgICAgPyB0aGlzLkhTTEEoSFNMLCBoYXJtb255RnVuY3Rpb24sIG1vZGUsIGlzQ1NTLCBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICA6IHRoaXMuSFNMKEhTTCwgaGFybW9ueUZ1bmN0aW9uLCBtb2RlLCBpc0NTUywgb3B0aW9ucyk7XG4gICAgICAgICAgICBjYXNlIENvbG9yTW9kZWwuUkdCOlxuICAgICAgICAgICAgICAgIHJldHVybiBoYXNBbHBoYVxuICAgICAgICAgICAgICAgICAgICA/IHRoaXMuUkdCQShIU0wsIGhhcm1vbnlGdW5jdGlvbiwgbW9kZSwgaXNDU1MsIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgIDogdGhpcy5SR0IoSFNMLCBoYXJtb255RnVuY3Rpb24sIG1vZGUsIGlzQ1NTLCBvcHRpb25zKTtcbiAgICAgICAgICAgIGNhc2UgQ29sb3JNb2RlbC5DSUVMYWI6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhhc0FscGhhXG4gICAgICAgICAgICAgICAgICAgID8gdGhpc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gICAgICAgIHJldHVybiBhcnJheS5tYXAoKGMpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IFJHQiA9IGhzbFRvUkdCKGMuSCwgYy5TLCBjLkwpO1xuICAgICAgICAgICAgcmV0dXJuIChjc3NcbiAgICAgICAgICAgICAgICA/IENTUy5DSUVMYWIocmdiVG9MYWIoUkdCLlIsIFJHQi5HLCBSR0IuQiksIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgOiB0cmFuc2xhdGVDb2xvci5DSUVMYWIoUkdCLCBvcHRpb25zLmRlY2ltYWxzKSk7XG4gICAgICAgIH0pO1xuICAgIH0sXG4gICAgQ0lFTGFiQShjb2xvciwgaGFybW9ueUZ1bmN0aW9uLCBtb2RlLCBjc3MsIG9wdGlvbnMpIHtcbiAgICAgICAgY29uc3QgYXJyYXkgPSBoYXJtb255RnVuY3Rpb24oY29sb3IsIG1vZGUpO1xuICAgICAgICByZXR1cm4gYXJyYXkubWFwKChjKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBSR0IgPSBoc2xUb1JHQihjLkgsIGMuUywgYy5MKTtcbiAgICAgICAgICAgIHJldHVybiAoY3NzXG4gICAgICAgICAgICAgICAgPyBDU1MuQ0lFTGFiKHtcbiAgICAgICAgICAgICAgICAgICAgLi4ucmdiVG9MYWIoUkdCLlIsIFJHQi5HLCBSR0IuQiksXG4gICAgICAgICAgICAgICAgICAgIEE6IG5vcm1hbGl6ZUFscGhhKGMuQSlcbiAgICAgICAgICAgICAgICB9LCBvcHRpb25zKVxuICAgICAgICAgICAgICAgIDogdHJhbnNsYXRlQ29sb3IuQ0lFTGFiQSh7XG4gICAgICAgICAgICAgICAgICAgIC4uLlJHQixcbiAgICAgICAgICAgICAgICAgICAgQTogbm9ybWFsaXplQWxwaGEoYy5BKVxuICAgICAgICAgICAgICAgIH0sIG9wdGlvbnMuZGVjaW1hbHMpKTtcbiAgICAgICAgfSk7XG4gICAgfVxufTtcbmV4cG9ydCBjb25zdCBjb2xvck1peGVyID0ge1xuICAgIG1peChjb2xvcnMsIG1vZGUpIHtcbiAgICAgICAgY29uc3QgcmdiTWFwID0gY29sb3JzLm1hcCgoY29sb3IpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG1vZGVsID0gZ2V0Q29sb3JNb2RlbChjb2xvcik7XG4gICAgICAgICAgICByZXR1cm4gZ2V0UkdCT2JqZWN0KGNvbG9yLCBtb2RlbCk7XG4gICAgICAgIH0pO1xuICAgICAgICBjb25zdCByeWJNYXAgPSBtb2RlID09PSBNaXguU1VCVFJBQ1RJVkVcbiAgICAgICAgICAgID8gcmdiTWFwLm1hcCgoY29sb3IpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBSWUIgPSByZ2JUb1JZQihjb2xvci5SLCBjb2xvci5HLCBjb2xvci5CKTtcbiAgICAgICAgICAgICAgICBpZiAoaGFzUHJvcChjb2xvciwgJ0EnKSkge1xuICAgICAgICAgICAgICAgICAgICBSWUIuQSA9IGNvbG9yLkE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBSWUI7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgOiBudWxsO1xuICAgICAgICBmdW5jdGlvbiBjcmVhdGVNaXgoaXRlbXMpIHtcbiAgICAgICAgICAgIGNvbnN0IGluaXRpYWwgPSBtb2RlID09PSBNaXguQURESVRJVkVcbiAgICAgICAgICAgICAgICA/IHsgUjogMCwgRzogMCwgQjogMCwgQTogMCB9XG4gICAgICAgICAgICAgICAgOiB7IFI6IDAsIFk6IDAsIEI6IDAsIEE6IDAgfTtcbiAgICAgICAgICAgIHJldHVybiBpdGVtcy5yZWR1Y2UoKG1peCwgY29sb3IpID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBjb2xvckEgPSBoYXNQcm9wKGNvbG9yLCAnQScpID8gY29sb3IuQSA6IDE7XG4gICAgICAgICAgICAgICAgY29uc3QgY29tbW9uID0ge1xuICAgICAgICAgICAgICAgICAgICBSOiBNYXRoLm1pbihtaXguUiArIGNvbG9yLlIgKiBjb2xvckEsIDI1NSksXG4gICAgICAgICAgICAgICAgICAgIEI6IE1hdGgubWluKG1peC5CICsgY29sb3IuQiAqIGNvbG9yQSwgMjU1KSxcbiAgICAgICAgICAgICAgICAgICAgQTogMSAtICgxIC0gY29sb3JBKSAqICgxIC0gbWl4LkEpXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBjb25zdCBtaXhHWSA9ICdHJyBpbiBtaXhcbiAgICAgICAgICAgICAgICAgICAgPyBtaXguR1xuICAgICAgICAgICAgICAgICAgICA6IG1peC5ZO1xuICAgICAgICAgICAgICAgIGNvbnN0IGNvbG9yR1kgPSAnRycgaW4gY29sb3JcbiAgICAgICAgICAgICAgICAgICAgPyBjb2xvci5HXG4gICAgICAgICAgICAgICAgICAgIDogY29sb3IuWTtcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAuLi5jb21tb24sXG4gICAgICAgICAgICAgICAgICAgIC4uLihtb2RlID09PSBNaXguQURESVRJVkVcbiAgICAgICAgICAgICAgICAgICAgICAgID8geyBHOiBNYXRoLm1pbihtaXhHWSArIGNvbG9yR1kgKiBjb2xvckEsIDI1NSkgfVxuICAgICAgICAgICAgICAgICAgICAgICAgOiB7IFk6IE1hdGgubWluKG1peEdZICsgY29sb3JHWSAqIGNvbG9yQSwgMjU1KSB9KVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9LCBpbml0aWFsKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgbWl4O1xuICAgICAgICBpZiAobW9kZSA9PT0gTWl4LkFERElUSVZFKSB7XG4gICAgICAgICAgICBtaXggPSBjcmVhdGVNaXgocmdiTWFwKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IFJZQiA9IGNyZWF0ZU1peChyeWJNYXApO1xuICAgICAgICAgICAgbWl4ID0gcnliVG9SR0IoUllCLlIsIFJZQi5ZLCBSWUIuQik7XG4gICAgICAgICAgICBtaXguQSA9IFJZQi5BO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBSOiByb3VuZChtaXguUiksXG4gICAgICAgICAgICBHOiByb3VuZChtaXguRyksXG4gICAgICAgICAgICBCOiByb3VuZChtaXguQiksXG4gICAgICAgICAgICBBOiBtaW5tYXgobWl4LkEsIDAsIDEpXG4gICAgICAgIH07XG4gICAgfSxcbiAgICBbQ29sb3JNb2RlbC5IRVhdKGNvbG9ycywgbW9kZSwgY3NzKSB7XG4gICAgICAgIGNvbnN0IG1peCA9IHRoaXMubWl4KGNvbG9ycywgbW9kZSk7XG4gICAgICAgIGRlbGV0ZSBtaXguQTtcbiAgICAgICAgcmV0dXJuIChjc3NcbiAgICAgICAgICAgID8gQ1NTLkhFWChtaXgpXG4gICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLkhFWChtaXgpKTtcbiAgICB9LFxuICAgIEhFWEEoY29sb3JzLCBtb2RlLCBjc3MpIHtcbiAgICAgICAgY29uc3QgbWl4ID0gdGhpcy5taXgoY29sb3JzLCBtb2RlKTtcbiAgICAgICAgbWl4LkEgPSBjc3NcbiAgICAgICAgICAgID8gbm9ybWFsaXplQWxwaGEobWl4LkEpICogMjU1XG4gICAgICAgICAgICA6IG5vcm1hbGl6ZUFscGhhKG1peC5BKTtcbiAgICAgICAgcmV0dXJuIChjc3NcbiAgICAgICAgICAgID8gQ1NTLkhFWChtaXgpXG4gICAgICAgICAgICA6IHRyYW5zbGF0ZUNvbG9yLkhFWEEobWl4KSk7XG4gICAgfSxcbiAgICBbQ29sb3JNb2RlbC5SR0JdKGNvbG9ycywgbW9kZSwgY3NzLCBvcHRpb25zKSB7XG4gICAgICAgIGNvbnN0IG1peCA9IHRoaXMubWl4KGNvbG9ycywgbW9kZSk7XG4gICAgICAgIGRlbGV0ZSBtaXguQTtcbiAgICAgICAgcmV0dXJuIChjc3NcbiAgICAgIC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3VuZChjb2xvci5HLCBkZWNpbWFscyk7XG4gICAgY29uc3QgQiA9IHJvdW5kKGNvbG9yLkIsIGRlY2ltYWxzKTtcbiAgICByZXR1cm4ge1xuICAgICAgICBSLFxuICAgICAgICBHLFxuICAgICAgICBCLFxuICAgICAgICAuLi4oaGFzUHJvcChjb2xvciwgJ0EnKVxuICAgICAgICAgICAgPyB7XG4gICAgICAgICAgICAgICAgQTogcm91bmQoY29sb3IuQSwgZGVjaW1hbHMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICA6IHt9KVxuICAgIH07XG59O1xuZXhwb3J0IGNvbnN0IHJvdW5kSFNMT2JqZWN0ID0gKGNvbG9yLCBkZWNpbWFscykgPT4ge1xuICAgIHJldHVybiB7XG4gICAgICAgIEg6IHJvdW5kKGNvbG9yLkgsIGRlY2ltYWxzKSxcbiAgICAgICAgUzogcm91bmQoY29sb3IuUywgZGVjaW1hbHMpLFxuICAgICAgICBMOiByb3VuZChjb2xvci5MLCBkZWNpbWFscyksXG4gICAgICAgIC4uLihoYXNQcm9wKGNvbG9yLCAnQScpXG4gICAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgICBBOiByb3VuZChjb2xvci5BLCBkZWNpbWFscylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIDoge30pXG4gICAgfTtcbn07XG5leHBvcnQgY29uc3Qgcm91bmRDSUVMYWJPYmplY3QgPSAoY29sb3IsIGRlY2ltYWxzKSA9PiB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgTDogcm91bmQoY29sb3IuTCwgZGVjaW1hbHMpLFxuICAgICAgICBhOiByb3VuZChjb2xvci5hLCBkZWNpbWFscyksXG4gICAgICAgIGI6IHJvdW5kKGNvbG9yLmIsIGRlY2ltYWxzKVxuICAgIH07XG59O1xuZXhwb3J0IGNvbnN0IHJvdW5kQ01ZS09iamVjdCA9IChjb2xvciwgZGVjaW1hbHMpID0+IHtcbiAgICByZXR1cm4ge1xuICAgICAgICBDOiByb3VuZCh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R1cm4gdXRpbHMudHJhbnNsYXRlQ29sb3IuSEVYKHRoaXMucmdiKTtcbiAgICB9XG4gICAgZ2V0IEhFWEFPYmplY3QoKSB7XG4gICAgICAgIHJldHVybiB1dGlscy50cmFuc2xhdGVDb2xvci5IRVhBKHRoaXMucmdiKTtcbiAgICB9XG4gICAgZ2V0IFJHQk9iamVjdCgpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIFI6IHRoaXMuUixcbiAgICAgICAgICAgIEc6IHRoaXMuRyxcbiAgICAgICAgICAgIEI6IHRoaXMuQlxuICAgICAgICB9O1xuICAgIH1cbiAgICBnZXQgUkdCQU9iamVjdCgpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIC4uLnRoaXMuUkdCT2JqZWN0LFxuICAgICAgICAgICAgQTogdGhpcy5BXG4gICAgICAgIH07XG4gICAgfVxuICAgIGdldCBIU0xPYmplY3QoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBIOiB0aGlzLkgsXG4gICAgICAgICAgICBTOiB0aGlzLlMsXG4gICAgICAgICAgICBMOiB0aGlzLkxcbiAgICAgICAgfTtcbiAgICB9XG4gICAgZ2V0IEhTTEFPYmplY3QoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAuLi50aGlzLkhTTE9iamVjdCxcbiAgICAgICAgICAgIEE6IHRoaXMuQVxuICAgICAgICB9O1xuICAgIH1cbiAgICBnZXQgQ0lFTGFiT2JqZWN0KCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgTDogdGhpcy5DSUVMLFxuICAgICAgICAgICAgYTogdGhpcy5DSUVhLFxuICAgICAgICAgICAgYjogdGhpcy5DSUViXG4gICAgICAgIH07XG4gICAgfVxuICAgIGdldCBDSUVMYWJBT2JqZWN0KCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgLi4udGhpcy5DSUVMYWJPYmplY3QsXG4gICAgICAgICAgICBBOiB0aGlzLkFcbiAgICAgICAgfTtcbiAgICB9XG4gICAgZ2V0IENNWUtPYmplY3QoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBDOiB0aGlzLkMsXG4gICAgICAgICAgICBNOiB0aGlzLk0sXG4gICAgICAgICAgICBZOiB0aGlzLlksXG4gICAgICAgICAgICBLOiB0aGlzLktcbiAgICAgICAgfTtcbiAgICB9XG4gICAgZ2V0IENNWUtBT2JqZWN0KCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgLi4udGhpcy5DTVlLT2JqZWN0LFxuICAgICAgICAgICAgQTogdGhpcy5BXG4gICAgICAgIH07XG4gICAgfVxuICAgIGdldCBIRVgoKSB7XG4gICAgICAgIHJldHVybiBDU1MuSEVYKHtcbiAgICAgICAgICAgIFI6IHRoaXMuUixcbiAgICAgICAgICAgIEc6IHRoaXMuRyxcbiAgICAgICAgICAgIEI6IHRoaXMuQlxuICAgICAgICB9KTtcbiAgICB9XG4gICAgZ2V0IEhFWEEoKSB7XG4gICAgICAgIHJldHVybiBDU1MuSEVYKHtcbiAgICAgICAgICAgIFI6IHRoaXMuUixcbiAgICAgICAgICAgIEc6IHRoaXMuRyxcbiAgICAgICAgICAgIEI6IHRoaXMuQixcbiAgICAgICAgICAgIEE6IHRoaXMuQSAqIDI1NVxuICAgICAgICB9KTtcbiAgICB9XG4gICAgZ2V0IFJHQigpIHtcbiAgICAgICAgcmV0dXJuIENTUy5SR0Ioe1xuICAgICAgICAgICAgUjogdGhpcy5SLFxuICAgICAgICAgICAgRzogdGhpcy5HLFxuICAgICAgICAgICAgQjogdGhpcy5CXG4gICAgICAgIH0sIHRoaXMub3B0aW9ucyk7XG4gICAgfVxuICAgIGdldCBSR0JBKCkge1xuICAgICAgICByZXR1cm4gQ1NTLlJHQih7XG4gICAgICAgICAgICBSOiB0aGlzLlIsXG4gICAgICAgICAgICBHOiB0aGlzLkcsXG4gICAgICAgICAgICBCOiB0aGlzLkIsXG4gICAgICAgICAgICBBOiB0aGlzLkFcbiAgICAgICAgfSwgdGhpcy5vcHRpb25zKTtcbiAgICB9XG4gICAgZ2V0IEhTTCgpIHtcbiAgICAgICAgcmV0dXJuIENTUy5IU0woe1xuICAgICAgICAgICAgSDogdGhpcy5ILFxuICAgICAgICAgICAgUzogdGhpcy5TLFxuICAgICAgICAgICAgTDogdGhpcy5MXG4gICAgICAgIH0sIHRoaXMub3B0aW9ucyk7XG4gICAgfVxuICAgIGdldCBIU0xBKCkge1xuICAgICAgICByZXR1cm4gQ1NTLkhTTCh7XG4gICAgICAgICAgICBIOiB0aGlzLkgsXG4gICAgICAgICAgICBTOiB0aGlzLlMsXG4gICAgICAgICAgICBMOiB0aGlzLkwsXG4gICAgICAgICAgICBBOiB0aGlzLkFcbiAgICAgICAgfSwgdGhpcy5vcHRpb25zKTtcbiAgICB9XG4gICAgZ2V0IENJRUxhYigpIHtcbiAgICAgICAgcmV0dXJuIENTUy5DSUVMYWIoe1xuICAgICAgICAgICAgTDogdGhpcy5DSUVMLFxuICAgICAgICAgICAgYTogdGhpcy5DSUVhLFxuICAgICAgICAgICAgYjogdGhpcy5DSUViXG4gICAgICAgIH0sIHRoaXMub3B0aW9ucyk7XG4gICAgfVxuICAgIGdldCBDSUVMYWJBKCkge1xuICAgICAgICByZXR1cm4gQ1NTLkNJRUxhYih7XG4gICAgICAgICAgICBMOiB0aGlzLkNJRUwsXG4gICAgICAgICAgICBhOiB0aGlzLkNJRWEsXG4gICAgICAgICAgICBiOiB0aGlzLkNJRWIsXG4gICAgICAgICAgICBBOiB0aGlzLkFcbiAgICAgICAgfSwgdGhpcy5vcHRpb25zKTtcbiAgICB9XG4gICAgZ2V0IENNWUsoKSB7XG4gICAgICAgIHJldHVybiBDU1MuQ01ZSyh7XG4gICAgICAgICAgICBDOiB0aGlzLkMsXG4gICAgICAgICAgICBNOiB0aGlzLk0sXG4gICAgICAgICAgICBZOiB0aGlzLlksXG4gICAgICAgICAgICBLOiB0aGlzLktcbi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29sKyspIHtcblxuICAgICAgICAgICAgY29sb3JcbiAgICAgICAgICAgICAgICAuc2V0Uyhyb3cgKiAxMClcbiAgICAgICAgICAgICAgICAuc2V0TChjb2wgKiA1ICsgMzApO1xuXG4gICAgICAgICAgICBjb25zdCBib3ggPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcblxuICAgICAgICAgICAgYm94LmNsYXNzTGlzdC5hZGQoJ2JveCcpO1xuICAgICAgICAgICAgYm94LnN0eWxlLmJhY2tncm91bmQgPSBjb2xvci5IRVg7XG5cbiAgICAgICAgICAgIGJveC5pbm5lclRleHQgPVxuICAgICAgICAgICAgICAgIGBSOiR7Y29sb3IuUn1cbiAgICAgICAgICAgICAgICAgRzoke2NvbG9yLkd9XG4gICAgICAgICAgICAgICAgIEI6JHtjb2xvci5CfWA7XG4gICAgICAgICAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQoYm94KTtcblxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbnRhaW5lcjtcblxufTsiLCJpbXBvcnQgJy4vc3R5bGVzLnNjc3MnO1xuXG5leHBvcnQgZGVmYXVsdCAoQ29sb3JUcmFuc2xhdG9yKSA9PiB7XG5cbiAgICBjb25zdCBjb250YWluZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTtcbiAgICBjb25zdCBjb2xvciA9IG5ldyBDb2xvclRyYW5zbGF0b3IoeyBSOiAyNTUsIEc6IDAsIEI6IDAgfSk7XG4gICAgY29uc3QgaHVlID0gWzAsIDMwLCA2MCwgMTIwLCAyNDAsIDI4MCwgMzIwLCAwXTtcbiAgICBsZXQgcmFpbmJvdztcblxuICAgIGZvciAobGV0IHIgPSAwOyByIDwgaHVlLmxlbmd0aDsgcisrKSB7XG5cbiAgICAgICAgY29sb3Iuc2V0SChodWVbcl0pO1xuXG4gICAgICAgIGNvbnN0IGJvdyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2Rpd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JyxcbiAgICAgICAgJ2JsdWUnLFxuICAgICAgICAnYXF1YScsXG4gICAgICAgICd5ZWxsb3cnLFxuICAgICAgICAnZnVjaHNpYSdcbiAgICBdO1xuICAgIGNvbnN0IHRvdGFsID0gY29sb3JzLmxlbmd0aDtcblxuICAgIGZvciAobGV0IHJvdyA9IDA7IHJvdyA8IHRvdGFsOyByb3crKykge1xuXG4gICAgICAgIGNvbnN0IGhzbCA9IENvbG9yVHJhbnNsYXRvci50b0hTTE9iamVjdChjb2xvcnNbcm93XSk7XG4gICAgICAgIGNvbnN0IHN0ZXAgPSBoc2wuUyAvICh0b3RhbCAtIDEpO1xuXG4gICAgICAgIGZvciAobGV0IGNvbCA9IDA7IGNvbCA8IHRvdGFsOyBjb2wrKykge1xuXG4gICAgICAgICAgICBjb25zdCByZ2IgPSBDb2xvclRyYW5zbGF0b3IudG9IRVgoaHNsKTtcbiAgICAgICAgICAgIGNvbnN0IGNteWsgPSBDb2xvclRyYW5zbGF0b3IudG9DTVlLT2JqZWN0KGhzbCwgeyBkZWNpbWFsczogMCB9KTtcblxuICAgICAgICAgICAgY29uc3QgYm94ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7XG4gICAgICAgICAgICBib3guY2xhc3NMaXN0LmFkZCgnYm94Jyk7XG4gICAgICAgICAgICBib3guc3R5bGUuYmFja2dyb3VuZCA9IHJnYjtcbiAgICAgICAgICAgIGJveC5pbm5lclRleHQgPSBgQzoke2NteWsuQ31cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTToke2NteWsuTX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWToke2NteWsuWX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSzoke2NteWsuS31gO1xuXG4gICAgICAgICAgICBjb250YWluZXIuYXBwZW5kQ2hpbGQoYm94KTtcblxuICAgICAgICAgICAgaHNsLlMgLT0gc3RlcDtcblxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJ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Swic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///166\n')}},__webpack_module_cache__={};function __webpack_require__(I){var g=__webpack_module_cache__[I];if(void 0!==g)return g.exports;var C=__webpack_module_cache__[I]={exports:{}};return __webpack_modules__[I](C,C.exports,__webpack_require__),C.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(I){if("object"==typeof window)return window}}();var __webpack_exports__=__webpack_require__(166),__webpack_export_target__=window;for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__]=__webpack_exports__[__webpack_i__];__webpack_exports__.__esModule&&Object.defineProperty(__webpack_export_target__,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/docs/styles/styles.css b/docs/styles/styles.css index be9d5f6..e96358d 100644 --- a/docs/styles/styles.css +++ b/docs/styles/styles.css @@ -35,7 +35,7 @@ li.L1,li.L3,li.L5,li.L7,li.L9 { } pre .atv, code .atv { color: #060 } } -body,html{font-family:Roboto;height:100%}body{background-color:#333;margin:0;padding:0}header{padding:2em}header .logo{display:block;margin:0 auto;max-width:100%;width:500px}.separator{border-bottom:5px solid rgba(255,255,255,.1)}h1,h2,h3,h4,h5{color:#fff;font-family:Roboto;font-weight:300;margin:2em 2em 1.5em;text-align:center}.demo{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:1.5em 2em 3em}.demo article{font-size:13px;overflow-x:auto;width:50%;padding:2em}@media screen and (max-width: 768px){.demo article{font-size:11px;width:100%}}.demo .prettyprint{border:none;margin:0;padding:0}.demo.demo-square .demo-wrapper{padding-top:100%}.demo.demo-square-half .demo-wrapper{padding-top:50%}.demo:last-of-type{border-bottom:none}.demo-container{max-width:500px;position:relative;width:100%}.demo-wrapper{width:100%}.demo-wrapper>div{bottom:0;left:0;position:absolute;right:0;top:0}.github-buttons{display:flex;justify-content:center;padding:1em}.github-buttons span{padding:0 .5em} +body,html{font-family:Roboto;height:100%}body{background-color:#333;margin:0;padding:0}header{padding:2em}header .logo{display:block;margin:0 auto;max-width:100%;width:500px}.separator{border-bottom:5px solid hsla(0,0%,100%,.1)}h1,h2,h3,h4,h5{color:#fff;font-family:Roboto;font-weight:300;margin:2em 2em 1.5em;text-align:center}.demo{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:1.5em 2em 3em}.demo article{font-size:13px;overflow-x:auto;width:50%;padding:2em}@media screen and (max-width: 768px){.demo article{font-size:11px;width:100%}}.demo .prettyprint{border:none;margin:0;padding:0}.demo.demo-square .demo-wrapper{padding-top:100%}.demo.demo-square-half .demo-wrapper{padding-top:50%}.demo:last-of-type{border-bottom:none}.demo-container{max-width:500px;position:relative;width:100%}.demo-wrapper{width:100%}.demo-wrapper>div{bottom:0;left:0;position:absolute;right:0;top:0}.github-buttons{display:flex;justify-content:center;padding:1em}.github-buttons span{padding:0 .5em} #demo1 .demo-wrapper>div{display:flex;flex-shrink:0;flex-wrap:wrap}#demo1 .box{align-items:center;display:flex;box-sizing:border-box;flex-grow:0;flex-shrink:0;font-family:Arial;font-size:10px;justify-content:center;text-align:center;height:10%;width:10%}@media screen and (max-width: 768px){#demo1 .box{font-size:6px}} #demo2 .demo-wrapper>div{flex-shrink:0}#demo2 .rainbow{align-items:center;border-left:15px solid rgba(0,0,0,0);border-top:15px solid rgba(0,0,0,0);border-right:15px solid rgba(0,0,0,0);border-radius:500px 500px 0 0;box-sizing:border-box;display:flex;height:100%;width:100%} #demo3 .demo-wrapper>div{display:flex;flex-shrink:0;flex-wrap:wrap}#demo3 .flag{box-sizing:border-box;flex-grow:0;flex-shrink:0;font-size:10px;height:14.2857%;width:14.2857%}