import{g as r}from"./@babel-ynFNPEB3.js";var e,n={exports:{}}; /** * 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 */var t=(e||(e=1,n.exports=function(){for(var r=function(r,e,n){return void 0===e&&(e=0),void 0===n&&(n=1),rn?n:r},e=function(e){e._clipped=!1,e._unclipped=e.slice(0);for(var n=0;n<=3;n++)n<3?((e[n]<0||e[n]>255)&&(e._clipped=!0),e[n]=r(e[n],0,255)):3===n&&(e[n]=r(e[n],0,1));return e},n={},t=0,a=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];t=3?Array.prototype.slice.call(r):"object"==o(r[0])&&e?e.split("").filter((function(e){return void 0!==r[0][e]})).map((function(e){return r[0][e]})):r[0]},c=function(r){if(r.length<2)return null;var e=r.length-1;return"string"==o(r[e])?r[e].toLowerCase():null},i=Math.PI,l={clip_rgb:e,limit:r,type:o,unpack:u,last:c,TWOPI:2*i,PITHIRD:i/3,DEG2RAD:i/180,RAD2DEG:180/i},h={format:{},autodetect:[]},s=l.last,d=l.clip_rgb,b=l.type,p=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=this;if("object"===b(r[0])&&r[0].constructor&&r[0].constructor===this.constructor)return r[0];var t=s(r),a=!1;if(!t){a=!0,h.sorted||(h.autodetect=h.autodetect.sort((function(r,e){return e.p-r.p})),h.sorted=!0);for(var f=0,o=h.autodetect;f4?r[4]:1;return 1===f?[0,0,0,o]:[n>=1?0:255*(1-n)*(1-f), // r t>=1?0:255*(1-t)*(1-f), // g a>=1?0:255*(1-a)*(1-f), // b o]},x=_,A=l.unpack,E=l.type;g.prototype.cmyk=function(){return M(this._rgb)},m.cmyk=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["cmyk"])))},h.format.cmyk=x,h.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=A(r,"cmyk"),"array"===E(r)&&4===r.length)return"cmyk"}});var F=l.unpack,P=l.last,O=function(r){return Math.round(100*r)/100},j=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=F(r,"hsla"),t=P(r)||"lsa";return n[0]=O(n[0]||0),n[1]=O(100*n[1])+"%",n[2]=O(100*n[2])+"%","hsla"===t||n.length>3&&n[3]<1?(n[3]=n.length>3?n[3]:1,t="hsla"):n.length=3,t+"("+n.join(",")+")"},G=j,q=l.unpack,L=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=(r=q(r,"rgba"))[0],t=r[1],a=r[2];n/=255,t/=255,a/=255;var f,o,u=Math.min(n,t,a),c=Math.max(n,t,a),i=(c+u)/2;return c===u?(f=0,o=Number.NaN):f=i<.5?(c-u)/(c+u):(c-u)/(2-c-u),n==c?o=(t-a)/(c-u):t==c?o=2+(a-n)/(c-u):a==c&&(o=4+(n-t)/(c-u)),(o*=60)<0&&(o+=360),r.length>3&&void 0!==r[3]?[o,f,i,r[3]]:[o,f,i]},R=L,B=l.unpack,C=l.last,I=Math.round,D=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=B(r,"rgba"),t=C(r)||"rgb";return"hsl"==t.substr(0,3)?G(R(n),t):(n[0]=I(n[0]),n[1]=I(n[1]),n[2]=I(n[2]),("rgba"===t||n.length>3&&n[3]<1)&&(n[3]=n.length>3?n[3]:1,t="rgba"),t+"("+n.slice(0,"rgb"===t?3:4).join(",")+")")},Y=D,S=l.unpack,$=Math.round,z=function(){for(var r,e=[],n=arguments.length;n--;)e[n]=arguments[n];var t,a,f,o=(e=S(e,"hsl"))[0],u=e[1],c=e[2];if(0===u)t=a=f=255*c;else{var i=[0,0,0],l=[0,0,0],h=c<.5?c*(1+u):c+u-c*u,s=2*c-h,d=o/360;i[0]=d+1/3,i[1]=d,i[2]=d-1/3;for(var b=0;b<3;b++)i[b]<0&&(i[b]+=1),i[b]>1&&(i[b]-=1),6*i[b]<1?l[b]=s+6*(h-s)*i[b]:2*i[b]<1?l[b]=h:3*i[b]<2?l[b]=s+(h-s)*(2/3-i[b])*6:l[b]=s;t=(r=[$(255*l[0]),$(255*l[1]),$(255*l[2])])[0],a=r[1],f=r[2]}return e.length>3?[t,a,f,e[3]]:[t,a,f,1]},T=z,X=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,U=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,V=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,W=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,K=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Z=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,H=Math.round,J=function(r){var e;if(r=r.toLowerCase().trim(),h.format.named)try{return h.format.named(r)}catch(p){}if(e=r.match(X)){for(var n=e.slice(1,4),t=0;t<3;t++)n[t]=+n[t];return n[3]=1,n}if(e=r.match(U)){for(var a=e.slice(1,5),f=0;f<4;f++)a[f]=+a[f];return a}if(e=r.match(V)){for(var o=e.slice(1,4),u=0;u<3;u++)o[u]=H(2.55*o[u]);return o[3]=1,o}if(e=r.match(W)){for(var c=e.slice(1,5),i=0;i<3;i++)c[i]=H(2.55*c[i]);return c[3]=+c[3],c}if(e=r.match(K)){var l=e.slice(1,4);l[1]*=.01,l[2]*=.01;var s=T(l);return s[3]=1,s}if(e=r.match(Z)){var d=e.slice(1,4);d[1]*=.01,d[2]*=.01;var b=T(d);return b[3]=+e[4],b}};J.test=function(r){return X.test(r)||U.test(r)||V.test(r)||W.test(r)||K.test(r)||Z.test(r)};var Q=J,rr=l.type;g.prototype.css=function(r){return Y(this._rgb,r)},m.css=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["css"])))},h.format.css=Q,h.autodetect.push({p:5,test:function(r){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];if(!e.length&&"string"===rr(r)&&Q.test(r))return"css"}});var er=l.unpack;h.format.gl=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=er(r,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n},m.gl=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["gl"])))},g.prototype.gl=function(){var r=this._rgb;return[r[0]/255,r[1]/255,r[2]/255,r[3]]};var nr=l.unpack,tr=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t=nr(r,"rgb"),a=t[0],f=t[1],o=t[2],u=Math.min(a,f,o),c=Math.max(a,f,o),i=c-u,l=100*i/255,h=u/(255-i)*100;return 0===i?n=Number.NaN:(a===c&&(n=(f-o)/i),f===c&&(n=2+(o-a)/i),o===c&&(n=4+(a-f)/i),(n*=60)<0&&(n+=360)),[n,l,h]},ar=tr,fr=l.unpack,or=Math.floor,ur=function(){for(var r,e,n,t,a,f,o=[],u=arguments.length;u--;)o[u]=arguments[u];var c,i,l,h=(o=fr(o,"hcg"))[0],s=o[1],d=o[2];d*=255;var b=255*s;if(0===s)c=i=l=d;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var p=or(h/=60),g=h-p,v=d*(1-s),m=v+b*(1-g),y=v+b*g,w=v+b;switch(p){case 0:c=(r=[w,y,v])[0],i=r[1],l=r[2];break;case 1:c=(e=[m,w,v])[0],i=e[1],l=e[2];break;case 2:c=(n=[v,w,y])[0],i=n[1],l=n[2];break;case 3:c=(t=[v,m,w])[0],i=t[1],l=t[2];break;case 4:c=(a=[y,v,w])[0],i=a[1],l=a[2];break;case 5:c=(f=[w,v,m])[0],i=f[1],l=f[2]}}return[c,i,l,o.length>3?o[3]:1]},cr=ur,ir=l.unpack,lr=l.type;g.prototype.hcg=function(){return ar(this._rgb)},m.hcg=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["hcg"])))},h.format.hcg=cr,h.autodetect.push({p:1,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=ir(r,"hcg"),"array"===lr(r)&&3===r.length)return"hcg"}});var hr=l.unpack,sr=l.last,dr=Math.round,br=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=hr(r,"rgba"),t=n[0],a=n[1],f=n[2],o=n[3],u=sr(r)||"auto";void 0===o&&(o=1),"auto"===u&&(u=o<1?"rgba":"rgb");var c="000000"+((t=dr(t))<<16|(a=dr(a))<<8|(f=dr(f))).toString(16);c=c.substr(c.length-6);var i="0"+dr(255*o).toString(16);switch(i=i.substr(i.length-2),u.toLowerCase()){case"rgba":return"#"+c+i;case"argb":return"#"+i+c;default:return"#"+c}},pr=br,gr=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,vr=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,mr=function(r){if(r.match(gr)){4!==r.length&&7!==r.length||(r=r.substr(1)),3===r.length&&(r=(r=r.split(""))[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var e=parseInt(r,16);return[e>>16,e>>8&255,255&e,1]}if(r.match(vr)){5!==r.length&&9!==r.length||(r=r.substr(1)),4===r.length&&(r=(r=r.split(""))[0]+r[0]+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]);var n=parseInt(r,16);return[n>>24&255,n>>16&255,n>>8&255,Math.round((255&n)/255*100)/100]}throw new Error("unknown hex color: "+r)},yr=l.type;g.prototype.hex=function(r){return pr(this._rgb,r)},m.hex=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["hex"])))},h.format.hex=mr,h.autodetect.push({p:4,test:function(r){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];if(!e.length&&"string"===yr(r)&&[3,4,5,6,7,8,9].indexOf(r.length)>=0)return"hex"}});var wr=l.unpack,kr=l.TWOPI,Mr=Math.min,Nr=Math.sqrt,_r=Math.acos,xr=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t=wr(r,"rgb"),a=t[0],f=t[1],o=t[2],u=Mr(a/=255,f/=255,o/=255),c=(a+f+o)/3,i=c>0?1-u/c:0;return 0===i?n=NaN:(n=(a-f+(a-o))/2,n/=Nr((a-f)*(a-f)+(a-o)*(f-o)),n=_r(n),o>f&&(n=kr-n),n/=kr),[360*n,i,c]},Ar=xr,Er=l.unpack,Fr=l.limit,Pr=l.TWOPI,Or=l.PITHIRD,jr=Math.cos,Gr=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t,a,f=(r=Er(r,"hsi"))[0],o=r[1],u=r[2];return isNaN(f)&&(f=0),isNaN(o)&&(o=0),f>360&&(f-=360),f<0&&(f+=360),(f/=360)<1/3?t=1-((a=(1-o)/3)+(n=(1+o*jr(Pr*f)/jr(Or-Pr*f))/3)):f<2/3?a=1-((n=(1-o)/3)+(t=(1+o*jr(Pr*(f-=1/3))/jr(Or-Pr*f))/3)):n=1-((t=(1-o)/3)+(a=(1+o*jr(Pr*(f-=2/3))/jr(Or-Pr*f))/3)),[255*(n=Fr(u*n*3)),255*(t=Fr(u*t*3)),255*(a=Fr(u*a*3)),r.length>3?r[3]:1]},qr=Gr,Lr=l.unpack,Rr=l.type;g.prototype.hsi=function(){return Ar(this._rgb)},m.hsi=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["hsi"])))},h.format.hsi=qr,h.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=Lr(r,"hsi"),"array"===Rr(r)&&3===r.length)return"hsi"}});var Br=l.unpack,Cr=l.type;g.prototype.hsl=function(){return R(this._rgb)},m.hsl=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["hsl"])))},h.format.hsl=T,h.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=Br(r,"hsl"),"array"===Cr(r)&&3===r.length)return"hsl"}});var Ir=l.unpack,Dr=Math.min,Yr=Math.max,Sr=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t,a,f=(r=Ir(r,"rgb"))[0],o=r[1],u=r[2],c=Dr(f,o,u),i=Yr(f,o,u),l=i-c;return a=i/255,0===i?(n=Number.NaN,t=0):(t=l/i,f===i&&(n=(o-u)/l),o===i&&(n=2+(u-f)/l),u===i&&(n=4+(f-o)/l),(n*=60)<0&&(n+=360)),[n,t,a]},$r=Sr,zr=l.unpack,Tr=Math.floor,Xr=function(){for(var r,e,n,t,a,f,o=[],u=arguments.length;u--;)o[u]=arguments[u];var c,i,l,h=(o=zr(o,"hsv"))[0],s=o[1],d=o[2];if(d*=255,0===s)c=i=l=d;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var b=Tr(h/=60),p=h-b,g=d*(1-s),v=d*(1-s*p),m=d*(1-s*(1-p));switch(b){case 0:c=(r=[d,m,g])[0],i=r[1],l=r[2];break;case 1:c=(e=[v,d,g])[0],i=e[1],l=e[2];break;case 2:c=(n=[g,d,m])[0],i=n[1],l=n[2];break;case 3:c=(t=[g,v,d])[0],i=t[1],l=t[2];break;case 4:c=(a=[m,g,d])[0],i=a[1],l=a[2];break;case 5:c=(f=[d,g,v])[0],i=f[1],l=f[2]}}return[c,i,l,o.length>3?o[3]:1]},Ur=Xr,Vr=l.unpack,Wr=l.type;g.prototype.hsv=function(){return $r(this._rgb)},m.hsv=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["hsv"])))},h.format.hsv=Ur,h.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=Vr(r,"hsv"),"array"===Wr(r)&&3===r.length)return"hsv"}});var Kr={ // Corresponds roughly to RGB brighter/darker Kn:18, // D65 standard referent Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034, // 4 / 29 t1:.206896552, // 6 / 29 t2:.12841855, // 3 * t1 * t1 t3:.008856452},Zr=l.unpack,Hr=Math.pow,Jr=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=Zr(r,"rgb"),t=n[0],a=n[1],f=n[2],o=ee(t,a,f),u=o[0],c=o[1],i=116*c-16;return[i<0?0:i,500*(u-c),200*(c-o[2])]},Qr=function(r){return(r/=255)<=.04045?r/12.92:Hr((r+.055)/1.055,2.4)},re=function(r){return r>Kr.t3?Hr(r,1/3):r/Kr.t2+Kr.t0},ee=function(r,e,n){return r=Qr(r),e=Qr(e),n=Qr(n),[re((.4124564*r+.3575761*e+.1804375*n)/Kr.Xn),re((.2126729*r+.7151522*e+.072175*n)/Kr.Yn),re((.0193339*r+.119192*e+.9503041*n)/Kr.Zn)]},ne=Jr,te=l.unpack,ae=Math.pow,fe=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t,a,f=(r=te(r,"lab"))[0],o=r[1],u=r[2];return t=(f+16)/116,n=isNaN(o)?t:t+o/500,a=isNaN(u)?t:t-u/200,t=Kr.Yn*ue(t),n=Kr.Xn*ue(n),a=Kr.Zn*ue(a),[oe(3.2404542*n-1.5371385*t-.4985314*a),oe(-.969266*n+1.8760108*t+.041556*a),oe(.0556434*n-.2040259*t+1.0572252*a),r.length>3?r[3]:1]},oe=function(r){return 255*(r<=.00304?12.92*r:1.055*ae(r,1/2.4)-.055)},ue=function(r){return r>Kr.t1?r*r*r:Kr.t2*(r-Kr.t0)},ce=fe,ie=l.unpack,le=l.type;g.prototype.lab=function(){return ne(this._rgb)},m.lab=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["lab"])))},h.format.lab=ce,h.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=ie(r,"lab"),"array"===le(r)&&3===r.length)return"lab"}});var he=l.unpack,se=l.RAD2DEG,de=Math.sqrt,be=Math.atan2,pe=Math.round,ge=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=he(r,"lab"),t=n[0],a=n[1],f=n[2],o=de(a*a+f*f),u=(be(f,a)*se+360)%360;return 0===pe(1e4*o)&&(u=Number.NaN),[t,o,u]},ve=ge,me=l.unpack,ye=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=me(r,"rgb"),t=n[0],a=n[1],f=n[2],o=ne(t,a,f),u=o[0],c=o[1],i=o[2];return ve(u,c,i)},we=ye,ke=l.unpack,Me=l.DEG2RAD,Ne=Math.sin,_e=Math.cos,xe=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=ke(r,"lch"),t=n[0],a=n[1],f=n[2];return isNaN(f)&&(f=0),[t,_e(f*=Me)*a,Ne(f)*a]},Ae=xe,Ee=l.unpack,Fe=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=(r=Ee(r,"lch"))[0],t=r[1],a=r[2],f=Ae(n,t,a),o=f[0],u=f[1],c=f[2],i=ce(o,u,c);return[i[0],i[1],i[2],r.length>3?r[3]:1]},Pe=Fe,Oe=l.unpack,je=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=Oe(r,"hcl").reverse();return Pe.apply(void 0,n)},Ge=je,qe=l.unpack,Le=l.type;g.prototype.lch=function(){return we(this._rgb)},g.prototype.hcl=function(){return we(this._rgb).reverse()},m.lch=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["lch"])))},m.hcl=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["hcl"])))},h.format.lch=Pe,h.format.hcl=Ge,["lch","hcl"].forEach((function(r){return h.autodetect.push({p:2,test:function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];if(e=qe(e,r),"array"===Le(e)&&3===e.length)return r}})}));var Re={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"},Be=l.type;g.prototype.name=function(){for(var r=pr(this._rgb,"rgb"),e=0,n=Object.keys(Re);e0;)e[n]=arguments[n+1];if(!e.length&&"string"===Be(r)&&Re[r.toLowerCase()])return"named"}});var Ce=l.unpack,Ie=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=Ce(r,"rgb");return(n[0]<<16)+(n[1]<<8)+n[2]},De=Ie,Ye=l.type,Se=function(r){if("number"==Ye(r)&&r>=0&&r<=16777215)return[r>>16,r>>8&255,255&r,1];throw new Error("unknown num color: "+r)},$e=l.type;g.prototype.num=function(){return De(this._rgb)},m.num=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["num"])))},h.format.num=Se,h.autodetect.push({p:5,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(1===r.length&&"number"===$e(r[0])&&r[0]>=0&&r[0]<=16777215)return"num"}});var ze=l.unpack,Te=l.type,Xe=Math.round;g.prototype.rgb=function(r){return void 0===r&&(r=!0),!1===r?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Xe)},g.prototype.rgba=function(r){return void 0===r&&(r=!0),this._rgb.slice(0,4).map((function(e,n){return n<3?!1===r?e:Xe(e):e}))},m.rgb=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["rgb"])))},h.format.rgb=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=ze(r,"rgba");return void 0===n[3]&&(n[3]=1),n},h.autodetect.push({p:3,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=ze(r,"rgba"),"array"===Te(r)&&(3===r.length||4===r.length&&"number"==Te(r[3])&&r[3]>=0&&r[3]<=1))return"rgb"}});var Ue=Math.log,Ve=function(r){var e,n,t,a=r/100;return a<66?(e=255,n=-155.25485562709179-.44596950469579133*(n=a-2)+104.49216199393888*Ue(n),t=a<20?0:.8274096064007395*(t=a-10)-254.76935184120902+115.67994401066147*Ue(t)):(e=351.97690566805693+.114206453784165*(e=a-55)-40.25366309332127*Ue(e),n=325.4494125711974+.07943456536662342*(n=a-50)-28.0852963507957*Ue(n),t=255),[e,n,t,1]},We=l.unpack,Ke=Math.round,Ze=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];for(var n,t=We(r,"rgb"),a=t[0],f=t[2],o=1e3,u=4e4,c=.4;u-o>c;){var i=Ve(n=.5*(u+o));i[2]/i[0]>=f/a?u=n:o=n}return Ke(n)},He=Ze;g.prototype.temp=g.prototype.kelvin=g.prototype.temperature=function(){return He(this._rgb)},m.temp=m.kelvin=m.temperature=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(g,[null].concat(r,["temp"])))},h.format.temp=h.format.kelvin=h.format.temperature=Ve;var Je=l.type;g.prototype.alpha=function(r,e){return void 0===e&&(e=!1),void 0!==r&&"number"===Je(r)?e?(this._rgb[3]=r,this):new g([this._rgb[0],this._rgb[1],this._rgb[2],r],"rgb"):this._rgb[3]},g.prototype.clipped=function(){return this._rgb._clipped||!1},g.prototype.darken=function(r){void 0===r&&(r=1);var e=this,n=e.lab();return n[0]-=Kr.Kn*r,new g(n,"lab").alpha(e.alpha(),!0)},g.prototype.brighten=function(r){return void 0===r&&(r=1),this.darken(-r)},g.prototype.darker=g.prototype.darken,g.prototype.brighter=g.prototype.brighten,g.prototype.get=function(r){var e=r.split("."),n=e[0],t=e[1],a=this[n]();if(t){var f=n.indexOf(t);if(f>-1)return a[f];throw new Error("unknown channel "+t+" in mode "+n)}return a};var Qe=l.type,rn=Math.pow,en=1e-7,nn=20;g.prototype.luminance=function(r){if(void 0!==r&&"number"===Qe(r)){if(0===r)return new g([0,0,0,this._rgb[3]],"rgb");if(1===r)return new g([255,255,255,this._rgb[3]],"rgb");var e=this.luminance(),n="rgb",t=nn,a=function(e,f){var o=e.interpolate(f,.5,n),u=o.luminance();return Math.abs(r-u)r?a(e,o):a(o,f)},f=(e>r?a(new g([0,0,0]),this):a(this,new g([255,255,255]))).rgb();return new g(f.concat([this._rgb[3]]))}return tn.apply(void 0,this._rgb.slice(0,3))};var tn=function(r,e,n){return.2126*(r=an(r))+.7152*(e=an(e))+.0722*(n=an(n))},an=function(r){return(r/=255)<=.03928?r/12.92:rn((r+.055)/1.055,2.4)},fn={},on=l.type,un=function(r,e,n){void 0===n&&(n=.5);for(var t=[],a=arguments.length-3;a-- >0;)t[a]=arguments[a+3];var f=t[0]||"lrgb";if(fn[f]||t.length||(f=Object.keys(fn)[0]),!fn[f])throw new Error("interpolation mode "+f+" is not defined");return"object"!==on(r)&&(r=new g(r)),"object"!==on(e)&&(e=new g(e)),fn[f](r,e,n).alpha(r.alpha()+n*(e.alpha()-r.alpha()))};g.prototype.mix=g.prototype.interpolate=function(r,e){void 0===e&&(e=.5);for(var n=[],t=arguments.length-2;t-- >0;)n[t]=arguments[t+2];return un.apply(void 0,[this,r,e].concat(n))},g.prototype.premultiply=function(r){void 0===r&&(r=!1);var e=this._rgb,n=e[3];return r?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new g([e[0]*n,e[1]*n,e[2]*n,n],"rgb")},g.prototype.saturate=function(r){void 0===r&&(r=1);var e=this,n=e.lch();return n[1]+=Kr.Kn*r,n[1]<0&&(n[1]=0),new g(n,"lch").alpha(e.alpha(),!0)},g.prototype.desaturate=function(r){return void 0===r&&(r=1),this.saturate(-r)};var cn=l.type;g.prototype.set=function(r,e,n){void 0===n&&(n=!1);var t=r.split("."),a=t[0],f=t[1],o=this[a]();if(f){var u=a.indexOf(f);if(u>-1){if("string"==cn(e))switch(e.charAt(0)){case"+":case"-":o[u]+=+e;break;case"*":o[u]*=+e.substr(1);break;case"/":o[u]/=+e.substr(1);break;default:o[u]=+e}else{if("number"!==cn(e))throw new Error("unsupported value for Color.set");o[u]=e}var c=new g(o,a);return n?(this._rgb=c._rgb,this):c}throw new Error("unknown channel "+f+" in mode "+a)}return o};var ln=function(r,e,n){var t=r._rgb,a=e._rgb;return new g(t[0]+n*(a[0]-t[0]),t[1]+n*(a[1]-t[1]),t[2]+n*(a[2]-t[2]),"rgb")};fn.rgb=ln;var hn=Math.sqrt,sn=Math.pow,dn=function(r,e,n){var t=r._rgb,a=t[0],f=t[1],o=t[2],u=e._rgb,c=u[0],i=u[1],l=u[2];return new g(hn(sn(a,2)*(1-n)+sn(c,2)*n),hn(sn(f,2)*(1-n)+sn(i,2)*n),hn(sn(o,2)*(1-n)+sn(l,2)*n),"rgb")};fn.lrgb=dn;var bn=function(r,e,n){var t=r.lab(),a=e.lab();return new g(t[0]+n*(a[0]-t[0]),t[1]+n*(a[1]-t[1]),t[2]+n*(a[2]-t[2]),"lab")};fn.lab=bn;var pn=function(r,e,n,t){var a,f,o,u,c,i,l,h,s,d,b,p;return"hsl"===t?(o=r.hsl(),u=e.hsl()):"hsv"===t?(o=r.hsv(),u=e.hsv()):"hcg"===t?(o=r.hcg(),u=e.hcg()):"hsi"===t?(o=r.hsi(),u=e.hsi()):"lch"!==t&&"hcl"!==t||(t="hcl",o=r.hcl(),u=e.hcl()),"h"===t.substr(0,1)&&(c=(a=o)[0],l=a[1],s=a[2],i=(f=u)[0],h=f[1],d=f[2]),isNaN(c)||isNaN(i)?isNaN(c)?isNaN(i)?p=Number.NaN:(p=i,1!=s&&0!=s||"hsv"==t||(b=h)):(p=c,1!=d&&0!=d||"hsv"==t||(b=l)):p=c+n*(i>c&&i-c>180?i-(c+360):i180?i+360-c:i-c),void 0===b&&(b=l+n*(h-l)),new g([p,b,s+n*(d-s)],t)},gn=function(r,e,n){return pn(r,e,n,"lch")};fn.lch=gn,fn.hcl=gn;var vn=function(r,e,n){var t=r.num(),a=e.num();return new g(t+n*(a-t),"num")};fn.num=vn;var mn=function(r,e,n){return pn(r,e,n,"hcg")};fn.hcg=mn;var yn=function(r,e,n){return pn(r,e,n,"hsi")};fn.hsi=yn;var wn=function(r,e,n){return pn(r,e,n,"hsl")};fn.hsl=wn;var kn=function(r,e,n){return pn(r,e,n,"hsv")};fn.hsv=kn;var Mn=l.clip_rgb,Nn=Math.pow,_n=Math.sqrt,xn=Math.PI,An=Math.cos,En=Math.sin,Fn=Math.atan2,Pn=function(r,e,n){void 0===e&&(e="lrgb"),void 0===n&&(n=null);var t=r.length;n||(n=Array.from(new Array(t)).map((function(){return 1})));var a=t/n.reduce((function(r,e){return r+e}));if(n.forEach((function(r,e){n[e]*=a})),r=r.map((function(r){return new g(r)})),"lrgb"===e)return On(r,n);for(var f=r.shift(),o=f.get(e),u=[],c=0,i=0,l=0;l=360;)b-=360;o[d]=b}else o[d]=o[d]/u[d];return s/=t,new g(o,e).alpha(s>.99999?1:s,!0)},On=function(r,e){for(var n=r.length,t=[0,0,0,0],a=0;a.9999999&&(t[3]=1),new g(Mn(t))},jn=l.type,Gn=Math.pow,qn=function(r){var e="rgb",n=m("#ccc"),t=0,a=[0,1],f=[],o=[0,0],u=!1,c=[],i=!1,l=0,h=1,s=!1,d={},b=!0,p=1,g=function(r){if((r=r||["#fff","#000"])&&"string"===jn(r)&&m.brewer&&m.brewer[r.toLowerCase()]&&(r=m.brewer[r.toLowerCase()]),"array"===jn(r)){1===r.length&&(r=[r[0],r[0]]),r=r.slice(0);for(var e=0;e=u[n];)n++;return n-1}return 0},y=function(r){return r},w=function(r){return r},k=function(r,t){var a,i;if(null==t&&(t=!1),isNaN(r)||null===r)return n;i=t?r:u&&u.length>2?v(r)/(u.length-2):h!==l?(r-l)/(h-l):1,i=w(i),t||(i=y(i)),1!==p&&(i=Gn(i,p)),i=o[0]+i*(1-o[0]-o[1]),i=Math.min(1,Math.max(0,i));var s=Math.floor(1e4*i);if(b&&d[s])a=d[s];else{if("array"===jn(c))for(var g=0;g=k&&g===f.length-1){a=c[g];break}if(i>k&&i2){var i=r.map((function(e,n){return n/(r.length-1)})),s=r.map((function(r){return(r-l)/(h-l)}));s.every((function(r,e){return i[e]===r}))||(w=function(r){if(r<=0||r>=1)return r;for(var e=0;r>=s[e+1];)e++;var n=(r-s[e])/(s[e+1]-s[e]);return i[e]+n*(i[e+1]-i[e])})}}return a=[l,h],N},N.mode=function(r){return arguments.length?(e=r,M(),N):e},N.range=function(r,e){return g(r),N},N.out=function(r){return i=r,N},N.spread=function(r){return arguments.length?(t=r,N):t},N.correctLightness=function(r){return null==r&&(r=!0),s=r,M(),y=s?function(r){for(var e=k(0,!0).lab()[0],n=k(1,!0).lab()[0],t=e>n,a=k(r,!0).lab()[0],f=e+(n-e)*r,o=a-f,u=0,c=1,i=20;Math.abs(o)>.01&&i-- >0;)t&&(o*=-1),o<0?(u=r,r+=.5*(c-r)):(c=r,r+=.5*(u-r)),a=k(r,!0).lab()[0],o=a-f;return r}:function(r){return r},N},N.padding=function(r){return null!=r?("number"===jn(r)&&(r=[r,r]),o=r,N):o},N.colors=function(e,n){arguments.length<2&&(n="hex");var t=[];if(0===arguments.length)t=c.slice(0);else if(1===e)t=[N(.5)];else if(e>1){var f=a[0],o=a[1]-f;t=Ln(0,e).map((function(r){return N(f+r/(e-1)*o)}))}else{r=[];var i=[];if(u&&u.length>2)for(var l=1,h=u.length,s=1<=h;s?lh;s?l++:l--)i.push(.5*(u[l-1]+u[l]));else i=a;t=i.map((function(r){return N(r)}))}return m[n]&&(t=t.map((function(r){return r[n]()}))),t},N.cache=function(r){return null!=r?(b=r,N):b},N.gamma=function(r){return null!=r?(p=r,N):p},N.nodata=function(r){return null!=r?(n=m(r),N):n},N};function Ln(r,e,n){for(var t=[],a=rf;a?o++:o--)t.push(o);return t}var Rn=function(r){var e,n,t,a,f,o,u;if(2===(r=r.map((function(r){return new g(r)}))).length)e=r.map((function(r){return r.lab()})),f=e[0],o=e[1],a=function(r){var e=[0,1,2].map((function(e){return f[e]+r*(o[e]-f[e])}));return new g(e,"lab")};else if(3===r.length)n=r.map((function(r){return r.lab()})),f=n[0],o=n[1],u=n[2],a=function(r){var e=[0,1,2].map((function(e){return(1-r)*(1-r)*f[e]+2*(1-r)*r*o[e]+r*r*u[e]}));return new g(e,"lab")};else if(4===r.length){var c;t=r.map((function(r){return r.lab()})),f=t[0],o=t[1],u=t[2],c=t[3],a=function(r){var e=[0,1,2].map((function(e){return(1-r)*(1-r)*(1-r)*f[e]+3*(1-r)*(1-r)*r*o[e]+3*(1-r)*r*r*u[e]+r*r*r*c[e]}));return new g(e,"lab")}}else if(5===r.length){var i=Rn(r.slice(0,3)),l=Rn(r.slice(2,5));a=function(r){return r<.5?i(2*r):l(2*(r-.5))}}return a},Bn=function(r){var e=Rn(r);return e.scale=function(){return qn(e)},e},Cn=function(r,e,n){if(!Cn[n])throw new Error("unknown blend mode "+n);return Cn[n](r,e)},In=function(r){return function(e,n){var t=m(n).rgb(),a=m(e).rgb();return m.rgb(r(t,a))}},Dn=function(r){return function(e,n){var t=[];return t[0]=r(e[0],n[0]),t[1]=r(e[1],n[1]),t[2]=r(e[2],n[2]),t}},Yn=function(r){return r},Sn=function(r,e){return r*e/255},$n=function(r,e){return r>e?e:r},zn=function(r,e){return r>e?r:e},Tn=function(r,e){return 255*(1-(1-r/255)*(1-e/255))},Xn=function(r,e){return e<128?2*r*e/255:255*(1-2*(1-r/255)*(1-e/255))},Un=function(r,e){return 255*(1-(1-e/255)/(r/255))},Vn=function(r,e){return 255===r||(r=e/255*255/(1-r/255))>255?255:r};Cn.normal=In(Dn(Yn)),Cn.multiply=In(Dn(Sn)),Cn.screen=In(Dn(Tn)),Cn.overlay=In(Dn(Xn)),Cn.darken=In(Dn($n)),Cn.lighten=In(Dn(zn)),Cn.dodge=In(Dn(Vn)),Cn.burn=In(Dn(Un));for(var Wn=Cn,Kn=l.type,Zn=l.clip_rgb,Hn=l.TWOPI,Jn=Math.pow,Qn=Math.sin,rt=Math.cos,et=function(r,e,n,t,a){void 0===r&&(r=300),void 0===e&&(e=-1.5),void 0===n&&(n=1),void 0===t&&(t=1),void 0===a&&(a=[0,1]);var f,o=0;"array"===Kn(a)?f=a[1]-a[0]:(f=0,a=[a,a]);var u=function(u){var c=Hn*((r+120)/360+e*u),i=Jn(a[0]+f*u,t),l=(0!==o?n[0]+u*o:n)*i*(1-i)/2,h=rt(c),s=Qn(c);return m(Zn([255*(i+l*(-.14861*h+1.78277*s)),255*(i+l*(-.29227*h-.90649*s)),255*(i+l*(1.97294*h)),1]))};return u.start=function(e){return null==e?r:(r=e,u)},u.rotations=function(r){return null==r?e:(e=r,u)},u.gamma=function(r){return null==r?t:(t=r,u)},u.hue=function(r){return null==r?n:("array"===Kn(n=r)?0==(o=n[1]-n[0])&&(n=n[1]):o=0,u)},u.lightness=function(r){return null==r?a:("array"===Kn(r)?(a=r,f=r[1]-r[0]):(a=[r,r],f=0),u)},u.scale=function(){return m.scale(u)},u.hue(n),u},nt="0123456789abcdef",tt=Math.floor,at=Math.random,ft=function(){for(var r="#",e=0;e<6;e++)r+=nt.charAt(tt(16*at()));return new g(r,"hex")},ot=Math.log,ut=Math.pow,ct=Math.floor,it=Math.abs,lt=function(r,e){void 0===e&&(e=null);var n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===o(r)&&(r=Object.values(r)),r.forEach((function(r){e&&"object"===o(r)&&(r=r[e]),null==r||isNaN(r)||(n.values.push(r),n.sum+=r,rn.max&&(n.max=r),n.count+=1)})),n.domain=[n.min,n.max],n.limits=function(r,e){return ht(n,r,e)},n},ht=function(r,e,n){void 0===e&&(e="equal"),void 0===n&&(n=7),"array"==o(r)&&(r=lt(r));var t=r.min,a=r.max,f=r.values.sort((function(r,e){return r-e}));if(1===n)return[t,a];var u=[];if("c"===e.substr(0,1)&&(u.push(t),u.push(a)),"e"===e.substr(0,1)){u.push(t);for(var c=1;c 0");var i=Math.LOG10E*ot(t),l=Math.LOG10E*ot(a);u.push(t);for(var h=1;h200&&(w=!1)}for(var B={},C=0;Ct?(n+.05)/(t+.05):(t+.05)/(n+.05)},bt=Math.sqrt,pt=Math.atan2,gt=Math.abs,vt=Math.cos,mt=Math.PI,yt=function(r,e,n,t){void 0===n&&(n=1),void 0===t&&(t=1),r=new g(r),e=new g(e);for(var a=Array.from(r.lab()),f=a[0],o=a[1],u=a[2],c=Array.from(e.lab()),i=c[0],l=c[1],h=c[2],s=bt(o*o+u*u),d=bt(l*l+h*h),b=f<16?.511:.040975*f/(1+.01765*f),p=.0638*s/(1+.0131*s)+.638,v=s<1e-6?0:180*pt(u,o)/mt;v<0;)v+=360;for(;v>=360;)v-=360;var m=v>=164&&v<=345?.56+gt(.2*vt(mt*(v+168)/180)):.36+gt(.4*vt(mt*(v+35)/180)),y=s*s*s*s,w=bt(y/(y+1900)),k=p*(w*m+1-w),M=s-d,N=o-l,_=u-h,x=(f-i)/(n*b),A=M/(t*p);return bt(x*x+A*A+(N*N+_*_-M*M)/(k*k))},wt=function(r,e,n){void 0===n&&(n="lab"),r=new g(r),e=new g(e);var t=r.get(n),a=e.get(n),f=0;for(var o in t){var u=(t[o]||0)-(a[o]||0);f+=u*u}return Math.sqrt(f)},kt=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];try{return new(Function.prototype.bind.apply(g,[null].concat(r))),!0}catch(n){return!1}},Mt={cool:function(){return qn([m.hsl(180,1,.9),m.hsl(250,.7,.4)])},hot:function(){return qn(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Nt={ // sequential 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"], // diverging 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"], // qualitative 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"]},_t=0,xt=Object.keys(Nt);_t