!function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}e((function(e){"undefined"==typeof Symbol&&function(t,n){e.exports=function(t){var e=Object.defineProperty,n=Object.defineProperties,r=0,i=[],a=Array.prototype.slice,o="object"==typeof t.ES6?t.ES6:t.ES6={},u=Array.isArray,l=Object.prototype.toString,s=Array.prototype.push,c=function(){},f=function(t){return t},h=function(t){return"function"==typeof t},d=function(){},p=function(t,e){this._array=t,this._flag=e,this._nextIndex=0},g=function(t,e){this._string=t,this._flag=e,this._nextIndex=0},v=function(t){return null!==t&&("object"==typeof t||"function"==typeof t)},m=function(t,e){if("number"==typeof t.length&&0<=t.length&&"number"==typeof e.length&&0<=e.length){var n=Math.floor(t.length),r=Math.floor(e.length),i=0;for(t.length=n+r;in?n:t},e={},n=0,r=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];n255)&&(e._clipped=!0),e[n]=t(e[n],0,255)):3===n&&(e[n]=t(e[n],0,1));return e},limit:t,type:a,unpack:function(t,e){return void 0===e&&(e=null),t.length>=3?Array.prototype.slice.call(t):"object"==a(t[0])&&e?e.split("").filter((function(e){return void 0!==t[0][e]})).map((function(e){return t[0][e]})):t[0]},last:function(t){if(t.length<2)return null;var e=t.length-1;return"string"==a(t[e])?t[e].toLowerCase():null},PI:o,TWOPI:2*o,PITHIRD:o/3,DEG2RAD:o/180,RAD2DEG:180/o},l={format:{},autodetect:[]},s=u.last,c=u.clip_rgb,f=u.type,h=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=this;if("object"===f(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var i=s(e),a=!1;if(!i){a=!0,l.sorted||(l.autodetect=l.autodetect.sort((function(t,e){return e.p-t.p})),l.sorted=!0);for(var o=0,u=l.autodetect;o4?e[4]:1;return 1===o?[0,0,0,u]:[r>=1?0:255*(1-r)*(1-o),i>=1?0:255*(1-i)*(1-o),a>=1?0:255*(1-a)*(1-o),u]},_=u.unpack,x=u.type;d.prototype.cmyk=function(){return y(this._rgb)},g.cmyk=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["cmyk"])))},l.format.cmyk=w,l.autodetect.push({p:2,test:function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];if(e=_(e,"cmyk"),"array"===x(e)&&4===e.length)return"cmyk"}});var M=u.unpack,k=u.last,A=function(t){return Math.round(100*t)/100},$=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=M(e,"hsla"),i=k(e)||"lsa";return r[0]=A(r[0]||0),r[1]=A(100*r[1])+"%",r[2]=A(100*r[2])+"%","hsla"===i||r.length>3&&r[3]<1?(r[3]=r.length>3?r[3]:1,i="hsla"):r.length=3,i+"("+r.join(",")+")"},L=u.unpack,S=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=(e=L(e,"rgba"))[0],i=e[1],a=e[2];r/=255,i/=255,a/=255;var o,u,l=Math.min(r,i,a),s=Math.max(r,i,a),c=(s+l)/2;return s===l?(o=0,u=Number.NaN):o=c<.5?(s-l)/(s+l):(s-l)/(2-s-l),r==s?u=(i-a)/(s-l):i==s?u=2+(a-r)/(s-l):a==s&&(u=4+(r-i)/(s-l)),(u*=60)<0&&(u+=360),e.length>3&&void 0!==e[3]?[u,o,c,e[3]]:[u,o,c]},T=u.unpack,D=u.last,C=Math.round,N=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=T(e,"rgba"),i=D(e)||"rgb";return"hsl"==i.substr(0,3)?$(S(r),i):(r[0]=C(r[0]),r[1]=C(r[1]),r[2]=C(r[2]),("rgba"===i||r.length>3&&r[3]<1)&&(r[3]=r.length>3?r[3]:1,i="rgba"),i+"("+r.slice(0,"rgb"===i?3:4).join(",")+")")},E=u.unpack,O=Math.round,z=function(){for(var t,e=arguments,n=[],r=arguments.length;r--;)n[r]=e[r];var i,a,o,u=(n=E(n,"hsl"))[0],l=n[1],s=n[2];if(0===l)i=a=o=255*s;else{var c=[0,0,0],f=[0,0,0],h=s<.5?s*(1+l):s+l-s*l,d=2*s-h,p=u/360;c[0]=p+1/3,c[1]=p,c[2]=p-1/3;for(var g=0;g<3;g++)c[g]<0&&(c[g]+=1),c[g]>1&&(c[g]-=1),6*c[g]<1?f[g]=d+6*(h-d)*c[g]:2*c[g]<1?f[g]=h:3*c[g]<2?f[g]=d+(h-d)*(2/3-c[g])*6:f[g]=d;i=(t=[O(255*f[0]),O(255*f[1]),O(255*f[2])])[0],a=t[1],o=t[2]}return n.length>3?[i,a,o,n[3]]:[i,a,o,1]},F=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,j=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,H=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,P=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,R=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,B=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Y=Math.round,W=function(t){var e;if(t=t.toLowerCase().trim(),l.format.named)try{return l.format.named(t)}catch(t){}if(e=t.match(F)){for(var n=e.slice(1,4),r=0;r<3;r++)n[r]=+n[r];return n[3]=1,n}if(e=t.match(j)){for(var i=e.slice(1,5),a=0;a<4;a++)i[a]=+i[a];return i}if(e=t.match(H)){for(var o=e.slice(1,4),u=0;u<3;u++)o[u]=Y(2.55*o[u]);return o[3]=1,o}if(e=t.match(P)){for(var s=e.slice(1,5),c=0;c<3;c++)s[c]=Y(2.55*s[c]);return s[3]=+s[3],s}if(e=t.match(R)){var f=e.slice(1,4);f[1]*=.01,f[2]*=.01;var h=z(f);return h[3]=1,h}if(e=t.match(B)){var d=e.slice(1,4);d[1]*=.01,d[2]*=.01;var p=z(d);return p[3]=+e[4],p}};W.test=function(t){return F.test(t)||j.test(t)||H.test(t)||P.test(t)||R.test(t)||B.test(t)};var U=W,I=u.type;d.prototype.css=function(t){return N(this._rgb,t)},g.css=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["css"])))},l.format.css=U,l.autodetect.push({p:5,test:function(t){for(var e=arguments,n=[],r=arguments.length-1;r-- >0;)n[r]=e[r+1];if(!n.length&&"string"===I(t)&&U.test(t))return"css"}});var q=u.unpack;l.format.gl=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=q(e,"rgba");return r[0]*=255,r[1]*=255,r[2]*=255,r},g.gl=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["gl"])))},d.prototype.gl=function(){var t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};var G=u.unpack,X=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r,i=G(e,"rgb"),a=i[0],o=i[1],u=i[2],l=Math.min(a,o,u),s=Math.max(a,o,u),c=s-l,f=100*c/255,h=l/(255-c)*100;return 0===c?r=Number.NaN:(a===s&&(r=(o-u)/c),o===s&&(r=2+(u-a)/c),u===s&&(r=4+(a-o)/c),(r*=60)<0&&(r+=360)),[r,f,h]},V=u.unpack,K=Math.floor,Z=function(){for(var t,e,n,r,i,a,o=arguments,u=[],l=arguments.length;l--;)u[l]=o[l];var s,c,f,h=(u=V(u,"hcg"))[0],d=u[1],p=u[2];p*=255;var g=255*d;if(0===d)s=c=f=p;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var v=K(h/=60),m=h-v,y=p*(1-d),b=y+g*(1-m),w=y+g*m,_=y+g;switch(v){case 0:s=(t=[_,w,y])[0],c=t[1],f=t[2];break;case 1:s=(e=[b,_,y])[0],c=e[1],f=e[2];break;case 2:s=(n=[y,_,w])[0],c=n[1],f=n[2];break;case 3:s=(r=[y,b,_])[0],c=r[1],f=r[2];break;case 4:s=(i=[w,y,_])[0],c=i[1],f=i[2];break;case 5:s=(a=[_,y,b])[0],c=a[1],f=a[2]}}return[s,c,f,u.length>3?u[3]:1]},J=u.unpack,Q=u.type;d.prototype.hcg=function(){return X(this._rgb)},g.hcg=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["hcg"])))},l.format.hcg=Z,l.autodetect.push({p:1,test:function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];if(e=J(e,"hcg"),"array"===Q(e)&&3===e.length)return"hcg"}});var tt=u.unpack,et=u.last,nt=Math.round,rt=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=tt(e,"rgba"),i=r[0],a=r[1],o=r[2],u=r[3],l=et(e)||"auto";void 0===u&&(u=1),"auto"===l&&(l=u<1?"rgba":"rgb");var s=(i=nt(i))<<16|(a=nt(a))<<8|(o=nt(o)),c="000000"+s.toString(16);c=c.substr(c.length-6);var f="0"+nt(255*u).toString(16);switch(f=f.substr(f.length-2),l.toLowerCase()){case"rgba":return"#"+c+f;case"argb":return"#"+f+c;default:return"#"+c}},it=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,at=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,ot=function(t){if(t.match(it)){4!==t.length&&7!==t.length||(t=t.substr(1)),3===t.length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var e=parseInt(t,16);return[e>>16,e>>8&255,255&e,1]}if(t.match(at)){5!==t.length&&9!==t.length||(t=t.substr(1)),4===t.length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);var n=parseInt(t,16);return[n>>24&255,n>>16&255,n>>8&255,Math.round((255&n)/255*100)/100]}throw new Error("unknown hex color: "+t)},ut=u.type;d.prototype.hex=function(t){return rt(this._rgb,t)},g.hex=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["hex"])))},l.format.hex=ot,l.autodetect.push({p:4,test:function(t){for(var e=arguments,n=[],r=arguments.length-1;r-- >0;)n[r]=e[r+1];if(!n.length&&"string"===ut(t)&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});var lt=u.unpack,st=u.TWOPI,ct=Math.min,ft=Math.sqrt,ht=Math.acos,dt=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r,i=lt(e,"rgb"),a=i[0],o=i[1],u=i[2],l=ct(a/=255,o/=255,u/=255),s=(a+o+u)/3,c=s>0?1-l/s:0;return 0===c?r=NaN:(r=(a-o+(a-u))/2,r/=ft((a-o)*(a-o)+(a-u)*(o-u)),r=ht(r),u>o&&(r=st-r),r/=st),[360*r,c,s]},pt=u.unpack,gt=u.limit,vt=u.TWOPI,mt=u.PITHIRD,yt=Math.cos,bt=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r,i,a,o=(e=pt(e,"hsi"))[0],u=e[1],l=e[2];return isNaN(o)&&(o=0),isNaN(u)&&(u=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?i=1-((a=(1-u)/3)+(r=(1+u*yt(vt*o)/yt(mt-vt*o))/3)):o<2/3?a=1-((r=(1-u)/3)+(i=(1+u*yt(vt*(o-=1/3))/yt(mt-vt*o))/3)):r=1-((i=(1-u)/3)+(a=(1+u*yt(vt*(o-=2/3))/yt(mt-vt*o))/3)),[255*(r=gt(l*r*3)),255*(i=gt(l*i*3)),255*(a=gt(l*a*3)),e.length>3?e[3]:1]},wt=u.unpack,_t=u.type;d.prototype.hsi=function(){return dt(this._rgb)},g.hsi=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["hsi"])))},l.format.hsi=bt,l.autodetect.push({p:2,test:function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];if(e=wt(e,"hsi"),"array"===_t(e)&&3===e.length)return"hsi"}});var xt=u.unpack,Mt=u.type;d.prototype.hsl=function(){return S(this._rgb)},g.hsl=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["hsl"])))},l.format.hsl=z,l.autodetect.push({p:2,test:function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];if(e=xt(e,"hsl"),"array"===Mt(e)&&3===e.length)return"hsl"}});var kt=u.unpack,At=Math.min,$t=Math.max,Lt=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r,i,a,o=(e=kt(e,"rgb"))[0],u=e[1],l=e[2],s=At(o,u,l),c=$t(o,u,l),f=c-s;return a=c/255,0===c?(r=Number.NaN,i=0):(i=f/c,o===c&&(r=(u-l)/f),u===c&&(r=2+(l-o)/f),l===c&&(r=4+(o-u)/f),(r*=60)<0&&(r+=360)),[r,i,a]},St=u.unpack,Tt=Math.floor,Dt=function(){for(var t,e,n,r,i,a,o=arguments,u=[],l=arguments.length;l--;)u[l]=o[l];var s,c,f,h=(u=St(u,"hsv"))[0],d=u[1],p=u[2];if(p*=255,0===d)s=c=f=p;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var g=Tt(h/=60),v=h-g,m=p*(1-d),y=p*(1-d*v),b=p*(1-d*(1-v));switch(g){case 0:s=(t=[p,b,m])[0],c=t[1],f=t[2];break;case 1:s=(e=[y,p,m])[0],c=e[1],f=e[2];break;case 2:s=(n=[m,p,b])[0],c=n[1],f=n[2];break;case 3:s=(r=[m,y,p])[0],c=r[1],f=r[2];break;case 4:s=(i=[b,m,p])[0],c=i[1],f=i[2];break;case 5:s=(a=[p,m,y])[0],c=a[1],f=a[2]}}return[s,c,f,u.length>3?u[3]:1]},Ct=u.unpack,Nt=u.type;d.prototype.hsv=function(){return Lt(this._rgb)},g.hsv=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["hsv"])))},l.format.hsv=Dt,l.autodetect.push({p:2,test:function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];if(e=Ct(e,"hsv"),"array"===Nt(e)&&3===e.length)return"hsv"}});var Et=18,Ot=.95047,zt=1,Ft=1.08883,jt=.137931034,Ht=.206896552,Pt=.12841855,Rt=.008856452,Bt=u.unpack,Yt=Math.pow,Wt=function(t){return(t/=255)<=.04045?t/12.92:Yt((t+.055)/1.055,2.4)},Ut=function(t){return t>Rt?Yt(t,1/3):t/Pt+jt},It=function(t,e,n){return t=Wt(t),e=Wt(e),n=Wt(n),[Ut((.4124564*t+.3575761*e+.1804375*n)/Ot),Ut((.2126729*t+.7151522*e+.072175*n)/zt),Ut((.0193339*t+.119192*e+.9503041*n)/Ft)]},qt=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=Bt(e,"rgb"),i=r[0],a=r[1],o=r[2],u=It(i,a,o),l=u[0],s=u[1],c=u[2],f=116*s-16;return[f<0?0:f,500*(l-s),200*(s-c)]},Gt=u.unpack,Xt=Math.pow,Vt=function(t){return 255*(t<=.00304?12.92*t:1.055*Xt(t,1/2.4)-.055)},Kt=function(t){return t>Ht?t*t*t:Pt*(t-jt)},Zt=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r,i,a,o=(e=Gt(e,"lab"))[0],u=e[1],l=e[2];return i=(o+16)/116,r=isNaN(u)?i:i+u/500,a=isNaN(l)?i:i-l/200,i=zt*Kt(i),r=Ot*Kt(r),a=Ft*Kt(a),[Vt(3.2404542*r-1.5371385*i-.4985314*a),Vt(-.969266*r+1.8760108*i+.041556*a),Vt(.0556434*r-.2040259*i+1.0572252*a),e.length>3?e[3]:1]},Jt=u.unpack,Qt=u.type;d.prototype.lab=function(){return qt(this._rgb)},g.lab=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["lab"])))},l.format.lab=Zt,l.autodetect.push({p:2,test:function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];if(e=Jt(e,"lab"),"array"===Qt(e)&&3===e.length)return"lab"}});var te=u.unpack,ee=u.RAD2DEG,ne=Math.sqrt,re=Math.atan2,ie=Math.round,ae=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=te(e,"lab"),i=r[0],a=r[1],o=r[2],u=ne(a*a+o*o),l=(re(o,a)*ee+360)%360;return 0===ie(1e4*u)&&(l=Number.NaN),[i,u,l]},oe=u.unpack,ue=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=oe(e,"rgb"),i=r[0],a=r[1],o=r[2],u=qt(i,a,o),l=u[0],s=u[1],c=u[2];return ae(l,s,c)},le=u.unpack,se=u.DEG2RAD,ce=Math.sin,fe=Math.cos,he=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=le(e,"lch"),i=r[0],a=r[1],o=r[2];return isNaN(o)&&(o=0),[i,fe(o*=se)*a,ce(o)*a]},de=u.unpack,pe=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=(e=de(e,"lch"))[0],i=e[1],a=e[2],o=he(r,i,a),u=o[0],l=o[1],s=o[2],c=Zt(u,l,s),f=c[0],h=c[1],d=c[2];return[f,h,d,e.length>3?e[3]:1]},ge=u.unpack,ve=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=ge(e,"hcl").reverse();return pe.apply(void 0,r)},me=u.unpack,ye=u.type;d.prototype.lch=function(){return ue(this._rgb)},d.prototype.hcl=function(){return ue(this._rgb).reverse()},g.lch=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["lch"])))},g.hcl=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["hcl"])))},l.format.lch=pe,l.format.hcl=ve,["lch","hcl"].forEach((function(t){return l.autodetect.push({p:2,test:function(){for(var e=arguments,n=[],r=arguments.length;r--;)n[r]=e[r];if(n=me(n,t),"array"===ye(n)&&3===n.length)return t}})}));var be={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"},we=u.type;d.prototype.name=function(){for(var t=rt(this._rgb,"rgb"),e=0,n=Object.keys(be);e0;)n[r]=e[r+1];if(!n.length&&"string"===we(t)&&be[t.toLowerCase()])return"named"}});var _e=u.unpack,xe=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=_e(e,"rgb"),i=r[0],a=r[1],o=r[2];return(i<<16)+(a<<8)+o},Me=u.type,ke=function(t){if("number"==Me(t)&&t>=0&&t<=16777215)return[t>>16,t>>8&255,255&t,1];throw new Error("unknown num color: "+t)},Ae=u.type;d.prototype.num=function(){return xe(this._rgb)},g.num=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["num"])))},l.format.num=ke,l.autodetect.push({p:5,test:function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];if(1===e.length&&"number"===Ae(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var $e=u.unpack,Le=u.type,Se=Math.round;d.prototype.rgb=function(t){return void 0===t&&(t=!0),!1===t?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Se)},d.prototype.rgba=function(t){return void 0===t&&(t=!0),this._rgb.slice(0,4).map((function(e,n){return n<3?!1===t?e:Se(e):e}))},g.rgb=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["rgb"])))},l.format.rgb=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];var r=$e(e,"rgba");return void 0===r[3]&&(r[3]=1),r},l.autodetect.push({p:3,test:function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];if(e=$e(e,"rgba"),"array"===Le(e)&&(3===e.length||4===e.length&&"number"==Le(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var Te=Math.log,De=function(t){var e,n,r,i=t/100;return i<66?(e=255,n=-155.25485562709179-.44596950469579133*(n=i-2)+104.49216199393888*Te(n),r=i<20?0:.8274096064007395*(r=i-10)-254.76935184120902+115.67994401066147*Te(r)):(e=351.97690566805693+.114206453784165*(e=i-55)-40.25366309332127*Te(e),n=325.4494125711974+.07943456536662342*(n=i-50)-28.0852963507957*Te(n),r=255),[e,n,r,1]},Ce=u.unpack,Ne=Math.round,Ee=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];for(var r,i=Ce(e,"rgb"),a=i[0],o=i[2],u=1e3,l=4e4,s=.4;l-u>s;){var c=De(r=.5*(l+u));c[2]/c[0]>=o/a?l=r:u=r}return Ne(r)};d.prototype.temp=d.prototype.kelvin=d.prototype.temperature=function(){return Ee(this._rgb)},g.temp=g.kelvin=g.temperature=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];return new(Function.prototype.bind.apply(d,[null].concat(e,["temp"])))},l.format.temp=l.format.kelvin=l.format.temperature=De;var Oe=u.type;d.prototype.alpha=function(t,e){return void 0===e&&(e=!1),void 0!==t&&"number"===Oe(t)?e?(this._rgb[3]=t,this):new d([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},d.prototype.clipped=function(){return this._rgb._clipped||!1},d.prototype.darken=function(t){void 0===t&&(t=1);var e=this.lab();return e[0]-=Et*t,new d(e,"lab").alpha(this.alpha(),!0)},d.prototype.brighten=function(t){return void 0===t&&(t=1),this.darken(-t)},d.prototype.darker=d.prototype.darken,d.prototype.brighter=d.prototype.brighten,d.prototype.get=function(t){var e=t.split("."),n=e[0],r=e[1],i=this[n]();if(r){var a=n.indexOf(r);if(a>-1)return i[a];throw new Error("unknown channel "+r+" in mode "+n)}return i};var ze=u.type,Fe=Math.pow;d.prototype.luminance=function(t){if(void 0!==t&&"number"===ze(t)){if(0===t)return new d([0,0,0,this._rgb[3]],"rgb");if(1===t)return new d([255,255,255,this._rgb[3]],"rgb");var e=this.luminance(),n=20,r=function(e,i){var a=e.interpolate(i,.5,"rgb"),o=a.luminance();return Math.abs(t-o)<1e-7||!n--?a:o>t?r(e,a):r(a,i)},i=(e>t?r(new d([0,0,0]),this):r(this,new d([255,255,255]))).rgb();return new d(i.concat([this._rgb[3]]))}return je.apply(void 0,this._rgb.slice(0,3))};var je=function(t,e,n){return.2126*(t=He(t))+.7152*(e=He(e))+.0722*(n=He(n))},He=function(t){return(t/=255)<=.03928?t/12.92:Fe((t+.055)/1.055,2.4)},Pe={},Re=u.type,Be=function(t,e,n){var r=arguments;void 0===n&&(n=.5);for(var i=[],a=arguments.length-3;a-- >0;)i[a]=r[a+3];var o=i[0]||"lrgb";if(Pe[o]||i.length||(o=Object.keys(Pe)[0]),!Pe[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==Re(t)&&(t=new d(t)),"object"!==Re(e)&&(e=new d(e)),Pe[o](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};d.prototype.mix=d.prototype.interpolate=function(t,e){var n=arguments;void 0===e&&(e=.5);for(var r=[],i=arguments.length-2;i-- >0;)r[i]=n[i+2];return Be.apply(void 0,[this,t,e].concat(r))},d.prototype.premultiply=function(t){void 0===t&&(t=!1);var e=this._rgb,n=e[3];return t?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new d([e[0]*n,e[1]*n,e[2]*n,n],"rgb")},d.prototype.saturate=function(t){void 0===t&&(t=1);var e=this.lch();return e[1]+=Et*t,e[1]<0&&(e[1]=0),new d(e,"lch").alpha(this.alpha(),!0)},d.prototype.desaturate=function(t){return void 0===t&&(t=1),this.saturate(-t)};var Ye=u.type;d.prototype.set=function(t,e,n){void 0===n&&(n=!1);var r=t.split("."),i=r[0],a=r[1],o=this[i]();if(a){var u=i.indexOf(a);if(u>-1){if("string"==Ye(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"!==Ye(e))throw new Error("unsupported value for Color.set");o[u]=e}var l=new d(o,i);return n?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+a+" in mode "+i)}return o},Pe.rgb=function(t,e,n){var r=t._rgb,i=e._rgb;return new d(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};var We=Math.sqrt,Ue=Math.pow;Pe.lrgb=function(t,e,n){var r=t._rgb,i=r[0],a=r[1],o=r[2],u=e._rgb,l=u[0],s=u[1],c=u[2];return new d(We(Ue(i,2)*(1-n)+Ue(l,2)*n),We(Ue(a,2)*(1-n)+Ue(s,2)*n),We(Ue(o,2)*(1-n)+Ue(c,2)*n),"rgb")},Pe.lab=function(t,e,n){var r=t.lab(),i=e.lab();return new d(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};var Ie=function(t,e,n,r){var i,a,o,u,l,s,c,f,h,p,g,v;return"hsl"===r?(o=t.hsl(),u=e.hsl()):"hsv"===r?(o=t.hsv(),u=e.hsv()):"hcg"===r?(o=t.hcg(),u=e.hcg()):"hsi"===r?(o=t.hsi(),u=e.hsi()):"lch"!==r&&"hcl"!==r||(r="hcl",o=t.hcl(),u=e.hcl()),"h"===r.substr(0,1)&&(l=(i=o)[0],c=i[1],h=i[2],s=(a=u)[0],f=a[1],p=a[2]),isNaN(l)||isNaN(s)?isNaN(l)?isNaN(s)?v=Number.NaN:(v=s,1!=h&&0!=h||"hsv"==r||(g=f)):(v=l,1!=p&&0!=p||"hsv"==r||(g=c)):v=l+n*(s>l&&s-l>180?s-(l+360):s180?s+360-l:s-l),void 0===g&&(g=c+n*(f-c)),new d([v,g,h+n*(p-h)],r)},qe=function(t,e,n){return Ie(t,e,n,"lch")};Pe.lch=qe,Pe.hcl=qe,Pe.num=function(t,e,n){var r=t.num(),i=e.num();return new d(r+n*(i-r),"num")},Pe.hcg=function(t,e,n){return Ie(t,e,n,"hcg")},Pe.hsi=function(t,e,n){return Ie(t,e,n,"hsi")},Pe.hsl=function(t,e,n){return Ie(t,e,n,"hsl")},Pe.hsv=function(t,e,n){return Ie(t,e,n,"hsv")};var Ge=u.clip_rgb,Xe=Math.pow,Ve=Math.sqrt,Ke=Math.PI,Ze=Math.cos,Je=Math.sin,Qe=Math.atan2,tn=function(t,e){for(var n=t.length,r=[0,0,0,0],i=0;i.9999999&&(r[3]=1),new d(Ge(r))},en=u.type,nn=Math.pow,rn=function(t){var e="rgb",n=g("#ccc"),r=0,i=[0,1],a=[],o=[0,0],u=!1,l=[],s=!1,c=0,f=1,h=!1,d={},p=!0,v=1,m=function(t){if((t=t||["#fff","#000"])&&"string"===en(t)&&g.brewer&&g.brewer[t.toLowerCase()]&&(t=g.brewer[t.toLowerCase()]),"array"===en(t)){1===t.length&&(t=[t[0],t[0]]),t=t.slice(0);for(var e=0;e2?function(t){if(null!=u){for(var e=u.length-1,n=0;n=u[n];)n++;return n-1}return 0}(t)/(u.length-2):f!==c?(t-c)/(f-c):1,s=b(s),r||(s=y(s)),1!==v&&(s=nn(s,v)),s=o[0]+s*(1-o[0]-o[1]),s=Math.min(1,Math.max(0,s));var h=Math.floor(1e4*s);if(p&&d[h])i=d[h];else{if("array"===en(l))for(var m=0;m=w&&m===a.length-1){i=l[m];break}if(s>w&&s2){var s=t.map((function(e,n){return n/(t.length-1)})),h=t.map((function(t){return(t-c)/(f-c)}));h.every((function(t,e){return s[e]===t}))||(b=function(t){if(t<=0||t>=1)return t;for(var e=0;t>=h[e+1];)e++;var n=(t-h[e])/(h[e+1]-h[e]);return s[e]+n*(s[e+1]-s[e])})}}return i=[c,f],x},x.mode=function(t){return arguments.length?(e=t,_(),x):e},x.range=function(t,e){return m(t),x},x.out=function(t){return s=t,x},x.spread=function(t){return arguments.length?(r=t,x):r},x.correctLightness=function(t){return null==t&&(t=!0),h=t,_(),y=h?function(t){for(var e=w(0,!0).lab()[0],n=w(1,!0).lab()[0],r=e>n,i=w(t,!0).lab()[0],a=e+(n-e)*t,o=i-a,u=0,l=1,s=20;Math.abs(o)>.01&&s-- >0;)r&&(o*=-1),o<0?(u=t,t+=.5*(l-t)):(l=t,t+=.5*(u-t)),i=w(t,!0).lab()[0],o=i-a;return t}:function(t){return t},x},x.padding=function(t){return null!=t?("number"===en(t)&&(t=[t,t]),o=t,x):o},x.colors=function(e,n){arguments.length<2&&(n="hex");var r=[];if(0===arguments.length)r=l.slice(0);else if(1===e)r=[x(.5)];else if(e>1){var a=i[0],o=i[1]-a;r=an(0,e,!1).map((function(t){return x(a+t/(e-1)*o)}))}else{t=[];var s=[];if(u&&u.length>2)for(var c=1,f=u.length,h=1<=f;h?cf;h?c++:c--)s.push(.5*(u[c-1]+u[c]));else s=i;r=s.map((function(t){return x(t)}))}return g[n]&&(r=r.map((function(t){return t[n]()}))),r},x.cache=function(t){return null!=t?(p=t,x):p},x.gamma=function(t){return null!=t?(v=t,x):v},x.nodata=function(t){return null!=t?(n=g(t),x):n},x};function an(t,e,n){for(var r=[],i=ta;i?o++:o--)r.push(o);return r}var on=function(t){var e,n,r,i,a,o,u;if(2===(t=t.map((function(t){return new d(t)}))).length)e=t.map((function(t){return t.lab()})),a=e[0],o=e[1],i=function(t){var e=[0,1,2].map((function(e){return a[e]+t*(o[e]-a[e])}));return new d(e,"lab")};else if(3===t.length)n=t.map((function(t){return t.lab()})),a=n[0],o=n[1],u=n[2],i=function(t){var e=[0,1,2].map((function(e){return(1-t)*(1-t)*a[e]+2*(1-t)*t*o[e]+t*t*u[e]}));return new d(e,"lab")};else if(4===t.length){var l;r=t.map((function(t){return t.lab()})),a=r[0],o=r[1],u=r[2],l=r[3],i=function(t){var e=[0,1,2].map((function(e){return(1-t)*(1-t)*(1-t)*a[e]+3*(1-t)*(1-t)*t*o[e]+3*(1-t)*t*t*u[e]+t*t*t*l[e]}));return new d(e,"lab")}}else if(5===t.length){var s=on(t.slice(0,3)),c=on(t.slice(2,5));i=function(t){return t<.5?s(2*t):c(2*(t-.5))}}return i},un=function(t,e,n){if(!un[n])throw new Error("unknown blend mode "+n);return un[n](t,e)},ln=function(t){return function(e,n){var r=g(n).rgb(),i=g(e).rgb();return g.rgb(t(r,i))}},sn=function(t){return function(e,n){var r=[];return r[0]=t(e[0],n[0]),r[1]=t(e[1],n[1]),r[2]=t(e[2],n[2]),r}};un.normal=ln(sn((function(t){return t}))),un.multiply=ln(sn((function(t,e){return t*e/255}))),un.screen=ln(sn((function(t,e){return 255*(1-(1-t/255)*(1-e/255))}))),un.overlay=ln(sn((function(t,e){return e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255))}))),un.darken=ln(sn((function(t,e){return t>e?e:t}))),un.lighten=ln(sn((function(t,e){return t>e?t:e}))),un.dodge=ln(sn((function(t,e){return 255===t||(t=e/255*255/(1-t/255))>255?255:t}))),un.burn=ln(sn((function(t,e){return 255*(1-(1-e/255)/(t/255))})));for(var cn=un,fn=u.type,hn=u.clip_rgb,dn=u.TWOPI,pn=Math.pow,gn=Math.sin,vn=Math.cos,mn=Math.floor,yn=Math.random,bn=Math.log,wn=Math.pow,_n=Math.floor,xn=Math.abs,Mn=function(t,e){void 0===e&&(e=null);var n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===a(t)&&(t=Object.values(t)),t.forEach((function(t){e&&"object"===a(t)&&(t=t[e]),null==t||isNaN(t)||(n.values.push(t),n.sum+=t,tn.max&&(n.max=t),n.count+=1)})),n.domain=[n.min,n.max],n.limits=function(t,e){return kn(n,t,e)},n},kn=function(t,e,n){void 0===e&&(e="equal"),void 0===n&&(n=7),"array"==a(t)&&(t=Mn(t));var r=t.min,i=t.max,o=t.values.sort((function(t,e){return t-e}));if(1===n)return[r,i];var u=[];if("c"===e.substr(0,1)&&(u.push(r),u.push(i)),"e"===e.substr(0,1)){u.push(r);for(var l=1;l 0");var s=Math.LOG10E*bn(r),c=Math.LOG10E*bn(i);u.push(r);for(var f=1;f200&&(w=!1)}for(var F={},j=0;j=360;)g-=360;o[p]=g}else o[p]=o[p]/u[p];return h/=r,new d(o,e).alpha(h>.99999?1:h,!0)},g.bezier=function(t){var e=on(t);return e.scale=function(){return rn(e)},e},g.blend=cn,g.cubehelix=function(t,e,n,r,i){void 0===t&&(t=300),void 0===e&&(e=-1.5),void 0===n&&(n=1),void 0===r&&(r=1),void 0===i&&(i=[0,1]);var a,o=0;"array"===fn(i)?a=i[1]-i[0]:(a=0,i=[i,i]);var u=function(u){var l=dn*((t+120)/360+e*u),s=pn(i[0]+a*u,r),c=(0!==o?n[0]+u*o:n)*s*(1-s)/2,f=vn(l),h=gn(l);return g(hn([255*(s+c*(-.14861*f+1.78277*h)),255*(s+c*(-.29227*f-.90649*h)),255*(s+c*(1.97294*f)),1]))};return u.start=function(e){return null==e?t:(t=e,u)},u.rotations=function(t){return null==t?e:(e=t,u)},u.gamma=function(t){return null==t?r:(r=t,u)},u.hue=function(t){return null==t?n:("array"===fn(n=t)?0==(o=n[1]-n[0])&&(n=n[1]):o=0,u)},u.lightness=function(t){return null==t?i:("array"===fn(t)?(i=t,a=t[1]-t[0]):(i=[t,t],a=0),u)},u.scale=function(){return g.scale(u)},u.hue(n),u},g.mix=g.interpolate=Be,g.random=function(){for(var t="#",e=0;e<6;e++)t+="0123456789abcdef".charAt(mn(16*yn()));return new d(t,"hex")},g.scale=rn,g.analyze=An.analyze,g.contrast=function(t,e){t=new d(t),e=new d(e);var n=t.luminance(),r=e.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},g.deltaE=function(t,e,n,r){void 0===n&&(n=1),void 0===r&&(r=1),t=new d(t),e=new d(e);for(var i=Array.from(t.lab()),a=i[0],o=i[1],u=i[2],l=Array.from(e.lab()),s=l[0],c=l[1],f=l[2],h=$n(o*o+u*u),p=$n(c*c+f*f),g=a<16?.511:.040975*a/(1+.01765*a),v=.0638*h/(1+.0131*h)+.638,m=h<1e-6?0:180*Ln(u,o)/Dn;m<0;)m+=360;for(;m>=360;)m-=360;var y=m>=164&&m<=345?.56+Sn(.2*Tn(Dn*(m+168)/180)):.36+Sn(.4*Tn(Dn*(m+35)/180)),b=h*h*h*h,w=$n(b/(b+1900)),_=v*(w*y+1-w),x=h-p,M=o-c,k=u-f,A=(a-s)/(n*g),$=x/(r*v);return $n(A*A+$*$+(M*M+k*k-x*x)/(_*_))},g.distance=function(t,e,n){void 0===n&&(n="lab"),t=new d(t),e=new d(e);var r=t.get(n),i=e.get(n),a=0;for(var o in r){var u=(r[o]||0)-(i[o]||0);a+=u*u}return Math.sqrt(a)},g.limits=An.limits,g.valid=function(){for(var t=arguments,e=[],n=arguments.length;n--;)e[n]=t[n];try{return new(Function.prototype.bind.apply(d,[null].concat(e))),!0}catch(t){return!1}},g.scales=Cn,g.colors=be,g.brewer=Fn,g}()})),r="http://www.w3.org/1999/xhtml",i={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function a(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),i.hasOwnProperty(e)?{space:i[e],local:t}:t}function o(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===r&&e.documentElement.namespaceURI===r?e.createElement(t):e.createElementNS(n,t)}}function u(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function l(t){var e=a(t);return(e.local?u:o)(e)}function s(){}function c(t){return null==t?s:function(){return this.querySelector(t)}}function f(){return[]}function h(t){return null==t?f:function(){return this.querySelectorAll(t)}}function d(t){return function(){return this.matches(t)}}function p(t){return new Array(t.length)}function g(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}g.prototype={constructor:g,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function v(t,e,n,r,i,a){for(var o,u=0,l=e.length,s=a.length;ue?1:t>=e?0:NaN}function b(t){return function(){this.removeAttribute(t)}}function w(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _(t,e){return function(){this.setAttribute(t,e)}}function x(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function M(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function k(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function A(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function $(t){return function(){this.style.removeProperty(t)}}function L(t,e,n){return function(){this.style.setProperty(t,e,n)}}function S(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function T(t,e){return t.style.getPropertyValue(e)||A(t).getComputedStyle(t,null).getPropertyValue(e)}function D(t){return function(){delete this[t]}}function C(t,e){return function(){this[t]=e}}function N(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function E(t){return t.trim().split(/^|\s+/)}function O(t){return t.classList||new z(t)}function z(t){this._node=t,this._names=E(t.getAttribute("class")||"")}function F(t,e){for(var n=O(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Q={},tt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(Q={mouseenter:"mouseover",mouseleave:"mouseout"}));function et(t,e,n){return t=nt(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function nt(t,e,n){return function(r){var i=tt;tt=r;try{t.call(this,this.__data__,e,n)}finally{tt=i}}}function rt(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function it(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r=M&&(M=x+1);!(_=b[M])&&++M=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=y);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==e?$:"function"==typeof e?S:L)(t,e,null==n?"":n)):T(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?D:"function"==typeof e?N:C)(t,e)):this.node()[t]},classed:function(t,e){var n=E(t+"");if(arguments.length<2){for(var r=O(this.node()),i=-1,a=n.length;++i-1)&&(t.push(this.parentNode),!0)})).select((function(){return this.parentNode}))},ft.prototype.selectAppend=function(t){var e,n=c(t),r=pt(t);for(var i in t=l(r.tag),e=this.select((function(){return n.apply(this,arguments)||this.appendChild(t.apply(this,arguments))})),r.attr)e.attr(i,r.attr[i]);return e},ft.prototype.tspans=function(t,e){return this.selectAll("tspan").data((function(e,n){return("function"==typeof t?t.call(this,e,n):t).map((function(t){return{line:t,parent:e}}))})).enter().append("tspan").text((function(t){return t.line})).attr("x",0).attr("dy",(function(t,n){return n?("function"==typeof e?e.call(this,t.parent,t.line,n):e)||15:0}))},ft.prototype.appendMany=function(t,e){if("string"==typeof e){console.warn("DEPRECATED: jetpack's appendMany order of arguments has changed. It's appendMany('div', data) from now on");var n=e;e=t,t=n}return this.selectAll(null).data(e).enter().append(t)},ft.prototype.at=function(t,e){if("object"==typeof t){for(var n in t)this.attr(vt.test(n)?n:n.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),t[n]);return this}return 1==arguments.length?this.attr(t):this.attr(t,e)},ft.prototype.st=function(t,e){if("object"==typeof t){for(var n in t)r(this,n,t[n]);return this}return 1==arguments.length?this.style(t):r(this,t,e);function r(t,e,n){e=e.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase();return~"top left bottom right padding-top padding-left padding-bottom padding-right border-top b-width border-left-width border-botto-width m border-right-width margin-top margin-left margin-bottom margin-right font-size width stroke-width line-height margin padding border border-radius max-width min-width max-height min-height".indexOf(e)?t.style(e,"function"==typeof n?a(n):i(n)):t.style(e,n),t}function i(t){return t.match?t:t+"px"}function a(t){return function(){var e=t.apply(this,arguments);return i(e)}}},ft.prototype.prop=ft.prototype.property;var xt="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},Mt=Array.prototype,kt=Object.prototype,At=Mt.slice,$t=kt.toString,Lt=kt.hasOwnProperty,St=Array.isArray,Tt=Object.keys,Dt=isNaN,Ct=!{toString:null}.propertyIsEnumerable("toString"),Nt=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Et=Math.pow(2,53)-1;function Ot(t){var e="[object "+t+"]";return function(t){return $t.call(t)===e}}var zt=St||Ot("Array");function Ft(t){return t instanceof Ft?t:this instanceof Ft?void(this._wrapped=t):new Ft(t)}function jt(t){return t}Ft.VERSION="1.12.1",Ft.prototype.value=function(){return this._wrapped},Ft.prototype.valueOf=Ft.prototype.toJSON=Ft.prototype.value,Ft.prototype.toString=function(){return String(this._wrapped)};var Ht=Ot("Function"),Pt=xt.document&&xt.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof Pt&&(Ht=function(t){return"function"==typeof t||!1});var Rt=Ht;function Bt(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function Yt(t,e){return null!=t&&Lt.call(t,e)}function Wt(t){if(!Bt(t))return[];if(Tt)return Tt(t);var e=[];for(var n in t)Yt(t,n)&&e.push(n);return Ct&&function(t,e){e=function(t){for(var e={},n=t.length,r=0;r=0&&e<=Et});var ne,re=(ne=1,function(t,e,n){e=Zt(e,n);for(var r=Qt(t),i=ne>0?0:r-1;i>=0&&i0?o=a>=0?a:Math.max(a+u,o):u=a>=0?Math.min(a+1,u):a+u+1;else if(n&&a&&u)return r[a=n(r,i)]===i?a:-1;if(i!=i)return(a=e(At.call(r,o,u),ae))>=0?a+o:-1;for(a=t>0?o:u-1;a>=0&&a=0}function le(t,e,n,r){var i;!0!==(i=e)&&!1!==i&&"[object Boolean]"!==$t.call(i)&&(r=n,n=e,e=!1),null!=n&&(n=Zt(n,r));for(var a=[],o=[],u=0,l=Qt(t);u=1e12&&!a||"t"===a?(v+=d.abbreviations.trillion,e/=1e12):u<1e12&&u>=1e9&&!a||"b"===a?(v+=d.abbreviations.billion,e/=1e9):u<1e9&&u>=1e6&&!a||"m"===a?(v+=d.abbreviations.million,e/=1e6):(u<1e6&&u>=1e3&&!a||"k"===a)&&(v+=d.abbreviations.thousand,e/=1e3)),t._.includes(n,"[.]")&&(g=!0,n=n.replace("[.]",".")),l=e.toString().split(".")[0],s=n.split(".")[1],f=n.indexOf(","),i=(n.split(".")[0].split(",")[0].match(/0/g)||[]).length,s?(t._.includes(s,"[")?(s=(s=s.replace("]","")).split("["),m=t._.toFixed(e,s[0].length+s[1].length,r,s[1].length)):m=t._.toFixed(e,s.length,r),l=m.split(".")[0],m=t._.includes(m,".")?d.delimiters.decimal+m.split(".")[1]:"",g&&0===Number(m.slice(1))&&(m="")):l=t._.toFixed(e,0,r),v&&!a&&Number(l)>=1e3&&v!==d.abbreviations.trillion)switch(l=String(Number(l)/1e3),v){case d.abbreviations.thousand:v=d.abbreviations.million;break;case d.abbreviations.million:v=d.abbreviations.billion;break;case d.abbreviations.billion:v=d.abbreviations.trillion}if(t._.includes(l,"-")&&(l=l.slice(1),y=!0),l.length0;b--)l="0"+l;return f>-1&&(l=l.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+d.delimiters.thousands)),0===n.indexOf(".")&&(l=""),h=l+m+(v||""),p?h=(p&&y?"(":"")+h+(p&&y?")":""):c>=0?h=0===c?(y?"-":"+")+h:h+(y?"-":"+"):y&&(h="-"+h),h},stringToNumber:function(t){var e,n,r,i=o[l.currentLocale],a=t,u={thousand:3,million:6,billion:9,trillion:12};if(l.zeroFormat&&t===l.zeroFormat)n=0;else if(l.nullFormat&&t===l.nullFormat||!t.replace(/[^0-9]+/g,"").length)n=null;else{for(e in n=1,"."!==i.delimiters.decimal&&(t=t.replace(/\./g,"").replace(i.delimiters.decimal,".")),u)if(r=new RegExp("[^a-zA-Z]"+i.abbreviations[e]+"(?:\\)|(\\"+i.currency.symbol+")?(?:\\))?)?$"),a.match(r)){n*=Math.pow(10,u[e]);break}n*=(t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1,t=t.replace(/[^0-9\.]+/g,""),n*=Number(t)}return n},isNaN:function(t){return"number"==typeof t&&isNaN(t)},includes:function(t,e){return-1!==t.indexOf(e)},insert:function(t,e,n){return t.slice(0,n)+e+t.slice(n)},reduce:function(t,e){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,r=Object(t),i=r.length>>>0,a=0;if(3===arguments.length)n=arguments[2];else{for(;a=i)throw new TypeError("Reduce of empty array with no initial value");n=r[a++]}for(;ar?t:r}),1)},toFixed:function(t,e,n,r){var i,a,o,u,l=t.toString().split("."),s=e-(r||0);return i=2===l.length?Math.min(Math.max(l[1].length,s),e):s,o=Math.pow(10,i),u=(n(t+"e+"+i)/o).toFixed(i),r>e-i&&(a=new RegExp("\\.?0{1,"+(r-(e-i))+"}$"),u=u.replace(a,"")),u}},t.options=l,t.formats=a,t.locales=o,t.locale=function(t){return t&&(l.currentLocale=t.toLowerCase()),l.currentLocale},t.localeData=function(t){if(!t)return o[l.currentLocale];if(t=t.toLowerCase(),!o[t])throw new Error("Unknown locale : "+t);return o[t]},t.reset=function(){for(var t in u)l[t]=u[t]},t.zeroFormat=function(t){l.zeroFormat="string"==typeof t?t:null},t.nullFormat=function(t){l.nullFormat="string"==typeof t?t:null},t.defaultFormat=function(t){l.defaultFormat="string"==typeof t?t:"0.0"},t.register=function(t,e,n){if(e=e.toLowerCase(),this[t+"s"][e])throw new TypeError(e+" "+t+" already registered.");return this[t+"s"][e]=n,n},t.validate=function(e,n){var r,i,a,o,u,l,s,c;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),(e=e.trim()).match(/^\d+$/))return!0;if(""===e)return!1;try{s=t.localeData(n)}catch(e){s=t.localeData(t.locale())}return a=s.currency.symbol,u=s.abbreviations,r=s.delimiters.decimal,i="."===s.delimiters.thousands?"\\.":s.delimiters.thousands,(null===(c=e.match(/^[^\d]+/))||(e=e.substr(1),c[0]===a))&&((null===(c=e.match(/[^\d]+$/))||(e=e.slice(0,-1),c[0]===u.thousand||c[0]===u.million||c[0]===u.billion||c[0]===u.trillion))&&(l=new RegExp(i+"{2}"),!e.match(/[^\d.,]/g)&&(!((o=e.split(r)).length>2)&&(o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(l):1===o[0].length?!!o[0].match(/^\d+$/)&&!o[0].match(l)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(l)&&!!o[1].match(/^\d+$/)))))},t.fn=s.prototype={clone:function(){return t(this)},format:function(e,n){var r,i,o,u=this._value,s=e||l.defaultFormat;if(n=n||Math.round,0===u&&null!==l.zeroFormat)i=l.zeroFormat;else if(null===u&&null!==l.nullFormat)i=l.nullFormat;else{for(r in a)if(s.match(a[r].regexps.format)){o=a[r].format;break}i=(o=o||t._.numberToFormat)(u,s,n)}return i},value:function(){return this._value},input:function(){return this._input},set:function(t){return this._value=Number(t),this},add:function(t){var n=e.correctionFactor.call(null,this._value,t);return this._value=e.reduce([this._value,t],(function(t,e,r,i){return t+Math.round(n*e)}),0)/n,this},subtract:function(t){var n=e.correctionFactor.call(null,this._value,t);return this._value=e.reduce([t],(function(t,e,r,i){return t-Math.round(n*e)}),Math.round(this._value*n))/n,this},multiply:function(t){return this._value=e.reduce([this._value,t],(function(t,n,r,i){var a=e.correctionFactor(t,n);return Math.round(t*a)*Math.round(n*a)/Math.round(a*a)}),1),this},divide:function(t){return this._value=e.reduce([this._value,t],(function(t,n,r,i){var a=e.correctionFactor(t,n);return Math.round(t*a)/Math.round(n*a)})),this},difference:function(e){return Math.abs(t(this._value).subtract(e).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){var e=t%10;return 1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th"},currency:{symbol:"$"}}),t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(e,n,r){var i,a=t._.includes(n," BPS")?" ":"";return e*=1e4,n=n.replace(/\s?BPS/,""),i=t._.numberToFormat(e,n,r),t._.includes(i,")")?((i=i.split("")).splice(-1,0,a+"BPS"),i=i.join("")):i=i+a+"BPS",i},unformat:function(e){return+(1e-4*t._.stringToNumber(e)).toFixed(15)}}),r={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},i="("+(i=(n={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}).suffixes.concat(r.suffixes.filter((function(t){return n.suffixes.indexOf(t)<0}))).join("|")).replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(i)},format:function(e,i,a){var o,u,l,s=t._.includes(i,"ib")?r:n,c=t._.includes(i," b")||t._.includes(i," ib")?" ":"";for(i=i.replace(/\s?i?b/,""),o=0;o<=s.suffixes.length;o++)if(u=Math.pow(s.base,o),l=Math.pow(s.base,o+1),null===e||0===e||e>=u&&e0&&(e/=u);break}return t._.numberToFormat(e,i,a)+c},unformat:function(e){var i,a,o=t._.stringToNumber(e);if(o){for(i=n.suffixes.length-1;i>=0;i--){if(t._.includes(e,n.suffixes[i])){a=Math.pow(n.base,i);break}if(t._.includes(e,r.suffixes[i])){a=Math.pow(r.base,i);break}}o*=a||1}return o}}),t.register("format","currency",{regexps:{format:/(\$)/},format:function(e,n,r){var i,a,o=t.locales[t.options.currentLocale],u={before:n.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:n.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(n=n.replace(/\s?\$\s?/,""),i=t._.numberToFormat(e,n,r),e>=0?(u.before=u.before.replace(/[\-\(]/,""),u.after=u.after.replace(/[\-\)]/,"")):e<0&&!t._.includes(u.before,"-")&&!t._.includes(u.before,"(")&&(u.before="-"+u.before),a=0;a=0;a--)switch(u.after[a]){case"$":i=a===u.after.length-1?i+o.currency.symbol:t._.insert(i,o.currency.symbol,-(u.after.length-(1+a)));break;case" ":i=a===u.after.length-1?i+" ":t._.insert(i," ",-(u.after.length-(1+a)+o.currency.symbol.length-1))}return i}}),t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(e,n,r){var i=("number"!=typeof e||t._.isNaN(e)?"0e+0":e.toExponential()).split("e");return n=n.replace(/e[\+|\-]{1}0/,""),t._.numberToFormat(Number(i[0]),n,r)+"e"+i[1]},unformat:function(e){var n=t._.includes(e,"e+")?e.split("e+"):e.split("e-"),r=Number(n[0]),i=Number(n[1]);return i=t._.includes(e,"e-")?i*=-1:i,t._.reduce([r,Math.pow(10,i)],(function(e,n,r,i){var a=t._.correctionFactor(e,n);return e*a*(n*a)/(a*a)}),1)}}),t.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,n,r){var i=t.locales[t.options.currentLocale],a=t._.includes(n," o")?" ":"";return n=n.replace(/\s?o/,""),a+=i.ordinal(e),t._.numberToFormat(e,n,r)+a}}),t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,n,r){var i,a=t._.includes(n," %")?" ":"";return t.options.scalePercentBy100&&(e*=100),n=n.replace(/\s?\%/,""),i=t._.numberToFormat(e,n,r),t._.includes(i,")")?((i=i.split("")).splice(-1,0,a+"%"),i=i.join("")):i=i+a+"%",i},unformat:function(e){var n=t._.stringToNumber(e);return t.options.scalePercentBy100?.01*n:n}}),t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(t,e,n){var r=Math.floor(t/60/60),i=Math.floor((t-60*r*60)/60),a=Math.round(t-60*r*60-60*i);return r+":"+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)},unformat:function(t){var e=t.split(":"),n=0;return 3===e.length?(n+=60*Number(e[0])*60,n+=60*Number(e[1]),n+=Number(e[2])):2===e.length&&(n+=60*Number(e[0]),n+=Number(e[1])),Number(n)}}),t}))}));var xe=new Set(["฿","₿","¢","$","€","eur","£","gbp","¥","yen","usd","cad","us$","ca$","can$"]),Me=Math.sqrt(50),ke=Math.sqrt(10),Ae=Math.sqrt(2);function $e(t,e,n){var r,i,a,o,u=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e=0?(a>=Me?10:a>=ke?5:a>=Ae?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=Me?10:a>=ke?5:a>=Ae?2:1)}(t,e,n))||!isFinite(o))return[];if(o>0){var l=Math.round(t/o),s=Math.round(e/o);for(l*oe&&--s,a=new Array(i=s-l+1);++ue&&--f,a=new Array(i=f-c+1);++u=e?t:""+Array(e+1-r.length).join(n)+t},p={s:d,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+d(r,2,"0")+":"+d(i,2,"0")},m:function t(e,n){if(e.date()25){var a=i(this).startOf(e).add(1,e).date(r),o=i(this).endOf(t);if(a.isBefore(o))return 1}var u=i(this).startOf(e).date(r).startOf(t).subtract(1,"millisecond"),l=this.diff(u,t,!0);return l<0?i(this).startOf("week").week():Math.ceil(l)},a.weeks=function(t){return void 0===t&&(t=null),this.week(t)}}}()}));function Oe(t){var e=_t(t,"ticks.major",{}),n=_t(t,"ticks.minor",{}),r=e.values,i=t.scale.domain(),a=t.scale.range();r&&r.length||(r=function(t,e,n,r){var i=Math.round(r);switch(t){case"text":var a=e.domain(),o=Math.max(1,Math.round(a.length/r));return a.filter((function(t,e){return e%o==0}));case"log":var u=function(t,e){void 0===e&&(e=6);var n=t[0]<0&&t[1]<0;n&&(t=[-1*t[0],-1*t[1]]);var r=t[1]e)for(;a[0].num>e;)a=Fe(t,i*=10);else if(a[a.length-1].num=t[0]&&e<=t[1]}))})})).map((function(t){return Object.assign({},t,{diff:Math.abs(t.ticks.length-e)})})).sort((function(t,e){return t.diff-e.diff}))[0].ticks;r&&u.reverse();if(n)return u.map((function(t){return-1*t}));return u}(n,i);return u.length>1?u:e.ticks(i);default:return e.ticks(i)}}(t.scaleType,t.scale,i,Math.abs(a[1]-a[0])/(e.spacing||80)),"number"!==t.scaleType&&"log"!==t.scaleType||"0o"!==t.tickLabelFormat||(r=r.filter((function(t){return t%1==0})))),"text"!==t.scaleType&&(r=r.filter("date"===t.scaleType?function(t){return t.getTime()>=Math.min(i[0].getTime(),i[1].getTime())&&t.getTime()<=Math.max(i[0].getTime(),i[1].getTime())}:function(t){return t>=Math.min(i[0],i[1])&&t<=Math.max(i[0],i[1])}));var o=!!zt(n.values)&&n.values;if(!o&&n.count){o=[];for(var u=function(t){var e=Math.min(r[t],r[t+1]),i=Math.max(r[t],r[t+1]),a=$e(e,i,n.count).filter((function(t){return t>e&&t5&&t.line&&je.test(t.line)&&(this.innerHTML=t.line.substr(0,3)+"…")})),t=this.getBoundingClientRect(),e(r,t)?ht(this).style("display","none"):t.width>0&&t.height>0&&(r=t)):ht(this).style("display","none"):t.width>0&&t.height>0&&(r=t)}t.each((function(t,e){var n;n={measure:this.getBoundingClientRect.bind(this),update:i.bind(this)},Le.push(n),Se||(Se=!0,requestAnimationFrame(Te))}))}function Pe(t,e,n,r){var i,a,o=t.scale,u=t.scaleType,l=t.tickLabelFormat,s=t.tickLabelUnit,c=t.tickLabelMultiply,f=t.minusChar;if(void 0===e&&(e=[]),void 0===r&&(r=!1),l&&"auto"!==l||("date"===u?l=Be(o.domain(),e):"number"!==u&&"log"!==u||(i=o.domain(),a=Math.abs(i[1]-i[0]),l=a<1?"0,0.00[0]":a<3?"0,0.0[0]":a<1e4?"0,0.[0]":a>1e6||Math.abs(i[0])>1e5||Math.abs(i[1])>1e5?"0,0a":"0,0")),"number"===u||"log"===u){var h=_t(n,"tickLabels.units","all");return{multiFormat:!1,tickFormat:function(t,e,n){var i=r||"all"===h||"first"===h&&e||"last"===h&&n;return function(t,e){var n=(e=Object.assign({},{format:"0.[00]",prepend:"",append:"",minusChar:"−",multiply:1},e)).format,r=e.append,i=e.prepend,a=e.minusChar,o=e.multiply;n.includes("%")&&Number.isFinite(t)&&(t*=.01),t*=o;var u=n.indexOf("(")>-1,l=_e(u?t:Math.abs(t)).format(n);return i&&!u&&t<0&&xe.has(i.trim().toLowerCase())?""+a+i+l.replace("+","")+r:i&&t>=0&&xe.has(i.trim().toLowerCase())&&n.includes("+")?(0===t?"±":"+")+i+l.replace("+","")+r:0===t&&n.includes("+")?""+i+l.replace("+","±")+r:t<0&&!u?""+i+a+l.replace("+","")+r:""+i+l+r}(t,{multiply:c,format:i?l:l.replace(/[%$]/g,""),prepend:i?s[0]:"",append:i?s[1]:"",minusChar:f})}}}if("date"===u){var d;if(r&&(l=l.replace(/\w+/g,(function(t){return Re[t]||t}))),l.indexOf("~~")>-1){var p=l.split("~~");d=function(t){return De(t).format(p[0])},l=p[1]}var g=l.split("|"),v=g.length>1,m=v?function(t,e){var n=new Array(t.length);return t=t.filter((function(t,n){return!n||le(e.map(t)).length>1})),function(e){for(var r,i=[],a=0,o=t.length;a|)/i)}}}var Re={YY:"YYYY",M:"MMMM",MM:"MMMM",MMM:"MMMM",DD:"D",dd:"dddd",ddd:"dddd"};function Be(t,e){var n=Math.abs(t[1].getTime()-t[0].getTime()),r=e&&e.length>0,i=r,a=r,o=r,u=r,l=r,s=r;return r&&e.forEach((function(t){i=i&&0===t.getMonth()&&1===t.getDate()&&0===t.getHours()&&0===t.getMinutes(),a=a&&Ie.has(t.getMonth())&&1===t.getDate()&&0===t.getHours()&&0===t.getMinutes(),o=o&&1===t.getDate()&&0===t.getHours()&&0===t.getMinutes(),u=u&&0===t.getDay()&&0===t.getHours()&&0===t.getMinutes(),l=l&&0===t.getHours()&&0===t.getMinutes(),s=s&&0===t.getMinutes()})),i?"YYYY":a||o?n>5*Ue?"YY|MMM":"YYYY|MMM":u?n>2*We?"MMM|D":"MMMM|D":l?n>Ue?"MMM YYYY|D":n>We?"MMM|D":"D.M.":s?nl[s]&&(l[s]=e.height),e&&e.left>l.left&&(l.left=e.left),e&&e.right>l.right&&(l.right=e.right)})),l}function tn(t){var e=t.options,n=t.themeOpts,r=t.ticksMajor,i=e.tickPosition,a=e.plotSize,o=e.scale,u=e.tickLines,l=e.aboveChart,s=e.belowChart,c=e.className,f=(_t(n,"tickLines.aboveChart")?l:s).selectAppend("g.x-tick-lines"+(c?"."+c:"")).html("").translate("bottom"===i?[0,a[1]]:[0,0]);if(!u)return f.remove();f.node().classList.add(Xe(n,e.emotion)),f.selectAll("line").remove();var h="bottom"===i?1:-1,d=_t(n,"tickLines.distance"),p=_t(n,"tickLines.length"),g=_t(n,"tickLines.strokeLinecap"),v=_t(n,"tickLines.width");return f.appendMany("line.x-tick-line",r).translate((function(t){return[o(t),d*h]})).classed("is-zero",(function(t){return 0===t})).attr("y1",(function(t){return p*h})),{left:.5*v,right:.5*v,height:d+p+("square"===g||"round"===g?.5*v:0)}}function en(t){var e=t.options,n=t.themeOpts,r=t.ticksMajor,i=e.tickPosition,a=e.plotSize,o=e.scale,u=e.tickLines,l=e.tickLabels,s=e.aboveChart,c=e.belowChart,f=e.className,h=e.theme,d=(_t(n,"tickLabels.aboveChart")?s:c).selectAppend("g.x-tick-labels"+(f?"."+f:"")).html("");if(!l)return d.remove();d.node().classList.add(function(t,e){var n=t.tickLabels;return(0,e.css)("\n text {\n text-anchor: middle;\n }\n "+(n.hideZero?"text.is-zero { display: none }":"")+"\n text tspan {\n "+Ze(n)+"\n }\n")}(n,e.emotion)),d.selectAll("text").remove();var p=(u?_t(n,"tickLines.distance")+_t(n,"tickLines.length"):0)+_t(n,"tickLabels.distance");d.translate("bottom"===i?[0,a[1]+p]:[0,-p-3]);var g=_t(n,"tickLabels.fontSize",_t(h,"typography.chart.fontSize",12)),v=Pe(e,r=r.sort((function(t,e){return o(t)-o(e)})),n),m=v.tickFormat,y=v.multiFormat,b=v.keepOrder;qe(d,"x",e,n,r),He(d.appendMany("text.x-tick-label."+i,r).translate((function(t){return[o(t),"bottom"===i?g:0]})).attr("y",0).attr("aria-hidden","true").classed("dw-bold","bold"===_t(n,"tickLabels.fontWeight")).classed("dw-italic","italic"===_t(n,"tickLabels.fontStyle")).classed("is-zero",(function(t){return 0===t})).tspans((function(t,e){var n=0===e,a=e===r.length-1,o=y?m(t,n,a):[m(t,n,a)];return b||"top"!==i||o.reverse(),o}),g+3).parent().attr("y",(function(t,e,n){var r=ht(n[0]).selectAll("tspan").size();return"top"===i?(r-1)*(g+3)*-1:0})),(function(t,e){return t.x+t.width+4>e.x}),!0);var w=d.node().getBBox(),_=Math.max(-1*w.x,0);return{left:_,right:w.width+(_>0?0:w.x)-e.plotSize[0]-_,height:d.node().getBoundingClientRect().height+p+_t(n,"tickLabels.extraSpace",1)}}function nn(t){var e=t.options,n=t.themeOpts,r=t.ticksMajor,i=t.ticksMinor,a=e.plotSize,o=e.scale,u=e.baseLine,l=e.gridLines,s=e.aboveChart,c=e.belowChart,f=e.className,h=(_t(n,"gridLines.aboveChart")?s:c).selectAppend("g.x-grid-lines"+(f?"."+f:"")).html("");if(!l)return h.remove();h.node().classList.add(Ge(n,e.emotion)),h.selectAll("line").remove(),i.length&&h.appendMany("line.x-grid-line.minor",i).translate((function(t){return[o(t),0]})).attr("y1",a[1]),r.length&&h.appendMany("line.x-grid-line.major",r.filter((function(t){return!u.includes("zero")||0!==t}))).translate((function(t){return[o(t),0]})).attr("y1",a[1])}function rn(t){var e=t.options,n=t.themeOpts,r=t.ticksMajor,i=e.plotSize,a=e.scale,o=e.scaleType,u=e.aboveChart,l=e.belowChart,s=e.baseLine,c=e.className,f=(_t(n,"baseLine.aboveChart")?u:l).selectAppend("g.x-base-lines"+(c?"."+c:"")).html("");f.node().classList.add(Ve(n,e.emotion)),f.selectAll("line").remove();var h=!1;if(["number","log"].includes(o)&&s.includes("zero")&&!r.includes(0)){var d=e.scale.domain(),p=d[0],g=d[1];Math.min(p,g)<=0&&Math.max(p,g)>=0&&(h=!0)}f.appendMany("line",s.filter((function(t){return"zero"!==t||r.includes(0)||h}))).translate((function(t){return["zero"===t?a(0):"left"===t?0:i[0],0]})).attr("y1",i[1]);var v=_t(n,"baseLine.width");return{left:s.includes("left")?v:0,right:s.includes("right")?v:0}}function an(t){var e=t.options,n=t.themeOpts,r=t.ticksMajor,i=e.tickPosition,a=e.plotSize,o=e.scale,u=e.tickLines,l=e.aboveChart,s=e.belowChart,c=e.className,f=e.tickLabelsInside,h=(_t(n,"tickLines.aboveChart")?l:s).selectAppend("g.y-tick-lines"+(c?"."+c:"")).html("").translate("right"===i?[a[0],0]:[0,0]);if(!u)return h.remove();h.node().classList.add(Xe(n,e.emotion)),h.selectAll("line").remove();var d="right"===i?1:-1,p=_t(n,"tickLines.length"+(f?"Inside":""),_t(n,"tickLines.length")),g=f?-p:_t(n,"tickLines.distance"),v=_t(n,"tickLines.strokeLinecap"),m=_t(n,"tickLines.width");return h.appendMany("line.y-tick-line",r).classed("is-zero",(function(t){return 0===t})).translate((function(t){return[g*d,o(t)]})).attr("x2",(function(t){return p*d})),{top:.5*m,bottom:.5*m,width:g+p+("square"===v||"round"===v?.5*m:0)}}function on(t){var e=t.options,n=t.themeOpts,r=t.ticksMajor,i=e.tickPosition,a=e.plotSize,o=e.scale,u=e.tickLines,l=e.tickLabels,s=e.aboveChart,c=e.belowChart,f=e.className,h=e.tickLabelsInside,d=e.theme,p=(_t(n,"tickLabels.aboveChart")?s:c).selectAppend("g.y-tick-labels"+(f?"."+f:"")).html("");if(p.selectAll("text").remove(),!l)return p.remove();p.node().classList.add(function(t,e){var n=t.tickLabels;return(0,e.css)("\n text {}\n "+(n.hideZero?"text.is-zero { display: none }":"")+"\n text tspan {\n "+Ze(n)+"\n }\n text.right {\n text-anchor: start;\n }\n text.right.inside {\n text-anchor: end;\n }\n text.left {\n text-anchor: end;\n }\n text.left.inside {\n text-anchor: start;\n }\n")}(n,e.emotion));var g=h?0:(u?_t(n,"tickLines.distance")+_t(n,"tickLines.length"):0)+_t(n,"tickLabels.distance");p.translate("right"===i?[a[0]+g,0]:[-g,0]);var v=_t(n,"tickLabels.fontSize",_t(d,"typography.chart.fontSize",12)),m=Pe(e,r=r.sort((function(t,e){return o(e)-o(t)})),n),y=m.tickFormat,b=m.multiFormat,w=m.keepOrder,_=n.tickLabels.hideZero&&0===r[r.length-1],x=n.tickLabels.hideZero&&0===r[0];qe(p,"y",e,n,r),He(p.appendMany("text.y-tick-label."+i,r).classed("inside",!!h).attr("aria-hidden",!0).translate((function(t){return[0,o(t)+Math.floor(v*(h?0:.4))-(h?5:0)]})).classed("dw-bold","bold"===_t(n,"tickLabels.fontWeight")).classed("dw-italic","italic"===_t(n,"tickLabels.fontStyle")).classed("is-zero",(function(t){return 0===t})).tspans((function(t,e){var n=e===(x?1:0),a=e===r.length-(_?2:1),o=b?y(t,a,n):[y(t,a,n)];return w||"top"!==i||o.reverse(),o}),v+3).attr("x","left"===i&&h?0:-1).parent().attr("y",(function(t,e,n){var r=ht(n[0]).selectAll("tspan").size();return h?(r-1)*(v+3)*-1:(r-1)*(v+3)*-.5})),(function(t,e){return t.y0?0:M.y)-e.plotSize[1]-k,$=p.node().getBoundingClientRect().width;return{top:k,bottom:A,width:h?0:$+g+_t(n,"tickLabels.extraSpace",1),labelWidth:h?$:0}}function un(t){var e=t.options,n=t.themeOpts,r=t.ticksMajor,i=t.ticksMinor,a=e.plotSize,o=e.scale,u=e.baseLine,l=e.gridLines,s=e.aboveChart,c=e.belowChart,f=e.className,h=(_t(n,"gridLines.aboveChart")?s:c).selectAppend("g.y-grid-lines"+(f?"."+f:"")).html("");if(!l)return h.remove();h.node().classList.add(Ge(n,e.emotion)),h.selectAll("line").remove(),i.length&&h.appendMany("line.y-grid-line.minor",i).translate((function(t){return[0,o(t)]})).attr("x2",a[0]),r.length&&h.appendMany("line.y-grid-line.major",r.filter((function(t){return!u.includes("zero")||0!==t}))).translate((function(t){return[0,o(t)]})).attr("x2",a[0])}function ln(t){var e=t.options,n=t.themeOpts,r=t.ticksMajor,i=e.plotSize,a=e.scale,o=e.scaleType,u=e.aboveChart,l=e.belowChart,s=e.baseLine,c=e.className,f=(_t(n,"baseLine.aboveChart")?u:l).selectAppend("g.y-base-lines"+(c?"."+c:"")).html("");f.node().classList.add(Ve(n,e.emotion)),f.selectAll("line").remove();var h=!1;if(["number","log"].includes(o)&&s.includes("zero")&&!r.includes(0)){var d=e.scale.domain(),p=d[0],g=d[1];Math.min(p,g)<=0&&Math.max(p,g)>=0&&(h=!0)}f.appendMany("line",s.filter((function(t){return"zero"!==t||r.includes(0)||h}))).translate((function(t){return[0,"zero"===t?a(0):"top"===t?0:i[1]]})).attr("x1",i[0]);var v=_t(n,"baseLine.width");return{top:s.includes("top")?v:0,bottom:s.includes("bottom")?v:0}}var sn=!1;function cn(t){t.numeral&&function(t){sn||(_e.register("locale","dw",t),_e.locale("dw"),sn=!0)}(t.numeral),t.dayjs&&"en"!==t.dayjs.name&&De.locale(t.dayjs)}function fn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function hn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function dn(){}var pn="\\s*([+-]?\\d+)\\s*",gn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",vn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mn=/^#([0-9a-f]{3,8})$/,yn=new RegExp("^rgb\\("+[pn,pn,pn]+"\\)$"),bn=new RegExp("^rgb\\("+[vn,vn,vn]+"\\)$"),wn=new RegExp("^rgba\\("+[pn,pn,pn,gn]+"\\)$"),_n=new RegExp("^rgba\\("+[vn,vn,vn,gn]+"\\)$"),xn=new RegExp("^hsl\\("+[gn,vn,vn]+"\\)$"),Mn=new RegExp("^hsla\\("+[gn,vn,vn,gn]+"\\)$"),kn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function An(){return this.rgb().formatHex()}function $n(){return this.rgb().formatRgb()}function Ln(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=mn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Sn(e):3===n?new Nn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Tn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Tn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=yn.exec(t))?new Nn(e[1],e[2],e[3],1):(e=bn.exec(t))?new Nn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=wn.exec(t))?Tn(e[1],e[2],e[3],e[4]):(e=_n.exec(t))?Tn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xn.exec(t))?Fn(e[1],e[2]/100,e[3]/100,1):(e=Mn.exec(t))?Fn(e[1],e[2]/100,e[3]/100,e[4]):kn.hasOwnProperty(t)?Sn(kn[t]):"transparent"===t?new Nn(NaN,NaN,NaN,0):null}function Sn(t){return new Nn(t>>16&255,t>>8&255,255&t,1)}function Tn(t,e,n,r){return r<=0&&(t=e=n=NaN),new Nn(t,e,n,r)}function Dn(t){return t instanceof dn||(t=Ln(t)),t?new Nn((t=t.rgb()).r,t.g,t.b,t.opacity):new Nn}function Cn(t,e,n,r){return 1===arguments.length?Dn(t):new Nn(t,e,n,null==r?1:r)}function Nn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function En(){return"#"+zn(this.r)+zn(this.g)+zn(this.b)}function On(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function zn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Fn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Hn(t,e,n,r)}function jn(t){if(t instanceof Hn)return new Hn(t.h,t.s,t.l,t.opacity);if(t instanceof dn||(t=Ln(t)),!t)return new Hn;if(t instanceof Hn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,l=(a+i)/2;return u?(o=e===a?(n-r)/u+6*(n0&&l<1?0:o,new Hn(o,u,l,t.opacity)}function Hn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Pn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}fn(dn,Ln,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:An,formatHex:An,formatHsl:function(){return jn(this).formatHsl()},formatRgb:$n,toString:$n}),fn(Nn,Cn,hn(dn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Nn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Nn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:En,formatHex:En,formatRgb:On,toString:On})),fn(Hn,(function(t,e,n,r){return 1===arguments.length?jn(t):new Hn(t,e,n,null==r?1:r)}),hn(dn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Hn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Hn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Nn(Pn(t>=240?t-240:t+120,i,r),Pn(t,i,r),Pn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Rn=Math.PI/180,Bn=180/Math.PI,Yn=6/29,Wn=3*Yn*Yn;function Un(t){if(t instanceof qn)return new qn(t.l,t.a,t.b,t.opacity);if(t instanceof Jn)return Qn(t);t instanceof Nn||(t=Dn(t));var e,n,r=Kn(t.r),i=Kn(t.g),a=Kn(t.b),o=Gn((.2225045*r+.7168786*i+.0606169*a)/1);return r===i&&i===a?e=n=o:(e=Gn((.4360747*r+.3850649*i+.1430804*a)/.96422),n=Gn((.0139322*r+.0971045*i+.7141733*a)/.82521)),new qn(116*o-16,500*(e-o),200*(o-n),t.opacity)}function In(t,e,n,r){return 1===arguments.length?Un(t):new qn(t,e,n,null==r?1:r)}function qn(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Gn(t){return t>.008856451679035631?Math.pow(t,1/3):t/Wn+4/29}function Xn(t){return t>Yn?t*t*t:Wn*(t-4/29)}function Vn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Kn(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Zn(t){if(t instanceof Jn)return new Jn(t.h,t.c,t.l,t.opacity);if(t instanceof qn||(t=Un(t)),0===t.a&&0===t.b)return new Jn(NaN,0a&&(i=e.slice(a,i),u[o]?u[o]+=i:u[++o]=i),(n=n[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,l.push({i:o,x:mr(n,r)})),a=wr.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:mr(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,o.rotate,u,l),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:mr(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,o.skewX,u,l),function(t,e,n,r,a,o){if(t!==n||e!==r){var u=a.push(i(a)+"scale(",null,",",null,")");o.push({i:u-4,x:mr(t,n)},{i:u-2,x:mr(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,u,l),a=o=null,function(t){for(var e,n=-1,r=l.length;++nMath.abs(i.l-e)?i.l-e:t}),100);l=l.map((function(t){return t+s}))}return(l=l.map((function(t){return In(t,i.a,i.b)}))).map((function(t){return t.hex()}))}function zr(t,e){void 0===t&&(t=new Error("cant create getColor function without theme")),void 0===e&&(e={});var n=e.selectedColor;void 0===n&&(n=0);var r=e.customColors;void 0===r&&(r={});var i=e.keys;void 0===i&&(i=[]);var a=e.permute,o=e.includeBaseColor;void 0===o&&(o=!0);var u=e.lightnessRange;void 0===u&&(u=[30,90]);var l=e.positiveColor;void 0===l&&(l=!1);var s=e.negativeColor;void 0===s&&(s=!1);var c=e.neutralColor;void 0===c&&(c=!1);var f=t.colors.palette;n=isNaN(n)?n:f[n%f.length];var h=i.length-Object.keys(r).filter((function(t){return""!==r[t].toString()&&i.includes(t)})).length,d=[];if(r&&Object.keys(r).length){var p={};Object.keys(r).forEach((function(t){String(r[t]).length&&(p[t]=isNaN(r[t])?r[t]:f[r[t]])})),Object.keys(p).length&&d.push(Fr(p))}(l||s||c)&&d.push(jr(l?t.colors.positive:n,s?t.colors.negative:n,c?t.colors.neutral:l?t.colors.positive:n));var g=t.colors.mode;if(g&&h>0&&(g.rotateLimit>=h?d.push(Hr(f,n)):g.shades&&g.shades[n]&&d.push(Pr(g.shades[n],h))),h>0){a=void 0===a?h>4:a;var v=Or(n,h,o,u=h<=3?[30,60]:u);a&&(v=function(t){t.reverse();var e=t.length;if(e<3)return t.slice(0);var n=0,r=-2,i=[],a={},o=Math.ceil(e/2.5);do{!a[n%=e]&&(e<5||Math.abs(r-n)>1)?(i.push(t[n]),a[n]=!0,r=n,n+=o):n+=1}while(i.length0?t:r.value<0?e:n}},Hr=function(t,e){return function(n){return t[(Math.max(0,t.indexOf(e))+n.i)%t.length]}},Pr=function(t,e){return function(n){if("string"!=typeof t[0]){t.sort((function(t,e){return t.length-e.length}));var r=t.length-1;return t.forEach((function(t,n){e>(t[n-1]||[]).length&&e<=t.length&&(r=n)})),t[r][n.i%t[r].length]}return t[n.i%t.length]}},Rr=function(t){var e=0,n=[];return function(r){return n[r.i]?n[r.i]:e!==t.length?n[r.i]=t[e++]:null}};function Br(t,e){return te?1:t>=e?0:NaN}function Yr(t){var e;return 1===t.length&&(e=t,t=function(t,n){return Br(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}var Wr=Yr(Br).right;function Ur(t,e){var n,r,i,a=t.length,o=-1;if(null==e){for(;++o=n)for(r=i=n;++on&&(r=n),i=n)for(r=i=n;++on&&(r=n),i=0?(a>=qr?10:a>=Gr?5:a>=Xr?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=qr?10:a>=Gr?5:a>=Xr?2:1)}function Kr(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=qr?i*=10:a>=Gr?i*=5:a>=Xr&&(i*=2),er&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function si(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i2?ci:si,i=a=null,f}function f(e){return isNaN(e=+e)?n:(i||(i=r(o.map(t),u,l)))(t(s(e)))}return f.invert=function(n){return s(e((a||(a=r(u,o.map(t),mr)))(n)))},f.domain=function(t){return arguments.length?(o=Qr.call(t,ii),s===oi||(s=li(o)),c()):o.slice()},f.range=function(t){return arguments.length?(u=ti.call(t),c()):u.slice()},f.rangeRound=function(t){return u=ti.call(t),l=Mr,c()},f.clamp=function(t){return arguments.length?(s=t?li(o):oi,f):s!==oi},f.interpolate=function(t){return arguments.length?(l=t,c()):l},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,c()}}()(t,e)}function di(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function pi(t){return(t=di(Math.abs(t)))?t[1]:NaN}var gi,vi=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mi(t){if(!(e=vi.exec(t)))throw new Error("invalid format: "+t);var e;return new yi({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function yi(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function bi(t,e){var n=di(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}mi.prototype=yi.prototype,yi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var wi={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return bi(100*t,e)},r:bi,s:function(t,e){var n=di(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(gi=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+di(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function _i(t){return t}var xi,Mi,ki,Ai=Array.prototype.map,$i=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Li(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?_i:(e=Ai.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,u=e[0],l=0;i>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),a.push(t.substring(i-=u,i+u)),!((l+=u+1)>r));)u=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?_i:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Ai.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",s=void 0===t.minus?"-":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=mi(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,v=t.precision,m=t.trim,y=t.type;"n"===y?(g=!0,y="g"):wi[y]||(void 0===v&&(v=12),m=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===h?a:/[%p]/.test(y)?l:"",_=wi[y],x=/[defgprs%]/.test(y);function M(t){var i,a,l,h=b,M=w;if("c"===y)M=_(t)+M,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:_(Math.abs(t),v),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==f&&(k=!1),h=(k?"("===f?f:s:"-"===f||"("===f?"":f)+h,M=("s"===y?$i[8+gi/3]:"")+M+(k&&"("===f?")":""),x)for(i=-1,a=t.length;++i(l=t.charCodeAt(i))||l>57){M=(46===l?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var A=h.length+t.length+M.length,$=A>1)+h+t+M+$.slice(A);break;default:t=$+h+t+M}return u(t)}return v=void 0===v?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=mi(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(pi(e)/3))),i=Math.pow(10,-r),a=$i[8+r/3];return function(t){return n(i*t)+a}}}}function Si(t,e,n,r){var i,a=Kr(t,e,n);switch((r=mi(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(pi(e)/3)))-pi(Math.abs(t)))}(a,o))||(r.precision=i),ki(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,pi(e)-pi(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-pi(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return Mi(r)}function Ti(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){var r,i,a,o,u=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++u0?r=Vr(u=Math.floor(u/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Vr(u=Math.ceil(u*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[a]=Math.floor(u/r)*r,i[o]=Math.ceil(l/r)*r,e(i)):r<0&&(i[a]=Math.ceil(u*r)/r,i[o]=Math.floor(l*r)/r,e(i)),t},t}function Di(){var t=hi(oi,oi);return t.copy=function(){return fi(t,Di())},Zr.apply(t,arguments),Ti(t)}xi=Li({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Mi=xi.format,ki=xi.formatPrefix;var Ci=new Date,Ni=new Date;function Ei(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e0))return u;do{u.push(o=new Date(+n)),e(n,a),t(n)}while(o=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Ci.setTime(+e),Ni.setTime(+r),t(Ci),t(Ni),Math.floor(n(Ci,Ni))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var Oi=Ei((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));Oi.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Ei((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Oi:null};var zi=Ei((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()})),Fi=Ei((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()})),ji=Ei((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()})),Hi=Ei((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1}));function Pi(t){return Ei((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var Ri=Pi(0),Bi=Pi(1),Yi=(Pi(2),Pi(3),Pi(4)),Wi=(Pi(5),Pi(6),Ei((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),Ui=Ei((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Ui.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ei((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};Ei((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})),Ei((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}));var Ii=Ei((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}));function qi(t){return Ei((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var Gi=qi(0),Xi=qi(1),Vi=(qi(2),qi(3),qi(4)),Ki=(qi(5),qi(6),Ei((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),Ei((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));function Zi(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ji(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Qi(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}Ki.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ei((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var ta,ea,na,ra,ia={"-":"",_:" ",0:"0"},aa=/^\s*\d+/,oa=/^%/,ua=/[\\^$*+?|[\]().{}]/g;function la(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a68?1900:2e3),n+r[0].length):-1}function ba(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function wa(t,e,n){var r=aa.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function _a(t,e,n){var r=aa.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function xa(t,e,n){var r=aa.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Ma(t,e,n){var r=aa.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function ka(t,e,n){var r=aa.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function Aa(t,e,n){var r=aa.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function $a(t,e,n){var r=aa.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function La(t,e,n){var r=aa.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Sa(t,e,n){var r=aa.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ta(t,e,n){var r=oa.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Da(t,e,n){var r=aa.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Ca(t,e,n){var r=aa.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Na(t,e){return la(t.getDate(),e,2)}function Ea(t,e){return la(t.getHours(),e,2)}function Oa(t,e){return la(t.getHours()%12||12,e,2)}function za(t,e){return la(1+Hi.count(Ui(t),t),e,3)}function Fa(t,e){return la(t.getMilliseconds(),e,3)}function ja(t,e){return Fa(t,e)+"000"}function Ha(t,e){return la(t.getMonth()+1,e,2)}function Pa(t,e){return la(t.getMinutes(),e,2)}function Ra(t,e){return la(t.getSeconds(),e,2)}function Ba(t){var e=t.getDay();return 0===e?7:e}function Ya(t,e){return la(Ri.count(Ui(t)-1,t),e,2)}function Wa(t){var e=t.getDay();return e>=4||0===e?Yi(t):Yi.ceil(t)}function Ua(t,e){return t=Wa(t),la(Yi.count(Ui(t),t)+(4===Ui(t).getDay()),e,2)}function Ia(t){return t.getDay()}function qa(t,e){return la(Bi.count(Ui(t)-1,t),e,2)}function Ga(t,e){return la(t.getFullYear()%100,e,2)}function Xa(t,e){return la((t=Wa(t)).getFullYear()%100,e,2)}function Va(t,e){return la(t.getFullYear()%1e4,e,4)}function Ka(t,e){var n=t.getDay();return la((t=n>=4||0===n?Yi(t):Yi.ceil(t)).getFullYear()%1e4,e,4)}function Za(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+la(e/60|0,"0",2)+la(e%60,"0",2)}function Ja(t,e){return la(t.getUTCDate(),e,2)}function Qa(t,e){return la(t.getUTCHours(),e,2)}function to(t,e){return la(t.getUTCHours()%12||12,e,2)}function eo(t,e){return la(1+Ii.count(Ki(t),t),e,3)}function no(t,e){return la(t.getUTCMilliseconds(),e,3)}function ro(t,e){return no(t,e)+"000"}function io(t,e){return la(t.getUTCMonth()+1,e,2)}function ao(t,e){return la(t.getUTCMinutes(),e,2)}function oo(t,e){return la(t.getUTCSeconds(),e,2)}function uo(t){var e=t.getUTCDay();return 0===e?7:e}function lo(t,e){return la(Gi.count(Ki(t)-1,t),e,2)}function so(t){var e=t.getUTCDay();return e>=4||0===e?Vi(t):Vi.ceil(t)}function co(t,e){return t=so(t),la(Vi.count(Ki(t),t)+(4===Ki(t).getUTCDay()),e,2)}function fo(t){return t.getUTCDay()}function ho(t,e){return la(Xi.count(Ki(t)-1,t),e,2)}function po(t,e){return la(t.getUTCFullYear()%100,e,2)}function go(t,e){return la((t=so(t)).getUTCFullYear()%100,e,2)}function vo(t,e){return la(t.getUTCFullYear()%1e4,e,4)}function mo(t,e){var n=t.getUTCDay();return la((t=n>=4||0===n?Vi(t):Vi.ceil(t)).getUTCFullYear()%1e4,e,4)}function yo(){return"+0000"}function bo(){return"%"}function wo(t){return+t}function _o(t){return Math.floor(+t/1e3)}!function(t){ta=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,u=t.months,l=t.shortMonths,s=ca(i),c=fa(i),f=ca(a),h=fa(a),d=ca(o),p=fa(o),g=ca(u),v=fa(u),m=ca(l),y=fa(l),b={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:Na,e:Na,f:ja,g:Xa,G:Ka,H:Ea,I:Oa,j:za,L:Fa,m:Ha,M:Pa,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:wo,s:_o,S:Ra,u:Ba,U:Ya,V:Ua,w:Ia,W:qa,x:null,X:null,y:Ga,Y:Va,Z:Za,"%":bo},w={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Ja,e:Ja,f:ro,g:go,G:mo,H:Qa,I:to,j:eo,L:no,m:io,M:ao,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:wo,s:_o,S:oo,u:uo,U:lo,V:co,w:fo,W:ho,x:null,X:null,y:po,Y:vo,Z:yo,"%":bo},_={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=v[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return k(t,e,n,r)},d:xa,e:xa,f:Sa,g:ya,G:ma,H:ka,I:ka,j:Ma,L:La,m:_a,M:Aa,p:function(t,e,n){var r=s.exec(e.slice(n));return r?(t.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:wa,Q:Da,s:Ca,S:$a,u:da,U:pa,V:ga,w:ha,W:va,x:function(t,e,r){return k(t,n,e,r)},X:function(t,e,n){return k(t,r,e,n)},y:ya,Y:ma,Z:ba,"%":Ta};function x(t,e){return function(n){var r,i,a,o=[],u=-1,l=0,s=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=Ji(Qi(a.y,0,1))).getUTCDay(),r=i>4||0===i?Xi.ceil(r):Xi(r),r=Ii.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=Zi(Qi(a.y,0,1))).getDay(),r=i>4||0===i?Bi.ceil(r):Bi(r),r=Hi.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?Ji(Qi(a.y,0,1)).getUTCDay():Zi(Qi(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,Ji(a)):Zi(a)}}function k(t,e,n,r){for(var i,a,o=0,u=e.length,l=n.length;o=l)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=_[i in ia?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=x(n,b),b.X=x(r,b),b.c=x(e,b),w.x=x(n,w),w.X=x(r,w),w.c=x(e,w),{format:function(t){var e=x(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",w);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t+="",!0);return e.toString=function(){return t},e}}}(t),ea=ta.format,ta.parse,na=ta.utcFormat,ra=ta.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Date.prototype.toISOString||na("%Y-%m-%dT%H:%M:%S.%LZ");+new Date("2000-01-01T00:00:00.000Z")||ra("%Y-%m-%dT%H:%M:%S.%LZ");function xo(t){return new Date(t)}function Mo(t){return t instanceof Date?+t:+new Date(+t)}function ko(t,e,n,r,i,a,o,u,l){var s=hi(oi,oi),c=s.invert,f=s.domain,h=l(".%L"),d=l(":%S"),p=l("%I:%M"),g=l("%I %p"),v=l("%a %d"),m=l("%b %d"),y=l("%B"),b=l("%Y"),w=[[o,1,1e3],[o,5,5e3],[o,15,15e3],[o,30,3e4],[a,1,6e4],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function _(u){return(o(u)=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Do(t,e){for(var n,r=0,i=t.length;r0)for(var r,i,a=new Array(r),o=0;o=0&&e._call.call(null,t),e=e._next;--Oo}()}finally{Oo=0,function(){var t,e,n=No,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:No=e);Eo=t,Xo(r)}(),Ho=0}}function Go(){var t=Ro.now(),e=t-jo;e>1e3&&(Po-=e,jo=t)}function Xo(t){Oo||(zo&&(zo=clearTimeout(zo)),t-Ho>24?(t<1/0&&(zo=setTimeout(qo,t-Ro.now()-Po)),Fo&&(Fo=clearInterval(Fo))):(Fo||(jo=Ro.now(),Fo=setInterval(Go,1e3)),Oo=1,Bo(qo)))}function Vo(t,e,n){var r=new Uo;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r}Uo.prototype=Io.prototype={constructor:Uo,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Yo():+n)+(null==e?0:+e),this._next||Eo===this||(Eo?Eo._next=this:No=this,Eo=this),this._call=t,this._time=n,Xo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xo())}};var Ko=Lo("start","end","cancel","interrupt"),Zo=[];function Jo(t,e,n,r,i,a){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(l){var s,c,f,h;if(1!==n.state)return u();for(s in i)if((h=i[s]).name===n.name){if(3===h.state)return Vo(a);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[s]):+s0)throw new Error("too late; already scheduled");return n}function tu(t,e){var n=eu(t,e);if(n.state>3)throw new Error("too late; already running");return n}function eu(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function nu(t,e){var n,r;return function(){var i=tu(this,t),a=i.tween;if(a!==n)for(var o=0,u=(r=n=a).length;o=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Qo:tu;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}var xu=ft.prototype.constructor;function Mu(t){return function(){this.style.removeProperty(t)}}function ku(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Au(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&ku(t,a,n)),r}return a._value=e,a}function $u(t){return function(e){this.textContent=t.call(this,e)}}function Lu(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&$u(r)),e}return r._value=t,r}var Su=0;function Tu(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Du(t){return ft().transition(t)}function Cu(){return++Su}var Nu=ft.prototype;Tu.prototype=Du.prototype={constructor:Tu,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=c(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):o=!1;o&&delete t.__transition}}(this,t)}))},ft.prototype.transition=function(t){var e,n;t instanceof Tu?(e=t._id,t=t._name):(e=Cu(),(n=Ou).time=Yo(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,a=0;a=s&&a<=l&&o<=i&&o>=u}));u.empty()?t.highlight.clear():t.highlight.set(u.datum())}}function Iu(t){return t}var qu=("function"!=typeof/./&&"object"!=typeof Int8Array&&"undefined"!=typeof document&&"function"!=typeof document.childNodes?function(t){return"function"==typeof t||!1}:null)||function(t){return"[object Function]"===Fu.call(t)};function Gu(t,e){if(t._isColumnChart()){var n=function(t){var e=t.column,n=t.active,r=t.type;void 0===r&&(r="auto");var i=t.format;void 0===i&&(i=Iu);var a=[];"auto"===r&&(r="date"===e.type()?"timescale":e.length<6?"buttons":"select");function o(t){a.forEach((function(n){qu(n)&&n(e.val(t),t)}))}return{ui:function t(r){if(e.length<2)return function(){return!1};var i;function a(t,e,n){tt.preventDefault();var r=ht(n[e]);r.classed("active")||(n.forEach((function(t){return ht(t).classed("active",!1)})),r.classed("active",!0),o(e))}return"select"===r&&(i=function(t){var n=ht(document.createElement("select")).attr("class","filter-ui filter-select");return n.selectAll("option").data(e.values()).enter().append("option").attr("value",(function(t,e){return e})).html((function(t,n){return String(e.raw()[n]).trim()})),n.on("change",(function(t){return o(n.node().value)})),n}),"buttons"===r&&(i=function(r){var i=ht(".dw-chart").append("div.filter-ui filter-links");i.selectAll("a").data(e.values().filter((function(t,n){return e.raw()[n]}))).enter().append("a").attr("href",(function(t,e){return"#"+e})).classed("active",(function(t,e){return e===n})).html((function(t,n){return String(e.raw()[n]).trim()})).on("click",a);var o=i.select("a:first-child").node(),u=i.select("a:last-child").node(),l=o.offsetTop+o.clientHeight;return u.offsetTop+o.clientHeight-l>1?(i.remove(),t("select")(r)):i.remove()}),"timescale"===r&&(i=function(t){var n=Math.min(t.__w-35),r=Math.round((e.val(-1).getTime()-e.val(0).getTime())/864e5);function i(t,n){return t*(1-(e.val(-1).getTime()-n.getTime())/864e5/r)}var o=ht(document.createElement("div")).attr("class","filter-ui").style("position","relative").style("height","45px").style("margin-left","3px"),u=0;return o.selectAll("div").data(e.values()).enter().append("div").append("div.point").classed("active",(function(t,e){return 0===e})).style("left",(function(t,r){var a=i(n,t);return r===e.length-1&&(u=a),a+"px"})).on("click",a).parent().append("div.point-label").html((function(t,n){return e.raw()[n]})).style("left",(function(t,e){return i(n,t)+"px"})),o.append("div.line").style("width",u+"px"),o}),i}(r),change:function(t){a.push(t)}}}({column:dw.utils.columnNameColumn(t.axes(!0).columns),active:0}),r=n.ui(t),i=0,a=Wu(t.chart().get("id"));r&&function(){var o=ht(e.parentElement),u=o.selectAll(".dw-chart-header");0===u.nodes().length?(o.insert("div.dw-chart-header.fake",":first-child"),u=o.selectAll(".dw-chart-header")):u.nodes().length>1&&(o.selectAll(".dw-chart-header.fake").remove(),u=o.selectAll(".dw-chart-header"));var l=u.nodes()[0].clientHeight;u.append((function(){return r.node()})),i=u.nodes()[0].clientHeight-l,t.__filterH=i,n.change((function(e,n){t.__lastRow=n,t.update(),a("column:change",{value:e,index:n}),t.fire("column:change",{value:e,index:n})}))}(),t.__filterUI=r}}var Xu=e((function(e,n){e.exports=function(){function e(){}function n(t){return t()}function r(){return Object.create(null)}function i(t){t.forEach(n)}function a(t){return"function"==typeof t}function o(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function u(t,e){t.appendChild(e)}function l(t,e,n){t.insertBefore(e,n||null)}function s(t){t.parentNode.removeChild(t)}function c(t,e){for(var n=0;n0;)i[a]=r[a+2];var o=i.length?i[0]:n;return d.ctx&&u(d.ctx[e],d.ctx[e]=o)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](o),p&&J(t,e)),n})):[],d.update(),p=!0,i(d.before_update),d.fragment=!!o&&o(d.ctx),n.target){if(n.hydrate){var g=function(t){return Array.from(t.childNodes)}(n.target);d.fragment&&d.fragment.l(g),g.forEach(s)}else d.fragment&&d.fragment.c();n.intro&&I(t.$$.fragment),K(t,n.target,n.anchor),P()}M(f)}var tt=function(){};tt.prototype.$destroy=function(){Z(this,1),this.$destroy=e},tt.prototype.$on=function(t,e){var n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}},tt.prototype.$set=function(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)};var et="http://www.w3.org/1999/xhtml",nt={svg:"http://www.w3.org/2000/svg",xhtml:et,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function rt(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),nt.hasOwnProperty(e)?{space:nt[e],local:t}:t}function it(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===et&&e.documentElement.namespaceURI===et?e.createElement(t):e.createElementNS(n,t)}}function at(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ot(t){var e=rt(t);return(e.local?at:it)(e)}function ut(){}function lt(t){return null==t?ut:function(){return this.querySelector(t)}}function st(){return[]}function ct(t){return new Array(t.length)}function ft(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function ht(t,e,n,r,i,a){for(var o,u=0,l=e.length,s=a.length;ue?1:t>=e?0:NaN}function gt(t){return function(){this.removeAttribute(t)}}function vt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function mt(t,e){return function(){this.setAttribute(t,e)}}function yt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function bt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function wt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function _t(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function xt(t){return function(){this.style.removeProperty(t)}}function Mt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function kt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function At(t,e){return t.style.getPropertyValue(e)||_t(t).getComputedStyle(t,null).getPropertyValue(e)}function $t(t){return function(){delete this[t]}}function Lt(t,e){return function(){this[t]=e}}function St(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Tt(t){return t.trim().split(/^|\s+/)}function Dt(t){return t.classList||new Ct(t)}function Ct(t){this._node=t,this._names=Tt(t.getAttribute("class")||"")}function Nt(t,e){for(var n=Dt(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Vt={};function Kt(t,e,n){return t=Zt(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function Zt(t,e,n){return function(r){try{t.call(this,this.__data__,e,n)}finally{}}}function Jt(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function Qt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r=_&&(_=w+1);!(b=m[_])&&++_=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=pt);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==e?xt:"function"==typeof e?kt:Mt)(t,e,null==n?"":n)):At(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?$t:"function"==typeof e?St:Lt)(t,e)):this.node()[t]},classed:function(t,e){var n=Tt(t+"");if(arguments.length<2){for(var r=Dt(this.node()),i=-1,a=n.length;++i-1||(t.push(this.parentNode),0))})).select((function(){return this.parentNode}))},oe.prototype.selectAppend=function(t){var e,n=lt(t),r=pe(t);for(var i in t=ot(r.tag),e=this.select((function(){return n.apply(this,arguments)||this.appendChild(t.apply(this,arguments))})),r.attr)e.attr(i,r.attr[i]);return e},oe.prototype.tspans=function(t,e){return this.selectAll("tspan").data((function(e,n){return("function"==typeof t?t.call(this,e,n):t).map((function(t){return{line:t,parent:e}}))})).enter().append("tspan").text((function(t){return t.line})).attr("x",0).attr("dy",(function(t,n){return n?("function"==typeof e?e.call(this,t.parent,t.line,n):e)||15:0}))},oe.prototype.appendMany=function(t,e){if("string"==typeof e){console.warn("DEPRECATED: jetpack's appendMany order of arguments has changed. It's appendMany('div', data) from now on");var n=e;e=t,t=n}return this.selectAll(null).data(e).enter().append(t)},oe.prototype.at=function(t,e){if("object"==typeof t){for(var n in t)this.attr(ve.test(n)?n:n.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),t[n]);return this}return 1==arguments.length?this.attr(t):this.attr(t,e)},oe.prototype.st=function(t,e){if("object"==typeof t){for(var n in t)r(this,n,t[n]);return this}return 1==arguments.length?this.style(t):r(this,t,e);function r(t,e,n){return e=e.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),~"top left bottom right padding-top padding-left padding-bottom padding-right border-top b-width border-left-width border-botto-width m border-right-width margin-top margin-left margin-bottom margin-right font-size width stroke-width line-height margin padding border border-radius max-width min-width max-height min-height".indexOf(e)?t.style(e,"function"==typeof n?a(n):i(n)):t.style(e,n),t}function i(t){return t.match?t:t+"px"}function a(t){return function(){var e=t.apply(this,arguments);return i(e)}}},oe.prototype.prop=oe.prototype.property;var _e=Math.cos(.25*Math.PI),xe=Math.sin(.25*Math.PI);function Me(t){var e=t[0],n=t[1];return[e*_e-n*xe,e*xe+n*_e]}function ke(t){var e=t[0],n=t[1];return[e*_e+n*xe,n*_e-e*xe]}function Ae(t,e,n,r){void 0===r&&(r=!0);var i=r?1:0,a=(n-t[i])/(e[i]-t[i]);if(a<0||a>1)return null;var o=r?0:1;return t[o]+a*(e[o]-t[o])}function $e(t){return void 0===t&&(t=!0),function(e){var n=e.source,r=e.sourcePadding,i=e.targetPadding,a=e.circle,o=e.circleRadius;return function(e){var u,l;a&&o&&(i+=o),r>0&&((n=Object.assign({},n)).x-=r,n.y-=r,n.width+=2*r,n.height+=2*r);var s=n.x+.5*n.width,c=n.y+.5*n.height,f=0,h=0,d=Le(s,c,f,h,.25,t),p=d[0],g=d[1],v=n.height/n.width,m=p-s,y=g-c;if(Math.abs(y/m)0?1:-1),c+=.5*n.width*y/m*(m>0?1:-1)):(s+=.5*n.height*m/y*(y>0?1:-1),c+=.5*n.height*(y>0?1:-1)),p=(u=Le(s,c,f,h,.25,t))[0],g=u[1],i>0){var b=Math.atan2(-g,-p);p=(l=Le(s,c,f=-Math.cos(b)*i,h=-Math.sin(b)*i,.25,t))[0],g=l[1]}e.attr("d","M "+s+","+c+" Q "+p+","+g+" "+f+","+h)}}}function Le(t,e,n,r,i,a){void 0===i&&(i=.25),void 0===a&&(a=!0);var o=n-t,u=r-e,l=u,s=-o,c=.5*(t+n),f=.5*(e+r),h=Math.sqrt(l*l+s*s),d=Math.sqrt(o*o+u*u)*i/h*(a?-1:1);return[c+l*d,f+s*d]}var Se=$e(!0),Te=$e(!1),De=Object.freeze({__proto__:null,straight:function(t){var e=t.source,n=t.sourcePadding,r=t.targetPadding,i=t.circle,a=t.circleRadius;return function(t){var o,u,l,s;i&&a&&(r+=a),n&&((e=Object.assign({},e)).x-=n,e.y-=n,e.width+=2*n,e.height+=2*n);var c=e.x+.5*e.width,f=e.y+.5*e.height,h=0,d=0,p=!0,g=-c,v=-f,m=e.height/e.width;if(2*Math.abs(c)0?1:-1),f+=.5*e.height*(f<0?1:-1),p=!1;else if(2*Math.abs(f)0?1:-1),c+=.5*e.width*(c<0?1:-1),p=!1;else{var y,b,w=Me([-.5*e.width,0]),_=w[0],x=w[1],M=Me([.5*e.width,0]),k=M[0],A=M[1],$=Me([0,-.5*e.height]),L=$[0],S=$[1],T=Me([0,.5*e.height]),D=T[0],C=T[1],N=Me([-c,-f]),E=N[0],O=N[1];if(c>0&&f>0&&E>=_&&E<=L){var z=Me([-.5*e.width,-.5*e.height]),F=z[0];y=(o=ke([E,Ae(E=D&&E<=k){var j=Me([.5*e.width,.5*e.height]),H=j[0];y=(u=ke([E,Ae(E0&&f<0&&O>=x&&O<=C){var P=Me([-.5*e.width,.5*e.height]),R=P[0],B=P[1];y=(l=ke([Ae(O0&&O>=S&&O<=A){var Y=Me([.5*e.width,-.5*e.height]),W=Y[0],U=Y[1];y=(s=ke([Ae(O0?1:-1),b=.5*e.width*v/g*(g>0?1:-1)):(y=.5*e.height*g/v*(v>0?1:-1),b=.5*e.height*(v>0?1:-1));c+=y,f+=b}if(r>0&&p){g=-c,v=-f;var I=Math.atan2(v,g);h=-Math.cos(I)*r,d=-Math.sin(I)*r}t.attr("d","M "+c+","+f+" L "+h+","+d),t.classed("crisp",c.toFixed(1)===h.toFixed(1)||f.toFixed(1)===d.toFixed(1))}},curveLeft:Se,curveRight:Te}),Ce={triangle:{viewBox:"-10 -10 20 20",markerWidth:20,markerHeight:20,minLen:20,path:"M-8.75,-3.75 L 1,0 L -8.75,3.75"},lines:{viewBox:"-10 -10 20 20",markerWidth:20,markerHeight:20,minLen:15,path:"M-4.75,-3.75 L 0,0 L -4.75,3.75",strokes:!0}},Ne=Math.ceil,Ee=Math.max,Oe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},ze="object"==typeof Oe&&Oe&&Oe.Object===Object&&Oe,Fe="object"==typeof self&&self&&self.Object===Object&&self,je=(ze||Fe||Function("return this")()).Symbol,He=Object.prototype,Pe=He.hasOwnProperty,Re=He.toString,Be=je?je.toStringTag:void 0,Ye=Object.prototype.toString,We=je?je.toStringTag:void 0,Ue=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":We&&We in Object(t)?function(t){var e=Pe.call(t,Be),n=t[Be];try{t[Be]=void 0;var r=!0}catch(t){}var i=Re.call(t);return r&&(e?t[Be]=n:delete t[Be]),i}(t):function(t){return Ye.call(t)}(t)},Ie=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},qe=function(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!function(t){if(!Ie(t))return!1;var e=Ue(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}(t)},Ge=/^(?:0|[1-9]\d*)$/,Xe=function(t,e,n){if(!Ie(n))return!1;var r=typeof e;return!!("number"==r?qe(n)&&function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Ge.test(t))&&t>-1&&t%1==0&&t>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?xn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?xn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=fn.exec(t))?new An(e[1],e[2],e[3],1):(e=hn.exec(t))?new An(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=dn.exec(t))?xn(e[1],e[2],e[3],e[4]):(e=pn.exec(t))?xn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=gn.exec(t))?Tn(e[1],e[2]/100,e[3]/100,1):(e=vn.exec(t))?Tn(e[1],e[2]/100,e[3]/100,e[4]):mn.hasOwnProperty(t)?_n(mn[t]):"transparent"===t?new An(NaN,NaN,NaN,0):null}function _n(t){return new An(t>>16&255,t>>8&255,255&t,1)}function xn(t,e,n,r){return r<=0&&(t=e=n=NaN),new An(t,e,n,r)}function Mn(t){return t instanceof on||(t=wn(t)),t?new An((t=t.rgb()).r,t.g,t.b,t.opacity):new An}function kn(t,e,n,r){return 1===arguments.length?Mn(t):new An(t,e,n,null==r?1:r)}function An(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function $n(){return"#"+Sn(this.r)+Sn(this.g)+Sn(this.b)}function Ln(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Sn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Tn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Cn(t,e,n,r)}function Dn(t){if(t instanceof Cn)return new Cn(t.h,t.s,t.l,t.opacity);if(t instanceof on||(t=wn(t)),!t)return new Cn;if(t instanceof Cn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,l=(a+i)/2;return u?(o=e===a?(n-r)/u+6*(n0&&l<1?0:o,new Cn(o,u,l,t.opacity)}function Cn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function En(t,e){return"translate("+Math.round(t)+"px, "+Math.round(e)+"px);"}function On(t){return!0===t||void 0===t}function zn(t){return!(!On(t.showDesktop)||!1!==t.showMobile)}function Fn(t){return!1===t.showDesktop&&!1===t.showMobile}function jn(t,e){return"function"==typeof e?e(t):t}rn(on,wn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:yn,formatHex:yn,formatHsl:function(){return Dn(this).formatHsl()},formatRgb:bn,toString:bn}),rn(An,kn,an(on,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new An(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new An(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$n,formatHex:$n,formatRgb:Ln,toString:Ln})),rn(Cn,(function(t,e,n,r){return 1===arguments.length?Dn(t):new Cn(t,e,n,null==r?1:r)}),an(on,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Cn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Cn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new An(Nn(t>=240?t-240:t+120,i,r),Nn(t,i,r),Nn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Hn=180/Math.PI;function Pn(t,e,n){if(void 0===e&&(e=null),void 0===n&&(n=null),!e)return t;for(var r=e.split("."),i=t,a=0;a]*>/gi,Bn=/|<\?(?:php)?[\s\S]*?\?>/gi;function Yn(t,e){if(null===t)return null;if(void 0!==t){if((t=String(t)).indexOf("<")<0||t.indexOf(">")<0)return t;if(t=function(t,e){e=(((void 0!==e?e||"":"

")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");for(var n=t,r=t;;)if(r=(n=r).replace(Bn,"").replace(Rn,(function(t,n){return e.indexOf("<"+n.toLowerCase()+">")>-1?t:""})),n===r)return r}(t,e),"undefined"==typeof document)return t;var n=document.createElement("div");n.innerHTML=t;for(var r=n.querySelectorAll("*"),i=0;i337.5||t<=22.5:return"bc";case t>22.5&&t<=67.5:return"bl";case t>67.5&&t<=112.5:return"ml";case t>112.5&&t<=157.5:return"tl";case t>157.5&&t<=202.5:return"tc";case t>202.5&&t<=247.5:return"tr";case t>247.5&&t<=292.5:return"mr";case t>292.5&&t<=337.5:return"br";default:return"mc"}}(t)}function _(t){var e=C(r),n=e[0],i=e[1];return v>n-t&&vi-t&&m',r=p(),V(i.$$.fragment),y(n,"class","dot-drag svelte-11oj9tu"),y(e,"style",c=t[6](t[0])),y(e,"class",h="range-annotation edit-mode range "+t[0].type+" svelte-11oj9tu"),w(e,"edit-mode",t[3]),w(e,"no-edit-mode",!t[3]),w(e,"selected",t[5])},m:function(a,o){l(a,e,o),u(e,n),u(e,r),K(i,e,null),d=!0,g||(b=v(n,"mousedown",m(t[9])),g=!0)},p:function(t,n){var r={};1&n&&(r.annotation=t[0]),16&n&&(r.index=t[4]),1&n&&(r.orientation=t[0].type),!a&&4&n&&(a=!0,r.activeResizer=t[2],F((function(){return a=!1}))),!o&&2&n&&(o=!0,r.resizing=t[1],F((function(){return o=!1}))),i.$set(r),(!d||65&n&&c!==(c=t[6](t[0])))&&y(e,"style",c),(!d||1&n&&h!==(h="range-annotation edit-mode range "+t[0].type+" svelte-11oj9tu"))&&y(e,"class",h),9&n&&w(e,"edit-mode",t[3]),9&n&&w(e,"no-edit-mode",!t[3]),33&n&&w(e,"selected",t[5])},i:function(t){d||(I(i.$$.fragment,t),d=!0)},o:function(t){q(i.$$.fragment,t),d=!1},d:function(t){t&&s(e),Z(i),g=!1,b()}}}function sr(t){var e,n,r,i;function a(e){t[22].call(null,e)}function o(e){t[23].call(null,e)}var u={annotation:t[0],index:t[4],orientation:t[0].type};return void 0!==t[2]&&(u.activeResizer=t[2]),void 0!==t[1]&&(u.resizing=t[1]),e=new de({props:u}),T.push((function(){return X(e,"activeResizer",a)})),T.push((function(){return X(e,"resizing",o)})),e.$on("selectAnnotation",t[24]),{c:function(){V(e.$$.fragment)},m:function(t,n){K(e,t,n),i=!0},p:function(t,i){var a={};1&i&&(a.annotation=t[0]),16&i&&(a.index=t[4]),1&i&&(a.orientation=t[0].type),!n&&4&i&&(n=!0,a.activeResizer=t[2],F((function(){return n=!1}))),!r&&2&i&&(r=!0,a.resizing=t[1],F((function(){return r=!1}))),e.$set(a)},i:function(t){i||(I(e.$$.fragment,t),i=!0)},o:function(t){q(e.$$.fragment,t),i=!1},d:function(t){Z(e,t)}}}function cr(t){var e,n,r,i,a,o,u=[ur,or],c=[];function f(t,e){return"line"===t[0].display?0:1}return e=f(t),n=c[e]=u[e](t),{c:function(){n.c(),r=g()},m:function(n,u){c[e].m(n,u),l(n,r,u),i=!0,a||(o=v(window,"keydown",t[8]),a=!0)},p:function(t,i){var a=i[0],o=e;(e=f(t))===o?c[e].p(t,a):(W(),q(c[o],1,1,(function(){c[o]=null})),U(),(n=c[e])?n.p(t,a):(n=c[e]=u[e](t)).c(),I(n,1),n.m(r.parentNode,r))},i:function(t){i||(I(n),i=!0)},o:function(t){q(n),i=!1},d:function(t){c[e].d(t),t&&s(r),a=!1,o()}}}function fr(t,e,n){var r,i,a,o,u,l,s,c=e.annotation,f=e.dataToPx,h=e.pxToData,d=e.editorState,p=e.editMode,g=e.index,v=e.moveX,m=e.moveY,y=e.resizing,b=e.dragging,w=e.activeResizer,_=e.forceAnchorDragTemp,x=$();return t.$$set=function(t){"annotation"in t&&n(0,c=t.annotation),"dataToPx"in t&&n(13,f=t.dataToPx),"pxToData"in t&&n(14,h=t.pxToData),"editorState"in t&&n(15,d=t.editorState),"editMode"in t&&n(3,p=t.editMode),"index"in t&&n(4,g=t.index),"moveX"in t&&n(10,v=t.moveX),"moveY"in t&&n(11,m=t.moveY),"resizing"in t&&n(1,y=t.resizing),"dragging"in t&&n(12,b=t.dragging),"activeResizer"in t&&n(2,w=t.activeResizer),"forceAnchorDragTemp"in t&&n(16,_=t.forceAnchorDragTemp)},t.$$.update=function(){if(32784&t.$$.dirty&&n(5,r=1===d.selectedRangeAnnotations.length&&d.selectedRangeAnnotations[0]===g),93223&t.$$.dirty&&r&&y&&(v||m))if(["l","r"].includes(w)){var e,p=f(c.x0,0)[0],x=f(c.x1,0)[0];"l"===w&&"line"===c.display?e="x0":"l"===w?e=p>x?"x1":"x0":"r"===w&&(e=p>x?"x0":"x1");var M=f(c[e],0)[0],k=f(c["x1"===e?"x0":"x1"],0)[0];M-k>0!=M+v-k>0&&n(2,w="l"===w?"r":"l");var A=h(M+=v,0)[0];if(n(0,c[e]=A,c),_){var $=h(k-=v,0)[0];n(0,c["x1"===e?"x0":"x1"]=$,c)}n(10,v=0)}else{var L,S=f(0,c.y0)[1],T=f(0,c.y1)[1];"t"===w&&"line"===c.display?L="y0":"t"===w?L=S0!=N+m-E>0&&n(2,w="t"===w?"b":"t");var O=h(C,N+=m),z=(O[0],O[1]);n(0,c[L]=z,c),n(11,m=0)}if(31777&t.$$.dirty&&r&&b&&(v||m))if("x"===c.type){var F=f(c.x0,0),j=F[0],H=(F[1],f(c.x1,0)),P=H[0];H[1],P+=v;var R=h(j+=v,0),B=R[0],Y=(R[1],h(P,0)),W=Y[0];Y[1],n(0,c.x0=B,c),n(0,c.x1=W,c),n(10,v=0)}else{var U=f(0,c.y0),I=(U[0],U[1]),q=f(0,c.y1),G=(q[0],q[1]);G+=m;var X=h(0,I+=m),V=(X[0],X[1]),K=h(0,G),Z=(K[0],K[1]);n(0,c.y0=V,c),n(0,c.y1=Z,c),n(11,m=0)}8193&t.$$.dirty&&n(17,i="x"===c.type?f(c.x0,0)[0]:f(0,c.y0)[1]),8193&t.$$.dirty&&n(18,a="x"===c.type?f(c.x1,0)[0]:f(0,c.y1)[1]),393216&t.$$.dirty&&n(19,o=Math.min(i,a)),393216&t.$$.dirty&&n(20,u=Math.max(i,a)),1572864&t.$$.dirty&&n(6,l=function(t){var e=[],n=wn(t.color),r=t.opacity/100;return e.push("background-color: rgba("+n.r+", "+n.g+", "+n.b+", "+r+")"),e.push(("x"===t.type?"left":"top")+": "+o+"px"),e.push(("x"===t.type?"width":"height")+": "+(u-o)+"px"),e.join("; ")}),131072&t.$$.dirty&&n(7,s=function(t){var e=[];e.push(("x"===t.type?"left":"top")+": "+i+"px");var n=wn(t.color),r=t.opacity/100;return e.push("border-color: rgba("+n.r+", "+n.g+", "+n.b+", "+r+")"),"x"===t.type?e.push("border-left-width: "+(t.strokeWidth||1)+"px"):e.push("border-top-width: "+(t.strokeWidth||1)+"px"),"dashed"===t.strokeType?e.push("border-style: dashed"):"dotted"===t.strokeType?e.push("border-style: dotted"):e.push("border-style: solid"),e.join("; ")})},[c,y,w,p,g,r,l,s,function(t){p&&"Escape"===t.key&&r&&x("selectAnnotation",null)},function(t){p&&(x("selectAnnotation",{type:"range",index:g}),n(12,b=!0))},v,m,b,f,h,d,_,i,a,o,u,function(e){L(t,e)},function(t){n(2,w=t),n(5,r),n(1,y),n(10,v),n(11,m),n(13,f),n(0,c),n(14,h),n(16,_),n(15,d),n(4,g),n(12,b)},function(t){n(1,y=t)},function(e){L(t,e)},function(t){n(2,w=t),n(5,r),n(1,y),n(10,v),n(11,m),n(13,f),n(0,c),n(14,h),n(16,_),n(15,d),n(4,g),n(12,b)},function(t){n(1,y=t)},function(e){L(t,e)}]}var hr=function(t){function e(e){t.call(this),Q(this,e,fr,cr,o,{annotation:0,dataToPx:13,pxToData:14,editorState:15,editMode:3,index:4,moveX:10,moveY:11,resizing:1,dragging:12,activeResizer:2,forceAnchorDragTemp:16})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(tt);function dr(t){if(!t||"object"!=typeof t)return t;try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}var pr=G.document;function gr(t,e,n){var r=t.slice();return r[67]=e[n],r[69]=n,r}function vr(t,e,n){var r=t.slice();return r[67]=e[n],r[69]=n,r}function mr(t){var e,n,r,i,a,o,u,l,s,c,f;function h(e){t[43].call(null,e)}function d(e){t[44].call(null,e)}function p(e){t[45].call(null,e)}function g(e){t[46].call(null,e)}function v(e){t[47].call(null,e)}function m(e){t[48].call(null,e)}function y(e){t[49].call(null,e)}function b(e){t[50].call(null,e)}function w(e){t[51].call(null,e)}var _={annotation:t[67],dataToPx:t[1],pxToData:t[2],theme:t[3],cm:t[4],visWidth:t[5],isMobileWidth:t[15],index:t[25].length-1-t[69],editMode:t[7],editorState:t[0],forceAnchorDragTemp:t[22],key:t[16][t[25].length-1-t[69]]};return void 0!==t[19]&&(_.noOffsetAtEventStart=t[19]),void 0!==t[24]&&(_.isEditable=t[24]),void 0!==t[11]&&(_.dragging=t[11]),void 0!==t[21]&&(_.forceAnchorDrag=t[21]),void 0!==t[20]&&(_.forceOffsetDrag=t[20]),void 0!==t[9]&&(_.moveX=t[9]),void 0!==t[10]&&(_.moveY=t[10]),void 0!==t[12]&&(_.resizing=t[12]),void 0!==t[23]&&(_.activeResizer=t[23]),e=new ar({props:_}),T.push((function(){return X(e,"noOffsetAtEventStart",h)})),T.push((function(){return X(e,"isEditable",d)})),T.push((function(){return X(e,"dragging",p)})),T.push((function(){return X(e,"forceAnchorDrag",g)})),T.push((function(){return X(e,"forceOffsetDrag",v)})),T.push((function(){return X(e,"moveX",m)})),T.push((function(){return X(e,"moveY",y)})),T.push((function(){return X(e,"resizing",b)})),T.push((function(){return X(e,"activeResizer",w)})),e.$on("selectAnnotation",t[28]),e.$on("updateEditorState",t[29]),e.$on("update",t[52]),{c:function(){V(e.$$.fragment)},m:function(t,n){K(e,t,n),f=!0},p:function(t,f){var h={};33554432&f[0]&&(h.annotation=t[67]),2&f[0]&&(h.dataToPx=t[1]),4&f[0]&&(h.pxToData=t[2]),8&f[0]&&(h.theme=t[3]),16&f[0]&&(h.cm=t[4]),32&f[0]&&(h.visWidth=t[5]),32768&f[0]&&(h.isMobileWidth=t[15]),33554432&f[0]&&(h.index=t[25].length-1-t[69]),128&f[0]&&(h.editMode=t[7]),1&f[0]&&(h.editorState=t[0]),4194304&f[0]&&(h.forceAnchorDragTemp=t[22]),33619968&f[0]&&(h.key=t[16][t[25].length-1-t[69]]),!n&&524288&f[0]&&(n=!0,h.noOffsetAtEventStart=t[19],F((function(){return n=!1}))),!r&&16777216&f[0]&&(r=!0,h.isEditable=t[24],F((function(){return r=!1}))),!i&&2048&f[0]&&(i=!0,h.dragging=t[11],F((function(){return i=!1}))),!a&&2097152&f[0]&&(a=!0,h.forceAnchorDrag=t[21],F((function(){return a=!1}))),!o&&1048576&f[0]&&(o=!0,h.forceOffsetDrag=t[20],F((function(){return o=!1}))),!u&&512&f[0]&&(u=!0,h.moveX=t[9],F((function(){return u=!1}))),!l&&1024&f[0]&&(l=!0,h.moveY=t[10],F((function(){return l=!1}))),!s&&4096&f[0]&&(s=!0,h.resizing=t[12],F((function(){return s=!1}))),!c&&8388608&f[0]&&(c=!0,h.activeResizer=t[23],F((function(){return c=!1}))),e.$set(h)},i:function(t){f||(I(e.$$.fragment,t),f=!0)},o:function(t){q(e.$$.fragment,t),f=!1},d:function(t){Z(e,t)}}}function yr(t){var e,n,r,i,a,o,u;function l(e){t[54].call(null,e)}function s(e){t[55].call(null,e)}function c(e){t[56].call(null,e)}function f(e){t[57].call(null,e)}function h(e){t[58].call(null,e)}var d={annotation:t[67],dataToPx:t[1],pxToData:t[2],visWidth:t[5],editMode:t[7],editorState:t[0],forceAnchorDragTemp:t[22],index:t[26].length-1-t[69]};return void 0!==t[11]&&(d.dragging=t[11]),void 0!==t[9]&&(d.moveX=t[9]),void 0!==t[10]&&(d.moveY=t[10]),void 0!==t[12]&&(d.resizing=t[12]),void 0!==t[23]&&(d.activeResizer=t[23]),e=new hr({props:d}),T.push((function(){return X(e,"dragging",l)})),T.push((function(){return X(e,"moveX",s)})),T.push((function(){return X(e,"moveY",c)})),T.push((function(){return X(e,"resizing",f)})),T.push((function(){return X(e,"activeResizer",h)})),e.$on("selectAnnotation",t[28]),{c:function(){V(e.$$.fragment)},m:function(t,n){K(e,t,n),u=!0},p:function(t,u){var l={};67108864&u[0]&&(l.annotation=t[67]),2&u[0]&&(l.dataToPx=t[1]),4&u[0]&&(l.pxToData=t[2]),32&u[0]&&(l.visWidth=t[5]),128&u[0]&&(l.editMode=t[7]),1&u[0]&&(l.editorState=t[0]),4194304&u[0]&&(l.forceAnchorDragTemp=t[22]),67108864&u[0]&&(l.index=t[26].length-1-t[69]),!n&&2048&u[0]&&(n=!0,l.dragging=t[11],F((function(){return n=!1}))),!r&&512&u[0]&&(r=!0,l.moveX=t[9],F((function(){return r=!1}))),!i&&1024&u[0]&&(i=!0,l.moveY=t[10],F((function(){return i=!1}))),!a&&4096&u[0]&&(a=!0,l.resizing=t[12],F((function(){return a=!1}))),!o&&8388608&u[0]&&(o=!0,l.activeResizer=t[23],F((function(){return o=!1}))),e.$set(l)},i:function(t){u||(I(e.$$.fragment,t),u=!0)},o:function(t){q(e.$$.fragment,t),u=!1},d:function(t){Z(e,t)}}}function br(t){var e,n,r;return{c:function(){y(e=f("div"),"class",n="create-rect "+t[0].createMode+" svelte-1r6aetx"),y(e,"style",r=t[27]())},m:function(t,n){l(t,e,n)},p:function(t,i){1&i[0]&&n!==(n="create-rect "+t[0].createMode+" svelte-1r6aetx")&&y(e,"class",n),134217728&i[0]&&r!==(r=t[27]())&&y(e,"style",r)},d:function(t){t&&s(e)}}}function wr(t){var e,n,r,a,o,h,d,g,m;z(t[42]);for(var b=t[25],_=[],x=0;x'+r.num+''+Yn(t.text)+""))})),h.classed("hide",!e)}5&t.$$.dirty[0]&&v&&n(0,v.pxToData=l,v),3&t.$$.dirty[0]&&v&&n(0,v.dataToPx=u,v),1537&t.$$.dirty[0]|768&t.$$.dirty[1]&&n(27,I=function(){var t=[];if("text"===v.createMode){if(Math.abs(x)<1)return;return t.push("top: "+(M>0?E:E+M)+"px"),t.push("height: "+(M>0?M:-M)+"px"),t.push("left: "+(x>0?N:N+x)+"px"),t.push("width: "+(x>0?x:-x)+"px"),t.join("; ")}if("range"===v.createMode){if(Math.abs(x)<1&&Math.abs(M)<1)return;Math.abs(M)>Math.abs(x)?(t.push("top: "+(M<0?E+M:E)+"px"),t.push("left: 0px"),t.push("width: 100%"),t.push("height: "+Math.abs(M)+"px")):(t.push("top: 0px"),t.push("left: "+(x<0?N+x:N)+"px"),t.push("height: 100%"),t.push("width: "+Math.abs(x)+"px"))}return t.join("; ")}),30720&t.$$.dirty[0]&&(n(14,q=S||C||O),G&&(q?G.classList.add("editing-annotations"):G.classList.remove("editing-annotations")))},[v,u,l,s,c,f,d,p,a,x,M,S,C,O,q,Y,U,o,g,m,y,b,w,_,z,R,B,I,function(t){if(null===t.detail)return n(0,v.selectedTextAnnotations=[],v),n(0,v.selectedRangeAnnotations=[],v),void n(24,z=!1);if("text"===t.detail.type){var e=v.selectedTextAnnotations,r=e.length>1;(e[0]!==t.detail.index||r)&&(n(24,z=!1),n(0,v.selectedTextAnnotations=[t.detail.index],v),n(0,v.selectedRangeAnnotations=[],v))}else n(0,v.selectedRangeAnnotations=[t.detail.index],v),n(0,v.selectedTextAnnotations=[],v)},function(t){var e=Object.entries(t.detail)[0],r=e[0],i=e[1];n(0,v[r]=i,v)},function(t){p&&"Escape"===t.key&&O&&j()},function(t){p&&(n(0,v.selectedTextAnnotations=[],v),n(0,v.selectedRangeAnnotations=[],v))},function(t){p&&((S||O||C&&["l","r"].includes(_))&&(n(9,x+=t.movementX),t.movementX&&(n(24,z=!1),D=!0)),(S||O||C&&["t","b"].includes(_))&&(n(10,M+=t.movementY),t.movementY&&(n(24,z=!1),D=!0)),n(22,w=!1),t.ctrlKey&&!m&&n(22,w=!0))},function(t){p&&(D||n(24,z=t.target.classList.contains("text-edit")||t.target.parentNode.classList&&t.target.parentNode.classList.contains("text-edit")),F(),O&&(function(){if("text"===v.createMode){var t=l(N,E),e=t[0],a=t[1],o=function(t,e){var n=t<0,r=e<0;return n&&r?"br":n&&!r?"tr":!n&&r?"bl":"tl"}(x,M),u=Math.abs(x/f*100),s=Object.assign({},dr(v.defaults.text),{x:e,y:a,align:o,width:u});Math.abs(x)<10&&Math.abs(M)<10&&(s.width=25,s.align="mc",s.dy=E<100?50:-50,s.connectorLine.enabled=!0),Y&&(s.mobileFallback=!1),r.unshift(s),n(36,r)}else if("range"===v.createMode){var c=l(N,E),h=c[0],d=c[1],p=l(N+x,E+M),g=p[0],m=p[1],y=Math.abs(x)>Math.abs(M)?"x":"y",b="range";("x"===y&&Math.abs(x)<10||"y"===y&&Math.abs(M)<10)&&(b="line");var w=Object.assign({},dr(v.defaults[b]),{type:y,display:b,x0:h,x1:g,y0:d,y1:m});i.unshift(w),n(37,i)}}(),function(){if("text"===v.createMode){if(n(0,v.selectedTextAnnotations=[0],v),n(0,v.selectedRangeAnnotations=[],v),W()[0].render)return;n(24,z=!0),setTimeout((function(){var t=r.length-1,e=o.querySelectorAll(".text-annotation")[t].querySelector(".text-edit");e.focus(),function(t){var e=document.createRange();e.selectNodeContents(t);var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}(e)}))}"range"===v.createMode&&(n(0,v.selectedTextAnnotations=[],v),n(0,v.selectedRangeAnnotations=[0],v))}(),j()))},function(){p&&(S||C)&&F()},function(t){p&&v.createMode&&(n(13,O=!0),n(39,N=t.offsetX),n(40,E=t.offsetY))},r,i,h,N,E,W,function(){n(8,a=window.innerWidth)},function(t){n(19,m=t)},function(t){n(24,z=t)},function(t){n(11,S=t)},function(t){n(21,b=t)},function(t){n(20,y=t)},function(t){n(9,x=t)},function(t){n(10,M=t)},function(t){n(12,C=t)},function(t){n(23,_=t)},function(e){L(t,e)},function(t){T[t?"unshift":"push"]((function(){n(17,o=t)}))},function(t){n(11,S=t)},function(t){n(9,x=t)},function(t){n(10,M=t)},function(t){n(12,C=t)},function(t){n(23,_=t)},function(t){T[t?"unshift":"push"]((function(){n(18,g=t)}))}]}return function(t){function e(e){t.call(this),Q(this,e,_r,wr,o,{textAnnotations:36,rangeAnnotations:37,dataToPx:1,pxToData:2,theme:3,cm:4,visWidth:5,annotationKeysSel:38,ariaLabel:6,editMode:7,editorState:0},[-1,-1,-1])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(tt)}()}));function Vu(t){if(!t||"object"!=typeof t)return t;try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}function Ku(t){return dw.column("x",[t],"date").val(0)}function Zu(t){return function(e,n){return e=Ku(e),[t.x(e),t.y(n)].map((function(t){return isNaN(+t)?t:+t.toFixed(1)}))}}function Ju(t){return function(e,n){return[e=ea("%Y/%m/%d %H:%M")(t.x.invert(e)),n=t.y.invert(n).toFixed(4)]}}function Qu(t){var e=t.__canvas,n=e.size,r=e.margin;t._$chart.select("div.annotations-outer").style("width",n.width+"px").style("height",n.height+"px").style("top",r.t+"px").style("left",r.l+"px")}De.extend(Ce),De.extend(Ee),De.extend(Ne),De.extend((function(t,e){var n=e.prototype,r=n.format;n.format=function(t){var e=this,n=t||"YYYY-MM-DDTHH:mm:ssZ",i=this.$locale().seasonSeparator||"-",a=n.replace(/(\[[^\]]+])|BB|B/g,(function(t,n){var r,a,o=e.$y,u=o+1,l="B"===t,s=l?[String(o).slice(-2),2]:[o,4],c=[String(u).slice(-2),2];return n||(l?"'":"")+(r=e.$utils()).s.apply(r,s.concat(["0"]))+i+(l?"'":"")+(a=e.$utils()).s.apply(a,c.concat(["0"]))}));return r.bind(this)(a)}})),dw.visualization.register("column-chart",(function(){var t=!0;return{checkDataset:function(t){var e=this,n=e.dataset;n.limitRows(e.isTimeScale()?400:100),n.limitColumns(500),e.initGetColor(),e.setRoot(t),e.axesDef=e.axes(),e.__lastRow=0},render:function(e){var r=this;if(r.size().filter((function(t){return!isFinite(t)||t<=0})).length)r.renderingComplete();else if(r.checkDataset(e),r.axesDef){t&&(r.initLocales(),t=!1),Gu(r,e);var i=r.initCanvas(e);r._marginChangeCount=0,r.__themeProps=Bu(r.theme()),r._minus=Hu(r.theme(),"typography.chart.minusCharacter","−"),function(t){var e=t.colorMap(),r=t.chart(),i=Wu(t.chart().get("id")),a=t.get("valueLabels.show","hover"),o=t.get("valueLabels.enabled",!0),u="column-chart"===t.meta.id,l=t._$chart,s=t.chartBbox();t.highlight={delay:"column-chart"===t.meta.id?0:200,timer:null,column:null,inactive:!0,set:function(c,f){t.highlight.column!==c&&(t.highlight.timer&&clearTimeout(t.highlight.timer),t.highlight.timer=setTimeout((function(){t.highlight.inactive=!1,l.select(".container").classed("has-hover",!0);var h=t.chart().hasHighlight(),d=l.selectAll("rect.column");d.classed("hover",(function(t){return c&&t.key===c.key})),u?d.style("fill",(function(t){if(c&&t.key===c.key){var r=h?t._columnFill:n(t._columnFill).darken(.9).hex();return e(r)}if(t.key!==c.key)return e(t[h&&!t._isHighlighted?"_hlColor":"_columnFill"])})):(d.classed("unfocus",(function(t){return c&&t.key!==c.key})),l.selectAll(".cc-swatch").classed("hover",(function(t){return c&&t.key===c.key})).classed("unfocus",(function(t){return c&&t.key!==c.key})));var p=o&&"hover"!==a?"unfocus":"dontshow";if(l.selectAll("div.label.series").classed("hover",(function(t){return t&&c&&t.key===c.key})),l.selectAll("div.label.value").each((function(t){var e=ht(this);c&&t?t.key===c.key?e.classed("hover",!0).classed("dontshow",!o).classed("unfocus",!1):(e.classed("hover",!1),e.classed(p,h&&!t._isHighlighted||!h),h&&t._isHighlighted&&(e.classed("unfocus",!0),e.classed("dontshow",!1))):e.classed("hover",!1)})),!f){var g=t.getXAxisPosition();l.selectAll(".label.series text").tspans((function(e){if(c){var n=u?e.key===c.key:e.x===c.x,r=t._xFormatter.map((function(t){return n?t(e.x):""}));return"top"===g&&r.reverse(),r}})).attr("dx",(function(t){var e=r.getElementBounds(this.parentElement),n=0;return n=Math.min(s.right-e.right,n),n=Math.max(s.left-e.left,n)}))}l.selectAll(".tick.primary").classed("unfocus",!0),i("highlight.set",{column:c.key})}),t.highlight.inactive?t.highlight.delay:1),t.highlight.column=c)},clear:function(){var n=t.get("valueLabels.enabled",!0),r=t.get("valueLabels.show","hover"),a=t.chart().hasHighlight(),o=l.selectAll("rect.column");if(l.select(".container").classed("has-hover",!1),t.highlight.column=null,t.highlight.inactive=!0,t.highlight.timer&&clearTimeout(t.highlight.timer),l.selectAll(".hover").classed("hover",!1),u&&o.style("fill",(function(t){return a&&!t._isHighlighted?e(t._hlColor):e(t._columnFill)})),a){var s=n&&"hover"!==r?"unfocus":"dontshow";l.selectAll("div.label.value:not(.highlighted)").classed(s,!0),l.selectAll("div.label.value.highlighted").classed("unfocus",!1).classed("dontshow",!1),l.selectAll("rect.highlighted").classed("unfocus",!1),l.selectAll("rect:not(.highlighted)").classed("unfocus",!0)}else l.selectAll(".unfocus").classed("unfocus",!1),"hover"===r&&l.selectAll("div.label.value").classed("dontshow",!0);l.selectAll(".cc-swatch").classed("unfocus",(function(e){return a&&!t.__highlightedSeries.length&&!e._isHighlighted})),l.selectAll(".series.label text").text(""),l.selectAll(".tick.primary").classed("unfocus",!1),i("highlight.clear")}}}(r),r.renderChart(e,i),r.renderingComplete()}else r.renderingComplete()},renderChart:function(){this.getBarColumn()&&this.renderSharedMarkup()},renderSharedMarkup:function(t){var e=this,n=e.__canvas.margin,r=e.__svgMarkup.svgRoot;e.renderAnnotations(),e.initScalesAndGrids(),e.initValueFormatter(),r.transition().duration(t?e.animation.duration:0).attr("transform","translate("+n.l+","+n.t+")"),e.renderAnnotations(),e.renderColumns(),e.addValueLabels(),e.addLabels("series"),e.addXGridHoverLabels()},marginsChanged:function(){if(!(this._marginChangeCount++>15)){var t=this.__canvas,e=t.size,n=t.margin;n.b=n.annotationKeys+n.legend.bottom,n.t=n.legend.top,n.l=Math.max(n.yGrid.left,n.xGrid.left),n.r=Math.max(n.yGrid.right,n.xGrid.right,n.directLabels),n.t+=Math.max(n.xGrid.top+n.labels.top,n.yGrid.top),n.b+=Math.max(n.xGrid.bottom+n.labels.bottom,n.yGrid.bottom),e.width=e.outerWidth-n.l-n.r,e.height=e.outerHeight-n.t-n.b,this.initScalesAndGrids()}},initScalesAndGrids:function(){var t=this;t.calculateScales(),t.renderYGrid(),t.renderXGrid(),t.seriesAndValueLabelPadding(),t.adjustXGrid()},calculateScales:function(){var t=this,e=t.__canvas,n=e.size,r=e.marginInner;t.__scales={y:Di().domain(t.getDomain()).range([n.height,0]),x:(t.isTimeScale()?Ao:ri)().domain(t.getDomainX()).rangeRound([r.l,n.width-r.r])}},seriesAndValueLabelPadding:function(){var t=this,e=t.__canvas,n=e.size,r=e.margin;t.__rotateLabels=t.rotateLabels();var i=t.getDomain(),a=t.valueDistribution().diverging,o={tpad:0,bpad:0},u=[n.height,0],l=Di().domain(i).range(u),s=0;!function e(r,i){var o={tpad:0,bpad:0},u=t.checkSeriesLabelSpace(r,n.height,i),l=t.checkValueLabelSpace(r,n.height,i);if(t._isGrouped()&&a)return r.tpad+=l.tpad,void(r.bpad+=u.bpad+l.bpad);[u,l].forEach((function(t){Object.keys(t).forEach((function(e){o[e]=Math.max(t[e],o[e])}))})),(o.tpad>0||o.bpad>0)&&r.tpad+r.bpad0?n.y(0)-n.y(t.value):n.y(t.value)-n.y(0)})).style("fill",(function(t){return!i||i&&t._isHighlighted?a(t._columnFill):a(t._hlColor)}))}l.exit().remove(),t=l.enter().append("rect.column"),u&&s(!1,t),s(u)},addLabels:function(t){var e=this,n=e.chart(),r=e.get("valueLabels.enabled",!0),i=e.chart().hasHighlight();if(("value"!==t||r||i)&&("series"!==t||!e.isTimeScale())){var a,o=e.__update,u=e.__scales,l=e.__canvas.margin,s=e.valueDistribution(),c=s.diverging,f=s.neg,h="value"===t?e.valueDist():e.seriesDist(),d="series"===t&&e.__rotateLabels,p="series"===t?e.seriesLabelData():e.columnData(),g=e.labelHeight("X","value",100),v=o?e._$chart.select("div.labels."+t):e._$chart.append("div.labels."+t),m=v.selectAll("div.label."+t).data(p,(function(t){return t.x})).classed("rotate90",!1);m.exit().remove(),(a=m.enter().append("div.label."+t).classed("smaller","series"===t&&e.useSmallerLabels()).classed("highlighted",(function(t){return i&&t._isHighlighted}))).append("span").style("color",e.__themeProps[t]),v.selectAll("div.label").classed("outline","value"===t&&!e.isTimeScale()).each((function(n){ht(this).select("span").html("value"===t?e.formatValue(n):n.label)})),o&&y(!1,a),y(o),d&&v.selectAll("div.label.series").classed("rotate90",!0).classed("lbl-align-right",(function(t){return"top"===t.align})).classed("lbl-align-left",(function(t){return"bottom"===t.align})),"value"===t&&e.applyValueLabelClasses()}function y(r,i){var a=i||v.selectAll("div.label");o&&"value"===t&&v.selectAll("div.label").style("overflow","hidden");var s=!!i;a.transition(e.t(r)).style("width",(function(r){return r.lblW="value"===t?n.getElementBounds(ht(this).select("span").node()).width:d?r._rotatedLblW:e.labelSpace(),r.lblW+"px"})).style("left",(function(n){var r=u.x(n.x)-n.lblW/2+e.labelOffset();return"value"===t&&(r=e.fitLabel(r,n.lblW)),r+"px"})).style("top",(function(n){if("value"===t){var r=s?0:n.value,i=r>=0&&!f?-(g+h):h;return u.y(r)+l.t+i+"px"}var a=e._isGrouped()&&c?e.valueLabelSpace():0,o=e.labelHeight(n.label,e.sLblClass(n),n.lblW);if(d){var p=(n.lblW/2+h+2)*("bottom"===n.align?-1:1);return u.y(n.y)+l.t-o/2+p+a+"px"}var v="top"===n.align?h:-(h+o);return u.y(n.y)+l.t+v+a+"px"})).on("end",(function(){return v.selectAll("div.label").style("overflow",null)}))}},addValueLabels:function(){this.addLabels("value")},fitLabel:function(t,e){return Math.min(this.chartBbox().right-e,Math.max(0,t))},applyValueLabelClasses:function(){var t=this.chart().hasHighlight(),e=this.get("valueLabels.enabled",!0),n=this.get("valueLabels.show","hover"),r=this._$chart.selectAll(".label.value");if(t){var i=e&&"hover"!==n?"unfocus":"dontshow";r.classed("highlighted",(function(t){return t._isHighlighted})).classed(i,(function(t){return!t._isHighlighted}))}else r.classed("dontshow","hover"===n&&e)},addXGridHoverLabels:function(){var t=this;if(t.isTimeScale()){t.initDateFormatter();var e=t.__svgMarkup.gridAbove,n=t.__scales,r=e.select("g.x-tick-labels").append("g.labels.series"),i=t.columnData(),a="top"===t.getXAxisPosition(),o=t.__themeProps.xGridOpts.tickLabels,u=Hu(t.__themeProps.xGridOpts,"tickLabels.fontSize",Hu(t.theme(),"style.chart.fontSize",12)),l=r.selectAll("g.label.series").data(i).enter().append("g.label.series").classed("top",a).classed("bottom",!a).translate((function(t){return[n.x(t.x),0]}));["bg","fg"].forEach((function(e){var n=l.append("text.label.series."+e).attr("y",a?-1*(t._xFormatter.length-1)*(u+3):u).classed("dw-bold",!0).style("font-size",o.fontSize?o.fontSize+"px":null);"fg"===e&&n.style("fill",o.color)}))}},useSmallerLabels:function(){return this.segmentWidth()<30},rotateLabels:function(){var t=this,e=t.get("rotate-labels","auto");if("on"===e)return!0;if("off"===e)return!1;var n=!1;return t.seriesLabelData().forEach((function(e){n||t.labelWidth(e.label,t.sLblClass(e),0)>t.labelSpace()&&(n=!0)})),n},sLblClass:function(t){var e=this._isColumnChart()?"hover":"",n=t._isHighlighted;return"label series"+(this.useSmallerLabels()?" smaller":"")+" "+(n?"highlighted":e)},getBarColumn:function(t){var e=this.__lastRow;if(void 0===e)throw new Error("filter must not be undefined");return void 0===this.axesDef.columns[e]?null:this.dataset.column(this.axesDef.columns[e])},update:function(){var t=this;delete t.__columnWidth,delete t.__seriesLabelData,delete t.__domain,delete t.__dataDomain,t.__update=!0,t.renderSharedMarkup(!0)},getDomain:function(){var t=this;return t.__domain||(t.__domain=t.applyCustomRange(t.dataDomain())),t.__domain},dataDomain:function(){var t=this;if(t.__dataDomain)return t.__dataDomain;var e=t.columnData().filter((function(t){return!t.noData})).map((function(t){return t.value})),n=[Math.min.apply(Math,e.concat([0])),Math.max.apply(Math,e.concat([0]))];return t.get("absolute-scale",!1)&&(n=dw.utils.minMax(t.axes(!0).columns),n=[Math.min(0,n[0]),Math.max(0,n[1])]),t.__dataDomain=n,n},applyCustomRange:function(t){var e=[t[0],t[1]],n=this.useCustomRange(),r=this.get("custom-range",[]).map((function(t){return+t}));return n[0]&&(e[0]=Math.min(r[0],t[0])),n[1]&&(e[1]=Math.max(r[1],t[1])),e},useCustomRange:function(){var t=this.getBarColumn().range(),e=this.get("custom-range",["",""]);if(""===e[0]&&""===e[1])return[!1,!1];e=e.map((function(t){return+t}));var n=[];return n[0]=!isNaN(e[0])&&e[0]t[1],n},leftOffset:function(){var t=this.getColumnWidth();return Math.round((this.isTimeScale()?0:this.segmentWidth())/2-t/2)},chartBbox:function(){var t=this;return t.__chartBbox||(t.__chartBbox=t.chart().getElementBounds(t._$chart.node())),t.__chartBbox},labelOffset:function(){return this.__canvas.margin.l+(this.isTimeScale()?0:this.segmentWidth()/2)},nSeries:function(){return this.columnData().length},labelSpace:function(){return.9*this.segmentWidth()},columnWidth:function(){return this.getColumnWidth()},segmentWidth:function(){var t=this.__canvas,e=t.size,n=t.marginInner;return(e.width-n.l-n.r)/this.nSeries()},axisLabelsAlignment:function(){return this._isStacked()&&this.useDirectLabeling()?"left":this.get("yAxisLabels.alignment","left")},getColumnWidth:function(){var t=this;if(t.__columnWidth)return t.__columnWidth;var e=t.__canvas.size,n="grouped-column-chart"===t.meta.id?"series":"bar",r=1-.5*t.get(n+"-padding",30)/100;if(t.isTimeScale()){var i=t.getDates(),a=i.slice(1).map((function(t,e){return t-i[e]})),o=Math.min.apply(null,a.filter(Boolean)),u=a.reduce((function(t,e){return t+(e>o?e/o-1:0)}),0),l=i.length+u,s=e.width/(l+1)*r,c=t.getDomainX(!0),f=t.getDomainX(),h=Math.abs(c[1]-c[0])/Math.abs(f[1]-f[0]);return t.__columnWidth=Math.round(s*h),t.__columnWidth}var d=t.getDomainX().length;if(t.__columnWidth=e.width/d*r,t.groupSpacing()){var p=t.nSeries(),g=t.get("yAxisLabels.enabled",!0)?p:p-1;t.__columnWidth-=t.groupSpacing()*g/p}return t.__columnWidth},getCustomTicksY:function(){var t=this,e=t.get("custom-ticks","");return e?dw.column("x",e.split(","),"number").values().map((function(e){return e*(t.isNormalized()?.01:1)})):[]},getCustomTicksX:function(){var t=this.getDates();if(!this.get("custom-ticks-x"))return t.length<5?t:[];var e=dw.column("labels",this.get("custom-ticks-x").split(","),"date").values();return!(e=e.filter(ju).sort((function(t,e){return t.getTime()-e.getTime()}))).length&&t.length<5?t:e},renderYGrid:function(){var t=this,e=t.__canvas,n=e.size,r=e.margin,i=e.marginInner,a=t.getColumnFormat(),o=[a["number-prepend"]||"",a["number-append"]||""],u=Math.pow(10,-a["number-divisor"]||0),l=t.__svgMarkup,s=l.gridBelow,c=l.gridAbove,f=t.theme(),h=t.get("yAxisLabels.enabled",!0),d=t.get("grid-lines",!0),p=t.getCustomTicksY(),g=t.isNormalized(),v=!h&&!d,m=t.get("y-grid-format","auto"),y=t.axisLabelsAlignment(),b=t.chart();if(r.yGrid=function(t){var e=ye("y",t),n=e.options,r=e.themeOpts,i=Oe(n),a=i.ticksMinor,o=i.ticksMajor,u=[an,on,un,ln],l={top:0,left:0,right:0,bottom:0,labelWidth:0},s=n.tickPosition;return u.forEach((function(t){var e=t({options:n,themeOpts:r,ticksMajor:o,ticksMinor:a});e&&e.width>l[s]&&(l[s]=e.width),e&&e.top>l.top&&(l.top=e.top),e&&e.bottom>l.bottom&&(l.bottom=e.bottom),e&&e.labelWidth>l.labelWidth&&(l.labelWidth=e.labelWidth)})),l}({visId:"column-chart",className:"grid-y",belowChart:s,aboveChart:c,scale:t.__scales.y,scaleType:"number",plotSize:[n.width,n.height],tickPosition:y,tickLabels:h,gridLines:d,theme:f,tickLabelsInside:t.insideTicks(),secondary:!0,tickLabelFormat:g?m.replace("%",""):m,tickLabelMultiply:g?100:u,tickLabelUnit:g?["","%"]:o,minusChar:t._minus,baseLine:["zero"],ticks:{major:{values:p.length&&!v?p:void 0}},emotion:b.emotion,translate:b.translate}),t.insideTicks()){var w=[];c.selectAll("text.y-tick-label tspan").each((function(e){var n=ht(this);if(o[0]||o[1]){var a=n.text(),u=a.replace(o[0],"").replace(o[1],"");n.text(u),w.push(t.chart().getElementBounds(n.node()).width),n.text(a),i[y.slice(0,1)]=Math.max.apply(Math,w)+5}else i[y.slice(0,1)]=r.yGrid.labelWidth+5}))}for(var _=0,x=["top","left","bottom","right"];_r[M.slice(0,1)]){t.marginsChanged();break}}},renderXGrid:function(){var t=this,e=t.__svgMarkup,n=e.gridBelow,r=e.gridAbove,i=t.__canvas,a=i.size,o=i.margin,u=t.__scales,l=t.theme(),s=Hu(l,"style.chart.gridFrame.vertical",[]),c=t.verticalBaseLine(),f=!t.isTimeScale()&&c;if(t.isTimeScale()||c){var h=t.axisLabelsAlignment(),d=[];c&&(s.includes("axisSide")&&d.push(h),s.includes("oppositeSide")&&d.push("left"===h?"right":"left"));var p=t.getXAxisPosition(),g=t.get("grid-lines-x.enabled",!1),v=t.getCustomTicksX(),m=t.get("x-grid-format","auto"),y=t.chart(),b=t.get("grid-lines-x.type","ticks"),w=Di().range([0,1]).domain([0,1]),_={visId:"column-chart",className:"grid-x",belowChart:n,aboveChart:r,scale:f?w:u.x,scaleType:"date",secondary:!1,plotSize:[a.width,a.height],tickPosition:p,gridLines:!f&&"lines"===b&&g,tickLines:!f&&"ticks"===b&&g,tickLabels:!f,theme:l,tickLabelFormat:m,minusChar:Hu(l,"typography.chart.minusCharacter","−"),baseLine:d,ticks:{major:{values:v.length&&!f?v:void 0}},translate:y.translate,emotion:y.emotion};t.__xFormat="auto"===m?Be(u.x.domain(),Oe(_).ticksMajor):m;for(var x=Qe(_),M=0,k=["top","left","bottom","right"];M1){o.xGrid=Qe(_),t.marginsChanged();break}}}},adjustXGrid:function(){var t=this.__canvas.marginInner;t.b&&this._$chart.selectAll("g.x-tick-lines, g.x-tick-labels").each((function(e){var n=ht(this).attr("transform").match(/([\d.]+)[^\d+]([\d.]+)/);if(n){var r="translate("+n[1]+","+(parseFloat(n[2])+t.b)+")";ht(this).attr("transform",r)}}))},verticalBaseLine:function(){var t=this.get("yAxisLabels.enabled",!0),e=Hu(this.theme(),"style.chart.gridFrame.vertical",[]);return t&&e.length&&!this.insideTicks()},valueDistribution:function(){var t=!0,e=!0;return this.columnData().forEach((function(n){n.value<0&&(t=!1),n.value>0&&(e=!1)})),{pos:t,neg:e,mix:!e&&!t}},getXAxisPosition:function(){var t=this.__domain||this.getDomain();return this.valueDistribution().neg&&0===Math.max.apply(Math,t)?"top":"bottom"},tickDist:function(){return Hu(this.theme(),"vis.column-chart.axes.tickDist.vertical",8)},valueDist:function(){return Hu(this.theme(),"vis.column-chart.labels.values.dist",5)},seriesDist:function(){var t=this.__themeProps.xGridOpts.tickLabels.distance;return this.isTimeScale()?t:Hu(this.theme(),"vis.column-chart.labels.series.dist",t)},xTickLength:function(){var t=this.get("grid-lines-x.enabled",!1);return"ticks"===this.get("grid-lines-x.type","ticks")&&t?Hu(this.theme(),"style.chart.axes.ticks.horizontal.length",5):0},xTickFontSize:function(){return function(t,e,n,r){var i=null;return e.forEach((function(e){null===i&&(i=Hu(t,e+"."+n))})),i||r}(this.theme(),["vis.column-chart.labels.ticks.horizontal","style.chart.labels.ticks.horizontal","typography.chart"],"fontSize",12)},valueLabelH:function(){return this.__vLblHeight=this.__vLblHeight||this.labelHeight("10","value",100),this.__vLblHeight},valueLabelSpace:function(){return this.valueLabelsEnabled()?this.valueLabelH()+this.valueDist():0},valueLabelsEnabled:function(){return this.get("valueLabels.enabled",!0)||this.chart().hasHighlight()},groupSpacing:function(){return"grouped-column-chart"!==this.meta.id?0:Hu(this.theme(),"vis.grouped-column-chart.axes.gridlines.gapBetweenGroups",0)},renderGridGroups:function(){var t=this,e=t.__canvas,n=e.size,r=e.margin,i=t.groupSpacing();if(i){var a=t.__svgMarkup,o=a.gridBelow,u=a.gridAbove,l=t.insideTicks(),s=t.nSeries(),c=t.segmentWidth(),f=i/2,h=n.outerWidth-r.r,d=t.columnData().map((function(e,n){return{x1:0===n&&l?0:t.__scales.x(e.x)+f,x2:l&&n===s-1?h:t.__scales.x(e.x)+c-f}}));["grid","base"].forEach((function(t){var e="g.y-"+t+"-lines",n=o.select(e).node()?o:u,r=n.select(e).remove().node();n.selectAll(e).data(d).enter().append((function(){return r.cloneNode(!0)})).each((function(t){ht(this).selectAll("line").attr("x1",t.x1).attr("x2",t.x2)}))}))}},formattedLabel:function(t){return this.dataset.column(this.axes().labels).type(!0).formatter()(this.axes(!0).labels.val(t))+""||""},highlightKey:function(t){return this.formattedLabel(t)},label:function(t){return dw.utils.purifyHtml(this.axes(!0).labels.raw(t),"")||""},colorKey:function(t){var e=this.axes(!0).labels;return"text"!==this.axes(!0).labels.type()?dw.utils.purifyHtml(e.raw(t)):dw.utils.purifyHtml(e.val(t,!0)||e.val(t)||"")},colorKeys:function(){var t=this,e=[];return t.dataset.eachRow((function(n){e.push(t.colorKey(n))})),e},initGetColor:function(){var t=this,e=Hu(t.theme(),"style.chart.highlights.noFade",!1),r=t.get("base-color",0),i={customColors:Object.assign({},t.__customColors,t.get("custom-colors",{})),selectedColor:r};t.get("negative-color",!1)&&(i.negativeColor=t.theme().colors.negative);var a=zr(t.theme(),i),o=a;if(t.chart().hasHighlight()){var u=t.theme().colors.background;o=function(r,i,o,l){return t.chart().isHighlighted(t.formattedLabel(i))||l||e?a(r,i,o):n.interpolate(a(r,i,o),u,.65,"rgb").hex()}}t.getColor=o},fmtColumn:function(){return"column-chart"!==this.meta.id?this.dataset.column(this.axesDef.columns[0]):this.getBarColumn()},getColumnFormat:function(){return this.chart().get("metadata.data.column-format",{})[this.fmtColumn().name()]||{}},initValueFormatter:function(){var t,e,n=this,r=n.isNormalized(),i=n.shortPrependAppend()&&!r,a=n.getColumnFormat(),o=n.get("y-grid-format","auto");"auto"===o&&(t=n.__scales.y.domain(),e=Math.abs(t[1]-t[0]),o=e<1?"0,0.00[0]":e<3?"0,0.0[0]":e<1e4?"0,0.[0]":e>1e6||Math.abs(t[0])>1e5||Math.abs(t[1])>1e5?"0,0a":"0,0"),r&&!o.includes("%")&&(o+="%"),n.formatValue=function(t){return t.noData?"":function(t,e){var n=(e=Object.assign({},{format:"0.[00]",prepend:"",append:"",minusChar:"−",multiply:1},e)).format,r=e.append,i=e.prepend,a=e.minusChar,o=e.multiply;n.includes("%")&&Number.isFinite(t)&&(t*=.01),t*=o;var u=n.indexOf("(")>-1,l=_e(u?t:Math.abs(t)).format(n);return i&&!u&&t<0&&Pu.has(i.trim().toLowerCase())?""+a+i+l.replace("+","")+r:i&&t>=0&&Pu.has(i.trim().toLowerCase())&&n.includes("+")?(0===t?"±":"+")+i+l.replace("+","")+r:0===t&&n.includes("+")?""+i+l.replace("+","±")+r:t<0&&!u?""+i+a+l.replace("+","")+r:""+i+l+r}(t.value*(r?100:1),{format:o,append:i&&a["number-append"]||"",prepend:i&&a["number-prepend"]||"",multiply:Math.pow(10,-a["number-divisor"]||0),minusChar:n._minus})}},_isStacked:function(){return"stacked-column-chart"===this.meta.id},_isGrouped:function(){return"grouped-column-chart"===this.meta.id},_isColumnChart:function(){return"column-chart"===this.meta.id},isNormalized:function(){return!!this._isStacked()&&(!this.valueDistribution().diverging&&this.get("normalize",!1))},getDates:function(t){var e=this,n=e.dataset.list().map((function(t,n){return{date:t[e.axesDef.labels],_i:n}})).filter((function(t){return ju(t.date)}));return e.isMMMFormat()&&(n=e.fixMMMFormat(n)),n=n.sort((function(t,e){return t.date.getTime()-e.date.getTime()})),t?n:n.map((function(t){return t.date}))},isMMMFormat:function(){var t=this.axes(!0).labels,e=Array.from({length:t.length}).map((function(e,n){return t.raw(n)}));return"MMM"===dw.column.types.date(e).format()},fixMMMFormat:function(t){var e=!1,n=0;return t.forEach((function(r,i){e||0===i||(n=ju(t[i-1].date)?t[i-1].date.getTime():n,ju(r.date)&&r.date.getTime()=0?"top":"bottom",t.y=0,t}))),this.__seriesLabelData},getDomainX:function(t){var e=this;if(e.isTimeScale()){var n=e.getDates(),r=Ur(n),i=t?[]:e.get("custom-range-x",[]);return i.length&&(dw.column("",i,"date").values().forEach((function(t){ju(t)&&r.push(t)})),r=Ur(r)),function(t,e){var n=t[0].getTime(),r=t[1].getTime(),i=(r-n)*e;return[new Date(n-i),new Date(r+i)]}(r,.5/n.length)}return e._isStacked(),e.columnData().map((function(t){return t.x}))},setRoot:function(t){ht(t).classed(this.chart().get("type"),!0).style("position","relative")},renderAnnotations:function(t,e){var n=this,r=n.__canvas,i=r.size,a=r.margin;if(n.__scales||n.calculateScales(),n._annotationLayer){var o=Zu(n.__scales,i.height,n.__domain),u=Ju(n.__scales,i.height,n.__domain);Qu(n),n._annotationLayer.$set({dataToPx:o,pxToData:u})}else n._annotationLayer=function(t){var e=t.__canvas.size,n=t.chart(),r=t._$chart,i=t.__scales,a=t.chart().inEditor(),o=a?function(){var t=window.parent.dw.backend.hooks.call("get-annotation-controls").results;if(t&&t.length)return window.__registerAnnotationControls=void 0,t[t.length-1];window.__registerAnnotationControls=function(t){s.$set({editMode:!0}),t.syncAnnotationLayer(s)}}():null,u=Vu(t.get("text-annotations",[])),l=Vu(t.get("range-annotations",[]));if(u.length||l.length||a){u.forEach((function(e){e.x=Ku(e.x),e.y=+e.y,t.isNormalized()&&(e.y=e.y/100)})),l.forEach((function(e){e.x0=Ku(e.x0),e.x1=Ku(e.x1),e.y0=+e.y0,e.y1=+e.y1,t.isNormalized()&&(e.y0=e.y0/100,e.y1=e.y1/100)}));var s,c=r.append("div.annotation-keys"),f=r.append("div.annotations-outer").append("div.annotations"),h=Zu(i),d=Ju(i);if(Qu(t),t._annotationLayer)try{t._annotationLayer.$destroy()}catch(t){}t.isTimeScale()&&!t.__filterUI&&(s=new Xu({target:f.node(),props:{textAnnotations:u,rangeAnnotations:l,dataToPx:h,pxToData:d,theme:t.theme(),cm:t.colorMap(),visWidth:e.width,annotationKeysSel:c}}),o&&(s.$set({editMode:!0}),o.syncAnnotationLayer(s))),o&&function(t,e){if(t&&!e){var n=o.get().editorState;n.disableControls=!1,o.set({editorState:n})}else{var r=e?"Annotations can not be used because the chart is currently set to display tabs.":"Annotations can not be used because you are not using a date axis.",i=o.get().editorState;i.disableControls=!0,i.messages={disableControls:r},o.set({editorState:i})}}(t.isTimeScale(),!!t.__filterUI);var p=r.select(".annotation-keys:not(.hide)").node();return t.__annotationKeyHeight=p&&p.children.length?n.getElementBounds(p).height+20:0,s}}(n);a.annotationKeys=n.__annotationKeyHeight||0},shortPrependAppend:function(){var t=this.getColumnFormat();return((t["number-prepend"]||"").trim()+(t["number-append"]||"").trim()).length<4},initLocales:function(){cn(this.chart().locales);try{var t=this.chart().locales.dayjs;t&&De.locale(t)}catch(t){}try{var e=this.chart().locales.numeral;e&&function(t){Ru||(_e.register("locale","dw",t),_e.locale("dw"),Ru=!0)}(e)}catch(t){}},initDateFormatter:function(){var t=this.__xFormat,e=0;this._$chart.selectAll(".x-tick-labels text").each((function(t){e=Math.max(this.childElementCount,e)})),this._xFormatter=t.split("|").reduce((function(t,n){return t.length0?e.y(0)-e.y(t.value):e.y(t.value)-e.y(0)})).attr("width",t.columnWidth()-r).attr("y",(function(t){return t.value>0?e.y(t.value):e.y(0)})),n&&i.selectAll("rect.column").classed("highlighted",(function(t){return t._isHighlighted})).classed("unfocus",(function(t){return!t._isHighlighted}))},addValueLabels:function(){var t=this,e=t.chart(),r=t.get("valueLabels.enabled",!0),i=t.chart().hasHighlight();if(r||i){var a="outside"===t.get("valueLabels.placement"),o=t.__scales,u=t.__canvas.margin,l=t.valueDist(),s=t.labelHeight("X","value",100),c=t._$chart.append("div.labels.values").selectAll("div.label-group.values").data(t.columnData()).enter().append("div.label-group.values").selectAll("div.label.value").data((function(t){return t.data})).enter().append("div.label.value").classed("inside",!a).classed("inverted",(function(t){return!a&&n(t._columnFill).lab()[0]<70}));c.append("span.fg").style("color",a?t.__themeProps.value:null).html((function(e){return t.formatValue(e,!t.shortPrependAppend())})),c.style("left",(function(n,r){var i=ht(this).select("span"),a=e.getElementBounds(i.node()).width,l=(t.segmentWidth()-t.groupWidth())/2+t.columnWidth()*(.5+r);return t.fitLabel(o.x(n.x)+u.l+l-a/2,a)+"px"})).style("top",(function(t){if(a){var e=t.value>=0?-(s+l):l;return o.y(t.value)+u.t+e+"px"}return o.y(t.value)+u.t-(t.value<0?s+5:-5)+"px"})),t.applyValueLabelClasses()}},addDirectLabels:function(){var t=this;if(t.useDirectLabeling()){var e=t.colorMap(),r=t.__canvas,i=r.margin,a=r.size,o=t._$chart.selectAll("g.column-group.last rect").nodes().filter((function(t){return ht(t).datum().label})).map((function(r,o){var u=ht(r).datum(),s=t.__scales.y(u[u.value<0?"y0":"y1"])+i.t;return t.__last_bar={x:t.__scales.x(u.x)+t.labelOffset()-t.columnWidth()/2,w:t.columnWidth()},{label:ht(r).datum().label,x:a.outerWidth-i.r+20,y:s+u._height/2,oy:s+u._height/2,w:i.r-20,align:"left",valign:"middle",cl:"",rotate:0,sl2Key:"row-"+o,color:t.get("use-line-color")?e(l(ht(r).datum()._columnFill)):n(t.__theme.colors.background).lab()[0]<50?"#ffffff":"#000000"}})),u=t._$chart.selectAll("div.label.direct").data(o).enter().append("div.label.direct").style("right","0px").style("width",(function(t){return t.w+"px"})).append("span").style("color",(function(t){return t.color})).html((function(t){return t.label})).parent().style("top",(function(e){var n=t.chart().getElementBounds(this).height;return e.y-n/2+"px"}));!function(t){var e=t.labels,n=t.pad,r=t.valign,i=t.ymin,a=t.chart;if(e.nodes().length){var o=1,u="top"===r?0:"middle"===r?.5:1;e.each((function(t){t.__noverlap={otop:t.y,top:t.y,dy:0},ht(this).style("height","auto")})),function t(){var r=!1;e.nodes().forEach((function(t,i){e.nodes().forEach((function(e,o){var l=ht(t).datum(),s=ht(e).datum(),c=a.getElementBounds(t),f=a.getElementBounds(e);if(o>i){var h,d,p=c.left,g=f.left,v=p+c.width,m=g+c.width,y=l.__noverlap.top-n,b=s.__noverlap.top-n,w=y+c.height+2*n,_=b+f.height+2*n;g>v||mw||_50?r[0]>85?n.lab(80,r[1],r[2]):e:r[0]<15?n.lab(20,r[1],r[2]):e}},useDirectLabeling:function(){return this._isStacked()&&this.get("categoryLabels.enabled",!0)&&"direct"===this.get("categoryLabels.position","direct")},connectBars:function(){var t=this;if(t._isStacked()&&t.get("connect-bars")){var e=t.valueDistribution(),n=e.neg,r=e.pos;if(n||r){var i=t.__svgMarkup.svgRoot,a=t.__scales,o=t.columnData(),u=t.getColumnWidth(),l=Hu(t.theme(),"vis.stacked-column-chart.connectBars.opacity",.15),s=o.length;o.forEach((function(e,r){if(!(r>s-2)){var c=t.isTimeScale()?0:t.segmentWidth()/2;e.data.forEach((function(t,e){var s=o[r+1].data[e],f=t._height,h=s._height,d=Math.round(a.x(t.x)+u/2+c),p=Math.round(a.x(o[r+1].x)-u/2+c),g=a.y(t[n?"y0":"y1"]),v=a.y(s[n?"y0":"y1"]),m="M"+d+" "+g+"L"+d+" "+(g+f)+" L"+p+" "+(v+h)+" L"+p+" "+v;i.append("path").attr("d",m).attr("fill",t._columnFill).attr("opacity",l)}))}}))}}},valueLabelSpace:function(){var t=this,e=t.get("valueLabels.enabled",!0),n="inside"===t.get("valueLabels.placement"),r=t.chart().hasHighlight();if(t._isStacked()||n)return 0;if(r||e){var i=t.valueDist();return t.labelHeight("X","label value",100)+i}return 0},valueDistribution:function(){var t=this;if(t.__valueDistribution)return t.__valueDistribution;var e=!1,n=!0,r=!0;return t.axes(!0).columns.forEach((function(t){var i=t.range();i[0]!==Number.MAX_VALUE&&((i[0]<0&&i[1]>0||i[1]<0&&i[0]>0)&&(e=!0),t.each((function(t){t>0&&(r=!1),t<0&&(n=!1)})))})),t.__valueDistribution={diverging:e,neg:r,pos:n,mix:!r&&!n},t.__valueDistribution},highlightedSeries:function(){var t=this;t.__highlightedSeries=[],t.chart().hasHighlight()&&t.axes(!0).columns.forEach((function(e,n){t.chart().isHighlighted(e.name())&&t.__highlightedSeries.push(e.name())}))},highlightedKeys:function(){var t=this;if(t.hlKeys=[],t.chart().hasHighlight()){var e=t.axes(!0).labels.type(!0).formatter();t.axes(!0).columns.forEach((function(n,r){n.each((function(r,i){var a=e(t.axes(!0).labels.val(i))+"",o=n.name()+"-"+i;t.chart().isHighlighted(a)&&(t.hlKeys.push(o),t.hlKeys.push(a)),t.chart().isHighlighted(n.name())&&-1===t.hlKeys.indexOf(o)&&t.hlKeys.push(o)}))}))}},initializeColors:function(){var t=this,e={};t.axes(!0).columns.forEach((function(n,r){n.each((function(r,i){var a=n.name()+"-"+i,o=t.colorKey(i),u=t.getColor(o,i,a,!0),l=t.getColor(o,i,a);e["row-"+i]={default:l,noFade:u},e[a]={default:l,noFade:u}}))})),t.colorData=e},legendPadding:function(){return{top:Hu(this.theme(),"style.chart.legend.padding.top",0),bottom:Hu(this.theme(),"style.chart.legend.padding.bottom",20)}},repositionLegend:function(){var t=this,e=Hu(t.theme(),"style.chart.legend.position","top");if("top"!==e&&!(t._isStacked()&&t.useDirectLabeling()||"bottom"!==e)){var n=t.__canvas,r=n.size,i=n.margin,a=i.legend,o=i.annotationKeys,u=r.outerHeight-a.bottom-(o||0)+t.legendPadding().top;t._$chart.select(".legend").style("top",u+"px")}},useLegend:function(){return this.dataset.numRows()>1&&this.get("color-key",!0)},legendHeight:function(t){if(!this.useLegend())return 0;var e=this.legendPadding(),n=this._$chart.select(".legend"),r=this.chart().getElementBounds(n.node()).height;return Math.round(e.top+e.bottom+r)},createGetColor:function(){var t=this,e=Object.assign({},t.__customColors,t.get("custom-colors",{})),r=t.get("base-color",0),i=Hu(t.theme(),"style.chart.highlights.noFade",!1),a=zr(t.theme(),{customColors:e,selectedColor:r,permute:!1,keys:t.colorKeys()}),o=a;if(t.chart().hasHighlight()){var u=t.theme().colors.background;o=function(e,r,o,l){return t.hlKeys.includes(o)||t.hlKeys.includes(e)||l||i||"undefined"===e?a(e,r):n.interpolate(a(e,r),u,.65,"rgb").hex()}}t.getColor=o},getDates:function(t){var e=dw.column.types.date(this.axesDef.columns).parse,n=this.axesDef.columns.map((function(t,n){return{date:e(t),_i:n}})).filter((function(t){return ju(t.date)}));return this.isMMMFormat()&&(n=this.fixMMMFormat(n).sort((function(t,e){return t.date.getTime()-e.date.getTime()}))),t?n:n.map((function(t){return t.date}))},isMMMFormat:function(){return"MMM"===dw.column.types.date(this.axesDef.columns).format()},columnData:function(){return this._columnData()},_columnData:function(){var t=this;if(t.__columnData)return t.__columnData;var e=t.get("sort-values"),n=t.get("reverse-order"),r=(t.isTimeScale()?t.getDates(!0):t.axesDef.columns.map((function(t,e){return t+"-"+e}))).map((function(e,n){n=t.isTimeScale()?e._i:n;var r=t.dataset.column(t.axesDef.columns[n]),i=t.isTimeScale()?e.date:e,a=t.chart().hasHighlight(),o=a&&t.chart().isHighlighted(r.name());return{x:i,range:r.range(),label:t.labelText(r.title()),name:r.name()+"",_isHighlighted:o,data:r.values().map((function(e,n){var u=t.invalidValue(e),l=(u?0:e)/(t.isNormalized()?r.sum():1),s=t.colorKey(n),c=t.axes(!0).labels.val(n),f=a&&t.chart().isHighlighted(t.highlightKey(n));return{_columnFill:t.getColor(s,n,c,!0),_isHighlighted:o||f,key:s+"-"+n,x:i,value:l,noData:u,label:t.formattedLabel(n),r:n}}))}}));return t.isTimeScale()||(e&&(r=t.sortBars(r)),n&&r.reverse()),r},sortBars:function(t){var e="last"!==this.get("sort-by");return t.sort((function(t,n){var r=e?0:t.data.length-1;return t.data[r].value-n.data[r].value}))},labelText:function(t){return/^X\.\d+$/.test(t)?"":t},seriesLabelData:function(){var t=this,e=t.valueDistribution(),n=e.pos,r=e.mix,i=e.diverging;return t.__seriesLabelData||(t.__seriesLabelData=t.columnData().map((function(e){return e.y=i?t.__scales.y.domain()[0]:0,e.align=n||r&&e.range[0]>=0||i?"top":"bottom",e}))),t.__seriesLabelData},isTimeScale:function(){var t=this;if(void 0!==t.__isTimeScale)return t.__isTimeScale;t.axesDef=t.axes();var e=dw.column.types.date(t.axesDef.columns),n=t.axesDef.columns.map((function(t){return e.parse(t)})).filter(ju),r=t.chart().get("metadata.data.column-format",{})[t.axesDef.labels]||{};return t.__isTimeScale=t._isStacked()&&"text"!==r.type&&n.length,t.__isTimeScale}}})),dw.visualization.register("stacked-column-chart","grouped-column-chart",(function(){return{columnData:function(){var t=this;if(t.__stackedColumnData)return t.__stackedColumnData;var e,n=t.get("sort-values"),r=t.get("reverse-order"),i=t._columnData();return t.isTimeScale()&&n&&(e=i.reduce((function(e,n){return t.dataset.column(n.name).values().forEach((function(t,n){e[n]||(e[n]=0),e[n]+=t})),e}),{})),i.forEach((function(a,o){if(t.isTimeScale()){if(n){var u=t.get("sort-by","last");a.data=a.data.sort((function(t,n){return e[t.r]-e[n.r]})),"last"!==u&&a.data.reverse()}r&&a.data.reverse()}var l=0,s=0;a.data.forEach((function(t){t.y0=t.value>=0?l:s,t.y1=t.y0+t.value,l+=t.value>0?t.value:0,s+=t.value<0?t.value:0})),a.posSum=l,a.negSum=s,o===i.length-1&&(a._last=!0)})),t.__stackedColumnData=i,i},seriesLabelData:function(){var t=this,e=t.valueDistribution(),n=e.pos,r=e.mix,i=e.diverging;return t.__seriesLabelData||(t.__seriesLabelData=t.columnData().map((function(t){var e=t.range[0];return{_isHighlighted:t._isHighlighted,label:t.label,x:t.x,sum:t.posSum+t.negSum,y:[t.posSum,t.negSum].includes(0)?0:t[e>=0?"posSum":"negSum"],align:n||r&&e>=0||i&&0!==t.posSum?"top":"bottom"}}))),t.__seriesLabelData},renderColumns:function(){var t=this,e=t.__scales,n=t.chart().hasHighlight(),r=t.colorMap(),i=t.__svgMarkup.gColumns,a=t.columnData(),o=i.selectAll("g.column-group").data(a).enter().append("g.column-group").classed("last",(function(t,e){return e===a.length-1})).translate((function(n){return[e.x(n.x)+t.leftOffset(),0]}));o.selectAll("rect.column").data((function(t){return t.data})).enter().append("rect.column").style("fill",(function(t){return r(t._columnFill)})).attr("height",(function(t){return t._height=Math.abs(e.y(0)-e.y(t.value)),t._height})).attr("width",t.columnWidth()).attr("y",(function(t){return t.value<0?e.y(t.y0):e.y(t.y1)})),n&&o.selectAll("rect.column").classed("highlighted",(function(t){return t._isHighlighted})).classed("unfocus",(function(t){return!t._isHighlighted}))},addValueLabels:function(){var t=this,e=t.chart(),r=t.get("valueLabels.enabled",!0),i=e.hasHighlight();if(r||i){var a=t.__scales,o=t.__canvas.margin,u=t.columnData(),l=t.labelHeight("X","value",100),s=t._$chart.append("div.labels.values").selectAll("div.label-group.values").data(u).enter().append("div.label-group.values").selectAll("div.label.value.inside").data((function(t){return t.data})).enter().append("div.label.value.inside").classed("inverted",(function(t){return n(t._columnFill).lab()[0]<70}));s.append("span.fg").html((function(e){return t.formatValue(e,!t.shortPrependAppend())})),s.style("left",(function(n){var r=e.getElementBounds(this).width;return a.x(n.x)-r/2+t.labelOffset()+"px"})).style("top",(function(t,e){var n=(a.y(t.y0)-a.y(t.y1))/2;return a.y(t.y0)-n+o.t-l/2+"px"})),t.applyValueLabelClasses()}},dataDomain:function(){var t=this;if(t.__dataDomain)return t.__dataDomain;var e=t.isNormalized(),n=0,r=0,i=[],a=[];return t.axes(!0).columns.forEach((function(t){e?(n=0,r=1):(t.each((function(t,e){n=t<0?n+t:n,r=t>0?r+t:r})),i.push(n),a.push(r),n=0,r=0)})),e||(n=Math.min.apply(Math,i),r=Math.max.apply(Math,a)),t.__dataDomain=e?[0,1]:[n,r],t.__dataDomain},getDomain:function(){var t=this;if(t.__domain)return t.__domain;var e=t.dataDomain(),n=t.isNormalized(),r=t.get("custom-range",[]).map((function(t){return+t}));return isNaN(r[0])||(e[0]=r[0]>e[0]?e[0]:r[0]),isNaN(r[1])||(e[1]=r[1]0&&(e[0]=0),e[1]<0&&(e[1]=0),t.__domain=n?[0,1]:e,t.__domain},columnWidth:function(){return Math.round(this.getColumnWidth())},nSeries:function(){return this.columnData().length},useLegend:function(){return!this.useDirectLabeling()&&this.get("categoryLabels.enabled",!0)}}}))}();