UNPKG

billboard.js

Version:

Re-usable easy interface JavaScript chart library, based on D3 v4+

11 lines 279 kB
/*! * Copyright (c) 2017 ~ present NAVER Corp. * billboard.js project is licensed under the MIT license * * billboard.js, JavaScript chart library * https://naver.github.io/billboard.js/ * * @version 3.14.2 * @requires billboard.js * @summary billboard.js plugin */(function(qr,Gr){typeof exports=="object"&&typeof module=="object"?module.exports=Gr():typeof define=="function"&&define.amd?define("bb",[],Gr):typeof exports=="object"?exports.bb=Gr():(qr.bb=qr.bb||{},qr.bb.plugin=qr.bb.plugin||{},qr.bb.plugin["stanford.pkgd"]=Gr())})(this,function(){return function(){"use strict";var Ne={33539:function(u,h,t){t.d(h,{default:function(){return mf}});function n(r,o,l){r.prototype=o.prototype=l,l.constructor=r}function e(r,o){var l=Object.create(r.prototype);for(var g in o)l[g]=o[g];return l}function a(){}var s=.7,i=1/s,f="\\s*([+-]?\\d+)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",v="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",d=/^#([0-9a-f]{3,8})$/,p=new RegExp(`^rgb\\(${f},${f},${f}\\)$`),y=new RegExp(`^rgb\\(${v},${v},${v}\\)$`),m=new RegExp(`^rgba\\(${f},${f},${f},${c}\\)$`),S=new RegExp(`^rgba\\(${v},${v},${v},${c}\\)$`),I=new RegExp(`^hsl\\(${c},${v},${v}\\)$`),E=new RegExp(`^hsla\\(${c},${v},${v},${c}\\)$`),R={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};n(a,A,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:N,formatHex:N,formatHex8:P,formatHsl:C,formatRgb:b,toString:b});function N(){return this.rgb().formatHex()}function P(){return this.rgb().formatHex8()}function C(){return q(this).formatHsl()}function b(){return this.rgb().formatRgb()}function A(r){var o,l;return r=(r+"").trim().toLowerCase(),(o=d.exec(r))?(l=o[1].length,o=parseInt(o[1],16),l===6?M(o):l===3?new j(o>>8&15|o>>4&240,o>>4&15|o&240,(o&15)<<4|o&15,1):l===8?F(o>>24&255,o>>16&255,o>>8&255,(o&255)/255):l===4?F(o>>12&15|o>>8&240,o>>8&15|o>>4&240,o>>4&15|o&240,((o&15)<<4|o&15)/255):null):(o=p.exec(r))?new j(o[1],o[2],o[3],1):(o=y.exec(r))?new j(o[1]*255/100,o[2]*255/100,o[3]*255/100,1):(o=m.exec(r))?F(o[1],o[2],o[3],o[4]):(o=S.exec(r))?F(o[1]*255/100,o[2]*255/100,o[3]*255/100,o[4]):(o=I.exec(r))?tt(o[1],o[2]/100,o[3]/100,1):(o=E.exec(r))?tt(o[1],o[2]/100,o[3]/100,o[4]):R.hasOwnProperty(r)?M(R[r]):r==="transparent"?new j(NaN,NaN,NaN,0):null}function M(r){return new j(r>>16&255,r>>8&255,r&255,1)}function F(r,o,l,g){return g<=0&&(r=o=l=NaN),new j(r,o,l,g)}function B(r){return r instanceof a||(r=A(r)),r?(r=r.rgb(),new j(r.r,r.g,r.b,r.opacity)):new j}function U(r,o,l,g){return arguments.length===1?B(r):new j(r,o,l,g==null?1:g)}function j(r,o,l,g){this.r=+r,this.g=+o,this.b=+l,this.opacity=+g}n(j,U,e(a,{brighter(r){return r=r==null?i:Math.pow(i,r),new j(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?s:Math.pow(s,r),new j(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new j(V(this.r),V(this.g),V(this.b),G(this.opacity))},displayable(){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:W,formatHex:W,formatHex8:z,formatRgb:w,toString:w}));function W(){return`#${X(this.r)}${X(this.g)}${X(this.b)}`}function z(){return`#${X(this.r)}${X(this.g)}${X(this.b)}${X((isNaN(this.opacity)?1:this.opacity)*255)}`}function w(){const r=G(this.opacity);return`${r===1?"rgb(":"rgba("}${V(this.r)}, ${V(this.g)}, ${V(this.b)}${r===1?")":`, ${r})`}`}function G(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function V(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function X(r){return r=V(r),(r<16?"0":"")+r.toString(16)}function tt(r,o,l,g){return g<=0?r=o=l=NaN:l<=0||l>=1?r=o=NaN:o<=0&&(r=NaN),new Z(r,o,l,g)}function q(r){if(r instanceof Z)return new Z(r.h,r.s,r.l,r.opacity);if(r instanceof a||(r=A(r)),!r)return new Z;if(r instanceof Z)return r;r=r.rgb();var o=r.r/255,l=r.g/255,g=r.b/255,x=Math.min(o,l,g),O=Math.max(o,l,g),T=NaN,D=O-x,$=(O+x)/2;return D?(o===O?T=(l-g)/D+(l<g)*6:l===O?T=(g-o)/D+2:T=(o-l)/D+4,D/=$<.5?O+x:2-O-x,T*=60):D=$>0&&$<1?0:T,new Z(T,D,$,r.opacity)}function rt(r,o,l,g){return arguments.length===1?q(r):new Z(r,o,l,g==null?1:g)}function Z(r,o,l,g){this.h=+r,this.s=+o,this.l=+l,this.opacity=+g}n(Z,rt,e(a,{brighter(r){return r=r==null?i:Math.pow(i,r),new Z(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?s:Math.pow(s,r),new Z(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,o=isNaN(r)||isNaN(this.s)?0:this.s,l=this.l,g=l+(l<.5?l:1-l)*o,x=2*l-g;return new j(xt(r>=240?r-240:r+120,x,g),xt(r,x,g),xt(r<120?r+240:r-120,x,g),this.opacity)},clamp(){return new Z(mt(this.h),ht(this.s),ht(this.l),G(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=G(this.opacity);return`${r===1?"hsl(":"hsla("}${mt(this.h)}, ${ht(this.s)*100}%, ${ht(this.l)*100}%${r===1?")":`, ${r})`}`}}));function mt(r){return r=(r||0)%360,r<0?r+360:r}function ht(r){return Math.max(0,Math.min(1,r||0))}function xt(r,o,l){return(r<60?o+(l-o)*r/60:r<180?l:r<240?o+(l-o)*(240-r)/60:o)*255}var Rt=r=>()=>r;function Nt(r,o){return function(l){return r+l*o}}function Jt(r,o,l){return r=Math.pow(r,l),o=Math.pow(o,l)-r,l=1/l,function(g){return Math.pow(r+g*o,l)}}function Xt(r,o){var l=o-r;return l?Nt(r,l>180||l<-180?l-360*Math.round(l/360):l):Rt(isNaN(r)?o:r)}function jt(r){return(r=+r)==1?vt:function(o,l){return l-o?Jt(o,l,r):Rt(isNaN(o)?l:o)}}function vt(r,o){var l=o-r;return l?Nt(r,l):Rt(isNaN(r)?o:r)}function Et(r){return function(o,l){var g=r((o=rt(o)).h,(l=rt(l)).h),x=vt(o.s,l.s),O=vt(o.l,l.l),T=vt(o.opacity,l.opacity);return function(D){return o.h=g(D),o.s=x(D),o.l=O(D),o.opacity=T(D),o+""}}}var $t=Et(Xt),Bt=Et(vt);function Ft(r,o,l,g,x){var O=r*r,T=O*r;return((1-3*r+3*O-T)*o+(4-6*O+3*T)*l+(1+3*r+3*O-3*T)*g+T*x)/6}function Vt(r){var o=r.length-1;return function(l){var g=l<=0?l=0:l>=1?(l=1,o-1):Math.floor(l*o),x=r[g],O=r[g+1],T=g>0?r[g-1]:2*x-O,D=g<o-1?r[g+2]:2*O-x;return Ft((l-g/o)*o,T,x,O,D)}}function nr(r){var o=r.length;return function(l){var g=Math.floor(((l%=1)<0?++l:l)*o),x=r[(g+o-1)%o],O=r[g%o],T=r[(g+1)%o],D=r[(g+2)%o];return Ft((l-g/o)*o,x,O,T,D)}}var tr=function r(o){var l=jt(o);function g(x,O){var T=l((x=U(x)).r,(O=U(O)).r),D=l(x.g,O.g),$=l(x.b,O.b),L=vt(x.opacity,O.opacity);return function(H){return x.r=T(H),x.g=D(H),x.b=$(H),x.opacity=L(H),x+""}}return g.gamma=r,g}(1);function Zt(r){return function(o){var l=o.length,g=new Array(l),x=new Array(l),O=new Array(l),T,D;for(T=0;T<l;++T)D=U(o[T]),g[T]=D.r||0,x[T]=D.g||0,O[T]=D.b||0;return g=r(g),x=r(x),O=r(O),D.opacity=1,function($){return D.r=g($),D.g=x($),D.b=O($),D+""}}}var Ht=Zt(Vt),rr=Zt(nr);function Qt(r,o){return(isNumberArray(o)?numberArray:wt)(r,o)}function wt(r,o){var l=o?o.length:0,g=r?Math.min(l,r.length):0,x=new Array(g),O=new Array(l),T;for(T=0;T<g;++T)x[T]=ot(r[T],o[T]);for(;T<l;++T)O[T]=o[T];return function(D){for(T=0;T<g;++T)O[T]=x[T](D);return O}}function ft(r,o){var l=new Date;return r=+r,o=+o,function(g){return l.setTime(r*(1-g)+o*g),l}}function ct(r,o){return r=+r,o=+o,function(l){return r*(1-l)+o*l}}function nt(r,o){var l={},g={},x;(r===null||typeof r!="object")&&(r={}),(o===null||typeof o!="object")&&(o={});for(x in o)x in r?l[x]=ot(r[x],o[x]):g[x]=o[x];return function(O){for(x in l)g[x]=l[x](O);return g}}var Mt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bt=new RegExp(Mt.source,"g");function At(r){return function(){return r}}function Tt(r){return function(o){return r(o)+""}}function ur(r,o){var l=Mt.lastIndex=bt.lastIndex=0,g,x,O,T=-1,D=[],$=[];for(r=r+"",o=o+"";(g=Mt.exec(r))&&(x=bt.exec(o));)(O=x.index)>l&&(O=o.slice(l,O),D[T]?D[T]+=O:D[++T]=O),(g=g[0])===(x=x[0])?D[T]?D[T]+=x:D[++T]=x:(D[++T]=null,$.push({i:T,x:ct(g,x)})),l=bt.lastIndex;return l<o.length&&(O=o.slice(l),D[T]?D[T]+=O:D[++T]=O),D.length<2?$[0]?Tt($[0].x):At(o):(o=$.length,function(L){for(var H=0,K;H<o;++H)D[(K=$[H]).i]=K.x(L);return D.join("")})}function vr(r,o){o||(o=[]);var l=r?Math.min(o.length,r.length):0,g=o.slice(),x;return function(O){for(x=0;x<l;++x)g[x]=r[x]*(1-O)+o[x]*O;return g}}function Q(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function ot(r,o){var l=typeof o,g;return o==null||l==="boolean"?Rt(o):(l==="number"?ct:l==="string"?(g=A(o))?(o=g,tr):ur:o instanceof A?tr:o instanceof Date?ft:Q(o)?vr:Array.isArray(o)?wt:typeof o.valueOf!="function"&&typeof o.toString!="function"||isNaN(o)?nt:ct)(r,o)}function lt(r,o){return r=+r,o=+o,function(l){return Math.round(r*(1-l)+o*l)}}function st(r,o){return r==null||o==null?NaN:r<o?-1:r>o?1:r>=o?0:NaN}function yt(r,o){return r==null||o==null?NaN:o<r?-1:o>r?1:o>=r?0:NaN}function at(r){let o,l,g;r.length!==2?(o=st,l=(D,$)=>st(r(D),$),g=(D,$)=>r(D)-$):(o=r===st||r===yt?r:Lt,l=r,g=r);function x(D,$,L=0,H=D.length){if(L<H){if(o($,$)!==0)return H;do{const K=L+H>>>1;l(D[K],$)<0?L=K+1:H=K}while(L<H)}return L}function O(D,$,L=0,H=D.length){if(L<H){if(o($,$)!==0)return H;do{const K=L+H>>>1;l(D[K],$)<=0?L=K+1:H=K}while(L<H)}return L}function T(D,$,L=0,H=D.length){const K=x(D,$,L,H-1);return K>L&&g(D[K-1],$)>-g(D[K],$)?K-1:K}return{left:x,center:T,right:O}}function Lt(){return 0}function er(r){return r===null?NaN:+r}function*it(r,o){if(o===void 0)for(let l of r)l!=null&&(l=+l)>=l&&(yield l);else{let l=-1;for(let g of r)(g=o(g,++l,r))!=null&&(g=+g)>=g&&(yield g)}}const St=at(st),It=St.right,Ot=St.left,Wt=at(er).center;var _t=It;function ir(r){return function(){return r}}function lr(r){return+r}var mr=[0,1];function dr(r){return r}function Lr(r,o){return(o-=r=+r)?function(l){return(l-r)/o}:ir(isNaN(o)?NaN:.5)}function dn(r,o){var l;return r>o&&(l=r,r=o,o=l),function(g){return Math.max(r,Math.min(o,g))}}function Nn(r,o,l){var g=r[0],x=r[1],O=o[0],T=o[1];return x<g?(g=Lr(x,g),O=l(T,O)):(g=Lr(g,x),O=l(O,T)),function(D){return O(g(D))}}function hn(r,o,l){var g=Math.min(r.length,o.length)-1,x=new Array(g),O=new Array(g),T=-1;for(r[g]<r[0]&&(r=r.slice().reverse(),o=o.slice().reverse());++T<g;)x[T]=Lr(r[T],r[T+1]),O[T]=l(o[T],o[T+1]);return function(D){var $=_t(r,D,1,g)-1;return O[$](x[$](D))}}function _r(r,o){return o.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function jr(){var r=mr,o=mr,l=ot,g,x,O,T=dr,D,$,L;function H(){var _=Math.min(r.length,o.length);return T!==dr&&(T=dn(r[0],r[_-1])),D=_>2?hn:Nn,$=L=null,K}function K(_){return _==null||isNaN(_=+_)?O:($||($=D(r.map(g),o,l)))(g(T(_)))}return K.invert=function(_){return T(x((L||(L=D(o,r.map(g),ct)))(_)))},K.domain=function(_){return arguments.length?(r=Array.from(_,lr),H()):r.slice()},K.range=function(_){return arguments.length?(o=Array.from(_),H()):o.slice()},K.rangeRound=function(_){return o=Array.from(_),l=lt,H()},K.clamp=function(_){return arguments.length?(T=_?!0:dr,H()):T!==dr},K.interpolate=function(_){return arguments.length?(l=_,H()):l},K.unknown=function(_){return arguments.length?(O=_,K):O},function(_,et){return g=_,x=et,H()}}function ee(){return jr()(dr,dr)}function Jr(r,o){switch(arguments.length){case 0:break;case 1:this.range(r);break;default:this.range(o).domain(r);break}return this}function Vr(r,o){switch(arguments.length){case 0:break;case 1:{typeof r=="function"?this.interpolator(r):this.range(r);break}default:{this.domain(r),typeof o=="function"?this.interpolator(o):this.range(o);break}}return this}const gn=Math.sqrt(50),tn=Math.sqrt(10),Mr=Math.sqrt(2);function br(r,o,l){const g=(o-r)/Math.max(0,l),x=Math.floor(Math.log10(g)),O=g/Math.pow(10,x),T=O>=gn?10:O>=tn?5:O>=Mr?2:1;let D,$,L;return x<0?(L=Math.pow(10,-x)/T,D=Math.round(r*L),$=Math.round(o*L),D/L<r&&++D,$/L>o&&--$,L=-L):(L=Math.pow(10,x)*T,D=Math.round(r/L),$=Math.round(o/L),D*L<r&&++D,$*L>o&&--$),$<D&&.5<=l&&l<2?br(r,o,l*2):[D,$,L]}function an(r,o,l){if(o=+o,r=+r,l=+l,!(l>0))return[];if(r===o)return[r];const g=o<r,[x,O,T]=g?br(o,r,l):br(r,o,l);if(!(O>=x))return[];const D=O-x+1,$=new Array(D);if(g)if(T<0)for(let L=0;L<D;++L)$[L]=(O-L)/-T;else for(let L=0;L<D;++L)$[L]=(O-L)*T;else if(T<0)for(let L=0;L<D;++L)$[L]=(x+L)/-T;else for(let L=0;L<D;++L)$[L]=(x+L)*T;return $}function on(r,o,l){return o=+o,r=+r,l=+l,br(r,o,l)[2]}function J(r,o,l){o=+o,r=+r,l=+l;const g=o<r,x=g?on(o,r,l):on(r,o,l);return(g?-1:1)*(x<0?1/-x:x)}var gt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function k(r){if(!(o=gt.exec(r)))throw new Error("invalid format: "+r);var o;return new Y({fill:o[1],align:o[2],sign:o[3],symbol:o[4],zero:o[5],width:o[6],comma:o[7],precision:o[8]&&o[8].slice(1),trim:o[9],type:o[10]})}k.prototype=Y.prototype;function Y(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}Y.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ut(r){return Math.abs(r=Math.round(r))>=1e21?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function Kt(r,o){if((l=(r=o?r.toExponential(o-1):r.toExponential()).indexOf("e"))<0)return null;var l,g=r.slice(0,l);return[g.length>1?g[0]+g.slice(2):g,+r.slice(l+1)]}function Pt(r){return r=Kt(Math.abs(r)),r?r[1]:NaN}function xr(r,o){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pt(o)/3)))*3-Pt(Math.abs(r)))}function Or(r,o){return function(l,g){for(var x=l.length,O=[],T=0,D=r[0],$=0;x>0&&D>0&&($+D+1>g&&(D=Math.max(1,g-$)),O.push(l.substring(x-=D,x+D)),!(($+=D+1)>g));)D=r[T=(T+1)%r.length];return O.reverse().join(o)}}function Rr(r){return function(o){return o.replace(/[0-9]/g,function(l){return r[+l]})}}function Ur(r){t:for(var o=r.length,l=1,g=-1,x;l<o;++l)switch(r[l]){case".":g=x=l;break;case"0":g===0&&(g=l),x=l;break;default:if(!+r[l])break t;g>0&&(g=0);break}return g>0?r.slice(0,g)+r.slice(x+1):r}var dt;function Tr(r,o){var l=Kt(r,o);if(!l)return r+"";var g=l[0],x=l[1],O=x-(dt=Math.max(-8,Math.min(8,Math.floor(x/3)))*3)+1,T=g.length;return O===T?g:O>T?g+new Array(O-T+1).join("0"):O>0?g.slice(0,O)+"."+g.slice(O):"0."+new Array(1-O).join("0")+Kt(r,Math.max(0,o+O-1))[0]}function Hr(r,o){var l=Kt(r,o);if(!l)return r+"";var g=l[0],x=l[1];return x<0?"0."+new Array(-x).join("0")+g:g.length>x+1?g.slice(0,x+1)+"."+g.slice(x+1):g+new Array(x-g.length+2).join("0")}var sn={"%":(r,o)=>(r*100).toFixed(o),b:r=>Math.round(r).toString(2),c:r=>r+"",d:ut,e:(r,o)=>r.toExponential(o),f:(r,o)=>r.toFixed(o),g:(r,o)=>r.toPrecision(o),o:r=>Math.round(r).toString(8),p:(r,o)=>Hr(r*100,o),r:Hr,s:Tr,X:r=>Math.round(r).toString(16).toUpperCase(),x:r=>Math.round(r).toString(16)};function pn(r){return r}var yn=Array.prototype.map,un=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Ba(r){var o=r.grouping===void 0||r.thousands===void 0?pn:Or(yn.call(r.grouping,Number),r.thousands+""),l=r.currency===void 0?"":r.currency[0]+"",g=r.currency===void 0?"":r.currency[1]+"",x=r.decimal===void 0?".":r.decimal+"",O=r.numerals===void 0?pn:Rr(yn.call(r.numerals,String)),T=r.percent===void 0?"%":r.percent+"",D=r.minus===void 0?"\u2212":r.minus+"",$=r.nan===void 0?"NaN":r.nan+"";function L(K){K=k(K);var _=K.fill,et=K.align,zt=K.sign,or=K.symbol,pt=K.zero,Ct=K.width,Gt=K.comma,Dt=K.precision,kt=K.trim,Yt=K.type;Yt==="n"?(Gt=!0,Yt="g"):sn[Yt]||(Dt===void 0&&(Dt=12),kt=!0,Yt="g"),(pt||_==="0"&&et==="=")&&(pt=!0,_="0",et="=");var pr=or==="$"?l:or==="#"&&/[boxX]/.test(Yt)?"0"+Yt.toLowerCase():"",Sr=or==="$"?g:/[%p]/.test(Yt)?T:"",cr=sn[Yt],Nr=/[defgprs%]/.test(Yt);Dt=Dt===void 0?6:/[gprs]/.test(Yt)?Math.max(1,Math.min(21,Dt)):Math.max(0,Math.min(20,Dt));function sr(Ut){var gr=pr,ar=Sr,yr,Yr,Er;if(Yt==="c")ar=cr(Ut)+ar,Ut="";else{Ut=+Ut;var Ir=Ut<0||1/Ut<0;if(Ut=isNaN(Ut)?$:cr(Math.abs(Ut),Dt),kt&&(Ut=Ur(Ut)),Ir&&+Ut==0&&zt!=="+"&&(Ir=!1),gr=(Ir?zt==="("?zt:D:zt==="-"||zt==="("?"":zt)+gr,ar=(Yt==="s"?un[8+dt/3]:"")+ar+(Ir&&zt==="("?")":""),Nr){for(yr=-1,Yr=Ut.length;++yr<Yr;)if(Er=Ut.charCodeAt(yr),48>Er||Er>57){ar=(Er===46?x+Ut.slice(yr+1):Ut.slice(yr))+ar,Ut=Ut.slice(0,yr);break}}}Gt&&!pt&&(Ut=o(Ut,1/0));var wr=gr.length+Ut.length+ar.length,fr=wr<Ct?new Array(Ct-wr+1).join(_):"";switch(Gt&&pt&&(Ut=o(fr+Ut,fr.length?Ct-ar.length:1/0),fr=""),et){case"<":Ut=gr+Ut+ar+fr;break;case"=":Ut=gr+fr+Ut+ar;break;case"^":Ut=fr.slice(0,wr=fr.length>>1)+gr+Ut+ar+fr.slice(wr);break;default:Ut=fr+gr+Ut+ar;break}return O(Ut)}return sr.toString=function(){return K+""},sr}function H(K,_){var et=L((K=k(K),K.type="f",K)),zt=Math.max(-8,Math.min(8,Math.floor(Pt(_)/3)))*3,or=Math.pow(10,-zt),pt=un[8+zt/3];return function(Ct){return et(or*Ct)+pt}}return{format:L,formatPrefix:H}}var Mn,bn,Me;ja({thousands:",",grouping:[3],currency:["$",""]});function ja(r){return Mn=Ba(r),bn=Mn.format,Me=Mn.formatPrefix,Mn}function wa(r,o){return r=Math.abs(r),o=Math.abs(o)-r,Math.max(0,Pt(o)-Pt(r))+1}function Ga(r){return Math.max(0,-Pt(Math.abs(r)))}function Va(r,o,l,g){var x=J(r,o,l),O;switch(g=k(g==null?",f":g),g.type){case"s":{var T=Math.max(Math.abs(r),Math.abs(o));return g.precision==null&&!isNaN(O=xr(x,T))&&(g.precision=O),Me(g,T)}case"":case"e":case"g":case"p":case"r":{g.precision==null&&!isNaN(O=wa(x,Math.max(Math.abs(r),Math.abs(o))))&&(g.precision=O-(g.type==="e"));break}case"f":case"%":{g.precision==null&&!isNaN(O=Ga(x))&&(g.precision=O-(g.type==="%")*2);break}}return bn(g)}function ae(r){var o=r.domain;return r.ticks=function(l){var g=o();return an(g[0],g[g.length-1],l==null?10:l)},r.tickFormat=function(l,g){var x=o();return Va(x[0],x[x.length-1],l==null?10:l,g)},r.nice=function(l){l==null&&(l=10);var g=o(),x=0,O=g.length-1,T=g[x],D=g[O],$,L,H=10;for(D<T&&(L=T,T=D,D=L,L=x,x=O,O=L);H-- >0;){if(L=on(T,D,l),L===$)return g[x]=T,g[O]=D,o(g);if(L>0)T=Math.floor(T/L)*L,D=Math.ceil(D/L)*L;else if(L<0)T=Math.ceil(T*L)/L,D=Math.floor(D*L)/L;else break;$=L}return r},r}function Ha(){var r=continuous();return r.copy=function(){return copy(r,Ha())},initRange.apply(r,arguments),ae(r)}function Wa(r,o){r=r.slice();var l=0,g=r.length-1,x=r[l],O=r[g],T;return O<x&&(T=l,l=g,g=T,T=x,x=O,O=T),r[l]=o.floor(x),r[g]=o.ceil(O),r}function be(r){return Math.log(r)}function De(r){return Math.exp(r)}function za(r){return-Math.log(-r)}function Ya(r){return-Math.exp(-r)}function Ka(r){return isFinite(r)?+("1e"+r):r<0?0:r}function Xa(r){return r===10?Ka:r===Math.E?Math.exp:o=>Math.pow(r,o)}function Ja(r){return r===Math.E?Math.log:r===10&&Math.log10||r===2&&Math.log2||(r=Math.log(r),o=>Math.log(o)/r)}function Fe(r){return(o,l)=>-r(-o,l)}function $e(r){const o=r(be,De),l=o.domain;let g=10,x,O;function T(){return x=Ja(g),O=Xa(g),l()[0]<0?(x=Fe(x),O=Fe(O),r(za,Ya)):r(be,De),o}return o.base=function(D){return arguments.length?(g=+D,T()):g},o.domain=function(D){return arguments.length?(l(D),T()):l()},o.ticks=D=>{const $=l();let L=$[0],H=$[$.length-1];const K=H<L;K&&([L,H]=[H,L]);let _=x(L),et=x(H),zt,or;const pt=D==null?10:+D;let Ct=[];if(!(g%1)&&et-_<pt){if(_=Math.floor(_),et=Math.ceil(et),L>0){for(;_<=et;++_)for(zt=1;zt<g;++zt)if(or=_<0?zt/O(-_):zt*O(_),!(or<L)){if(or>H)break;Ct.push(or)}}else for(;_<=et;++_)for(zt=g-1;zt>=1;--zt)if(or=_>0?zt/O(-_):zt*O(_),!(or<L)){if(or>H)break;Ct.push(or)}Ct.length*2<pt&&(Ct=an(L,H,pt))}else Ct=an(_,et,Math.min(et-_,pt)).map(O);return K?Ct.reverse():Ct},o.tickFormat=(D,$)=>{if(D==null&&(D=10),$==null&&($=g===10?"s":","),typeof $!="function"&&(!(g%1)&&($=k($)).precision==null&&($.trim=!0),$=bn($)),D===1/0)return $;const L=Math.max(1,g*D/o.ticks().length);return H=>{let K=H/O(Math.round(x(H)));return K*g<g-.5&&(K*=g),K<=L?$(H):""}},o.nice=()=>l(Wa(l(),{floor:D=>O(Math.floor(x(D))),ceil:D=>O(Math.ceil(x(D)))})),o}function Qa(){const r=$e(transformer()).domain([1,10]);return r.copy=()=>copy(r,Qa()).base(r.base()),initRange.apply(r,arguments),r}function Dn(){var r=0,o=1,l,g,x,O,T=dr,D=!1,$;function L(K){return K==null||isNaN(K=+K)?$:T(x===0?.5:(K=(O(K)-l)*x,D?Math.max(0,Math.min(1,K)):K))}L.domain=function(K){return arguments.length?([r,o]=K,l=O(r=+r),g=O(o=+o),x=l===g?0:1/(g-l),L):[r,o]},L.clamp=function(K){return arguments.length?(D=!!K,L):D},L.interpolator=function(K){return arguments.length?(T=K,L):T};function H(K){return function(_){var et,zt;return arguments.length?([et,zt]=_,T=K(et,zt),L):[T(0),T(1)]}}return L.range=H(ot),L.rangeRound=H(lt),L.unknown=function(K){return arguments.length?($=K,L):$},function(K){return O=K,l=K(r),g=K(o),x=l===g?0:1/(g-l),L}}function Fn(r,o){return o.domain(r.domain()).interpolator(r.interpolator()).clamp(r.clamp()).unknown(r.unknown())}function Le(){var r=ae(Dn()(dr));return r.copy=function(){return Fn(r,Le())},Vr.apply(r,arguments)}function Ue(){var r=$e(Dn()).domain([1,10]);return r.copy=function(){return Fn(r,Ue()).base(r.base())},Vr.apply(r,arguments)}function Za(){var r=symlogish(Dn());return r.copy=function(){return Fn(r,Za()).constant(r.constant())},initInterpolator.apply(r,arguments)}function Be(){var r=powish(Dn());return r.copy=function(){return Fn(r,Be()).exponent(r.exponent())},initInterpolator.apply(r,arguments)}function Ef(){return Be.apply(null,arguments).exponent(.5)}var ka=Object.defineProperty,je=Object.getOwnPropertySymbols,qa=Object.prototype.hasOwnProperty,_a=Object.prototype.propertyIsEnumerable,we=(r,o,l)=>o in r?ka(r,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):r[o]=l,hr=(r,o)=>{for(var l in o||(o={}))qa.call(o,l)&&we(r,l,o[l]);if(je)for(var l of je(o))_a.call(o,l)&&we(r,l,o[l]);return r};const to={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_"},ro={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},no={area:"bb-area",areas:"bb-areas"},eo={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip"},ao={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars"},oo={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},so={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},io={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},uo={dragarea:"bb-dragarea",INCLUDED:"_included_"},fo={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},lo={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},co={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},vo={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},ho={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},go={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},po={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},If={level:"bb-level",levels:"bb-levels"},yo={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},mo={region:"bb-region",regions:"bb-regions"},xo={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},So={shape:"bb-shape",shapes:"bb-shapes"},Eo={brush:"bb-brush",subchart:"bb-subchart"},Io={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",TextOverlapping:"text-overlapping"},oe={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},Oo={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},To={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var Of=hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr(hr({},to),ro),no),eo),ao),oo),so),io),uo),lo),co),vo),ho),go),fo),po),yo),mo),xo),So),Eo),Io),oe),Oo),To);function Ro(){}function se(r){return r==null?Ro:function(){return this.querySelector(r)}}function Ao(r){typeof r!="function"&&(r=se(r));for(var o=this._groups,l=o.length,g=new Array(l),x=0;x<l;++x)for(var O=o[x],T=O.length,D=g[x]=new Array(T),$,L,H=0;H<T;++H)($=O[H])&&(L=r.call($,$.__data__,H,O))&&("__data__"in $&&(L.__data__=$.__data__),D[H]=L);return new Wr(g,this._parents)}function Po(r){return r==null?[]:Array.isArray(r)?r:Array.from(r)}function Co(){return[]}function Ge(r){return r==null?Co:function(){return this.querySelectorAll(r)}}function No(r){return function(){return Po(r.apply(this,arguments))}}function Mo(r){typeof r=="function"?r=No(r):r=Ge(r);for(var o=this._groups,l=o.length,g=[],x=[],O=0;O<l;++O)for(var T=o[O],D=T.length,$,L=0;L<D;++L)($=T[L])&&(g.push(r.call($,$.__data__,L,T)),x.push($));return new Wr(g,x)}function Ve(r){return function(){return this.matches(r)}}function He(r){return function(o){return o.matches(r)}}var bo=Array.prototype.find;function Do(r){return function(){return bo.call(this.children,r)}}function Fo(){return this.firstElementChild}function $o(r){return this.select(r==null?Fo:Do(typeof r=="function"?r:He(r)))}var Lo=Array.prototype.filter;function Uo(){return Array.from(this.children)}function Bo(r){return function(){return Lo.call(this.children,r)}}function jo(r){return this.selectAll(r==null?Uo:Bo(typeof r=="function"?r:He(r)))}function wo(r){typeof r!="function"&&(r=Ve(r));for(var o=this._groups,l=o.length,g=new Array(l),x=0;x<l;++x)for(var O=o[x],T=O.length,D=g[x]=[],$,L=0;L<T;++L)($=O[L])&&r.call($,$.__data__,L,O)&&D.push($);return new Wr(g,this._parents)}function We(r){return new Array(r.length)}function Go(){return new Wr(this._enter||this._groups.map(We),this._parents)}function $n(r,o){this.ownerDocument=r.ownerDocument,this.namespaceURI=r.namespaceURI,this._next=null,this._parent=r,this.__data__=o}$n.prototype={constructor:$n,appendChild:function(r){return this._parent.insertBefore(r,this._next)},insertBefore:function(r,o){return this._parent.insertBefore(r,o)},querySelector:function(r){return this._parent.querySelector(r)},querySelectorAll:function(r){return this._parent.querySelectorAll(r)}};function Vo(r){return function(){return r}}function Ho(r,o,l,g,x,O){for(var T=0,D,$=o.length,L=O.length;T<L;++T)(D=o[T])?(D.__data__=O[T],g[T]=D):l[T]=new $n(r,O[T]);for(;T<$;++T)(D=o[T])&&(x[T]=D)}function Wo(r,o,l,g,x,O,T){var D,$,L=new Map,H=o.length,K=O.length,_=new Array(H),et;for(D=0;D<H;++D)($=o[D])&&(_[D]=et=T.call($,$.__data__,D,o)+"",L.has(et)?x[D]=$:L.set(et,$));for(D=0;D<K;++D)et=T.call(r,O[D],D,O)+"",($=L.get(et))?(g[D]=$,$.__data__=O[D],L.delete(et)):l[D]=new $n(r,O[D]);for(D=0;D<H;++D)($=o[D])&&L.get(_[D])===$&&(x[D]=$)}function zo(r){return r.__data__}function Yo(r,o){if(!arguments.length)return Array.from(this,zo);var l=o?Wo:Ho,g=this._parents,x=this._groups;typeof r!="function"&&(r=Vo(r));for(var O=x.length,T=new Array(O),D=new Array(O),$=new Array(O),L=0;L<O;++L){var H=g[L],K=x[L],_=K.length,et=Ko(r.call(H,H&&H.__data__,L,g)),zt=et.length,or=D[L]=new Array(zt),pt=T[L]=new Array(zt),Ct=$[L]=new Array(_);l(H,K,or,pt,Ct,et,o);for(var Gt=0,Dt=0,kt,Yt;Gt<zt;++Gt)if(kt=or[Gt]){for(Gt>=Dt&&(Dt=Gt+1);!(Yt=pt[Dt])&&++Dt<zt;);kt._next=Yt||null}}return T=new Wr(T,g),T._enter=D,T._exit=$,T}function Ko(r){return typeof r=="object"&&"length"in r?r:Array.from(r)}function Xo(){return new Wr(this._exit||this._groups.map(We),this._parents)}function Jo(r,o,l){var g=this.enter(),x=this,O=this.exit();return typeof r=="function"?(g=r(g),g&&(g=g.selection())):g=g.append(r+""),o!=null&&(x=o(x),x&&(x=x.selection())),l==null?O.remove():l(O),g&&x?g.merge(x).order():x}function Qo(r){for(var o=r.selection?r.selection():r,l=this._groups,g=o._groups,x=l.length,O=g.length,T=Math.min(x,O),D=new Array(x),$=0;$<T;++$)for(var L=l[$],H=g[$],K=L.length,_=D[$]=new Array(K),et,zt=0;zt<K;++zt)(et=L[zt]||H[zt])&&(_[zt]=et);for(;$<x;++$)D[$]=l[$];return new Wr(D,this._parents)}function Zo(){for(var r=this._groups,o=-1,l=r.length;++o<l;)for(var g=r[o],x=g.length-1,O=g[x],T;--x>=0;)(T=g[x])&&(O&&T.compareDocumentPosition(O)^4&&O.parentNode.insertBefore(T,O),O=T);return this}function ko(r){r||(r=qo);function o(K,_){return K&&_?r(K.__data__,_.__data__):!K-!_}for(var l=this._groups,g=l.length,x=new Array(g),O=0;O<g;++O){for(var T=l[O],D=T.length,$=x[O]=new Array(D),L,H=0;H<D;++H)(L=T[H])&&($[H]=L);$.sort(o)}return new Wr(x,this._parents).order()}function qo(r,o){return r<o?-1:r>o?1:r>=o?0:NaN}function _o(){var r=arguments[0];return arguments[0]=this,r.apply(null,arguments),this}function ts(){return Array.from(this)}function rs(){for(var r=this._groups,o=0,l=r.length;o<l;++o)for(var g=r[o],x=0,O=g.length;x<O;++x){var T=g[x];if(T)return T}return null}function ns(){let r=0;for(const o of this)++r;return r}function es(){return!this.node()}function as(r){for(var o=this._groups,l=0,g=o.length;l<g;++l)for(var x=o[l],O=0,T=x.length,D;O<T;++O)(D=x[O])&&r.call(D,D.__data__,O,x);return this}var ie="http://www.w3.org/1999/xhtml",ze={svg:"http://www.w3.org/2000/svg",xhtml:ie,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ln(r){var o=r+="",l=o.indexOf(":");return l>=0&&(o=r.slice(0,l))!=="xmlns"&&(r=r.slice(l+1)),ze.hasOwnProperty(o)?{space:ze[o],local:r}:r}function os(r){return function(){this.removeAttribute(r)}}function ss(r){return function(){this.removeAttributeNS(r.space,r.local)}}function is(r,o){return function(){this.setAttribute(r,o)}}function us(r,o){return function(){this.setAttributeNS(r.space,r.local,o)}}function fs(r,o){return function(){var l=o.apply(this,arguments);l==null?this.removeAttribute(r):this.setAttribute(r,l)}}function ls(r,o){return function(){var l=o.apply(this,arguments);l==null?this.removeAttributeNS(r.space,r.local):this.setAttributeNS(r.space,r.local,l)}}function cs(r,o){var l=Ln(r);if(arguments.length<2){var g=this.node();return l.local?g.getAttributeNS(l.space,l.local):g.getAttribute(l)}return this.each((o==null?l.local?ss:os:typeof o=="function"?l.local?ls:fs:l.local?us:is)(l,o))}function Ye(r){return r.ownerDocument&&r.ownerDocument.defaultView||r.document&&r||r.defaultView}function vs(r){return function(){this.style.removeProperty(r)}}function ds(r,o,l){return function(){this.style.setProperty(r,o,l)}}function hs(r,o,l){return function(){var g=o.apply(this,arguments);g==null?this.style.removeProperty(r):this.style.setProperty(r,g,l)}}function gs(r,o,l){return arguments.length>1?this.each((o==null?vs:typeof o=="function"?hs:ds)(r,o,l==null?"":l)):fn(this.node(),r)}function fn(r,o){return r.style.getPropertyValue(o)||Ye(r).getComputedStyle(r,null).getPropertyValue(o)}function ps(r){return function(){delete this[r]}}function ys(r,o){return function(){this[r]=o}}function ms(r,o){return function(){var l=o.apply(this,arguments);l==null?delete this[r]:this[r]=l}}function xs(r,o){return arguments.length>1?this.each((o==null?ps:typeof o=="function"?ms:ys)(r,o)):this.node()[r]}function Ke(r){return r.trim().split(/^|\s+/)}function ue(r){return r.classList||new Xe(r)}function Xe(r){this._node=r,this._names=Ke(r.getAttribute("class")||"")}Xe.prototype={add:function(r){var o=this._names.indexOf(r);o<0&&(this._names.push(r),this._node.setAttribute("class",this._names.join(" ")))},remove:function(r){var o=this._names.indexOf(r);o>=0&&(this._names.splice(o,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(r){return this._names.indexOf(r)>=0}};function Je(r,o){for(var l=ue(r),g=-1,x=o.length;++g<x;)l.add(o[g])}function Qe(r,o){for(var l=ue(r),g=-1,x=o.length;++g<x;)l.remove(o[g])}function Ss(r){return function(){Je(this,r)}}function Es(r){return function(){Qe(this,r)}}function Is(r,o){return function(){(o.apply(this,arguments)?Je:Qe)(this,r)}}function Os(r,o){var l=Ke(r+"");if(arguments.length<2){for(var g=ue(this.node()),x=-1,O=l.length;++x<O;)if(!g.contains(l[x]))return!1;return!0}return this.each((typeof o=="function"?Is:o?Ss:Es)(l,o))}function Ts(){this.textContent=""}function Rs(r){return function(){this.textContent=r}}function As(r){return function(){var o=r.apply(this,arguments);this.textContent=o==null?"":o}}function Ps(r){return arguments.length?this.each(r==null?Ts:(typeof r=="function"?As:Rs)(r)):this.node().textContent}function Cs(){this.innerHTML=""}function Ns(r){return function(){this.innerHTML=r}}function Ms(r){return function(){var o=r.apply(this,arguments);this.innerHTML=o==null?"":o}}function bs(r){return arguments.length?this.each(r==null?Cs:(typeof r=="function"?Ms:Ns)(r)):this.node().innerHTML}function Ds(){this.nextSibling&&this.parentNode.appendChild(this)}function Fs(){return this.each(Ds)}function $s(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ls(){return this.each($s)}function Us(r){return function(){var o=this.ownerDocument,l=this.namespaceURI;return l===ie&&o.documentElement.namespaceURI===ie?o.createElement(r):o.createElementNS(l,r)}}function Bs(r){return function(){return this.ownerDocument.createElementNS(r.space,r.local)}}function Ze(r){var o=Ln(r);return(o.local?Bs:Us)(o)}function js(r){var o=typeof r=="function"?r:Ze(r);return this.select(function(){return this.appendChild(o.apply(this,arguments))})}function ws(){return null}function Gs(r,o){var l=typeof r=="function"?r:Ze(r),g=o==null?ws:typeof o=="function"?o:se(o);return this.select(function(){return this.insertBefore(l.apply(this,arguments),g.apply(this,arguments)||null)})}function Vs(){var r=this.parentNode;r&&r.removeChild(this)}function Hs(){return this.each(Vs)}function Ws(){var r=this.cloneNode(!1),o=this.parentNode;return o?o.insertBefore(r,this.nextSibling):r}function zs(){var r=this.cloneNode(!0),o=this.parentNode;return o?o.insertBefore(r,this.nextSibling):r}function Ys(r){return this.select(r?zs:Ws)}function Ks(r){return arguments.length?this.property("__data__",r):this.node().__data__}function Xs(r){return function(o){r.call(this,o,this.__data__)}}function Js(r){return r.trim().split(/^|\s+/).map(function(o){var l="",g=o.indexOf(".");return g>=0&&(l=o.slice(g+1),o=o.slice(0,g)),{type:o,name:l}})}function Qs(r){return function(){var o=this.__on;if(o){for(var l=0,g=-1,x=o.length,O;l<x;++l)O=o[l],(!r.type||O.type===r.type)&&O.name===r.name?this.removeEventListener(O.type,O.listener,O.options):o[++g]=O;++g?o.length=g:delete this.__on}}}function Zs(r,o,l){return function(){var g=this.__on,x,O=Xs(o);if(g){for(var T=0,D=g.length;T<D;++T)if((x=g[T]).type===r.type&&x.name===r.name){this.removeEventListener(x.type,x.listener,x.options),this.addEventListener(x.type,x.listener=O,x.options=l),x.value=o;return}}this.addEventListener(r.type,O,l),x={type:r.type,name:r.name,value:o,listener:O,options:l},g?g.push(x):this.__on=[x]}}function ks(r,o,l){var g=Js(r+""),x,O=g.length,T;if(arguments.length<2){var D=this.node().__on;if(D){for(var $=0,L=D.length,H;$<L;++$)for(x=0,H=D[$];x<O;++x)if((T=g[x]).type===H.type&&T.name===H.name)return H.value}return}for(D=o?Zs:Qs,x=0;x<O;++x)this.each(D(g[x],o,l));return this}function ke(r,o,l){var g=Ye(r),x=g.CustomEvent;typeof x=="function"?x=new x(o,l):(x=g.document.createEvent("Event"),l?(x.initEvent(o,l.bubbles,l.cancelable),x.detail=l.detail):x.initEvent(o,!1,!1)),r.dispatchEvent(x)}function qs(r,o){return function(){return ke(this,r,o)}}function _s(r,o){return function(){return ke(this,r,o.apply(this,arguments))}}function ti(r,o){return this.each((typeof o=="function"?_s:qs)(r,o))}function*ri(){for(var r=this._groups,o=0,l=r.length;o<l;++o)for(var g=r[o],x=0,O=g.length,T;x<O;++x)(T=g[x])&&(yield T)}var ni=[null];function Wr(r,o){this._groups=r,this._parents=o}function qe(){return new Wr([[document.documentElement]],ni)}function ei(){return this}Wr.prototype=qe.prototype={constructor:Wr,select:Ao,selectAll:Mo,selectChild:$o,selectChildren:jo,filter:wo,data:Yo,enter:Go,exit:Xo,join:Jo,merge:Qo,selection:ei,order:Zo,sort:ko,call:_o,nodes:ts,node:rs,size:ns,empty:es,each:as,attr:cs,style:gs,property:xs,classed:Os,text:Ps,html:bs,raise:Fs,lower:Ls,append:js,insert:Gs,remove:Hs,clone:Ys,datum:Ks,on:ks,dispatch:ti,[Symbol.iterator]:ri};var mn=qe,ai={value:()=>{}};function _e(){for(var r=0,o=arguments.length,l={},g;r<o;++r){if(!(g=arguments[r]+"")||g in l||/[\s.]/.test(g))throw new Error("illegal type: "+g);l[g]=[]}return new Un(l)}function Un(r){this._=r}function oi(r,o){return r.trim().split(/^|\s+/).map(function(l){var g="",x=l.indexOf(".");if(x>=0&&(g=l.slice(x+1),l=l.slice(0,x)),l&&!o.hasOwnProperty(l))throw new Error("unknown type: "+l);return{type:l,name:g}})}Un.prototype=_e.prototype={constructor:Un,on:function(r,o){var l=this._,g=oi(r+"",l),x,O=-1,T=g.length;if(arguments.length<2){for(;++O<T;)if((x=(r=g[O]).type)&&(x=si(l[x],r.name)))return x;return}if(o!=null&&typeof o!="function")throw new Error("invalid callback: "+o);for(;++O<T;)if(x=(r=g[O]).type)l[x]=ta(l[x],r.name,o);else if(o==null)for(x in l)l[x]=ta(l[x],r.name,null);return this},copy:function(){var r={},o=this._;for(var l in o)r[l]=o[l].slice();return new Un(r)},call:function(r,o){if((x=arguments.length-2)>0)for(var l=new Array(x),g=0,x,O;g<x;++g)l[g]=arguments[g+2];if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(O=this._[r],g=0,x=O.length;g<x;++g)O[g].value.apply(o,l)},apply:function(r,o,l){if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(var g=this._[r],x=0,O=g.length;x<O;++x)g[x].value.apply(o,l)}};function si(r,o){for(var l=0,g=r.length,x;l<g;++l)if((x=r[l]).name===o)return x.value}function ta(r,o,l){for(var g=0,x=r.length;g<x;++g)if(r[g].name===o){r[g]=ai,r=r.slice(0,g).concat(r.slice(g+1));break}return l!=null&&r.push({name:o,value:l}),r}var ii=_e,ln=0,xn=0,Sn=0,ra=1e3,Bn,En,jn=0,nn=0,wn=0,In=typeof performance=="object"&&performance.now?performance:Date,na=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function fe(){return nn||(na(ui),nn=In.now()+wn)}function ui(){nn=0}function Gn(){this._call=this._time=this._next=null}Gn.prototype=ea.prototype={constructor:Gn,restart:function(r,o,l){if(typeof r!="function")throw new TypeError("callback is not a function");l=(l==null?fe():+l)+(o==null?0:+o),!this._next&&En!==this&&(En?En._next=this:Bn=this,En=this),this._call=r,this._time=l,le()},stop:function(){this._call&&(this._call=null,this._time=1/0,le())}};function ea(r,o,l){var g=new Gn;return g.restart(r,o,l),g}function fi(){fe(),++ln;for(var r=Bn,o;r;)(o=nn-r._time)>=0&&r._call.call(void 0,o),r=r._next;--ln}function aa(){nn=(jn=In.now())+wn,ln=xn=0;try{fi()}finally{ln=0,ci(),nn=0}}function li(){var r=In.now(),o=r-jn;o>ra&&(wn-=o,jn=r)}function ci(){for(var r,o=Bn,l,g=1/0;o;)o._call?(g>o._time&&(g=o._time),r=o,o=o._next):(l=o._next,o._next=null,o=r?r._next=l:Bn=l);En=r,le(g)}function le(r){if(!ln){xn&&(xn=clearTimeout(xn));var o=r-nn;o>24?(r<1/0&&(xn=setTimeout(aa,r-In.now()-wn)),Sn&&(Sn=clearInterval(Sn))):(Sn||(jn=In.now(),Sn=setInterval(li,ra)),ln=1,na(aa))}}function oa(r,o,l){var g=new Gn;return o=o==null?0:+o,g.restart(x=>{g.stop(),r(x+o)},o,l),g}var vi=ii("start","end","cancel","interrupt"),di=[],sa=0,ia=1,ce=2,Vn=3,ua=4,ve=5,Hn=6;function Wn(r,o,l,g,x,O){var T=r.__transition;if(!T)r.__transition={};else if(l in T)return;hi(r,l,{name:o,index:g,group:x,on:vi,tween:di,time:O.time,delay:O.delay,duration:O.duration,ease:O.ease,timer:null,state:sa})}function de(r,o){var l=zr(r,o);if(l.state>sa)throw new Error("too late; already scheduled");return l}function Kr(r,o){var l=zr(r,o);if(l.state>Vn)throw new Error("too late; already running");return l}function zr(r,o){var l=r.__transition;if(!l||!(l=l[o]))throw new Error("transition not found");return l}function hi(r,o,l){var g=r.__transition,x;g[o]=l,l.timer=ea(O,0,l.time);function O(L){l.state=ia,l.timer.restart(T,l.delay,l.time),l.delay<=L&&T(L-l.delay)}function T(L){var H,K,_,et;if(l.state!==ia)return $();for(H in g)if(et=g[H],et.name===l.name){if(et.state===Vn)return oa(T);et.state===ua?(et.state=Hn,et.timer.stop(),et.on.call("interrupt",r,r.__data__,et.index,et.group),delete g[H]):+H<o&&(et.state=Hn,et.timer.stop(),et.on.call("cancel",r,r.__data__,et.index,et.group),delete g[H])}if(oa(function(){l.state===Vn&&(l.state=ua,l.timer.restart(D,l.delay,l.time),D(L))}),l.state=ce,l.on.call("start",r,r.__data__,l.index,l.group),l.state===ce){for(l.state=Vn,x=new Array(_=l.tween.length),H=0,K=-1;H<_;++H)(et=l.tween[H].value.call(r,r.__data__,l.index,l.group))&&(x[++K]=et);x.length=K+1}}function D(L){for(var H=L<l.duration?l.ease.call(null,L/l.duration):(l.timer.restart($),l.state=ve,1),K=-1,_=x.length;++K<_;)x[K].call(r,H);l.state===ve&&(l.on.call("end",r,r.__data__,l.index,l.group),$())}function $(){l.state=Hn,l.timer.stop(),delete g[o];for(var L in g)return;delete r.__transition}}function gi(r,o){var l=r.__transition,g,x,O=!0,T;if(l){o=o==null?null:o+"";for(T in l){if((g=l[T]).name!==o){O=!1;continue}x=g.state>ce&&g.state<ve,g.state=Hn,g.timer.stop(),g.on.call(x?"interrupt":"cancel",r,r.__data__,g.index,g.group),delete l[T]}O&&delete r.__transition}}function pi(r){return this.each(function(){gi(this,r)})}var fa=180/Math.PI,he={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function la(r,o,l,g,x,O){var T,D,$;return(T=Math.sqrt(r*r+o*o))&&(r/=T,o/=T),($=r*l+o*g)&&(l-=r*$,g-=o*$),(D=Math.sqrt(l*l+g*g))&&(l/=D,g/=D,$/=D),r*g<o*l&&(r=-r,o=-o,$=-$,T=-T),{translateX:x,translateY:O,rotate:Math.atan2(o,r)*fa,skewX:Math.atan($)*fa,scaleX:T,scaleY:D}}var zn;function yi(r){const o=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(r+"");return o.isIdentity?he:la(o.a,o.b,o.c,o.d,o.e,o.f)}function mi(r){return r==null||(zn||(zn=document.createElementNS("http://www.w3.org/2000/svg","g")),zn.setAttribute("transform",r),!(r=zn.transform.baseVal.consolidate()))?he:(r=r.matrix,la(r.a,r.b,r.c,r.d,r.e,r.f))}function ca(r,o,l,g){function x(L){return L.length?L.pop()+" ":""}function O(L,H,K,_,et,zt){if(L!==K||H!==_){var or=et.push("translate(",null,o,null,l);zt.push({i:or-4,x:ct(L,K)},{i:or-2,x:ct(H,_)})}else(K||_)&&et.push("translate("+K+o+_+l)}function T(L,H,K,_){L!==H?(L-H>180?H+=360:H-L>180&&(L+=360),_.push({i:K.push(x(K)+"rotate(",null,g)-2,x:ct(L,H)})):H&&K.push(x(K)+"rotate("+H+g)}function D(L,H,K,_){L!==H?_.push({i:K.push(x(K)+"skewX(",null,g)-2,x:ct(L,H)}):H&&K.push(x(K)+"skewX("+H+g)}function $(L,H,K,_,et,zt){if(L!==K||H!==_){var or=et.push(x(et)+"scale(",null,",",null,")");zt.push({i:or-4,x:ct(L,K)},{i:or-2,x:ct(H,_)})}else(K!==1||_!==1)&&et.push(x(et)+"scale("+K+","+_+")")}return function(L,H){var K=[],_=[];return L=r(L),H=r(H),O(L.translateX,L.translateY,H.translateX,H.translateY,K,_),T(L.rotate,H.rotate,K,_),D(L.skewX,H.skewX,K,_),$(L.scaleX,L.scaleY,H.scaleX,H.scaleY,K,_),L=H=null,function(et){for(var zt=-1,or=_.length,pt;++zt<or;)K[(pt=_[zt]).i]=pt.x(et);return K.join("")}}}var xi=ca(yi,"px, ","px)","deg)"),Si=ca(mi,", ",")",")");function Ei(r,o){var l,g;return function(){var x=Kr(this,r),O=x.tween;if(O!==l){g=l=O;for(var T=0,D=g.length;T<D;++T)if(g[T].name===o){g=g.slice(),g.splice(T,1);break}}x.tween=g}}function Ii(r,o,l){var g,x;if(typeof l!="function")throw new Error;return function(){var O=Kr(this,r),T=O.tween;if(T!==g){x=(g=T).slice();for(var D={name:o,value:l},$=0,L=x.length;$<L;++$)if(x[$].name===o){x[$]=D;break}$===L&&x.push(D)}O.tween=x}}function Oi(r,o){var l=this._id;if(r+="",arguments.length<2){for(var g=zr(this.node(),l).tween,x=0,O=g.length,T;x<O;++x)if((T=g[x]).name===r)return T.value;return null}return this.each((o==null?Ei:Ii)(l,r,o))}function ge(r,o,l){var g=r._id;return r.each(function(){var x=Kr(this,g);(x.value||(x.value={}))[o]=l.apply(this,arguments)}),function(x){return zr(x,g).value[o]}}function va(r,o){var l;return(typeof o=="number"?ct:o instanceof A?tr:(l=A(o))?(o=l,tr):ur)(r,o)}function Ti(r){return function(){this.removeAttribute(r)}}function Ri(r){return function(){this.removeAttributeNS(r.space,r.local)}}function Ai(r,o,l){var g,x=l+"",O;return function(){var T=this.getAttribute(r);return T===x?null:T===g?O:O=o(g=T,l)}}function Pi(r,o,l){var g,x=l+"",O;return function(){var T=this.getAttributeNS(r.space,r.local);return T===x?null:T===g?O:O=o(g=T,l)}}function Ci(r,o,l){var g,x,O;return function(){var T,D=l(this),$;return D==null?void this.removeAttribute(r):(T=this.getAttribute(r),$=D+"",T===$?null:T===g&&$===x?O:(x=$,O=o(g=T,D)))}}function Ni(r,o,l){var g,x,O;return function(){var T,D=l(this),$;return D==null?void this.removeAttributeNS(r.space,r.local):(T=this.getAttributeNS(r.space,r.local),$=D+"",T===$?null:T===g&&$===x?O:(x=$,O=o(g=T,D)))}}function Mi(r,o){var l=Ln(r),g=l==="transform"?Si:va;return this.attrTween(r,typeof o=="function"?(l.local?Ni:Ci)(l,g,ge(this,"attr."+r,o)):o==null?(l.local?Ri:Ti)(l):(l.local?Pi:Ai)(l,g,o))}function bi(r,o){return function(l){this.setAttribute(r,o.call(this,l))}}function Di(r,o){return function(l){this.setAttributeNS(r.space,r.local,o.call(this,l))}}function Fi(r,o){var l,g;function x(){var O=o.apply(this,arguments);return O!==g&&(l=(g=O)&&Di(r,O)),l}return x._value=o,x}function $i(r,o){var l,g;function x(){var O=o.apply(this,arguments);return O!==g&&(l=(g=O)&&bi(r,O)),l}return x._value=o,x}function Li(r,o){var l="attr."+r;if(arguments.length<2)return(l=this.tween(l))&&l._value;if(o==null)return this.tween(l,null);if(typeof o!="function")throw new Error;var g=Ln(r);return this.tween(l,(g.local?Fi:$i)(g,o))}function Ui(r,o){return function(){de(this,r).delay=+o.apply(this,arguments)}}function Bi(r,o){return o=+o,function(){de(this,r).delay=o}}function ji(r){var o=this._id;return arguments.length?this.each((typeof r=="function"?Ui:Bi)(o,r)):zr(this.node(),o).delay}function wi(r,o){return function(){Kr(this,r).duration=+o.apply(this,arguments)}}function Gi(r,o){return o=+o,function(){Kr(this,r).duration=o}}function Vi(r){var o=this._id;return arguments.length?this.each((typeof r=="function"?wi:Gi)(o,r)):zr(this.node(),o).duration}function Hi(r,o){if(typeof o!="function")throw new Error;return function(){Kr(this,r).ease=o}}function Wi(r){var o=this._id;return arguments.length?this.each(Hi(o,r)):zr(this.node(),o).ease}function zi(r,o){return function(){var l=o.apply(this,arguments);if(typeof l!="function")throw new Error;Kr(this,r).ease=l}}function Yi(r){if(typeof r!="function")throw new Error;return this.each(zi(this._id