"use strict";const wu=require("../../../../../_virtual/_commonjsHelpers.js"),Oe=require("../../../../../_virtual/chroma.js");/**
 * chroma.js - JavaScript library for color conversions
 *
 * Copyright (c) 2011-2019, Gregor Aisch
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * 3. The name Gregor Aisch may not be used to endorse or promote products
 * derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * -------------------------------------------------------
 *
 * chroma.js includes colors from colorbrewer2.org, which are released under
 * the following license:
 *
 * Copyright (c) 2002 Cynthia Brewer, Mark Harrower,
 * and The Pennsylvania State University.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 *
 * ------------------------------------------------------
 *
 * Named colors are taken from X11 Color Names.
 * http://www.w3.org/TR/css3-color/#svg-color
 *
 * @preserve
 */(function(De,$u){(function(Cr,gr){De.exports=gr()})(wu.commonjsGlobal,function(){for(var Cr=function(r,a,e){return a===void 0&&(a=0),e===void 0&&(e=1),r<a?a:r>e?e:r},gr=Cr,Se=function(r){r._clipped=!1,r._unclipped=r.slice(0);for(var a=0;a<=3;a++)a<3?((r[a]<0||r[a]>255)&&(r._clipped=!0),r[a]=gr(r[a],0,255)):a===3&&(r[a]=gr(r[a],0,1));return r},na={},xr=0,ta=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];xr<ta.length;xr+=1){var fa=ta[xr];na["[object "+fa+"]"]=fa.toLowerCase()}var hr=function(r){return na[Object.prototype.toString.call(r)]||"object"},Be=hr,He=function(r,a){return a===void 0&&(a=null),r.length>=3?Array.prototype.slice.call(r):Be(r[0])=="object"&&a?a.split("").filter(function(e){return r[0][e]!==void 0}).map(function(e){return r[0][e]}):r[0]},Ye=hr,Xe=function(r){if(r.length<2)return null;var a=r.length-1;return Ye(r[a])=="string"?r[a].toLowerCase():null},or=Math.PI,g={clip_rgb:Se,limit:Cr,type:hr,unpack:He,last:Xe,PI:or,TWOPI:or*2,PITHIRD:or/3,DEG2RAD:or/180,RAD2DEG:180/or},z={format:{},autodetect:[]},We=g.last,Ue=g.clip_rgb,ua=g.type,Z=z,va=function(){for(var a=[],e=arguments.length;e--;)a[e]=arguments[e];var n=this;if(ua(a[0])==="object"&&a[0].constructor&&a[0].constructor===this.constructor)return a[0];var f=We(a),u=!1;if(!f){u=!0,Z.sorted||(Z.autodetect=Z.autodetect.sort(function(i,h){return h.p-i.p}),Z.sorted=!0);for(var t=0,v=Z.autodetect;t<v.length;t+=1){var l=v[t];if(f=l.test.apply(l,a),f)break}}if(Z.format[f]){var o=Z.format[f].apply(null,u?a:a.slice(0,-1));n._rgb=Ue(o)}else throw new Error("unknown format: "+a);n._rgb.length===3&&n._rgb.push(1)};va.prototype.toString=function(){return ua(this.hex)=="function"?this.hex():"["+this._rgb.join(",")+"]"};var m=va,br=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(br.Color,[null].concat(r)))};br.Color=m,br.version="2.4.2";var L=br,Ve=g.unpack,la=Math.max,Ze=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=Ve(r,"rgb"),n=e[0],f=e[1],u=e[2];n=n/255,f=f/255,u=u/255;var t=1-la(n,la(f,u)),v=t<1?1/(1-t):0,l=(1-n-t)*v,o=(1-f-t)*v,i=(1-u-t)*v;return[l,o,i,t]},je=Ze,Je=g.unpack,Qe=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];r=Je(r,"cmyk");var e=r[0],n=r[1],f=r[2],u=r[3],t=r.length>4?r[4]:1;return u===1?[0,0,0,t]:[e>=1?0:255*(1-e)*(1-u),n>=1?0:255*(1-n)*(1-u),f>=1?0:255*(1-f)*(1-u),t]},Ke=Qe,rn=L,oa=m,ia=z,an=g.unpack,en=g.type,nn=je;oa.prototype.cmyk=function(){return nn(this._rgb)},rn.cmyk=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(oa,[null].concat(r,["cmyk"])))},ia.format.cmyk=Ke,ia.autodetect.push({p:2,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r=an(r,"cmyk"),en(r)==="array"&&r.length===4)return"cmyk"}});var tn=g.unpack,fn=g.last,Nr=function(r){return Math.round(r*100)/100},un=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=tn(r,"hsla"),n=fn(r)||"lsa";return e[0]=Nr(e[0]||0),e[1]=Nr(e[1]*100)+"%",e[2]=Nr(e[2]*100)+"%",n==="hsla"||e.length>3&&e[3]<1?(e[3]=e.length>3?e[3]:1,n="hsla"):e.length=3,n+"("+e.join(",")+")"},vn=un,ln=g.unpack,on=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];r=ln(r,"rgba");var e=r[0],n=r[1],f=r[2];e/=255,n/=255,f/=255;var u=Math.min(e,n,f),t=Math.max(e,n,f),v=(t+u)/2,l,o;return t===u?(l=0,o=Number.NaN):l=v<.5?(t-u)/(t+u):(t-u)/(2-t-u),e==t?o=(n-f)/(t-u):n==t?o=2+(f-e)/(t-u):f==t&&(o=4+(e-n)/(t-u)),o*=60,o<0&&(o+=360),r.length>3&&r[3]!==void 0?[o,l,v,r[3]]:[o,l,v]},ca=on,cn=g.unpack,sn=g.last,gn=vn,hn=ca,Fr=Math.round,bn=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=cn(r,"rgba"),n=sn(r)||"rgb";return n.substr(0,3)=="hsl"?gn(hn(e),n):(e[0]=Fr(e[0]),e[1]=Fr(e[1]),e[2]=Fr(e[2]),(n==="rgba"||e.length>3&&e[3]<1)&&(e[3]=e.length>3?e[3]:1,n="rgba"),n+"("+e.slice(0,n==="rgb"?3:4).join(",")+")")},pn=bn,dn=g.unpack,Ar=Math.round,mn=function(){for(var r,a=[],e=arguments.length;e--;)a[e]=arguments[e];a=dn(a,"hsl");var n=a[0],f=a[1],u=a[2],t,v,l;if(f===0)t=v=l=u*255;else{var o=[0,0,0],i=[0,0,0],h=u<.5?u*(1+f):u+f-u*f,c=2*u-h,p=n/360;o[0]=p+1/3,o[1]=p,o[2]=p-1/3;for(var b=0;b<3;b++)o[b]<0&&(o[b]+=1),o[b]>1&&(o[b]-=1),6*o[b]<1?i[b]=c+(h-c)*6*o[b]:2*o[b]<1?i[b]=h:3*o[b]<2?i[b]=c+(h-c)*(2/3-o[b])*6:i[b]=c;r=[Ar(i[0]*255),Ar(i[1]*255),Ar(i[2]*255)],t=r[0],v=r[1],l=r[2]}return a.length>3?[t,v,l,a[3]]:[t,v,l,1]},sa=mn,ga=sa,ha=z,ba=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,pa=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,da=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,ma=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ya=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,wa=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ka=Math.round,$a=function(r){r=r.toLowerCase().trim();var a;if(ha.format.named)try{return ha.format.named(r)}catch{}if(a=r.match(ba)){for(var e=a.slice(1,4),n=0;n<3;n++)e[n]=+e[n];return e[3]=1,e}if(a=r.match(pa)){for(var f=a.slice(1,5),u=0;u<4;u++)f[u]=+f[u];return f}if(a=r.match(da)){for(var t=a.slice(1,4),v=0;v<3;v++)t[v]=ka(t[v]*2.55);return t[3]=1,t}if(a=r.match(ma)){for(var l=a.slice(1,5),o=0;o<3;o++)l[o]=ka(l[o]*2.55);return l[3]=+l[3],l}if(a=r.match(ya)){var i=a.slice(1,4);i[1]*=.01,i[2]*=.01;var h=ga(i);return h[3]=1,h}if(a=r.match(wa)){var c=a.slice(1,4);c[1]*=.01,c[2]*=.01;var p=ga(c);return p[3]=+a[4],p}};$a.test=function(r){return ba.test(r)||pa.test(r)||da.test(r)||ma.test(r)||ya.test(r)||wa.test(r)};var yn=$a,wn=L,_a=m,Ma=z,kn=g.type,$n=pn,Ca=yn;_a.prototype.css=function(r){return $n(this._rgb,r)},wn.css=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(_a,[null].concat(r,["css"])))},Ma.format.css=Ca,Ma.autodetect.push({p:5,test:function(r){for(var a=[],e=arguments.length-1;e-- >0;)a[e]=arguments[e+1];if(!a.length&&kn(r)==="string"&&Ca.test(r))return"css"}});var xa=m,_n=L,Mn=z,Cn=g.unpack;Mn.format.gl=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=Cn(r,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e},_n.gl=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(xa,[null].concat(r,["gl"])))},xa.prototype.gl=function(){var r=this._rgb;return[r[0]/255,r[1]/255,r[2]/255,r[3]]};var xn=g.unpack,Nn=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=xn(r,"rgb"),n=e[0],f=e[1],u=e[2],t=Math.min(n,f,u),v=Math.max(n,f,u),l=v-t,o=l*100/255,i=t/(255-l)*100,h;return l===0?h=Number.NaN:(n===v&&(h=(f-u)/l),f===v&&(h=2+(u-n)/l),u===v&&(h=4+(n-f)/l),h*=60,h<0&&(h+=360)),[h,o,i]},Fn=Nn,An=g.unpack,En=Math.floor,Ln=function(){for(var r,a,e,n,f,u,t=[],v=arguments.length;v--;)t[v]=arguments[v];t=An(t,"hcg");var l=t[0],o=t[1],i=t[2],h,c,p;i=i*255;var b=o*255;if(o===0)h=c=p=i;else{l===360&&(l=0),l>360&&(l-=360),l<0&&(l+=360),l/=60;var y=En(l),$=l-y,M=i*(1-o),x=M+b*(1-$),G=M+b*$,T=M+b;switch(y){case 0:r=[T,G,M],h=r[0],c=r[1],p=r[2];break;case 1:a=[x,T,M],h=a[0],c=a[1],p=a[2];break;case 2:e=[M,T,G],h=e[0],c=e[1],p=e[2];break;case 3:n=[M,x,T],h=n[0],c=n[1],p=n[2];break;case 4:f=[G,M,T],h=f[0],c=f[1],p=f[2];break;case 5:u=[T,M,x],h=u[0],c=u[1],p=u[2];break}}return[h,c,p,t.length>3?t[3]:1]},Rn=Ln,zn=g.unpack,Pn=g.type,Tn=L,Na=m,Fa=z,Gn=Fn;Na.prototype.hcg=function(){return Gn(this._rgb)},Tn.hcg=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(Na,[null].concat(r,["hcg"])))},Fa.format.hcg=Rn,Fa.autodetect.push({p:1,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r=zn(r,"hcg"),Pn(r)==="array"&&r.length===3)return"hcg"}});var In=g.unpack,qn=g.last,pr=Math.round,On=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=In(r,"rgba"),n=e[0],f=e[1],u=e[2],t=e[3],v=qn(r)||"auto";t===void 0&&(t=1),v==="auto"&&(v=t<1?"rgba":"rgb"),n=pr(n),f=pr(f),u=pr(u);var l=n<<16|f<<8|u,o="000000"+l.toString(16);o=o.substr(o.length-6);var i="0"+pr(t*255).toString(16);switch(i=i.substr(i.length-2),v.toLowerCase()){case"rgba":return"#"+o+i;case"argb":return"#"+i+o;default:return"#"+o}},Aa=On,Dn=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Sn=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Bn=function(r){if(r.match(Dn)){(r.length===4||r.length===7)&&(r=r.substr(1)),r.length===3&&(r=r.split(""),r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var a=parseInt(r,16),e=a>>16,n=a>>8&255,f=a&255;return[e,n,f,1]}if(r.match(Sn)){(r.length===5||r.length===9)&&(r=r.substr(1)),r.length===4&&(r=r.split(""),r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]);var u=parseInt(r,16),t=u>>24&255,v=u>>16&255,l=u>>8&255,o=Math.round((u&255)/255*100)/100;return[t,v,l,o]}throw new Error("unknown hex color: "+r)},Ea=Bn,Hn=L,La=m,Yn=g.type,Ra=z,Xn=Aa;La.prototype.hex=function(r){return Xn(this._rgb,r)},Hn.hex=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(La,[null].concat(r,["hex"])))},Ra.format.hex=Ea,Ra.autodetect.push({p:4,test:function(r){for(var a=[],e=arguments.length-1;e-- >0;)a[e]=arguments[e+1];if(!a.length&&Yn(r)==="string"&&[3,4,5,6,7,8,9].indexOf(r.length)>=0)return"hex"}});var Wn=g.unpack,za=g.TWOPI,Un=Math.min,Vn=Math.sqrt,Zn=Math.acos,jn=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=Wn(r,"rgb"),n=e[0],f=e[1],u=e[2];n/=255,f/=255,u/=255;var t,v=Un(n,f,u),l=(n+f+u)/3,o=l>0?1-v/l:0;return o===0?t=NaN:(t=(n-f+(n-u))/2,t/=Vn((n-f)*(n-f)+(n-u)*(f-u)),t=Zn(t),u>f&&(t=za-t),t/=za),[t*360,o,l]},Jn=jn,Qn=g.unpack,Er=g.limit,K=g.TWOPI,Lr=g.PITHIRD,rr=Math.cos,Kn=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];r=Qn(r,"hsi");var e=r[0],n=r[1],f=r[2],u,t,v;return isNaN(e)&&(e=0),isNaN(n)&&(n=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(v=(1-n)/3,u=(1+n*rr(K*e)/rr(Lr-K*e))/3,t=1-(v+u)):e<2/3?(e-=1/3,u=(1-n)/3,t=(1+n*rr(K*e)/rr(Lr-K*e))/3,v=1-(u+t)):(e-=2/3,t=(1-n)/3,v=(1+n*rr(K*e)/rr(Lr-K*e))/3,u=1-(t+v)),u=Er(f*u*3),t=Er(f*t*3),v=Er(f*v*3),[u*255,t*255,v*255,r.length>3?r[3]:1]},rt=Kn,at=g.unpack,et=g.type,nt=L,Pa=m,Ta=z,tt=Jn;Pa.prototype.hsi=function(){return tt(this._rgb)},nt.hsi=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(Pa,[null].concat(r,["hsi"])))},Ta.format.hsi=rt,Ta.autodetect.push({p:2,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r=at(r,"hsi"),et(r)==="array"&&r.length===3)return"hsi"}});var ft=g.unpack,ut=g.type,vt=L,Ga=m,Ia=z,lt=ca;Ga.prototype.hsl=function(){return lt(this._rgb)},vt.hsl=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(Ga,[null].concat(r,["hsl"])))},Ia.format.hsl=sa,Ia.autodetect.push({p:2,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r=ft(r,"hsl"),ut(r)==="array"&&r.length===3)return"hsl"}});var ot=g.unpack,it=Math.min,ct=Math.max,st=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];r=ot(r,"rgb");var e=r[0],n=r[1],f=r[2],u=it(e,n,f),t=ct(e,n,f),v=t-u,l,o,i;return i=t/255,t===0?(l=Number.NaN,o=0):(o=v/t,e===t&&(l=(n-f)/v),n===t&&(l=2+(f-e)/v),f===t&&(l=4+(e-n)/v),l*=60,l<0&&(l+=360)),[l,o,i]},gt=st,ht=g.unpack,bt=Math.floor,pt=function(){for(var r,a,e,n,f,u,t=[],v=arguments.length;v--;)t[v]=arguments[v];t=ht(t,"hsv");var l=t[0],o=t[1],i=t[2],h,c,p;if(i*=255,o===0)h=c=p=i;else{l===360&&(l=0),l>360&&(l-=360),l<0&&(l+=360),l/=60;var b=bt(l),y=l-b,$=i*(1-o),M=i*(1-o*y),x=i*(1-o*(1-y));switch(b){case 0:r=[i,x,$],h=r[0],c=r[1],p=r[2];break;case 1:a=[M,i,$],h=a[0],c=a[1],p=a[2];break;case 2:e=[$,i,x],h=e[0],c=e[1],p=e[2];break;case 3:n=[$,M,i],h=n[0],c=n[1],p=n[2];break;case 4:f=[x,$,i],h=f[0],c=f[1],p=f[2];break;case 5:u=[i,$,M],h=u[0],c=u[1],p=u[2];break}}return[h,c,p,t.length>3?t[3]:1]},dt=pt,mt=g.unpack,yt=g.type,wt=L,qa=m,Oa=z,kt=gt;qa.prototype.hsv=function(){return kt(this._rgb)},wt.hsv=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(qa,[null].concat(r,["hsv"])))},Oa.format.hsv=dt,Oa.autodetect.push({p:2,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r=mt(r,"hsv"),yt(r)==="array"&&r.length===3)return"hsv"}});var dr={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ar=dr,$t=g.unpack,Da=Math.pow,_t=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=$t(r,"rgb"),n=e[0],f=e[1],u=e[2],t=Mt(n,f,u),v=t[0],l=t[1],o=t[2],i=116*l-16;return[i<0?0:i,500*(v-l),200*(l-o)]},Rr=function(r){return(r/=255)<=.04045?r/12.92:Da((r+.055)/1.055,2.4)},zr=function(r){return r>ar.t3?Da(r,1/3):r/ar.t2+ar.t0},Mt=function(r,a,e){r=Rr(r),a=Rr(a),e=Rr(e);var n=zr((.4124564*r+.3575761*a+.1804375*e)/ar.Xn),f=zr((.2126729*r+.7151522*a+.072175*e)/ar.Yn),u=zr((.0193339*r+.119192*a+.9503041*e)/ar.Zn);return[n,f,u]},Sa=_t,er=dr,Ct=g.unpack,xt=Math.pow,Nt=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];r=Ct(r,"lab");var e=r[0],n=r[1],f=r[2],u,t,v,l,o,i;return t=(e+16)/116,u=isNaN(n)?t:t+n/500,v=isNaN(f)?t:t-f/200,t=er.Yn*Tr(t),u=er.Xn*Tr(u),v=er.Zn*Tr(v),l=Pr(3.2404542*u-1.5371385*t-.4985314*v),o=Pr(-.969266*u+1.8760108*t+.041556*v),i=Pr(.0556434*u-.2040259*t+1.0572252*v),[l,o,i,r.length>3?r[3]:1]},Pr=function(r){return 255*(r<=.00304?12.92*r:1.055*xt(r,1/2.4)-.055)},Tr=function(r){return r>er.t1?r*r*r:er.t2*(r-er.t0)},Ba=Nt,Ft=g.unpack,At=g.type,Et=L,Ha=m,Ya=z,Lt=Sa;Ha.prototype.lab=function(){return Lt(this._rgb)},Et.lab=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(Ha,[null].concat(r,["lab"])))},Ya.format.lab=Ba,Ya.autodetect.push({p:2,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r=Ft(r,"lab"),At(r)==="array"&&r.length===3)return"lab"}});var Rt=g.unpack,zt=g.RAD2DEG,Pt=Math.sqrt,Tt=Math.atan2,Gt=Math.round,It=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=Rt(r,"lab"),n=e[0],f=e[1],u=e[2],t=Pt(f*f+u*u),v=(Tt(u,f)*zt+360)%360;return Gt(t*1e4)===0&&(v=Number.NaN),[n,t,v]},Xa=It,qt=g.unpack,Ot=Sa,Dt=Xa,St=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=qt(r,"rgb"),n=e[0],f=e[1],u=e[2],t=Ot(n,f,u),v=t[0],l=t[1],o=t[2];return Dt(v,l,o)},Bt=St,Ht=g.unpack,Yt=g.DEG2RAD,Xt=Math.sin,Wt=Math.cos,Ut=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=Ht(r,"lch"),n=e[0],f=e[1],u=e[2];return isNaN(u)&&(u=0),u=u*Yt,[n,Wt(u)*f,Xt(u)*f]},Wa=Ut,Vt=g.unpack,Zt=Wa,jt=Ba,Jt=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];r=Vt(r,"lch");var e=r[0],n=r[1],f=r[2],u=Zt(e,n,f),t=u[0],v=u[1],l=u[2],o=jt(t,v,l),i=o[0],h=o[1],c=o[2];return[i,h,c,r.length>3?r[3]:1]},Ua=Jt,Qt=g.unpack,Kt=Ua,rf=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=Qt(r,"hcl").reverse();return Kt.apply(void 0,e)},af=rf,ef=g.unpack,nf=g.type,Va=L,mr=m,Gr=z,Za=Bt;mr.prototype.lch=function(){return Za(this._rgb)},mr.prototype.hcl=function(){return Za(this._rgb).reverse()},Va.lch=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(mr,[null].concat(r,["lch"])))},Va.hcl=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(mr,[null].concat(r,["hcl"])))},Gr.format.lch=Ua,Gr.format.hcl=af,["lch","hcl"].forEach(function(r){return Gr.autodetect.push({p:2,test:function(){for(var a=[],e=arguments.length;e--;)a[e]=arguments[e];if(a=ef(a,r),nf(a)==="array"&&a.length===3)return r}})});var tf={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},ja=tf,ff=m,Ja=z,uf=g.type,ir=ja,vf=Ea,lf=Aa;ff.prototype.name=function(){for(var r=lf(this._rgb,"rgb"),a=0,e=Object.keys(ir);a<e.length;a+=1){var n=e[a];if(ir[n]===r)return n.toLowerCase()}return r},Ja.format.named=function(r){if(r=r.toLowerCase(),ir[r])return vf(ir[r]);throw new Error("unknown color name: "+r)},Ja.autodetect.push({p:5,test:function(r){for(var a=[],e=arguments.length-1;e-- >0;)a[e]=arguments[e+1];if(!a.length&&uf(r)==="string"&&ir[r.toLowerCase()])return"named"}});var of=g.unpack,cf=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=of(r,"rgb"),n=e[0],f=e[1],u=e[2];return(n<<16)+(f<<8)+u},sf=cf,gf=g.type,hf=function(r){if(gf(r)=="number"&&r>=0&&r<=16777215){var a=r>>16,e=r>>8&255,n=r&255;return[a,e,n,1]}throw new Error("unknown num color: "+r)},bf=hf,pf=L,Qa=m,Ka=z,df=g.type,mf=sf;Qa.prototype.num=function(){return mf(this._rgb)},pf.num=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(Qa,[null].concat(r,["num"])))},Ka.format.num=bf,Ka.autodetect.push({p:5,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r.length===1&&df(r[0])==="number"&&r[0]>=0&&r[0]<=16777215)return"num"}});var yf=L,Ir=m,re=z,ae=g.unpack,ee=g.type,ne=Math.round;Ir.prototype.rgb=function(r){return r===void 0&&(r=!0),r===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(ne)},Ir.prototype.rgba=function(r){return r===void 0&&(r=!0),this._rgb.slice(0,4).map(function(a,e){return e<3?r===!1?a:ne(a):a})},yf.rgb=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(Ir,[null].concat(r,["rgb"])))},re.format.rgb=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=ae(r,"rgba");return e[3]===void 0&&(e[3]=1),e},re.autodetect.push({p:3,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r=ae(r,"rgba"),ee(r)==="array"&&(r.length===3||r.length===4&&ee(r[3])=="number"&&r[3]>=0&&r[3]<=1))return"rgb"}});var yr=Math.log,wf=function(r){var a=r/100,e,n,f;return a<66?(e=255,n=a<6?0:-155.25485562709179-.44596950469579133*(n=a-2)+104.49216199393888*yr(n),f=a<20?0:-254.76935184120902+.8274096064007395*(f=a-10)+115.67994401066147*yr(f)):(e=351.97690566805693+.114206453784165*(e=a-55)-40.25366309332127*yr(e),n=325.4494125711974+.07943456536662342*(n=a-50)-28.0852963507957*yr(n),f=255),[e,n,f,1]},te=wf,kf=te,$f=g.unpack,_f=Math.round,Mf=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];for(var e=$f(r,"rgb"),n=e[0],f=e[2],u=1e3,t=4e4,v=.4,l;t-u>v;){l=(t+u)*.5;var o=kf(l);o[2]/o[0]>=f/n?t=l:u=l}return _f(l)},Cf=Mf,qr=L,wr=m,Or=z,xf=Cf;wr.prototype.temp=wr.prototype.kelvin=wr.prototype.temperature=function(){return xf(this._rgb)},qr.temp=qr.kelvin=qr.temperature=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(wr,[null].concat(r,["temp"])))},Or.format.temp=Or.format.kelvin=Or.format.temperature=te;var Nf=g.unpack,Dr=Math.cbrt,Ff=Math.pow,Af=Math.sign,Ef=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=Nf(r,"rgb"),n=e[0],f=e[1],u=e[2],t=[Sr(n/255),Sr(f/255),Sr(u/255)],v=t[0],l=t[1],o=t[2],i=Dr(.4122214708*v+.5363325363*l+.0514459929*o),h=Dr(.2119034982*v+.6806995451*l+.1073969566*o),c=Dr(.0883024619*v+.2817188376*l+.6299787005*o);return[.2104542553*i+.793617785*h-.0040720468*c,1.9779984951*i-2.428592205*h+.4505937099*c,.0259040371*i+.7827717662*h-.808675766*c]},fe=Ef;function Sr(r){var a=Math.abs(r);return a<.04045?r/12.92:(Af(r)||1)*Ff((a+.055)/1.055,2.4)}var Lf=g.unpack,kr=Math.pow,Rf=Math.sign,zf=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];r=Lf(r,"lab");var e=r[0],n=r[1],f=r[2],u=kr(e+.3963377774*n+.2158037573*f,3),t=kr(e-.1055613458*n-.0638541728*f,3),v=kr(e-.0894841775*n-1.291485548*f,3);return[255*Br(4.0767416621*u-3.3077115913*t+.2309699292*v),255*Br(-1.2684380046*u+2.6097574011*t-.3413193965*v),255*Br(-.0041960863*u-.7034186147*t+1.707614701*v),r.length>3?r[3]:1]},ue=zf;function Br(r){var a=Math.abs(r);return a>.0031308?(Rf(r)||1)*(1.055*kr(a,1/2.4)-.055):r*12.92}var Pf=g.unpack,Tf=g.type,Gf=L,ve=m,le=z,If=fe;ve.prototype.oklab=function(){return If(this._rgb)},Gf.oklab=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(ve,[null].concat(r,["oklab"])))},le.format.oklab=ue,le.autodetect.push({p:3,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r=Pf(r,"oklab"),Tf(r)==="array"&&r.length===3)return"oklab"}});var qf=g.unpack,Of=fe,Df=Xa,Sf=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];var e=qf(r,"rgb"),n=e[0],f=e[1],u=e[2],t=Of(n,f,u),v=t[0],l=t[1],o=t[2];return Df(v,l,o)},Bf=Sf,Hf=g.unpack,Yf=Wa,Xf=ue,Wf=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];r=Hf(r,"lch");var e=r[0],n=r[1],f=r[2],u=Yf(e,n,f),t=u[0],v=u[1],l=u[2],o=Xf(t,v,l),i=o[0],h=o[1],c=o[2];return[i,h,c,r.length>3?r[3]:1]},Uf=Wf,Vf=g.unpack,Zf=g.type,jf=L,oe=m,ie=z,Jf=Bf;oe.prototype.oklch=function(){return Jf(this._rgb)},jf.oklch=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return new(Function.prototype.bind.apply(oe,[null].concat(r,["oklch"])))},ie.format.oklch=Uf,ie.autodetect.push({p:3,test:function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];if(r=Vf(r,"oklch"),Zf(r)==="array"&&r.length===3)return"oklch"}});var ce=m,Qf=g.type;ce.prototype.alpha=function(r,a){return a===void 0&&(a=!1),r!==void 0&&Qf(r)==="number"?a?(this._rgb[3]=r,this):new ce([this._rgb[0],this._rgb[1],this._rgb[2],r],"rgb"):this._rgb[3]};var Kf=m;Kf.prototype.clipped=function(){return this._rgb._clipped||!1};var j=m,r0=dr;j.prototype.darken=function(r){r===void 0&&(r=1);var a=this,e=a.lab();return e[0]-=r0.Kn*r,new j(e,"lab").alpha(a.alpha(),!0)},j.prototype.brighten=function(r){return r===void 0&&(r=1),this.darken(-r)},j.prototype.darker=j.prototype.darken,j.prototype.brighter=j.prototype.brighten;var a0=m;a0.prototype.get=function(r){var a=r.split("."),e=a[0],n=a[1],f=this[e]();if(n){var u=e.indexOf(n)-(e.substr(0,2)==="ok"?2:0);if(u>-1)return f[u];throw new Error("unknown channel "+n+" in mode "+e)}else return f};var nr=m,e0=g.type,n0=Math.pow,t0=1e-7,f0=20;nr.prototype.luminance=function(r){if(r!==void 0&&e0(r)==="number"){if(r===0)return new nr([0,0,0,this._rgb[3]],"rgb");if(r===1)return new nr([255,255,255,this._rgb[3]],"rgb");var a=this.luminance(),e="rgb",n=f0,f=function(t,v){var l=t.interpolate(v,.5,e),o=l.luminance();return Math.abs(r-o)<t0||!n--?l:o>r?f(t,l):f(l,v)},u=(a>r?f(new nr([0,0,0]),this):f(this,new nr([255,255,255]))).rgb();return new nr(u.concat([this._rgb[3]]))}return u0.apply(void 0,this._rgb.slice(0,3))};var u0=function(r,a,e){return r=Hr(r),a=Hr(a),e=Hr(e),.2126*r+.7152*a+.0722*e},Hr=function(r){return r/=255,r<=.03928?r/12.92:n0((r+.055)/1.055,2.4)},O={},se=m,ge=g.type,$r=O,he=function(r,a,e){e===void 0&&(e=.5);for(var n=[],f=arguments.length-3;f-- >0;)n[f]=arguments[f+3];var u=n[0]||"lrgb";if(!$r[u]&&!n.length&&(u=Object.keys($r)[0]),!$r[u])throw new Error("interpolation mode "+u+" is not defined");return ge(r)!=="object"&&(r=new se(r)),ge(a)!=="object"&&(a=new se(a)),$r[u](r,a,e).alpha(r.alpha()+e*(a.alpha()-r.alpha()))},be=m,v0=he;be.prototype.mix=be.prototype.interpolate=function(r,a){a===void 0&&(a=.5);for(var e=[],n=arguments.length-2;n-- >0;)e[n]=arguments[n+2];return v0.apply(void 0,[this,r,a].concat(e))};var pe=m;pe.prototype.premultiply=function(r){r===void 0&&(r=!1);var a=this._rgb,e=a[3];return r?(this._rgb=[a[0]*e,a[1]*e,a[2]*e,e],this):new pe([a[0]*e,a[1]*e,a[2]*e,e],"rgb")};var Yr=m,l0=dr;Yr.prototype.saturate=function(r){r===void 0&&(r=1);var a=this,e=a.lch();return e[1]+=l0.Kn*r,e[1]<0&&(e[1]=0),new Yr(e,"lch").alpha(a.alpha(),!0)},Yr.prototype.desaturate=function(r){return r===void 0&&(r=1),this.saturate(-r)};var de=m,me=g.type;de.prototype.set=function(r,a,e){e===void 0&&(e=!1);var n=r.split("."),f=n[0],u=n[1],t=this[f]();if(u){var v=f.indexOf(u)-(f.substr(0,2)==="ok"?2:0);if(v>-1){if(me(a)=="string")switch(a.charAt(0)){case"+":t[v]+=+a;break;case"-":t[v]+=+a;break;case"*":t[v]*=+a.substr(1);break;case"/":t[v]/=+a.substr(1);break;default:t[v]=+a}else if(me(a)==="number")t[v]=a;else throw new Error("unsupported value for Color.set");var l=new de(t,f);return e?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+u+" in mode "+f)}else return t};var o0=m,i0=function(r,a,e){var n=r._rgb,f=a._rgb;return new o0(n[0]+e*(f[0]-n[0]),n[1]+e*(f[1]-n[1]),n[2]+e*(f[2]-n[2]),"rgb")};O.rgb=i0;var c0=m,Xr=Math.sqrt,tr=Math.pow,s0=function(r,a,e){var n=r._rgb,f=n[0],u=n[1],t=n[2],v=a._rgb,l=v[0],o=v[1],i=v[2];return new c0(Xr(tr(f,2)*(1-e)+tr(l,2)*e),Xr(tr(u,2)*(1-e)+tr(o,2)*e),Xr(tr(t,2)*(1-e)+tr(i,2)*e),"rgb")};O.lrgb=s0;var g0=m,h0=function(r,a,e){var n=r.lab(),f=a.lab();return new g0(n[0]+e*(f[0]-n[0]),n[1]+e*(f[1]-n[1]),n[2]+e*(f[2]-n[2]),"lab")};O.lab=h0;var ye=m,fr=function(r,a,e,n){var f,u,t,v;n==="hsl"?(t=r.hsl(),v=a.hsl()):n==="hsv"?(t=r.hsv(),v=a.hsv()):n==="hcg"?(t=r.hcg(),v=a.hcg()):n==="hsi"?(t=r.hsi(),v=a.hsi()):n==="lch"||n==="hcl"?(n="hcl",t=r.hcl(),v=a.hcl()):n==="oklch"&&(t=r.oklch().reverse(),v=a.oklch().reverse());var l,o,i,h,c,p;(n.substr(0,1)==="h"||n==="oklch")&&(f=t,l=f[0],i=f[1],c=f[2],u=v,o=u[0],h=u[1],p=u[2]);var b,y,$,M;return!isNaN(l)&&!isNaN(o)?(o>l&&o-l>180?M=o-(l+360):o<l&&l-o>180?M=o+360-l:M=o-l,y=l+e*M):isNaN(l)?isNaN(o)?y=Number.NaN:(y=o,(c==1||c==0)&&n!="hsv"&&(b=h)):(y=l,(p==1||p==0)&&n!="hsv"&&(b=i)),b===void 0&&(b=i+e*(h-i)),$=c+e*(p-c),n==="oklch"?new ye([$,b,y],n):new ye([y,b,$],n)},b0=fr,we=function(r,a,e){return b0(r,a,e,"lch")};O.lch=we,O.hcl=we;var p0=m,d0=function(r,a,e){var n=r.num(),f=a.num();return new p0(n+e*(f-n),"num")};O.num=d0;var m0=fr,y0=function(r,a,e){return m0(r,a,e,"hcg")};O.hcg=y0;var w0=fr,k0=function(r,a,e){return w0(r,a,e,"hsi")};O.hsi=k0;var $0=fr,_0=function(r,a,e){return $0(r,a,e,"hsl")};O.hsl=_0;var M0=fr,C0=function(r,a,e){return M0(r,a,e,"hsv")};O.hsv=C0;var x0=m,N0=function(r,a,e){var n=r.oklab(),f=a.oklab();return new x0(n[0]+e*(f[0]-n[0]),n[1]+e*(f[1]-n[1]),n[2]+e*(f[2]-n[2]),"oklab")};O.oklab=N0;var F0=fr,A0=function(r,a,e){return F0(r,a,e,"oklch")};O.oklch=A0;var Wr=m,E0=g.clip_rgb,Ur=Math.pow,Vr=Math.sqrt,Zr=Math.PI,ke=Math.cos,$e=Math.sin,L0=Math.atan2,R0=function(r,a,e){a===void 0&&(a="lrgb"),e===void 0&&(e=null);var n=r.length;e||(e=Array.from(new Array(n)).map(function(){return 1}));var f=n/e.reduce(function(y,$){return y+$});if(e.forEach(function(y,$){e[$]*=f}),r=r.map(function(y){return new Wr(y)}),a==="lrgb")return z0(r,e);for(var u=r.shift(),t=u.get(a),v=[],l=0,o=0,i=0;i<t.length;i++)if(t[i]=(t[i]||0)*e[0],v.push(isNaN(t[i])?0:e[0]),a.charAt(i)==="h"&&!isNaN(t[i])){var h=t[i]/180*Zr;l+=ke(h)*e[0],o+=$e(h)*e[0]}var c=u.alpha()*e[0];r.forEach(function(y,$){var M=y.get(a);c+=y.alpha()*e[$+1];for(var x=0;x<t.length;x++)if(!isNaN(M[x]))if(v[x]+=e[$+1],a.charAt(x)==="h"){var G=M[x]/180*Zr;l+=ke(G)*e[$+1],o+=$e(G)*e[$+1]}else t[x]+=M[x]*e[$+1]});for(var p=0;p<t.length;p++)if(a.charAt(p)==="h"){for(var b=L0(o/v[p],l/v[p])/Zr*180;b<0;)b+=360;for(;b>=360;)b-=360;t[p]=b}else t[p]=t[p]/v[p];return c/=n,new Wr(t,a).alpha(c>.99999?1:c,!0)},z0=function(r,a){for(var e=r.length,n=[0,0,0,0],f=0;f<r.length;f++){var u=r[f],t=a[f]/e,v=u._rgb;n[0]+=Ur(v[0],2)*t,n[1]+=Ur(v[1],2)*t,n[2]+=Ur(v[2],2)*t,n[3]+=v[3]*t}return n[0]=Vr(n[0]),n[1]=Vr(n[1]),n[2]=Vr(n[2]),n[3]>.9999999&&(n[3]=1),new Wr(E0(n))},D=L,ur=g.type,P0=Math.pow,jr=function(r){var a="rgb",e=D("#ccc"),n=0,f=[0,1],u=[],t=[0,0],v=!1,l=[],o=!1,i=0,h=1,c=!1,p={},b=!0,y=1,$=function(s){if(s=s||["#fff","#000"],s&&ur(s)==="string"&&D.brewer&&D.brewer[s.toLowerCase()]&&(s=D.brewer[s.toLowerCase()]),ur(s)==="array"){s.length===1&&(s=[s[0],s[0]]),s=s.slice(0);for(var d=0;d<s.length;d++)s[d]=D(s[d]);u.length=0;for(var k=0;k<s.length;k++)u.push(k/(s.length-1))}return q(),l=s},M=function(s){if(v!=null){for(var d=v.length-1,k=0;k<d&&s>=v[k];)k++;return k-1}return 0},x=function(s){return s},G=function(s){return s},T=function(s,d){var k,w;if(d==null&&(d=!1),isNaN(s)||s===null)return e;if(d)w=s;else if(v&&v.length>2){var I=M(s);w=I/(v.length-2)}else h!==i?w=(s-i)/(h-i):w=1;w=G(w),d||(w=x(w)),y!==1&&(w=P0(w,y)),w=t[0]+w*(1-t[0]-t[1]),w=Math.min(1,Math.max(0,w));var E=Math.floor(w*1e4);if(b&&p[E])k=p[E];else{if(ur(l)==="array")for(var C=0;C<u.length;C++){var N=u[C];if(w<=N){k=l[C];break}if(w>=N&&C===u.length-1){k=l[C];break}if(w>N&&w<u[C+1]){w=(w-N)/(u[C+1]-N),k=D.interpolate(l[C],l[C+1],w,a);break}}else ur(l)==="function"&&(k=l(w));b&&(p[E]=k)}return k},q=function(){return p={}};$(r);var _=function(s){var d=D(T(s));return o&&d[o]?d[o]():d};return _.classes=function(s){if(s!=null){if(ur(s)==="array")v=s,f=[s[0],s[s.length-1]];else{var d=D.analyze(f);s===0?v=[d.min,d.max]:v=D.limits(d,"e",s)}return _}return v},_.domain=function(s){if(!arguments.length)return f;i=s[0],h=s[s.length-1],u=[];var d=l.length;if(s.length===d&&i!==h)for(var k=0,w=Array.from(s);k<w.length;k+=1){var I=w[k];u.push((I-i)/(h-i))}else{for(var E=0;E<d;E++)u.push(E/(d-1));if(s.length>2){var C=s.map(function(F,A){return A/(s.length-1)}),N=s.map(function(F){return(F-i)/(h-i)});N.every(function(F,A){return C[A]===F})||(G=function(F){if(F<=0||F>=1)return F;for(var A=0;F>=N[A+1];)A++;var B=(F-N[A])/(N[A+1]-N[A]),U=C[A]+B*(C[A+1]-C[A]);return U})}}return f=[i,h],_},_.mode=function(s){return arguments.length?(a=s,q(),_):a},_.range=function(s,d){return $(s),_},_.out=function(s){return o=s,_},_.spread=function(s){return arguments.length?(n=s,_):n},_.correctLightness=function(s){return s==null&&(s=!0),c=s,q(),c?x=function(d){for(var k=T(0,!0).lab()[0],w=T(1,!0).lab()[0],I=k>w,E=T(d,!0).lab()[0],C=k+(w-k)*d,N=E-C,F=0,A=1,B=20;Math.abs(N)>.01&&B-- >0;)(function(){return I&&(N*=-1),N<0?(F=d,d+=(A-d)*.5):(A=d,d+=(F-d)*.5),E=T(d,!0).lab()[0],N=E-C})();return d}:x=function(d){return d},_},_.padding=function(s){return s!=null?(ur(s)==="number"&&(s=[s,s]),t=s,_):t},_.colors=function(s,d){arguments.length<2&&(d="hex");var k=[];if(arguments.length===0)k=l.slice(0);else if(s===1)k=[_(.5)];else if(s>1){var w=f[0],I=f[1]-w;k=T0(0,s,!1).map(function(A){return _(w+A/(s-1)*I)})}else{r=[];var E=[];if(v&&v.length>2)for(var C=1,N=v.length,F=1<=N;F?C<N:C>N;F?C++:C--)E.push((v[C-1]+v[C])*.5);else E=f;k=E.map(function(A){return _(A)})}return D[d]&&(k=k.map(function(A){return A[d]()})),k},_.cache=function(s){return s!=null?(b=s,_):b},_.gamma=function(s){return s!=null?(y=s,_):y},_.nodata=function(s){return s!=null?(e=D(s),_):e},_};function T0(r,a,e){for(var n=[],f=r<a,u=e?f?a+1:a-1:a,t=r;f?t<u:t>u;f?t++:t--)n.push(t);return n}var cr=m,G0=jr,I0=function(r){for(var a=[1,1],e=1;e<r;e++){for(var n=[1],f=1;f<=a.length;f++)n[f]=(a[f]||0)+a[f-1];a=n}return a},q0=function(r){var a,e,n,f,u,t,v;if(r=r.map(function(c){return new cr(c)}),r.length===2)a=r.map(function(c){return c.lab()}),u=a[0],t=a[1],f=function(c){var p=[0,1,2].map(function(b){return u[b]+c*(t[b]-u[b])});return new cr(p,"lab")};else if(r.length===3)e=r.map(function(c){return c.lab()}),u=e[0],t=e[1],v=e[2],f=function(c){var p=[0,1,2].map(function(b){return(1-c)*(1-c)*u[b]+2*(1-c)*c*t[b]+c*c*v[b]});return new cr(p,"lab")};else if(r.length===4){var l;n=r.map(function(c){return c.lab()}),u=n[0],t=n[1],v=n[2],l=n[3],f=function(c){var p=[0,1,2].map(function(b){return(1-c)*(1-c)*(1-c)*u[b]+3*(1-c)*(1-c)*c*t[b]+3*(1-c)*c*c*v[b]+c*c*c*l[b]});return new cr(p,"lab")}}else if(r.length>=5){var o,i,h;o=r.map(function(c){return c.lab()}),h=r.length-1,i=I0(h),f=function(c){var p=1-c,b=[0,1,2].map(function(y){return o.reduce(function($,M,x){return $+i[x]*Math.pow(p,h-x)*Math.pow(c,x)*M[y]},0)});return new cr(b,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return f},O0=function(r){var a=q0(r);return a.scale=function(){return G0(a)},a},Jr=L,S=function(r,a,e){if(!S[e])throw new Error("unknown blend mode "+e);return S[e](r,a)},X=function(r){return function(a,e){var n=Jr(e).rgb(),f=Jr(a).rgb();return Jr.rgb(r(n,f))}},W=function(r){return function(a,e){var n=[];return n[0]=r(a[0],e[0]),n[1]=r(a[1],e[1]),n[2]=r(a[2],e[2]),n}},D0=function(r){return r},S0=function(r,a){return r*a/255},B0=function(r,a){return r>a?a:r},H0=function(r,a){return r>a?r:a},Y0=function(r,a){return 255*(1-(1-r/255)*(1-a/255))},X0=function(r,a){return a<128?2*r*a/255:255*(1-2*(1-r/255)*(1-a/255))},W0=function(r,a){return 255*(1-(1-a/255)/(r/255))},U0=function(r,a){return r===255?255:(r=255*(a/255)/(1-r/255),r>255?255:r)};S.normal=X(W(D0)),S.multiply=X(W(S0)),S.screen=X(W(Y0)),S.overlay=X(W(X0)),S.darken=X(W(B0)),S.lighten=X(W(H0)),S.dodge=X(W(U0)),S.burn=X(W(W0));for(var V0=S,Qr=g.type,Z0=g.clip_rgb,j0=g.TWOPI,J0=Math.pow,Q0=Math.sin,K0=Math.cos,_e=L,ru=function(r,a,e,n,f){r===void 0&&(r=300),a===void 0&&(a=-1.5),e===void 0&&(e=1),n===void 0&&(n=1),f===void 0&&(f=[0,1]);var u=0,t;Qr(f)==="array"?t=f[1]-f[0]:(t=0,f=[f,f]);var v=function(l){var o=j0*((r+120)/360+a*l),i=J0(f[0]+t*l,n),h=u!==0?e[0]+l*u:e,c=h*i*(1-i)/2,p=K0(o),b=Q0(o),y=i+c*(-.14861*p+1.78277*b),$=i+c*(-.29227*p-.90649*b),M=i+c*(1.97294*p);return _e(Z0([y*255,$*255,M*255,1]))};return v.start=function(l){return l==null?r:(r=l,v)},v.rotations=function(l){return l==null?a:(a=l,v)},v.gamma=function(l){return l==null?n:(n=l,v)},v.hue=function(l){return l==null?e:(e=l,Qr(e)==="array"?(u=e[1]-e[0],u===0&&(e=e[1])):u=0,v)},v.lightness=function(l){return l==null?f:(Qr(l)==="array"?(f=l,t=l[1]-l[0]):(f=[l,l],t=0),v)},v.scale=function(){return _e.scale(v)},v.hue(e),v},au=m,eu="0123456789abcdef",nu=Math.floor,tu=Math.random,fu=function(){for(var r="#",a=0;a<6;a++)r+=eu.charAt(nu(tu()*16));return new au(r,"hex")},Kr=hr,Me=Math.log,uu=Math.pow,vu=Math.floor,lu=Math.abs,Ce=function(r,a){a===void 0&&(a=null);var e={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Kr(r)==="object"&&(r=Object.values(r)),r.forEach(function(n){a&&Kr(n)==="object"&&(n=n[a]),n!=null&&!isNaN(n)&&(e.values.push(n),e.sum+=n,n<e.min&&(e.min=n),n>e.max&&(e.max=n),e.count+=1)}),e.domain=[e.min,e.max],e.limits=function(n,f){return xe(e,n,f)},e},xe=function(r,a,e){a===void 0&&(a="equal"),e===void 0&&(e=7),Kr(r)=="array"&&(r=Ce(r));var n=r.min,f=r.max,u=r.values.sort(function(aa,ea){return aa-ea});if(e===1)return[n,f];var t=[];if(a.substr(0,1)==="c"&&(t.push(n),t.push(f)),a.substr(0,1)==="e"){t.push(n);for(var v=1;v<e;v++)t.push(n+v/e*(f-n));t.push(f)}else if(a.substr(0,1)==="l"){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var l=Math.LOG10E*Me(n),o=Math.LOG10E*Me(f);t.push(n);for(var i=1;i<e;i++)t.push(uu(10,l+i/e*(o-l)));t.push(f)}else if(a.substr(0,1)==="q"){t.push(n);for(var h=1;h<e;h++){var c=(u.length-1)*h/e,p=vu(c);if(p===c)t.push(u[p]);else{var b=c-p;t.push(u[p]*(1-b)+u[p+1]*b)}}t.push(f)}else if(a.substr(0,1)==="k"){var y,$=u.length,M=new Array($),x=new Array(e),G=!0,T=0,q=null;q=[],q.push(n);for(var _=1;_<e;_++)q.push(n+_/e*(f-n));for(q.push(f);G;){for(var s=0;s<e;s++)x[s]=0;for(var d=0;d<$;d++)for(var k=u[d],w=Number.MAX_VALUE,I=void 0,E=0;E<e;E++){var C=lu(q[E]-k);C<w&&(w=C,I=E),x[I]++,M[d]=I}for(var N=new Array(e),F=0;F<e;F++)N[F]=null;for(var A=0;A<$;A++)y=M[A],N[y]===null?N[y]=u[A]:N[y]+=u[A];for(var B=0;B<e;B++)N[B]*=1/x[B];G=!1;for(var U=0;U<e;U++)if(N[U]!==q[U]){G=!0;break}q=N,T++,T>200&&(G=!1)}for(var V={},vr=0;vr<e;vr++)V[vr]=[];for(var lr=0;lr<$;lr++)y=M[lr],V[y].push(u[lr]);for(var Y=[],J=0;J<e;J++)Y.push(V[J][0]),Y.push(V[J][V[J].length-1]);Y=Y.sort(function(aa,ea){return aa-ea}),t.push(Y[0]);for(var sr=1;sr<Y.length;sr+=2){var Q=Y[sr];!isNaN(Q)&&t.indexOf(Q)===-1&&t.push(Q)}}return t},Ne={analyze:Ce,limits:xe},Fe=m,ou=function(r,a){r=new Fe(r),a=new Fe(a);var e=r.luminance(),n=a.luminance();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},Ae=m,H=Math.sqrt,R=Math.pow,iu=Math.min,cu=Math.max,Ee=Math.atan2,Le=Math.abs,_r=Math.cos,Re=Math.sin,su=Math.exp,ze=Math.PI,gu=function(r,a,e,n,f){e===void 0&&(e=1),n===void 0&&(n=1),f===void 0&&(f=1);var u=function(Q){return 360*Q/(2*ze)},t=function(Q){return 2*ze*Q/360};r=new Ae(r),a=new Ae(a);var v=Array.from(r.lab()),l=v[0],o=v[1],i=v[2],h=Array.from(a.lab()),c=h[0],p=h[1],b=h[2],y=(l+c)/2,$=H(R(o,2)+R(i,2)),M=H(R(p,2)+R(b,2)),x=($+M)/2,G=.5*(1-H(R(x,7)/(R(x,7)+R(25,7)))),T=o*(1+G),q=p*(1+G),_=H(R(T,2)+R(i,2)),s=H(R(q,2)+R(b,2)),d=(_+s)/2,k=u(Ee(i,T)),w=u(Ee(b,q)),I=k>=0?k:k+360,E=w>=0?w:w+360,C=Le(I-E)>180?(I+E+360)/2:(I+E)/2,N=1-.17*_r(t(C-30))+.24*_r(t(2*C))+.32*_r(t(3*C+6))-.2*_r(t(4*C-63)),F=E-I;F=Le(F)<=180?F:E<=I?F+360:F-360,F=2*H(_*s)*Re(t(F)/2);var A=c-l,B=s-_,U=1+.015*R(y-50,2)/H(20+R(y-50,2)),V=1+.045*d,vr=1+.015*d*N,lr=30*su(-R((C-275)/25,2)),Y=2*H(R(d,7)/(R(d,7)+R(25,7))),J=-Y*Re(2*t(lr)),sr=H(R(A/(e*U),2)+R(B/(n*V),2)+R(F/(f*vr),2)+J*(B/(n*V))*(F/(f*vr)));return cu(0,iu(100,sr))},Pe=m,hu=function(r,a,e){e===void 0&&(e="lab"),r=new Pe(r),a=new Pe(a);var n=r.get(e),f=a.get(e),u=0;for(var t in n){var v=(n[t]||0)-(f[t]||0);u+=v*v}return Math.sqrt(u)},bu=m,pu=function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];try{return new(Function.prototype.bind.apply(bu,[null].concat(r))),!0}catch{return!1}},Te=L,Ge=jr,du={cool:function(){return Ge([Te.hsl(180,1,.9),Te.hsl(250,.7,.4)])},hot:function(){return Ge(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Mr={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},ra=0,Ie=Object.keys(Mr);ra<Ie.length;ra+=1){var qe=Ie[ra];Mr[qe.toLowerCase()]=Mr[qe]}var mu=Mr,P=L;P.average=R0,P.bezier=O0,P.blend=V0,P.cubehelix=ru,P.mix=P.interpolate=he,P.random=fu,P.scale=jr,P.analyze=Ne.analyze,P.contrast=ou,P.deltaE=gu,P.distance=hu,P.limits=Ne.limits,P.valid=pu,P.scales=du,P.colors=ja,P.brewer=mu;var yu=P;return yu})})(Oe.chroma);const ku=Oe.chroma.exports;module.exports=ku;
//# sourceMappingURL=chroma.js.map
