!function(){"use strict";var t="http://www.w3.org/1999/xhtml",e={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function r(t){var r=t+="",n=r.indexOf(":");return n>=0&&"xmlns"!==(r=t.slice(0,n))&&(t=t.slice(n+1)),e.hasOwnProperty(r)?{space:e[r],local:t}:t}function n(e){return function(){var r=this.ownerDocument,n=this.namespaceURI;return n===t&&r.documentElement.namespaceURI===t?r.createElement(e):r.createElementNS(n,e)}}function a(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function o(t){var e=r(t);return(e.local?a:n)(e)}function i(){}function u(t){return null==t?i:function(){return this.querySelector(t)}}function l(){return[]}function c(t){return new Array(t.length)}function s(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}s.prototype={constructor:s,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 f(t,e,r,n,a,o){for(var i,u=0,l=e.length,c=o.length;ue?1:t>=e?0:NaN}function p(t){return function(){this.removeAttribute(t)}}function g(t){return function(){this.removeAttributeNS(t.space,t.local)}}function b(t,e){return function(){this.setAttribute(t,e)}}function v(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function m(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttribute(t):this.setAttribute(t,r)}}function y(t,e){return function(){var r=e.apply(this,arguments);null==r?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function w(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function _(t){return function(){this.style.removeProperty(t)}}function x(t,e,r){return function(){this.style.setProperty(t,e,r)}}function M(t,e,r){return function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,r)}}function k(t,e){return t.style.getPropertyValue(e)||w(t).getComputedStyle(t,null).getPropertyValue(e)}function N(t){return function(){delete this[t]}}function A(t,e){return function(){this[t]=e}}function j(t,e){return function(){var r=e.apply(this,arguments);null==r?delete this[t]:this[t]=r}}function O(t){return t.trim().split(/^|\s+/)}function T(t){return t.classList||new D(t)}function D(t){this._node=t,this._names=O(t.getAttribute("class")||"")}function S(t,e){for(var r=T(t),n=-1,a=e.length;++n=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var G={},Z=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(G={mouseenter:"mouseover",mouseleave:"mouseout"}));function X(t,e,r){return t=K(t,e,r),function(e){var r=e.relatedTarget;r&&(r===this||8&r.compareDocumentPosition(this))||t.call(this,e)}}function K(t,e,r){return function(n){var a=Z;Z=n;try{t.call(this,this.__data__,e,r)}finally{Z=a}}}function J(t){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");return r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),{type:t,name:e}}))}function Q(t){return function(){var e=this.__on;if(e){for(var r,n=0,a=-1,o=e.length;n=M&&(M=x+1);!(_=y[M])&&++M=0;)(n=a[o])&&(i&&4^n.compareDocumentPosition(i)&&i.parentNode.insertBefore(n,i),i=n);return this},sort:function(t){function e(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}t||(t=d);for(var r=this._groups,n=r.length,a=new Array(n),o=0;o1?this.each((null==e?_:"function"==typeof e?M:x)(t,e,null==r?"":r)):k(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?N:"function"==typeof e?j:A)(t,e)):this.node()[t]},classed:function(t,e){var r=O(t+"");if(arguments.length<2){for(var n=T(this.node()),a=-1,o=r.length;++a=n.length)return null!=t&&r.sort(t),null!=e?e(r):r;for(var l,c,s,f=-1,h=r.length,d=n[a++],p=ft(),g=i();++fn.length)return r;var i,u=a[o-1];return null!=e&&o>=n.length?i=r.entries():(i=[],r.each((function(e,r){i.push({key:r,values:t(e,o)})}))),null!=u?i.sort((function(t,e){return u(t.key,e.key)})):i}(o(t,0,gt,bt),0)},key:function(t){return n.push(t),r},sortKeys:function(t){return a[n.length-1]=t,r},sortValues:function(e){return t=e,r},rollup:function(t){return e=t,r}}}function dt(){return{}}function pt(t,e,r){t[e]=r}function gt(){return ft()}function bt(t,e,r){t.set(e,r)}function vt(){}st.prototype=ft.prototype={constructor:st,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var mt=ft.prototype;function yt(t,e){return te?1:t>=e?0:NaN}function wt(t){return 1===t.length&&(t=function(t){return function(e,r){return yt(t(e),r)}}(t)),{left:function(e,r,n,a){for(null==n&&(n=0),null==a&&(a=e.length);n>>1;t(e[o],r)<0?n=o+1:a=o}return n},right:function(e,r,n,a){for(null==n&&(n=0),null==a&&(a=e.length);n>>1;t(e[o],r)>0?a=o:n=o+1}return n}}}vt.prototype=function(t,e){var r=new vt;if(t instanceof vt)t.each((function(t){r.add(t)}));else if(t){var n=-1,a=t.length;if(null==e)for(;++n=r)for(n=a=r;++ir&&(n=r),a=r)for(n=a=r;++ir&&(n=r),a=0?(o>=Mt?10:o>=kt?5:o>=Nt?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(o>=Mt?10:o>=kt?5:o>=Nt?2:1)}function jt(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),a=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/a;return o>=Mt?a*=10:o>=kt?a*=5:o>=Nt&&(a*=2),e=r)for(n=r;++on&&(n=r)}else for(;++o=r)for(n=r;++on&&(n=r);return n}function Tt(t,e){var r,n,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=r;++or&&(n=r)}else for(;++o=r)for(n=r;++or&&(n=r);return n}function Dt(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function St(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Ct(){}var $t="\\s*([+-]?\\d+)\\s*",Ft="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Et="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Lt=/^#([0-9a-f]{3,8})$/,Bt=new RegExp("^rgb\\("+[$t,$t,$t]+"\\)$"),zt=new RegExp("^rgb\\("+[Et,Et,Et]+"\\)$"),Ut=new RegExp("^rgba\\("+[$t,$t,$t,Ft]+"\\)$"),Pt=new RegExp("^rgba\\("+[Et,Et,Et,Ft]+"\\)$"),Yt=new RegExp("^hsl\\("+[Ft,Et,Et]+"\\)$"),Rt=new RegExp("^hsla\\("+[Ft,Et,Et,Ft]+"\\)$"),Ht={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 qt(){return this.rgb().formatHex()}function It(){return this.rgb().formatRgb()}function Wt(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Lt.exec(t))?(r=e[1].length,e=parseInt(e[1],16),6===r?Vt(e):3===r?new Kt(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?new Kt(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?new Kt(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=Bt.exec(t))?new Kt(e[1],e[2],e[3],1):(e=zt.exec(t))?new Kt(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ut.exec(t))?Gt(e[1],e[2],e[3],e[4]):(e=Pt.exec(t))?Gt(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Yt.exec(t))?ee(e[1],e[2]/100,e[3]/100,1):(e=Rt.exec(t))?ee(e[1],e[2]/100,e[3]/100,e[4]):Ht.hasOwnProperty(t)?Vt(Ht[t]):"transparent"===t?new Kt(NaN,NaN,NaN,0):null}function Vt(t){return new Kt(t>>16&255,t>>8&255,255&t,1)}function Gt(t,e,r,n){return n<=0&&(t=e=r=NaN),new Kt(t,e,r,n)}function Zt(t){return t instanceof Ct||(t=Wt(t)),t?new Kt((t=t.rgb()).r,t.g,t.b,t.opacity):new Kt}function Xt(t,e,r,n){return 1===arguments.length?Zt(t):new Kt(t,e,r,null==n?1:n)}function Kt(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function Jt(){return"#"+te(this.r)+te(this.g)+te(this.b)}function Qt(){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 te(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ee(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new ne(t,e,r,n)}function re(t){if(t instanceof ne)return new ne(t.h,t.s,t.l,t.opacity);if(t instanceof Ct||(t=Wt(t)),!t)return new ne;if(t instanceof ne)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),o=Math.max(e,r,n),i=NaN,u=o-a,l=(o+a)/2;return u?(i=e===o?(r-n)/u+6*(r0&&l<1?0:i,new ne(i,u,l,t.opacity)}function ne(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function ae(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}Dt(Ct,Wt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:qt,formatHex:qt,formatHsl:function(){return re(this).formatHsl()},formatRgb:It,toString:It}),Dt(Kt,Xt,St(Ct,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Kt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Kt(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:Jt,formatHex:Jt,formatRgb:Qt,toString:Qt})),Dt(ne,(function(t,e,r,n){return 1===arguments.length?re(t):new ne(t,e,r,null==n?1:n)}),St(Ct,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new ne(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new ne(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,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new Kt(ae(t>=240?t-240:t+120,a,n),ae(t,a,n),ae(t<120?t+240:t-120,a,n),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 oe=Math.PI/180,ie=180/Math.PI,ue=6/29,le=3*ue*ue;function ce(t){if(t instanceof fe)return new fe(t.l,t.a,t.b,t.opacity);if(t instanceof me)return ye(t);t instanceof Kt||(t=Zt(t));var e,r,n=ge(t.r),a=ge(t.g),o=ge(t.b),i=he((.2225045*n+.7168786*a+.0606169*o)/1);return n===a&&a===o?e=r=i:(e=he((.4360747*n+.3850649*a+.1430804*o)/.96422),r=he((.0139322*n+.0971045*a+.7141733*o)/.82521)),new fe(116*i-16,500*(e-i),200*(i-r),t.opacity)}function se(t,e,r,n){return 1===arguments.length?ce(t):new fe(t,e,r,null==n?1:n)}function fe(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function he(t){return t>.008856451679035631?Math.pow(t,1/3):t/le+4/29}function de(t){return t>ue?t*t*t:le*(t-4/29)}function pe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ge(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function be(t){if(t instanceof me)return new me(t.h,t.c,t.l,t.opacity);if(t instanceof fe||(t=ce(t)),0===t.a&&0===t.b)return new me(NaN,0o&&(a=e.slice(o,a),u[i]?u[i]+=a:u[++i]=a),(r=r[0])===(n=n[0])?u[i]?u[i]+=n:u[++i]=n:(u[++i]=null,l.push({i:i,x:Ae(r,n)})),o=Te.lastIndex;return on&&(e=r,r=n,n=e),function(t){return Math.max(r,Math.min(n,t))}}function Re(t,e,r){var n=t[0],a=t[1],o=e[0],i=e[1];return a2?He:Re,a=o=null,f}function f(e){return isNaN(e=+e)?r:(a||(a=n(i.map(t),u,l)))(t(c(e)))}return f.invert=function(r){return c(e((o||(o=n(u,i.map(t),Ae)))(r)))},f.domain=function(t){return arguments.length?(i=Ee.call(t,Be),c===Ue||(c=Ye(i)),s()):i.slice()},f.range=function(t){return arguments.length?(u=Le.call(t),s()):u.slice()},f.rangeRound=function(t){return u=Le.call(t),l=Ce,s()},f.clamp=function(t){return arguments.length?(c=t?Ye(i):Ue,f):c!==Ue},f.interpolate=function(t){return arguments.length?(l=t,s()):l},f.unknown=function(t){return arguments.length?(r=t,f):r},function(r,n){return t=r,e=n,s()}}()(t,e)}function We(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Ve(t){return(t=We(Math.abs(t)))?t[1]:NaN}var Ge,Ze=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xe(t){if(!(e=Ze.exec(t)))throw new Error("invalid format: "+t);var e;return new Ke({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 Ke(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 Je(t,e){var r=We(t,e);if(!r)return t+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}Xe.prototype=Ke.prototype,Ke.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 Qe={"%":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.round(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 Je(100*t,e)},r:Je,s:function(t,e){var r=We(t,e);if(!r)return t+"";var n=r[0],a=r[1],o=a-(Ge=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,i=n.length;return o===i?n:o>i?n+new Array(o-i+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+We(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function tr(t){return t}var er,rr,nr,ar=Array.prototype.map,or=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"];function ir(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?tr:(e=ar.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var a=t.length,o=[],i=0,u=e[0],l=0;a>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),o.push(t.substring(a-=u,a+u)),!((l+=u+1)>n));)u=e[i=(i+1)%e.length];return o.reverse().join(r)}),a=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",i=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?tr:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(ar.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Xe(t)).fill,r=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,b=t.precision,v=t.trim,m=t.type;"n"===m?(g=!0,m="g"):Qe[m]||(void 0===b&&(b=12),v=!0,m="g"),(d||"0"===e&&"="===r)&&(d=!0,e="0",r="=");var y="$"===h?a:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",w="$"===h?o:/[%p]/.test(m)?l:"",_=Qe[m],x=/[defgprs%]/.test(m);function M(t){var a,o,l,h=y,M=w;if("c"===m)M=_(t)+M,t="";else{var k=(t=+t)<0;if(t=isNaN(t)?s:_(Math.abs(t),b),v&&(t=function(t){t:for(var e,r=t.length,n=1,a=-1;n0){if(!+t[n])break t;a=0}}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),k&&0==+t&&(k=!1),h=(k?"("===f?f:c:"-"===f||"("===f?"":f)+h,M=("s"===m?or[8+Ge/3]:"")+M+(k&&"("===f?")":""),x)for(a=-1,o=t.length;++a(l=t.charCodeAt(a))||l>57){M=(46===l?i+t.slice(a+1):t.slice(a))+M,t=t.slice(0,a);break}}g&&!d&&(t=n(t,1/0));var N=h.length+t.length+M.length,A=N>1)+h+t+M+A.slice(N);break;default:t=A+h+t+M}return u(t)}return b=void 0===b?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var r=f(((t=Xe(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor(Ve(e)/3))),a=Math.pow(10,-n),o=or[8+n/3];return function(t){return r(a*t)+o}}}}function ur(t,e,r,n){var a,o=jt(t,e,r);switch((n=Xe(null==n?",f":n)).type){case"s":var i=Math.max(Math.abs(t),Math.abs(e));return null!=n.precision||isNaN(a=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ve(e)/3)))-Ve(Math.abs(t)))}(o,i))||(n.precision=a),nr(n,i);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(a=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ve(e)-Ve(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(n.precision=a-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(a=function(t){return Math.max(0,-Ve(Math.abs(t)))}(o))||(n.precision=a-2*("%"===n.type))}return rr(n)}function lr(t){var e=t.domain;return t.ticks=function(t){var r=e();return function(t,e,r){var n,a,o,i,u=-1;if(r=+r,(t=+t)===(e=+e)&&r>0)return[t];if((n=e0)for(t=Math.ceil(t/i),e=Math.floor(e/i),o=new Array(a=Math.ceil(e-t+1));++u0?n=At(u=Math.floor(u/n)*n,l=Math.ceil(l/n)*n,r):n<0&&(n=At(u=Math.ceil(u*n)/n,l=Math.floor(l*n)/n,r)),n>0?(a[o]=Math.floor(u/n)*n,a[i]=Math.ceil(l/n)*n,e(a)):n<0&&(a[o]=Math.ceil(u*n)/n,a[i]=Math.floor(l*n)/n,e(a)),t},t}function cr(){var t=Ie(Ue,Ue);return t.copy=function(){return qe(t,cr())},$e.apply(t,arguments),lr(t)}er=ir({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),rr=er.format,nr=er.formatPrefix;var sr=new Date,fr=new Date;function hr(t,e,r,n){function a(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return a.floor=function(e){return t(e=new Date(+e)),e},a.ceil=function(r){return t(r=new Date(r-1)),e(r,1),t(r),r},a.round=function(t){var e=a(t),r=a.ceil(t);return t-e0))return u;do{u.push(i=new Date(+r)),e(r,o),t(r)}while(i=e)for(;t(e),!r(e);)e.setTime(e-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}))},r&&(a.count=function(e,n){return sr.setTime(+e),fr.setTime(+n),t(sr),t(fr),Math.floor(r(sr,fr))},a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?a.filter(n?function(e){return n(e)%t==0}:function(e){return a.count(0,e)%t==0}):a:null}),a}var dr=hr((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));dr.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?hr((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):dr:null};var pr=hr((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()})),gr=hr((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()})),br=hr((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()})),vr=hr((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 mr(t){return hr((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 yr=mr(0),wr=mr(1),_r=(mr(2),mr(3),mr(4)),xr=(mr(5),mr(6),hr((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()}))),Mr=hr((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()}));Mr.every=function(t){return isFinite(t=Math.floor(t))&&t>0?hr((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var kr=hr((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 Nr(t){return hr((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 Ar=Nr(0),jr=Nr(1),Or=(Nr(2),Nr(3),Nr(4)),Tr=(Nr(5),Nr(6),hr((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 Dr(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 Sr(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 Cr(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}Tr.every=function(t){return isFinite(t=Math.floor(t))&&t>0?hr((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var $r,Fr,Er={"-":"",_:" ",0:"0"},Lr=/^\s*\d+/,Br=/^%/,zr=/[\\^$*+?|[\]().{}]/g;function Ur(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",o=a.length;return n+(o68?1900:2e3),r+n[0].length):-1}function Xr(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Kr(t,e,r){var n=Lr.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function Jr(t,e,r){var n=Lr.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Qr(t,e,r){var n=Lr.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function tn(t,e,r){var n=Lr.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function en(t,e,r){var n=Lr.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function rn(t,e,r){var n=Lr.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function nn(t,e,r){var n=Lr.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function an(t,e,r){var n=Lr.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function on(t,e,r){var n=Lr.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function un(t,e,r){var n=Br.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ln(t,e,r){var n=Lr.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function cn(t,e,r){var n=Lr.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function sn(t,e){return Ur(t.getDate(),e,2)}function fn(t,e){return Ur(t.getHours(),e,2)}function hn(t,e){return Ur(t.getHours()%12||12,e,2)}function dn(t,e){return Ur(1+vr.count(Mr(t),t),e,3)}function pn(t,e){return Ur(t.getMilliseconds(),e,3)}function gn(t,e){return pn(t,e)+"000"}function bn(t,e){return Ur(t.getMonth()+1,e,2)}function vn(t,e){return Ur(t.getMinutes(),e,2)}function mn(t,e){return Ur(t.getSeconds(),e,2)}function yn(t){var e=t.getDay();return 0===e?7:e}function wn(t,e){return Ur(yr.count(Mr(t)-1,t),e,2)}function _n(t,e){var r=t.getDay();return t=r>=4||0===r?_r(t):_r.ceil(t),Ur(_r.count(Mr(t),t)+(4===Mr(t).getDay()),e,2)}function xn(t){return t.getDay()}function Mn(t,e){return Ur(wr.count(Mr(t)-1,t),e,2)}function kn(t,e){return Ur(t.getFullYear()%100,e,2)}function Nn(t,e){return Ur(t.getFullYear()%1e4,e,4)}function An(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ur(e/60|0,"0",2)+Ur(e%60,"0",2)}function jn(t,e){return Ur(t.getUTCDate(),e,2)}function On(t,e){return Ur(t.getUTCHours(),e,2)}function Tn(t,e){return Ur(t.getUTCHours()%12||12,e,2)}function Dn(t,e){return Ur(1+kr.count(Tr(t),t),e,3)}function Sn(t,e){return Ur(t.getUTCMilliseconds(),e,3)}function Cn(t,e){return Sn(t,e)+"000"}function $n(t,e){return Ur(t.getUTCMonth()+1,e,2)}function Fn(t,e){return Ur(t.getUTCMinutes(),e,2)}function En(t,e){return Ur(t.getUTCSeconds(),e,2)}function Ln(t){var e=t.getUTCDay();return 0===e?7:e}function Bn(t,e){return Ur(Ar.count(Tr(t)-1,t),e,2)}function zn(t,e){var r=t.getUTCDay();return t=r>=4||0===r?Or(t):Or.ceil(t),Ur(Or.count(Tr(t),t)+(4===Tr(t).getUTCDay()),e,2)}function Un(t){return t.getUTCDay()}function Pn(t,e){return Ur(jr.count(Tr(t)-1,t),e,2)}function Yn(t,e){return Ur(t.getUTCFullYear()%100,e,2)}function Rn(t,e){return Ur(t.getUTCFullYear()%1e4,e,4)}function Hn(){return"+0000"}function qn(){return"%"}function In(t){return+t}function Wn(t){return Math.floor(+t/1e3)}!function(t){$r=function(t){var e=t.dateTime,r=t.date,n=t.time,a=t.periods,o=t.days,i=t.shortDays,u=t.months,l=t.shortMonths,c=Yr(a),s=Rr(a),f=Yr(o),h=Rr(o),d=Yr(i),p=Rr(i),g=Yr(u),b=Rr(u),v=Yr(l),m=Rr(l),y={a:function(t){return i[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:sn,e:sn,f:gn,H:fn,I:hn,j:dn,L:pn,m:bn,M:vn,p:function(t){return a[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:In,s:Wn,S:mn,u:yn,U:wn,V:_n,w:xn,W:Mn,x:null,X:null,y:kn,Y:Nn,Z:An,"%":qn},w={a:function(t){return i[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:jn,e:jn,f:Cn,H:On,I:Tn,j:Dn,L:Sn,m:$n,M:Fn,p:function(t){return a[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:In,s:Wn,S:En,u:Ln,U:Bn,V:zn,w:Un,W:Pn,x:null,X:null,y:Yn,Y:Rn,Z:Hn,"%":qn},_={a:function(t,e,r){var n=d.exec(e.slice(r));return n?(t.w=p[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=f.exec(e.slice(r));return n?(t.w=h[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=v.exec(e.slice(r));return n?(t.m=m[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=g.exec(e.slice(r));return n?(t.m=b[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,r,n){return k(t,e,r,n)},d:Qr,e:Qr,f:on,H:en,I:en,j:tn,L:an,m:Jr,M:rn,p:function(t,e,r){var n=c.exec(e.slice(r));return n?(t.p=s[n[0].toLowerCase()],r+n[0].length):-1},q:Kr,Q:ln,s:cn,S:nn,u:qr,U:Ir,V:Wr,w:Hr,W:Vr,x:function(t,e,n){return k(t,r,e,n)},X:function(t,e,r){return k(t,n,e,r)},y:Zr,Y:Gr,Z:Xr,"%":un};function x(t,e){return function(r){var n,a,o,i=[],u=-1,l=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++u53)return null;"w"in o||(o.w=1),"Z"in o?(a=(n=Sr(Cr(o.y,0,1))).getUTCDay(),n=a>4||0===a?jr.ceil(n):jr(n),n=kr.offset(n,7*(o.V-1)),o.y=n.getUTCFullYear(),o.m=n.getUTCMonth(),o.d=n.getUTCDate()+(o.w+6)%7):(a=(n=Dr(Cr(o.y,0,1))).getDay(),n=a>4||0===a?wr.ceil(n):wr(n),n=vr.offset(n,7*(o.V-1)),o.y=n.getFullYear(),o.m=n.getMonth(),o.d=n.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),a="Z"in o?Sr(Cr(o.y,0,1)).getUTCDay():Dr(Cr(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(a+5)%7:o.w+7*o.U-(a+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Sr(o)):Dr(o)}}function k(t,e,r,n){for(var a,o,i=0,u=e.length,l=r.length;i=l)return-1;if(37===(a=e.charCodeAt(i++))){if(a=e.charAt(i++),!(o=_[a in Er?e.charAt(i++):a])||(n=o(t,r,n))<0)return-1}else if(a!=r.charCodeAt(n++))return-1}return n}return y.x=x(r,y),y.X=x(n,y),y.c=x(e,y),w.x=x(r,w),w.X=x(n,w),w.c=x(e,w),{format:function(t){var e=x(t+="",y);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),Fr=$r.format,$r.parse,$r.utcFormat,$r.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"]});function Vn(t){return new Date(t)}function Gn(t){return t instanceof Date?+t:+new Date(+t)}function Zn(t,e,r,n,a,o,i,u,l){var c=Ie(Ue,Ue),s=c.invert,f=c.domain,h=l(".%L"),d=l(":%S"),p=l("%I:%M"),g=l("%I %p"),b=l("%a %d"),v=l("%b %d"),m=l("%B"),y=l("%Y"),w=[[i,1,1e3],[i,5,5e3],[i,15,15e3],[i,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[a,1,36e5],[a,3,108e5],[a,6,216e5],[a,12,432e5],[n,1,864e5],[n,2,1728e5],[r,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function _(u){return(i(u)Math.abs(a.l-e)?a.l-e:t}),100);l=l.map((function(t){return t+c}))}return(l=l.map((function(t){return se(t,a.a,a.b)}))).map((function(t){return t.hex()}))}function Kn(t,e){void 0===t&&(t=new Error("cant create getColor function without theme")),void 0===e&&(e={});var r=e.selectedColor;void 0===r&&(r=0);var n=e.customColors;void 0===n&&(n={});var a=e.keys;void 0===a&&(a=[]);var o=e.permute,i=e.includeBaseColor;void 0===i&&(i=!0);var u=e.lightnessRange;void 0===u&&(u=[30,90]);var l=e.positiveColor;void 0===l&&(l=!1);var c=e.negativeColor;void 0===c&&(c=!1);var s=e.neutralColor;void 0===s&&(s=!1);var f=t.colors.palette;r=isNaN(r)?r:f[r%f.length];var h=a.length-Object.keys(n).filter((function(t){return""!==n[t].toString()&&a.includes(t)})).length,d=[];if(n&&Object.keys(n).length){var p={};Object.keys(n).forEach((function(t){String(n[t]).length&&(p[t]=isNaN(n[t])?n[t]:f[n[t]])})),Object.keys(p).length&&d.push(Jn(p))}(l||c||s)&&d.push(Qn(l?t.colors.positive:r,c?t.colors.negative:r,s?t.colors.neutral:l?t.colors.positive:r));var g=t.colors.mode;if(g&&h>0&&(g.rotateLimit>=h?d.push(ta(f,r)):g.shades&&g.shades[r]&&d.push(ea(g.shades[r],h))),h>0){o=void 0===o?h>4:o;var b=Xn(r,h,i,u=h<=3?[30,60]:u);o&&(b=function(t){t.reverse();var e=t.length;if(e<3)return t.slice(0);var r=0,n=-2,a=[],o={},i=Math.ceil(e/2.5);do{!o[r%=e]&&(e<5||Math.abs(n-r)>1)?(a.push(t[r]),o[r]=!0,n=r,r+=i):r+=1}while(a.length0?t:n.value<0?e:r}},ta=function(t,e){return function(r){return t[(Math.max(0,t.indexOf(e))+r.i)%t.length]}},ea=function(t,e){return function(r){if("string"!=typeof t[0]){t.sort((function(t,e){return t.length-e.length}));var n=t.length-1;return t.forEach((function(t,r){e>(t[r-1]||[]).length&&e<=t.length&&(n=r)})),t[n][r.i%t[n].length]}return t[r.i%t.length]}},ra=function(t){var e=0,r=[];return function(n){return r[n.i]?r[n.i]:e!==t.length?r[n.i]=t[e++]:null}};function na(t){if("string"==typeof t){var e,r={},n=t.split(/([\.#])/g);for(t=n.shift();e=n.shift();)"."==e?r.class=r.class?r.class+" "+n.shift():n.shift():"#"==e&&(r.id=n.shift());return{tag:t,attr:r}}return t}function aa(){return null}var oa=/^(allowReorder|attributeName|attributeType|autoReverse|baseFrequency|baseProfile|calcMode|clipPathUnits|contentScriptType|contentStyleType|diffuseConstant|edgeMode|externalResourcesRequired|filterRes|filterUnits|glyphRef|gradientTransform|gradientUnits|kernelMatrix|kernelUnitLength|keyPoints|keySplines|keyTimes|lengthAdjust|limitingConeAngle|markerHeight|markerUnits|markerWidth|maskContentUnits|maskUnits|numOctaves|pathLength|patternContentUnits|patternTransform|patternUnits|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|referrerPolicy|refX|refY|repeatCount|repeatDur|requiredExtensions|requiredFeatures|specularConstant|specularExponent|spreadMethod|startOffset|stdDeviation|stitchTiles|surfaceScale|systemLanguage|tableValues|targetX|targetY|textLength|viewBox|viewTarget|xChannelSelector|yChannelSelector|zoomAndPan)$/;function ia(){for(var t=arguments,e=0,r=t.length;et(r)?1:t(e)>=t(r)?0:NaN}:function(e,r){return e[t]r[t]?1:e[t]>=r[t]?0:NaN}}function la(t,e,r){var n=e.swatches,a=e.swatchWidth,o=e.swatchHeight,i=e.itemMarginBottom,u=e.itemMarginRight,l=e.swatchBorderRadius,c=e.swatchLabelDistance,s=e.fontWeight,f=e.highlight,h=e.reverse,d=t.append("div.legend-categories").st({fontWeight:s}),p=function(t,e){void 0===e&&(e=700);var r=!1,n=!0;return{set:function(a){r!==a&&setTimeout((function(){n=!1,t(r)}),n?e:0),r=a},clear:function(){r=null,n=!0,t(null)},get:function(){return r}}}((function(t){null!==t?(f&&(d.classed("highlighted",!0),b.classed("highlight",(function(e){return e.key===t.key}))),r("mouseenter",t)):(f&&(d.classed("highlighted",!1),b.classed("highlight",!1)),r("mouseleave"))})),g=h?n.slice(0).reverse():n,b=d.appendMany("div.legend-swatch",g).st({marginBottom:i,marginRight:u}).on("mouseenter",(function(t){return p.set(t)}));d.on("mouseleave",p.clear);var v=b.append("div.legend-no-break"),m="50%"===l?"dw-circle":"export-rect";function y(t){var e=t.trim().indexOf(" "),r=t.trim().indexOf("-");return e<0&&r<0?t:r<0||e-1)&&(t.push(this.parentNode),!0)})).select((function(){return this.parentNode}))},it.prototype.selectAppend=function(t){var e,r=u(t),n=na(t);for(var a in t=o(n.tag),e=this.select((function(){return r.apply(this,arguments)||this.appendChild(t.apply(this,arguments))})),n.attr)e.attr(a,n.attr[a]);return e},it.prototype.tspans=function(t,e){return this.selectAll("tspan").data((function(e){return("function"==typeof t?t(e):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,r){return r?("function"==typeof e?e(t.parent,t.line,r):e)||15:0}))},it.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 r=e;e=t,t=r}return this.selectAll(null).data(e).enter().append(t)},it.prototype.at=function(t,e){if("object"==typeof t){for(var r in t)this.attr(oa.test(r)?r:r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),t[r]);return this}return 1==arguments.length?this.attr(t):this.attr(t,e)},it.prototype.st=function(t,e){if("object"==typeof t){for(var r in t)n(this,r,t[r]);return this}return 1==arguments.length?this.style(t):n(this,t,e);function n(t,e,r){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 height stroke-width line-height margin padding border border-radius max-width min-width".indexOf(e)?t.style(e,"function"==typeof r?o(r):a(r)):t.style(e,r),t}function a(t){return t.match?t:t+"px"}function o(t){return function(){var e=t.apply(this,arguments);return a(e)}}},it.prototype.prop=it.prototype.property;var ca="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function sa(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var fa=sa((function(t){ /*! @preserve * numeral.js * version : 2.0.6 * author : Adam Draper * license : MIT * http://adamwdraper.github.com/Numeral-js/ */ !function(e,r){t.exports?t.exports=r():e.numeral=r()}(ca,(function(){var t,e,r,n,a,o={},i={},u={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},l={currentLocale:u.currentLocale,zeroFormat:u.zeroFormat,nullFormat:u.nullFormat,defaultFormat:u.defaultFormat,scalePercentBy100:u.scalePercentBy100};function c(t,e){this._input=t,this._value=e}return(t=function(r){var n,a,i,u;if(t.isNumeral(r))n=r.value();else if(0===r||void 0===r)n=0;else if(null===r||e.isNaN(r))n=null;else if("string"==typeof r)if(l.zeroFormat&&r===l.zeroFormat)n=0;else if(l.nullFormat&&r===l.nullFormat||!r.replace(/[^0-9]+/g,"").length)n=null;else{for(a in o)if((u="function"==typeof o[a].regexps.unformat?o[a].regexps.unformat():o[a].regexps.unformat)&&r.match(u)){i=o[a].unformat;break}n=(i=i||t._.stringToNumber)(r)}else n=Number(r)||null;return new c(r,n)}).version="2.0.6",t.isNumeral=function(t){return t instanceof c},t._=e={numberToFormat:function(e,r,n){var a,o,u,l,c,s,f,h,d=i[t.options.currentLocale],p=!1,g=!1,b="",v="",m=!1;if(e=e||0,u=Math.abs(e),t._.includes(r,"(")?(p=!0,r=r.replace(/[\(|\)]/g,"")):(t._.includes(r,"+")||t._.includes(r,"-"))&&(s=t._.includes(r,"+")?r.indexOf("+"):e<0?r.indexOf("-"):-1,r=r.replace(/[\+|\-]/g,"")),t._.includes(r,"a")&&(o=!!(o=r.match(/a(k|m|b|t)?/))&&o[1],t._.includes(r," a")&&(b=" "),r=r.replace(new RegExp(b+"a[kmbt]?"),""),u>=1e12&&!o||"t"===o?(b+=d.abbreviations.trillion,e/=1e12):u<1e12&&u>=1e9&&!o||"b"===o?(b+=d.abbreviations.billion,e/=1e9):u<1e9&&u>=1e6&&!o||"m"===o?(b+=d.abbreviations.million,e/=1e6):(u<1e6&&u>=1e3&&!o||"k"===o)&&(b+=d.abbreviations.thousand,e/=1e3)),t._.includes(r,"[.]")&&(g=!0,r=r.replace("[.]",".")),l=e.toString().split(".")[0],c=r.split(".")[1],f=r.indexOf(","),a=(r.split(".")[0].split(",")[0].match(/0/g)||[]).length,c?(t._.includes(c,"[")?(c=(c=c.replace("]","")).split("["),v=t._.toFixed(e,c[0].length+c[1].length,n,c[1].length)):v=t._.toFixed(e,c.length,n),l=v.split(".")[0],v=t._.includes(v,".")?d.delimiters.decimal+v.split(".")[1]:"",g&&0===Number(v.slice(1))&&(v="")):l=t._.toFixed(e,0,n),b&&!o&&Number(l)>=1e3&&b!==d.abbreviations.trillion)switch(l=String(Number(l)/1e3),b){case d.abbreviations.thousand:b=d.abbreviations.million;break;case d.abbreviations.million:b=d.abbreviations.billion;break;case d.abbreviations.billion:b=d.abbreviations.trillion}if(t._.includes(l,"-")&&(l=l.slice(1),m=!0),l.length0;y--)l="0"+l;return f>-1&&(l=l.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+d.delimiters.thousands)),0===r.indexOf(".")&&(l=""),h=l+v+(b||""),p?h=(p&&m?"(":"")+h+(p&&m?")":""):s>=0?h=0===s?(m?"-":"+")+h:h+(m?"-":"+"):m&&(h="-"+h),h},stringToNumber:function(t){var e,r,n,a=i[l.currentLocale],o=t,u={thousand:3,million:6,billion:9,trillion:12};if(l.zeroFormat&&t===l.zeroFormat)r=0;else if(l.nullFormat&&t===l.nullFormat||!t.replace(/[^0-9]+/g,"").length)r=null;else{for(e in r=1,"."!==a.delimiters.decimal&&(t=t.replace(/\./g,"").replace(a.delimiters.decimal,".")),u)if(n=new RegExp("[^a-zA-Z]"+a.abbreviations[e]+"(?:\\)|(\\"+a.currency.symbol+")?(?:\\))?)?$"),o.match(n)){r*=Math.pow(10,u[e]);break}r*=(t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1,t=t.replace(/[^0-9\.]+/g,""),r*=Number(t)}return r},isNaN:function(t){return"number"==typeof t&&isNaN(t)},includes:function(t,e){return-1!==t.indexOf(e)},insert:function(t,e,r){return t.slice(0,r)+e+t.slice(r)},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 r,n=Object(t),a=n.length>>>0,o=0;if(3===arguments.length)r=arguments[2];else{for(;o=a)throw new TypeError("Reduce of empty array with no initial value");r=n[o++]}for(;on?t:n}),1)},toFixed:function(t,e,r,n){var a,o,i,u,l=t.toString().split("."),c=e-(n||0);return a=2===l.length?Math.min(Math.max(l[1].length,c),e):c,i=Math.pow(10,a),u=(r(t+"e+"+a)/i).toFixed(a),n>e-a&&(o=new RegExp("\\.?0{1,"+(n-(e-a))+"}$"),u=u.replace(o,"")),u}},t.options=l,t.formats=o,t.locales=i,t.locale=function(t){return t&&(l.currentLocale=t.toLowerCase()),l.currentLocale},t.localeData=function(t){if(!t)return i[l.currentLocale];if(t=t.toLowerCase(),!i[t])throw new Error("Unknown locale : "+t);return i[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,r){if(e=e.toLowerCase(),this[t+"s"][e])throw new TypeError(e+" "+t+" already registered.");return this[t+"s"][e]=r,r},t.validate=function(e,r){var n,a,o,i,u,l,c,s;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{c=t.localeData(r)}catch(e){c=t.localeData(t.locale())}return o=c.currency.symbol,u=c.abbreviations,n=c.delimiters.decimal,a="."===c.delimiters.thousands?"\\.":c.delimiters.thousands,(null===(s=e.match(/^[^\d]+/))||(e=e.substr(1),s[0]===o))&&((null===(s=e.match(/[^\d]+$/))||(e=e.slice(0,-1),s[0]===u.thousand||s[0]===u.million||s[0]===u.billion||s[0]===u.trillion))&&(l=new RegExp(a+"{2}"),!e.match(/[^\d.,]/g)&&(!((i=e.split(n)).length>2)&&(i.length<2?!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l):1===i[0].length?!!i[0].match(/^\d+$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/):!!i[0].match(/^\d+.*\d$/)&&!i[0].match(l)&&!!i[1].match(/^\d+$/)))))},t.fn=c.prototype={clone:function(){return t(this)},format:function(e,r){var n,a,i,u=this._value,c=e||l.defaultFormat;if(r=r||Math.round,0===u&&null!==l.zeroFormat)a=l.zeroFormat;else if(null===u&&null!==l.nullFormat)a=l.nullFormat;else{for(n in o)if(c.match(o[n].regexps.format)){i=o[n].format;break}a=(i=i||t._.numberToFormat)(u,c,r)}return a},value:function(){return this._value},input:function(){return this._input},set:function(t){return this._value=Number(t),this},add:function(t){var r=e.correctionFactor.call(null,this._value,t);return this._value=e.reduce([this._value,t],(function(t,e,n,a){return t+Math.round(r*e)}),0)/r,this},subtract:function(t){var r=e.correctionFactor.call(null,this._value,t);return this._value=e.reduce([t],(function(t,e,n,a){return t-Math.round(r*e)}),Math.round(this._value*r))/r,this},multiply:function(t){return this._value=e.reduce([this._value,t],(function(t,r,n,a){var o=e.correctionFactor(t,r);return Math.round(t*o)*Math.round(r*o)/Math.round(o*o)}),1),this},divide:function(t){return this._value=e.reduce([this._value,t],(function(t,r,n,a){var o=e.correctionFactor(t,r);return Math.round(t*o)/Math.round(r*o)})),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,r,n){var a,o=t._.includes(r," BPS")?" ":"";return e*=1e4,r=r.replace(/\s?BPS/,""),a=t._.numberToFormat(e,r,n),t._.includes(a,")")?((a=a.split("")).splice(-1,0,o+"BPS"),a=a.join("")):a=a+o+"BPS",a},unformat:function(e){return+(1e-4*t._.stringToNumber(e)).toFixed(15)}}),n={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},a="("+(a=(r={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}).suffixes.concat(n.suffixes.filter((function(t){return r.suffixes.indexOf(t)<0}))).join("|")).replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(a)},format:function(e,a,o){var i,u,l,c=t._.includes(a,"ib")?n:r,s=t._.includes(a," b")||t._.includes(a," ib")?" ":"";for(a=a.replace(/\s?i?b/,""),i=0;i<=c.suffixes.length;i++)if(u=Math.pow(c.base,i),l=Math.pow(c.base,i+1),null===e||0===e||e>=u&&e0&&(e/=u);break}return t._.numberToFormat(e,a,o)+s},unformat:function(e){var a,o,i=t._.stringToNumber(e);if(i){for(a=r.suffixes.length-1;a>=0;a--){if(t._.includes(e,r.suffixes[a])){o=Math.pow(r.base,a);break}if(t._.includes(e,n.suffixes[a])){o=Math.pow(n.base,a);break}}i*=o||1}return i}}),t.register("format","currency",{regexps:{format:/(\$)/},format:function(e,r,n){var a,o,i=t.locales[t.options.currentLocale],u={before:r.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:r.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(r=r.replace(/\s?\$\s?/,""),a=t._.numberToFormat(e,r,n),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),o=0;o=0;o--)switch(u.after[o]){case"$":a=o===u.after.length-1?a+i.currency.symbol:t._.insert(a,i.currency.symbol,-(u.after.length-(1+o)));break;case" ":a=o===u.after.length-1?a+" ":t._.insert(a," ",-(u.after.length-(1+o)+i.currency.symbol.length-1))}return a}}),t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(e,r,n){var a=("number"!=typeof e||t._.isNaN(e)?"0e+0":e.toExponential()).split("e");return r=r.replace(/e[\+|\-]{1}0/,""),t._.numberToFormat(Number(a[0]),r,n)+"e"+a[1]},unformat:function(e){var r=t._.includes(e,"e+")?e.split("e+"):e.split("e-"),n=Number(r[0]),a=Number(r[1]);return a=t._.includes(e,"e-")?a*=-1:a,t._.reduce([n,Math.pow(10,a)],(function(e,r,n,a){var o=t._.correctionFactor(e,r);return e*o*(r*o)/(o*o)}),1)}}),t.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,r,n){var a=t.locales[t.options.currentLocale],o=t._.includes(r," o")?" ":"";return r=r.replace(/\s?o/,""),o+=a.ordinal(e),t._.numberToFormat(e,r,n)+o}}),t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,r,n){var a,o=t._.includes(r," %")?" ":"";return t.options.scalePercentBy100&&(e*=100),r=r.replace(/\s?\%/,""),a=t._.numberToFormat(e,r,n),t._.includes(a,")")?((a=a.split("")).splice(-1,0,o+"%"),a=a.join("")):a=a+o+"%",a},unformat:function(e){var r=t._.stringToNumber(e);return t.options.scalePercentBy100?.01*r:r}}),t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(t,e,r){var n=Math.floor(t/60/60),a=Math.floor((t-60*n*60)/60),o=Math.round(t-60*n*60-60*a);return n+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)},unformat:function(t){var e=t.split(":"),r=0;return 3===e.length?(r+=60*Number(e[0])*60,r+=60*Number(e[1]),r+=Number(e[2])):2===e.length&&(r+=60*Number(e[0]),r+=Number(e[1])),Number(r)}}),t}))})),ha=sa((function(t,e){t.exports=function(){var t="millisecond",e="second",r="minute",n="hour",a="day",o="week",i="month",u="quarter",l="year",c="date",s=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},d=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},p={s:d,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),a=r%60;return(e<=0?"+":"-")+d(n,2,"0")+":"+d(a,2,"0")},m:function t(e,r){if(e.date()0&&n(l)?r>1?t(l,r-1,n,a,o):Ba(o,l):a||(o[o.length]=l)}return o}(t,1):[]}function Wa(t,e){for(var r=-1,n=null==t?0:t.length,a=Array(n);++r-1},Xa.prototype.set=function(t,e){var r=this.__data__,n=Ga(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Ka(t){if(!ga(t))return!1;var e=Oa(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var Ja,Qa=ma["__core-js_shared__"],to=(Ja=/[^.]+$/.exec(Qa&&Qa.keys&&Qa.keys.IE_PROTO||""))?"Symbol(src)_1."+Ja:"";var eo=Function.prototype.toString;function ro(t){if(null!=t){try{return eo.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var no=/^\[object .+?Constructor\]$/,ao=Function.prototype,oo=Object.prototype,io=ao.toString,uo=oo.hasOwnProperty,lo=RegExp("^"+io.call(uo).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function co(t){return!(!ga(t)||(e=t,to&&to in e))&&(Ka(t)?lo:no).test(ro(t));var e}function so(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return co(r)?r:void 0}var fo=so(ma,"Map"),ho=so(Object,"create");var po=Object.prototype.hasOwnProperty;var go=Object.prototype.hasOwnProperty;function bo(t){var e=-1,r=null==t?0:t.length;for(this.clear();++eu))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var s=-1,f=!0,h=2&r?new wo:void 0;for(o.set(t,e),o.set(e,t);++s-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}var Yo={};Yo["[object Float32Array]"]=Yo["[object Float64Array]"]=Yo["[object Int8Array]"]=Yo["[object Int16Array]"]=Yo["[object Int32Array]"]=Yo["[object Uint8Array]"]=Yo["[object Uint8ClampedArray]"]=Yo["[object Uint16Array]"]=Yo["[object Uint32Array]"]=!0,Yo["[object Arguments]"]=Yo["[object Array]"]=Yo["[object ArrayBuffer]"]=Yo["[object Boolean]"]=Yo["[object DataView]"]=Yo["[object Date]"]=Yo["[object Error]"]=Yo["[object Function]"]=Yo["[object Map]"]=Yo["[object Number]"]=Yo["[object Object]"]=Yo["[object RegExp]"]=Yo["[object Set]"]=Yo["[object String]"]=Yo["[object WeakMap]"]=!1;var Ro=Fa&&Fa.isTypedArray,Ho=Ro?Da(Ro):function(t){return Ta(t)&&Po(t.length)&&!!Yo[Oa(t)]},qo=Object.prototype.hasOwnProperty;function Io(t,e){var r=pa(t),n=!r&&Ra(t),a=!r&&!n&&Bo(t),o=!r&&!n&&!a&&Ho(t),i=r||n||a||o,u=i?function(t,e){for(var r=-1,n=Array(t);++r-1}function qi(t,e,r){for(var n=-1,a=null==t?0:t.length;++n=200){var c=e?null:Ii(t);if(c)return Ao(c);i=!1,a=xo,l=new wo}else l=e?[]:u;t:for(;++n50,a=ve(e);return a.l=n?Math.min(r-35,a.l):Math.max(r+40,a.l),a+""}function iu(t,e,r){if(void 0===e&&(e=null),void 0===r&&(r=null),!e)return t;for(var n=e.split("."),a=t,o=0;o=0?e[1]=Math.max(e[1],o):a<0&&(e[0]=Math.max(e[0],o))})),l&&t.selectAll(".bc-row-label span").each((function(t){var r=u-d(this)+i;e[0]=Math.max(e[0],r)}));return e}(),c.maxOverlap[0]>1||c.maxOverlap[1]>0){if(l&&f&&c.maxLabelWidths+10>o)return c.labelsTooLong=!0,c;if(++s>4)return c.labelsTooLong=!1,c;!function(){u.range(u.range().map((function(t,e){return t+100*(0===e?1:-1)*c.maxOverlap[e]/a}))),h&&(t.selectAll("div.bc-bar-inner").style("left",(function(t){return u(Math.min(0,t.value))+"%"})).style("right",(function(t){return 100-u(Math.max(0,t.value))+"%"})),t.selectAll("div.bc-bar-label").each((function(t){("bars"===r?t[n[0]]:t.value)<0||ut(this).style("margin-left",e.getElementBounds(this.parentNode).width+"px")})));f&&t.selectAll("div.bc-row").each((function(t){var e=["end","right"].includes(t._direction)?0:1,a=["end","right"].includes(t._direction)?1:0;ut(this).selectAll("div.bc-bar-inner").style("left",(function(t){return u(t.value)+"%"})),ut(this).selectAll("div.bc-"+r.replace("-plot","")).style("left",(function(t){return u(t[n[e]])+"%"})).style("right",(function(t){return 100-u(t[n[a]])+"%"})),ut(this).selectAll("div.bc-lbl-left").style("right",(function(t){return 100-u(t[n[e]])+"%"})),ut(this).selectAll("div.bc-lbl-right").style("left",(function(t){return u(t[n[a]])+"%"}))}))}(),g()}return c.labelsTooLong=!1,c}();function d(t){return e.getElementBounds(t).left}function p(r){return e.getElementBounds(r).right-e.getElementBounds(t.node()).right}}function lu(t,e,r){if(!r)return da;var n=t.chart().get("metadata.data.column-format",{})[r.name()]||{},a=iu(t.theme(),"typography.chart.minusCharacter","โˆ’"),o=fa.locales.x?"x":fa.locale(),i=fa.locales[o].currency.symbol,u="number"===r.type()?function(r,o,u){if(isNaN(r)||null===r)return"";var l=t.get(e)||"1,000.[00]";if(n["number-format"]&&"-"!==n["number-format"]&&"auto"!==n["number-format"]&&l.indexOf(".[")>-1&&-1===l.indexOf("a")){for(var c=Number(n["number-format"].replace(/n/,"")),s="",f=0;f-1?.01*r:r);return void 0===h._value||null===h._value?"":(h=(h=h.divide(Math.pow(10,n["number-divisor"]||0)).format(l)).replace("-",a),o?u?h.replace(i,"").replace("%",""):h:(n["number-prepend"]||"")+h+(n["number-append"]||""))}:"date"===r.type()?function(r){return ha(r).format(t.get(e)||"YYYY")}:da;return function(t,e,n){return"date"===r.type()?La(t)?u(t):t:u(t,e,n)}}var cu=sa((function(t,e){ /** * chroma.js - JavaScript library for color conversions * * Copyright (c) 2011-2019, Gregor Aisch * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name Gregor Aisch may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * ------------------------------------------------------- * * chroma.js includes colors from colorbrewer2.org, which are released under * the following license: * * Copyright (c) 2002 Cynthia Brewer, Mark Harrower, * and The Pennsylvania State University. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific * language governing permissions and limitations under the License. * * ------------------------------------------------------ * * Named colors are taken from X11 Color Names. * http://www.w3.org/TR/css3-color/#svg-color * * @preserve */ t.exports=function(){for(var t=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),tr?r:t},e={},r=0,n=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];r255)&&(e._clipped=!0),e[r]=t(e[r],0,255)):3===r&&(e[r]=t(e[r],0,1));return e},limit:t,type:o,unpack:function(t,e){return void 0===e&&(e=null),t.length>=3?Array.prototype.slice.call(t):"object"==o(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"==o(t[e])?t[e].toLowerCase():null},PI:i,TWOPI:2*i,PITHIRD:i/3,DEG2RAD:i/180,RAD2DEG:180/i},l={format:{},autodetect:[]},c=u.last,s=u.clip_rgb,f=u.type,h=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=this;if("object"===f(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var a=c(e),o=!1;if(!a){o=!0,l.sorted||(l.autodetect=l.autodetect.sort((function(t,e){return e.p-t.p})),l.sorted=!0);for(var i=0,u=l.autodetect;i4?e[4]:1;return 1===i?[0,0,0,u]:[n>=1?0:255*(1-n)*(1-i),a>=1?0:255*(1-a)*(1-i),o>=1?0:255*(1-o)*(1-i),u]},_=u.unpack,x=u.type;d.prototype.cmyk=function(){return m(this._rgb)},g.cmyk=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];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=[],r=arguments.length;r--;)e[r]=t[r];if(e=_(e,"cmyk"),"array"===x(e)&&4===e.length)return"cmyk"}});var M=u.unpack,k=u.last,N=function(t){return Math.round(100*t)/100},A=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=M(e,"hsla"),a=k(e)||"lsa";return n[0]=N(n[0]||0),n[1]=N(100*n[1])+"%",n[2]=N(100*n[2])+"%","hsla"===a||n.length>3&&n[3]<1?(n[3]=n.length>3?n[3]:1,a="hsla"):n.length=3,a+"("+n.join(",")+")"},j=u.unpack,O=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=(e=j(e,"rgba"))[0],a=e[1],o=e[2];n/=255,a/=255,o/=255;var i,u,l=Math.min(n,a,o),c=Math.max(n,a,o),s=(c+l)/2;return c===l?(i=0,u=Number.NaN):i=s<.5?(c-l)/(c+l):(c-l)/(2-c-l),n==c?u=(a-o)/(c-l):a==c?u=2+(o-n)/(c-l):o==c&&(u=4+(n-a)/(c-l)),(u*=60)<0&&(u+=360),e.length>3&&void 0!==e[3]?[u,i,s,e[3]]:[u,i,s]},T=u.unpack,D=u.last,S=Math.round,C=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=T(e,"rgba"),a=D(e)||"rgb";return"hsl"==a.substr(0,3)?A(O(n),a):(n[0]=S(n[0]),n[1]=S(n[1]),n[2]=S(n[2]),("rgba"===a||n.length>3&&n[3]<1)&&(n[3]=n.length>3?n[3]:1,a="rgba"),a+"("+n.slice(0,"rgb"===a?3:4).join(",")+")")},$=u.unpack,F=Math.round,E=function(){for(var t,e=arguments,r=[],n=arguments.length;n--;)r[n]=e[n];var a,o,i,u=(r=$(r,"hsl"))[0],l=r[1],c=r[2];if(0===l)a=o=i=255*c;else{var s=[0,0,0],f=[0,0,0],h=c<.5?c*(1+l):c+l-c*l,d=2*c-h,p=u/360;s[0]=p+1/3,s[1]=p,s[2]=p-1/3;for(var g=0;g<3;g++)s[g]<0&&(s[g]+=1),s[g]>1&&(s[g]-=1),6*s[g]<1?f[g]=d+6*(h-d)*s[g]:2*s[g]<1?f[g]=h:3*s[g]<2?f[g]=d+(h-d)*(2/3-s[g])*6:f[g]=d;a=(t=[F(255*f[0]),F(255*f[1]),F(255*f[2])])[0],o=t[1],i=t[2]}return r.length>3?[a,o,i,r[3]]:[a,o,i,1]},L=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,B=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,z=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,U=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,P=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Y=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,R=Math.round,H=function(t){var e;if(t=t.toLowerCase().trim(),l.format.named)try{return l.format.named(t)}catch(t){}if(e=t.match(L)){for(var r=e.slice(1,4),n=0;n<3;n++)r[n]=+r[n];return r[3]=1,r}if(e=t.match(B)){for(var a=e.slice(1,5),o=0;o<4;o++)a[o]=+a[o];return a}if(e=t.match(z)){for(var i=e.slice(1,4),u=0;u<3;u++)i[u]=R(2.55*i[u]);return i[3]=1,i}if(e=t.match(U)){for(var c=e.slice(1,5),s=0;s<3;s++)c[s]=R(2.55*c[s]);return c[3]=+c[3],c}if(e=t.match(P)){var f=e.slice(1,4);f[1]*=.01,f[2]*=.01;var h=E(f);return h[3]=1,h}if(e=t.match(Y)){var d=e.slice(1,4);d[1]*=.01,d[2]*=.01;var p=E(d);return p[3]=+e[4],p}};H.test=function(t){return L.test(t)||B.test(t)||z.test(t)||U.test(t)||P.test(t)||Y.test(t)};var q=H,I=u.type;d.prototype.css=function(t){return C(this._rgb,t)},g.css=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["css"])))},l.format.css=q,l.autodetect.push({p:5,test:function(t){for(var e=arguments,r=[],n=arguments.length-1;n-- >0;)r[n]=e[n+1];if(!r.length&&"string"===I(t)&&q.test(t))return"css"}});var W=u.unpack;l.format.gl=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=W(e,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n},g.gl=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];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 V=u.unpack,G=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n,a=V(e,"rgb"),o=a[0],i=a[1],u=a[2],l=Math.min(o,i,u),c=Math.max(o,i,u),s=c-l,f=100*s/255,h=l/(255-s)*100;return 0===s?n=Number.NaN:(o===c&&(n=(i-u)/s),i===c&&(n=2+(u-o)/s),u===c&&(n=4+(o-i)/s),(n*=60)<0&&(n+=360)),[n,f,h]},Z=u.unpack,X=Math.floor,K=function(){for(var t,e,r,n,a,o,i=arguments,u=[],l=arguments.length;l--;)u[l]=i[l];var c,s,f,h=(u=Z(u,"hcg"))[0],d=u[1],p=u[2];p*=255;var g=255*d;if(0===d)c=s=f=p;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var b=X(h/=60),v=h-b,m=p*(1-d),y=m+g*(1-v),w=m+g*v,_=m+g;switch(b){case 0:c=(t=[_,w,m])[0],s=t[1],f=t[2];break;case 1:c=(e=[y,_,m])[0],s=e[1],f=e[2];break;case 2:c=(r=[m,_,w])[0],s=r[1],f=r[2];break;case 3:c=(n=[m,y,_])[0],s=n[1],f=n[2];break;case 4:c=(a=[w,m,_])[0],s=a[1],f=a[2];break;case 5:c=(o=[_,m,y])[0],s=o[1],f=o[2]}}return[c,s,f,u.length>3?u[3]:1]},J=u.unpack,Q=u.type;d.prototype.hcg=function(){return G(this._rgb)},g.hcg=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["hcg"])))},l.format.hcg=K,l.autodetect.push({p:1,test:function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];if(e=J(e,"hcg"),"array"===Q(e)&&3===e.length)return"hcg"}});var tt=u.unpack,et=u.last,rt=Math.round,nt=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=tt(e,"rgba"),a=n[0],o=n[1],i=n[2],u=n[3],l=et(e)||"auto";void 0===u&&(u=1),"auto"===l&&(l=u<1?"rgba":"rgb");var c=(a=rt(a))<<16|(o=rt(o))<<8|(i=rt(i)),s="000000"+c.toString(16);s=s.substr(s.length-6);var f="0"+rt(255*u).toString(16);switch(f=f.substr(f.length-2),l.toLowerCase()){case"rgba":return"#"+s+f;case"argb":return"#"+f+s;default:return"#"+s}},at=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,ot=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,it=function(t){if(t.match(at)){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(ot)){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 r=parseInt(t,16);return[r>>24&255,r>>16&255,r>>8&255,Math.round((255&r)/255*100)/100]}throw new Error("unknown hex color: "+t)},ut=u.type;d.prototype.hex=function(t){return nt(this._rgb,t)},g.hex=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["hex"])))},l.format.hex=it,l.autodetect.push({p:4,test:function(t){for(var e=arguments,r=[],n=arguments.length-1;n-- >0;)r[n]=e[n+1];if(!r.length&&"string"===ut(t)&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});var lt=u.unpack,ct=u.TWOPI,st=Math.min,ft=Math.sqrt,ht=Math.acos,dt=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n,a=lt(e,"rgb"),o=a[0],i=a[1],u=a[2],l=st(o/=255,i/=255,u/=255),c=(o+i+u)/3,s=c>0?1-l/c:0;return 0===s?n=NaN:(n=(o-i+(o-u))/2,n/=ft((o-i)*(o-i)+(o-u)*(i-u)),n=ht(n),u>i&&(n=ct-n),n/=ct),[360*n,s,c]},pt=u.unpack,gt=u.limit,bt=u.TWOPI,vt=u.PITHIRD,mt=Math.cos,yt=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n,a,o,i=(e=pt(e,"hsi"))[0],u=e[1],l=e[2];return isNaN(i)&&(i=0),isNaN(u)&&(u=0),i>360&&(i-=360),i<0&&(i+=360),(i/=360)<1/3?a=1-((o=(1-u)/3)+(n=(1+u*mt(bt*i)/mt(vt-bt*i))/3)):i<2/3?o=1-((n=(1-u)/3)+(a=(1+u*mt(bt*(i-=1/3))/mt(vt-bt*i))/3)):n=1-((a=(1-u)/3)+(o=(1+u*mt(bt*(i-=2/3))/mt(vt-bt*i))/3)),[255*(n=gt(l*n*3)),255*(a=gt(l*a*3)),255*(o=gt(l*o*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=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["hsi"])))},l.format.hsi=yt,l.autodetect.push({p:2,test:function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];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 O(this._rgb)},g.hsl=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["hsl"])))},l.format.hsl=E,l.autodetect.push({p:2,test:function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];if(e=xt(e,"hsl"),"array"===Mt(e)&&3===e.length)return"hsl"}});var kt=u.unpack,Nt=Math.min,At=Math.max,jt=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n,a,o,i=(e=kt(e,"rgb"))[0],u=e[1],l=e[2],c=Nt(i,u,l),s=At(i,u,l),f=s-c;return o=s/255,0===s?(n=Number.NaN,a=0):(a=f/s,i===s&&(n=(u-l)/f),u===s&&(n=2+(l-i)/f),l===s&&(n=4+(i-u)/f),(n*=60)<0&&(n+=360)),[n,a,o]},Ot=u.unpack,Tt=Math.floor,Dt=function(){for(var t,e,r,n,a,o,i=arguments,u=[],l=arguments.length;l--;)u[l]=i[l];var c,s,f,h=(u=Ot(u,"hsv"))[0],d=u[1],p=u[2];if(p*=255,0===d)c=s=f=p;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var g=Tt(h/=60),b=h-g,v=p*(1-d),m=p*(1-d*b),y=p*(1-d*(1-b));switch(g){case 0:c=(t=[p,y,v])[0],s=t[1],f=t[2];break;case 1:c=(e=[m,p,v])[0],s=e[1],f=e[2];break;case 2:c=(r=[v,p,y])[0],s=r[1],f=r[2];break;case 3:c=(n=[v,m,p])[0],s=n[1],f=n[2];break;case 4:c=(a=[y,v,p])[0],s=a[1],f=a[2];break;case 5:c=(o=[p,v,m])[0],s=o[1],f=o[2]}}return[c,s,f,u.length>3?u[3]:1]},St=u.unpack,Ct=u.type;d.prototype.hsv=function(){return jt(this._rgb)},g.hsv=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];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=[],r=arguments.length;r--;)e[r]=t[r];if(e=St(e,"hsv"),"array"===Ct(e)&&3===e.length)return"hsv"}});var $t=18,Ft=.95047,Et=1,Lt=1.08883,Bt=.137931034,zt=.206896552,Ut=.12841855,Pt=.008856452,Yt=u.unpack,Rt=Math.pow,Ht=function(t){return(t/=255)<=.04045?t/12.92:Rt((t+.055)/1.055,2.4)},qt=function(t){return t>Pt?Rt(t,1/3):t/Ut+Bt},It=function(t,e,r){return t=Ht(t),e=Ht(e),r=Ht(r),[qt((.4124564*t+.3575761*e+.1804375*r)/Ft),qt((.2126729*t+.7151522*e+.072175*r)/Et),qt((.0193339*t+.119192*e+.9503041*r)/Lt)]},Wt=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=Yt(e,"rgb"),a=n[0],o=n[1],i=n[2],u=It(a,o,i),l=u[0],c=u[1],s=u[2],f=116*c-16;return[f<0?0:f,500*(l-c),200*(c-s)]},Vt=u.unpack,Gt=Math.pow,Zt=function(t){return 255*(t<=.00304?12.92*t:1.055*Gt(t,1/2.4)-.055)},Xt=function(t){return t>zt?t*t*t:Ut*(t-Bt)},Kt=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n,a,o,i=(e=Vt(e,"lab"))[0],u=e[1],l=e[2];return a=(i+16)/116,n=isNaN(u)?a:a+u/500,o=isNaN(l)?a:a-l/200,a=Et*Xt(a),n=Ft*Xt(n),o=Lt*Xt(o),[Zt(3.2404542*n-1.5371385*a-.4985314*o),Zt(-.969266*n+1.8760108*a+.041556*o),Zt(.0556434*n-.2040259*a+1.0572252*o),e.length>3?e[3]:1]},Jt=u.unpack,Qt=u.type;d.prototype.lab=function(){return Wt(this._rgb)},g.lab=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["lab"])))},l.format.lab=Kt,l.autodetect.push({p:2,test:function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];if(e=Jt(e,"lab"),"array"===Qt(e)&&3===e.length)return"lab"}});var te=u.unpack,ee=u.RAD2DEG,re=Math.sqrt,ne=Math.atan2,ae=Math.round,oe=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=te(e,"lab"),a=n[0],o=n[1],i=n[2],u=re(o*o+i*i),l=(ne(i,o)*ee+360)%360;return 0===ae(1e4*u)&&(l=Number.NaN),[a,u,l]},ie=u.unpack,ue=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=ie(e,"rgb"),a=n[0],o=n[1],i=n[2],u=Wt(a,o,i),l=u[0],c=u[1],s=u[2];return oe(l,c,s)},le=u.unpack,ce=u.DEG2RAD,se=Math.sin,fe=Math.cos,he=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=le(e,"lch"),a=n[0],o=n[1],i=n[2];return isNaN(i)&&(i=0),[a,fe(i*=ce)*o,se(i)*o]},de=u.unpack,pe=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=(e=de(e,"lch"))[0],a=e[1],o=e[2],i=he(n,a,o),u=i[0],l=i[1],c=i[2],s=Kt(u,l,c),f=s[0],h=s[1],d=s[2];return[f,h,d,e.length>3?e[3]:1]},ge=u.unpack,be=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=ge(e,"hcl").reverse();return pe.apply(void 0,n)},ve=u.unpack,me=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=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["lch"])))},g.hcl=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["hcl"])))},l.format.lch=pe,l.format.hcl=be,["lch","hcl"].forEach((function(t){return l.autodetect.push({p:2,test:function(){for(var e=arguments,r=[],n=arguments.length;n--;)r[n]=e[n];if(r=ve(r,t),"array"===me(r)&&3===r.length)return t}})}));var ye={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=nt(this._rgb,"rgb"),e=0,r=Object.keys(ye);e0;)r[n]=e[n+1];if(!r.length&&"string"===we(t)&&ye[t.toLowerCase()])return"named"}});var _e=u.unpack,xe=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=_e(e,"rgb"),a=n[0],o=n[1],i=n[2];return(a<<16)+(o<<8)+i},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)},Ne=u.type;d.prototype.num=function(){return xe(this._rgb)},g.num=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];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=[],r=arguments.length;r--;)e[r]=t[r];if(1===e.length&&"number"===Ne(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var Ae=u.unpack,je=u.type,Oe=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(Oe)},d.prototype.rgba=function(t){return void 0===t&&(t=!0),this._rgb.slice(0,4).map((function(e,r){return r<3?!1===t?e:Oe(e):e}))},g.rgb=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["rgb"])))},l.format.rgb=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];var n=Ae(e,"rgba");return void 0===n[3]&&(n[3]=1),n},l.autodetect.push({p:3,test:function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];if(e=Ae(e,"rgba"),"array"===je(e)&&(3===e.length||4===e.length&&"number"==je(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var Te=Math.log,De=function(t){var e,r,n,a=t/100;return a<66?(e=255,r=-155.25485562709179-.44596950469579133*(r=a-2)+104.49216199393888*Te(r),n=a<20?0:.8274096064007395*(n=a-10)-254.76935184120902+115.67994401066147*Te(n)):(e=351.97690566805693+.114206453784165*(e=a-55)-40.25366309332127*Te(e),r=325.4494125711974+.07943456536662342*(r=a-50)-28.0852963507957*Te(r),n=255),[e,r,n,1]},Se=u.unpack,Ce=Math.round,$e=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];for(var n,a=Se(e,"rgb"),o=a[0],i=a[2],u=1e3,l=4e4,c=.4;l-u>c;){var s=De(n=.5*(l+u));s[2]/s[0]>=i/o?l=n:u=n}return Ce(n)};d.prototype.temp=d.prototype.kelvin=d.prototype.temperature=function(){return $e(this._rgb)},g.temp=g.kelvin=g.temperature=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];return new(Function.prototype.bind.apply(d,[null].concat(e,["temp"])))},l.format.temp=l.format.kelvin=l.format.temperature=De;var Fe=u.type;d.prototype.alpha=function(t,e){return void 0===e&&(e=!1),void 0!==t&&"number"===Fe(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]-=$t*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("."),r=e[0],n=e[1],a=this[r]();if(n){var o=r.indexOf(n);if(o>-1)return a[o];throw new Error("unknown channel "+n+" in mode "+r)}return a};var Ee=u.type,Le=Math.pow;d.prototype.luminance=function(t){if(void 0!==t&&"number"===Ee(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(),r=20,n=function(e,a){var o=e.interpolate(a,.5,"rgb"),i=o.luminance();return Math.abs(t-i)<1e-7||!r--?o:i>t?n(e,o):n(o,a)},a=(e>t?n(new d([0,0,0]),this):n(this,new d([255,255,255]))).rgb();return new d(a.concat([this._rgb[3]]))}return Be.apply(void 0,this._rgb.slice(0,3))};var Be=function(t,e,r){return.2126*(t=ze(t))+.7152*(e=ze(e))+.0722*(r=ze(r))},ze=function(t){return(t/=255)<=.03928?t/12.92:Le((t+.055)/1.055,2.4)},Ue={},Pe=u.type,Ye=function(t,e,r){var n=arguments;void 0===r&&(r=.5);for(var a=[],o=arguments.length-3;o-- >0;)a[o]=n[o+3];var i=a[0]||"lrgb";if(Ue[i]||a.length||(i=Object.keys(Ue)[0]),!Ue[i])throw new Error("interpolation mode "+i+" is not defined");return"object"!==Pe(t)&&(t=new d(t)),"object"!==Pe(e)&&(e=new d(e)),Ue[i](t,e,r).alpha(t.alpha()+r*(e.alpha()-t.alpha()))};d.prototype.mix=d.prototype.interpolate=function(t,e){var r=arguments;void 0===e&&(e=.5);for(var n=[],a=arguments.length-2;a-- >0;)n[a]=r[a+2];return Ye.apply(void 0,[this,t,e].concat(n))},d.prototype.premultiply=function(t){void 0===t&&(t=!1);var e=this._rgb,r=e[3];return t?(this._rgb=[e[0]*r,e[1]*r,e[2]*r,r],this):new d([e[0]*r,e[1]*r,e[2]*r,r],"rgb")},d.prototype.saturate=function(t){void 0===t&&(t=1);var e=this.lch();return e[1]+=$t*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 Re=u.type;d.prototype.set=function(t,e,r){void 0===r&&(r=!1);var n=t.split("."),a=n[0],o=n[1],i=this[a]();if(o){var u=a.indexOf(o);if(u>-1){if("string"==Re(e))switch(e.charAt(0)){case"+":case"-":i[u]+=+e;break;case"*":i[u]*=+e.substr(1);break;case"/":i[u]/=+e.substr(1);break;default:i[u]=+e}else{if("number"!==Re(e))throw new Error("unsupported value for Color.set");i[u]=e}var l=new d(i,a);return r?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+o+" in mode "+a)}return i},Ue.rgb=function(t,e,r){var n=t._rgb,a=e._rgb;return new d(n[0]+r*(a[0]-n[0]),n[1]+r*(a[1]-n[1]),n[2]+r*(a[2]-n[2]),"rgb")};var He=Math.sqrt,qe=Math.pow;Ue.lrgb=function(t,e,r){var n=t._rgb,a=n[0],o=n[1],i=n[2],u=e._rgb,l=u[0],c=u[1],s=u[2];return new d(He(qe(a,2)*(1-r)+qe(l,2)*r),He(qe(o,2)*(1-r)+qe(c,2)*r),He(qe(i,2)*(1-r)+qe(s,2)*r),"rgb")},Ue.lab=function(t,e,r){var n=t.lab(),a=e.lab();return new d(n[0]+r*(a[0]-n[0]),n[1]+r*(a[1]-n[1]),n[2]+r*(a[2]-n[2]),"lab")};var Ie=function(t,e,r,n){var a,o,i,u,l,c,s,f,h,p,g,b;return"hsl"===n?(i=t.hsl(),u=e.hsl()):"hsv"===n?(i=t.hsv(),u=e.hsv()):"hcg"===n?(i=t.hcg(),u=e.hcg()):"hsi"===n?(i=t.hsi(),u=e.hsi()):"lch"!==n&&"hcl"!==n||(n="hcl",i=t.hcl(),u=e.hcl()),"h"===n.substr(0,1)&&(l=(a=i)[0],s=a[1],h=a[2],c=(o=u)[0],f=o[1],p=o[2]),isNaN(l)||isNaN(c)?isNaN(l)?isNaN(c)?b=Number.NaN:(b=c,1!=h&&0!=h||"hsv"==n||(g=f)):(b=l,1!=p&&0!=p||"hsv"==n||(g=s)):b=l+r*(c>l&&c-l>180?c-(l+360):c180?c+360-l:c-l),void 0===g&&(g=s+r*(f-s)),new d([b,g,h+r*(p-h)],n)},We=function(t,e,r){return Ie(t,e,r,"lch")};Ue.lch=We,Ue.hcl=We,Ue.num=function(t,e,r){var n=t.num(),a=e.num();return new d(n+r*(a-n),"num")},Ue.hcg=function(t,e,r){return Ie(t,e,r,"hcg")},Ue.hsi=function(t,e,r){return Ie(t,e,r,"hsi")},Ue.hsl=function(t,e,r){return Ie(t,e,r,"hsl")},Ue.hsv=function(t,e,r){return Ie(t,e,r,"hsv")};var Ve=u.clip_rgb,Ge=Math.pow,Ze=Math.sqrt,Xe=Math.PI,Ke=Math.cos,Je=Math.sin,Qe=Math.atan2,tr=function(t,e){for(var r=t.length,n=[0,0,0,0],a=0;a.9999999&&(n[3]=1),new d(Ve(n))},er=u.type,rr=Math.pow,nr=function(t){var e="rgb",r=g("#ccc"),n=0,a=[0,1],o=[],i=[0,0],u=!1,l=[],c=!1,s=0,f=1,h=!1,d={},p=!0,b=1,v=function(t){if((t=t||["#fff","#000"])&&"string"===er(t)&&g.brewer&&g.brewer[t.toLowerCase()]&&(t=g.brewer[t.toLowerCase()]),"array"===er(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,r=0;r=u[r];)r++;return r-1}return 0}(t)/(u.length-2):f!==s?(t-s)/(f-s):1,c=y(c),n||(c=m(c)),1!==b&&(c=rr(c,b)),c=i[0]+c*(1-i[0]-i[1]),c=Math.min(1,Math.max(0,c));var h=Math.floor(1e4*c);if(p&&d[h])a=d[h];else{if("array"===er(l))for(var v=0;v=w&&v===o.length-1){a=l[v];break}if(c>w&&c2){var c=t.map((function(e,r){return r/(t.length-1)})),h=t.map((function(t){return(t-s)/(f-s)}));h.every((function(t,e){return c[e]===t}))||(y=function(t){if(t<=0||t>=1)return t;for(var e=0;t>=h[e+1];)e++;var r=(t-h[e])/(h[e+1]-h[e]);return c[e]+r*(c[e+1]-c[e])})}}return a=[s,f],x},x.mode=function(t){return arguments.length?(e=t,_(),x):e},x.range=function(t,e){return v(t),x},x.out=function(t){return c=t,x},x.spread=function(t){return arguments.length?(n=t,x):n},x.correctLightness=function(t){return null==t&&(t=!0),h=t,_(),m=h?function(t){for(var e=w(0,!0).lab()[0],r=w(1,!0).lab()[0],n=e>r,a=w(t,!0).lab()[0],o=e+(r-e)*t,i=a-o,u=0,l=1,c=20;Math.abs(i)>.01&&c-- >0;)n&&(i*=-1),i<0?(u=t,t+=.5*(l-t)):(l=t,t+=.5*(u-t)),a=w(t,!0).lab()[0],i=a-o;return t}:function(t){return t},x},x.padding=function(t){return null!=t?("number"===er(t)&&(t=[t,t]),i=t,x):i},x.colors=function(e,r){arguments.length<2&&(r="hex");var n=[];if(0===arguments.length)n=l.slice(0);else if(1===e)n=[x(.5)];else if(e>1){var o=a[0],i=a[1]-o;n=ar(0,e,!1).map((function(t){return x(o+t/(e-1)*i)}))}else{t=[];var c=[];if(u&&u.length>2)for(var s=1,f=u.length,h=1<=f;h?sf;h?s++:s--)c.push(.5*(u[s-1]+u[s]));else c=a;n=c.map((function(t){return x(t)}))}return g[r]&&(n=n.map((function(t){return t[r]()}))),n},x.cache=function(t){return null!=t?(p=t,x):p},x.gamma=function(t){return null!=t?(b=t,x):b},x.nodata=function(t){return null!=t?(r=g(t),x):r},x};function ar(t,e,r){for(var n=[],a=to;a?i++:i--)n.push(i);return n}var or=function(t){var e,r,n,a,o,i,u;if(2===(t=t.map((function(t){return new d(t)}))).length)e=t.map((function(t){return t.lab()})),o=e[0],i=e[1],a=function(t){var e=[0,1,2].map((function(e){return o[e]+t*(i[e]-o[e])}));return new d(e,"lab")};else if(3===t.length)r=t.map((function(t){return t.lab()})),o=r[0],i=r[1],u=r[2],a=function(t){var e=[0,1,2].map((function(e){return(1-t)*(1-t)*o[e]+2*(1-t)*t*i[e]+t*t*u[e]}));return new d(e,"lab")};else if(4===t.length){var l;n=t.map((function(t){return t.lab()})),o=n[0],i=n[1],u=n[2],l=n[3],a=function(t){var e=[0,1,2].map((function(e){return(1-t)*(1-t)*(1-t)*o[e]+3*(1-t)*(1-t)*t*i[e]+3*(1-t)*t*t*u[e]+t*t*t*l[e]}));return new d(e,"lab")}}else if(5===t.length){var c=or(t.slice(0,3)),s=or(t.slice(2,5));a=function(t){return t<.5?c(2*t):s(2*(t-.5))}}return a},ir=function(t,e,r){if(!ir[r])throw new Error("unknown blend mode "+r);return ir[r](t,e)},ur=function(t){return function(e,r){var n=g(r).rgb(),a=g(e).rgb();return g.rgb(t(n,a))}},lr=function(t){return function(e,r){var n=[];return n[0]=t(e[0],r[0]),n[1]=t(e[1],r[1]),n[2]=t(e[2],r[2]),n}};ir.normal=ur(lr((function(t){return t}))),ir.multiply=ur(lr((function(t,e){return t*e/255}))),ir.screen=ur(lr((function(t,e){return 255*(1-(1-t/255)*(1-e/255))}))),ir.overlay=ur(lr((function(t,e){return e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255))}))),ir.darken=ur(lr((function(t,e){return t>e?e:t}))),ir.lighten=ur(lr((function(t,e){return t>e?t:e}))),ir.dodge=ur(lr((function(t,e){return 255===t||(t=e/255*255/(1-t/255))>255?255:t}))),ir.burn=ur(lr((function(t,e){return 255*(1-(1-e/255)/(t/255))})));for(var cr=ir,sr=u.type,fr=u.clip_rgb,hr=u.TWOPI,dr=Math.pow,pr=Math.sin,gr=Math.cos,br=Math.floor,vr=Math.random,mr=Math.log,yr=Math.pow,wr=Math.floor,_r=Math.abs,xr=function(t,e){void 0===e&&(e=null);var r={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===o(t)&&(t=Object.values(t)),t.forEach((function(t){e&&"object"===o(t)&&(t=t[e]),null==t||isNaN(t)||(r.values.push(t),r.sum+=t,tr.max&&(r.max=t),r.count+=1)})),r.domain=[r.min,r.max],r.limits=function(t,e){return Mr(r,t,e)},r},Mr=function(t,e,r){void 0===e&&(e="equal"),void 0===r&&(r=7),"array"==o(t)&&(t=xr(t));var n=t.min,a=t.max,i=t.values.sort((function(t,e){return t-e}));if(1===r)return[n,a];var u=[];if("c"===e.substr(0,1)&&(u.push(n),u.push(a)),"e"===e.substr(0,1)){u.push(n);for(var l=1;l 0");var c=Math.LOG10E*mr(n),s=Math.LOG10E*mr(a);u.push(n);for(var f=1;f200&&(w=!1)}for(var L={},B=0;B=360;)g-=360;i[p]=g}else i[p]=i[p]/u[p];return h/=n,new d(i,e).alpha(h>.99999?1:h,!0)},g.bezier=function(t){var e=or(t);return e.scale=function(){return nr(e)},e},g.blend=cr,g.cubehelix=function(t,e,r,n,a){void 0===t&&(t=300),void 0===e&&(e=-1.5),void 0===r&&(r=1),void 0===n&&(n=1),void 0===a&&(a=[0,1]);var o,i=0;"array"===sr(a)?o=a[1]-a[0]:(o=0,a=[a,a]);var u=function(u){var l=hr*((t+120)/360+e*u),c=dr(a[0]+o*u,n),s=(0!==i?r[0]+u*i:r)*c*(1-c)/2,f=gr(l),h=pr(l);return g(fr([255*(c+s*(-.14861*f+1.78277*h)),255*(c+s*(-.29227*f-.90649*h)),255*(c+s*(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?n:(n=t,u)},u.hue=function(t){return null==t?r:("array"===sr(r=t)?0==(i=r[1]-r[0])&&(r=r[1]):i=0,u)},u.lightness=function(t){return null==t?a:("array"===sr(t)?(a=t,o=t[1]-t[0]):(a=[t,t],o=0),u)},u.scale=function(){return g.scale(u)},u.hue(r),u},g.mix=g.interpolate=Ye,g.random=function(){for(var t="#",e=0;e<6;e++)t+="0123456789abcdef".charAt(br(16*vr()));return new d(t,"hex")},g.scale=nr,g.analyze=kr.analyze,g.contrast=function(t,e){t=new d(t),e=new d(e);var r=t.luminance(),n=e.luminance();return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)},g.deltaE=function(t,e,r,n){void 0===r&&(r=1),void 0===n&&(n=1),t=new d(t),e=new d(e);for(var a=Array.from(t.lab()),o=a[0],i=a[1],u=a[2],l=Array.from(e.lab()),c=l[0],s=l[1],f=l[2],h=Nr(i*i+u*u),p=Nr(s*s+f*f),g=o<16?.511:.040975*o/(1+.01765*o),b=.0638*h/(1+.0131*h)+.638,v=h<1e-6?0:180*Ar(u,i)/Tr;v<0;)v+=360;for(;v>=360;)v-=360;var m=v>=164&&v<=345?.56+jr(.2*Or(Tr*(v+168)/180)):.36+jr(.4*Or(Tr*(v+35)/180)),y=h*h*h*h,w=Nr(y/(y+1900)),_=b*(w*m+1-w),x=h-p,M=i-s,k=u-f,N=(o-c)/(r*g),A=x/(n*b);return Nr(N*N+A*A+(M*M+k*k-x*x)/(_*_))},g.distance=function(t,e,r){void 0===r&&(r="lab"),t=new d(t),e=new d(e);var n=t.get(r),a=e.get(r),o=0;for(var i in n){var u=(n[i]||0)-(a[i]||0);o+=u*u}return Math.sqrt(o)},g.limits=kr.limits,g.valid=function(){for(var t=arguments,e=[],r=arguments.length;r--;)e[r]=t[r];try{return new(Function.prototype.bind.apply(d,[null].concat(e))),!0}catch(t){return!1}},g.scales=Dr,g.colors=ye,g.brewer=Er,g}()}));for(var su=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,fu=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,hu=function(t){if(t.match(su)){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(fu)){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 r=parseInt(t,16);return[r>>24&255,r>>16&255,r>>8&255,Math.round((255&r)/255*100)/100]}throw new Error("unknown hex color: "+t)},du=.95047,pu=1,gu=1.08883,bu=.137931034,vu=.12841855,mu=.008856452,yu={},wu=0,_u=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];wu<_u.length;wu+=1){var xu=_u[wu];yu["[object "+xu+"]"]=xu.toLowerCase()}var Mu=function(t){return yu[Object.prototype.toString.call(t)]||"object"},ku=(Math.PI,function(t,e){return void 0===e&&(e=null),t.length>=3?Array.prototype.slice.call(t):"object"==Mu(t[0])&&e?e.split("").filter((function(e){return void 0!==t[0][e]})).map((function(e){return t[0][e]})):t[0]}),Nu=Math.pow,Au=function(t){return(t/=255)<=.04045?t/12.92:Nu((t+.055)/1.055,2.4)},ju=function(t){return t>mu?Nu(t,1/3):t/vu+bu},Ou=function(t,e,r){return t=Au(t),e=Au(e),r=Au(r),[ju((.4124564*t+.3575761*e+.1804375*r)/du),ju((.2126729*t+.7151522*e+.072175*r)/pu),ju((.0193339*t+.119192*e+.9503041*r)/gu)]},Tu=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=ku(t,"rgb"),n=r[0],a=r[1],o=r[2],i=Ou(n,a,o),u=i[0],l=i[1],c=i[2],s=116*l-16;return[s<0?0:s,500*(u-l),200*(l-c)]};function Du(t){return Tu(hu(t))[0]}function Su(t,e){var r=function(t){var e=t.colors.chartContentBaseColor||(cu.contrast(t.colors.background,"#000000")<5.5?"#f1f1f1":"#333333"),r={tickText:{secondary:iu(t,"colors.bgBlendRatios.tickText.secondary",cu(t.colors.background).luminance()<.5?.6:.4),primary:iu(t,"colors.bgBlendRatios.tickText.primary",.2)},series:iu(t,"colors.bgBlendRatios.series",0),value:iu(t,"colors.bgBlendRatios.value",.2),axis:iu(t,"colors.bgBlendRatios.axis",0),gridline:iu(t,"colors.bgBlendRatios.gridline",.82)};return{tickText:{secondary:cu.mix(e,t.colors.background,r.tickText.secondary).hex(),primary:cu.mix(e,t.colors.background,r.tickText.primary).hex()},series:cu.mix(e,t.colors.background,r.series).hex(),value:cu.mix(e,t.colors.background,r.value).hex(),axis:cu.mix(e,t.colors.background,r.axis).hex(),gridline:cu.mix(e,t.colors.background,r.gridline).hex(),fallbackBaseColor:e}}(t),n=r.fallbackBaseColor,a=Du(t.colors.background)<.6,o=hu(r.axis),i=iu(t,"vis.d3-bars.bars.barBackground.opacity",a?.1:.05),u=iu(t,"vis.d3-bars.bars.barBackground.color",!1),l=["style.chart","vis."+e,"vis.d3-bars"],c={gridline:!!Cu(t,"axes.gridlines.color",l)&&r.gridline,axis:!!Cu(t,"axes.gridlines.baselineColor",l)&&r.axis,tickText:!!Cu(t,"labels.ticks.secondary.color",l)&&r.tickText.secondary};if(u){var s=hu(u);u="rgba("+s[0]+","+s[1]+","+s[2]+","+i+")"}else u="rgba("+o[0]+","+o[1]+","+o[2]+","+i+")";var f={barBg:u,rowDividerColor:!!Cu(t,"rowDivider.color",["vis.d3-bars"])&&Me(t.colors.background,n)(a?.2:.15)},h=Cu(t,"axes.gridlines.baselineColor",["vis.d3-bars","style.chart.axes"],r.axis);return{shared:c,bars:f,dar:{darBaseline:!!Cu(t,"axes.gridlines.baselineColor",["vis."+e,"vis.d3-dot-plot"])&&Me(h,t.colors.background)(a?.7:.6)}}}function Cu(t,e,r,n){var a=!0;for(var o in r)if(iu(t,r[o]+"."+e)&&(a=!1,n&&!a)){n=iu(t,r[o]+"."+e);break}return n||a}var $u=sa((function(t,e){t.exports=function(t,e,r){var n=e.prototype,a=n.format;r.en.ordinal=function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"},n.format=function(t){var e=this,r=this.$locale(),n=this.$utils(),o=(t||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(t){switch(t){case"Q":return Math.ceil((e.$M+1)/3);case"Do":return r.ordinal(e.$D);case"gggg":return e.weekYear();case"GGGG":return e.isoWeekYear();case"wo":return r.ordinal(e.week(),"W");case"w":case"ww":return n.s(e.week(),"w"===t?1:2,"0");case"W":case"WW":return n.s(e.isoWeek(),"W"===t?1:2,"0");case"k":case"kk":return n.s(String(0===e.$H?24:e.$H),"k"===t?1:2,"0");case"X":return Math.floor(e.$d.getTime()/1e3);case"x":return e.$d.getTime();case"z":return"["+e.offsetName()+"]";case"zzz":return"["+e.offsetName("long")+"]";default:return t}}));return a.bind(this)(o)}}})),Fu=sa((function(t,e){var r;t.exports=(r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},function(t,e,n){var a=e.prototype,o=a.format;n.en.formats=r,a.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var e=this.$locale().formats,n=function(t,e){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,a){var o=a&&a.toUpperCase();return n||e[a]||r[a]||e[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,r){return e||r.slice(1)}))}))}(t,void 0===e?{}:e);return o.call(this,n)}})})),Eu=sa((function(t,e){var r,n;t.exports=(r="week",n="year",function(t,e,a){var o=e.prototype;o.week=function(t){if(void 0===t&&(t=null),null!==t)return this.add(7*(t-this.week()),"day");var e=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var o=a(this).startOf(n).add(1,n).date(e),i=a(this).endOf(r);if(o.isBefore(i))return 1}var u=a(this).startOf(n).date(e).startOf(r).subtract(1,"millisecond"),l=this.diff(u,r,!0);return l<0?a(this).startOf("week").week():Math.ceil(l)},o.weeks=function(t){return void 0===t&&(t=null),this.week(t)}})}));dw.visualization.register("d3-bars",(function(){ha.extend($u),ha.extend(Eu),ha.extend(Fu);var t=!0,e={maxLabelWidths:0,maxOverlap:[0,0],labelsTooLong:!1};return{type:function(){return"bars"},render:function(r){var n=this,a=n.chart(),o=n.size(),i=n.dataset,u=n.theme();!function(t,e){var r=e.visualize;void 0===r&&(r={});var n=e.axes;if(void 0===n&&(n={}),void 0!==r["color-bars"]&&(r["base-color"]=r["color-bars"],delete r["color-bars"]),void 0!==r["color-bars2"]&&void 0===r["base-color2"]&&(r["base-color2"]=r["color-bars2"],delete r["color-bars2"]),"d3-range-plot"===t&&(void 0!==r["range-start-color"]&&(r["base-color"]=r["range-start-color"],delete r["range-start-color"]),void 0!==r["range-end-color"]&&void 0===r["base-color2"]&&(r["base-color2"]=r["range-end-color"],delete r["range-end-color"])),void 0!==r["hide-value-labels"]&&(r["show-value-labels"]=!r["hide-value-labels"],delete r["hide-value-labels"]),"hide"!==r["value-label-visibility"]||"d3-bars-stacked"!==t&&"d3-bars-grouped"!==t||(r["show-value-labels"]=!1,r["value-label-visibility"]="always"),"show"!==r["value-label-visibility"]||"d3-bars-stacked"!==t&&"d3-bars-grouped"!==t||(r["show-value-labels"]=!0,r["value-label-visibility"]="always"),"hide"===r["value-label-visibility"]&&"d3-dot-plot"===t&&(r["show-value-labels"]=!1,r["value-label-visibility"]="hover"),void 0!==r["hide-category-labels"]&&(r["show-category-labels"]=!r["hide-category-labels"],delete r["hide-category-labels"]),void 0!==r["hide-group-labels"]&&(r["show-group-labels"]=!r["hide-group-labels"],delete r["hide-group-labels"]),void 0===r["group-by-column"]&&n.groups&&"--"!==n.groups&&(r["group-by-column"]=!0),void 0!==r["resort-bars"]&&(r["sort-bars"]=r["resort-bars"],!0===r["resort-bars"]&&void 0!==r["sort-asc"]&&(r["reverse-order"]=r["sort-asc"]),delete r["resort-bars"],delete r["sort-asc"]),"string"==typeof r["sort-bars"]&&"d3-bars"===t)switch(r["sort-bars"]){case"keep":r["sort-bars"]=!1,r["reverse-order"]=!1;break;case"desc":r["sort-bars"]=!0,r["reverse-order"]=!1;break;case"asc":r["sort-bars"]=!0,r["reverse-order"]=!0}if("none"!==r["range-value-labels"]||"d3-range-plot"!==t&&"d3-arrow-plot"!==t||(r["show-value-labels"]=!1,r["range-value-labels"]="start"),"string"==typeof r["sort-arrows"]&&("keep"===r["sort-arrows"]?r["sort-range"]={enabled:!1,by:"start"}:r["sort-range"]={enabled:!0,by:r["sort-arrows"]},delete r["sort-arrows"]),"string"==typeof r["range-ends"]&&("line"===r["range-ends"]||"circle"===r["range-ends"]?r["range-ends"]={enabled:!0,shape:r["range-ends"]}:r["range-ends"]={enabled:!1,shape:"circle"}),r["custom-colors"]&&(r["color-category"]=r["color-category"]||{categoryOrder:[],palette:[],categoryLabels:{},map:{}},Object.keys(r["custom-colors"]).length&&void 0===r["color-by-column"]&&(r["color-category"].map=r["custom-colors"],r["color-by-column"]=!0),delete r["custom-colors"]),r["color-category"]&&(r["color-category"].categoryLabels||(r["color-category"].categoryLabels={}),r["color-category"].map||(r["color-category"].map={})),r["color-key"]&&Object.keys(r["color-key"]).length&&(!r["color-category"]||"object"!=typeof r["color-category"].categoryLabels||!Object.keys(r["color-category"].categoryLabels).length)){void 0===r["color-by-column"]&&(r["color-by-column"]=!0),r["color-category"]=r["color-category"]||{categoryOrder:[],palette:[],map:{}};var a=Object.keys(r["color-key"]);r["color-category"].categoryLabels=a.reduce((function(t,e){return t[e]=r["color-key"][e].label,t}),{}),delete r["color-key"]}}(a.get("type"),a.get("metadata"));var l,c=(l=a.get("id"),function(t,e){if(window.parent&&window.parent.postMessage){var r={source:"datawrapper",chartId:l,type:t,data:e};window.parent.postMessage(r,"*")}}),s=n.colorMap();if(!0===t){var f=a.locales.dayjs;f&&ha.locale(f);var h=a.locales.numeral;if(h)try{fa.register("locale","x",h),fa.locale("x")}catch(t){}t=!1}var d=n.type(),p=!1,g=n.axes(!0).labels.type(),b=function(t,e,r){var n=iu(e,t);return n?r.reduce((function(t,e){return n.accepts.includes(e.type())&&t.push(e),t}),[]):[]}("groups",n.meta.axes,i.columns()).length>("date"===g?0:1),v=n.get("group-by-column",!1)&&b?n.axes().groups:null,m="range-plot"===d||"arrow-plot"===d,y="bars-split"===d?n.axes().colors:n.axes().colors||n.axes().labels,w="bars"===d?n.axes().bars:"bars-bullet"===d?[n.axes().bars,n.axes().bars2]:m?[n.axes().start,n.axes().end]:"dot-plot"===d?n.axes()["dots-multiple"]:n.axes()["bars-multiple"];pa(w)||(w=[w]);var _=n.get("show-value-labels",!0)&&"bars-bullet"!==d,x=n.get("value-label-visibility"),M=n.axes().labels,k=n.dataset.column(M),N=n.get("rules")&&"dot-plot"!==d&&"range-plot"!==d&&"arrow-plot"!==d,A=n.get("background")&&("bars"===d||"bars-split"===d||"bars-grouped"===d),j=n.get("thick")&&!m&&"dot-plot"!==d,O="bars-stacked"===d&&n.get("stack-percentages",!1),T=O?function(t){return null===t?"":fa(.01*t).format(t<5?"0.[0]%":"0%")}:"bars"===d||"dot-plot"===d||m||"bars-bullet"===d?lu(n,"value-label-format",n.dataset.column(w[0])):null,D=O?function(t,e){return null===t?"":fa(.01*t).format(t<5?"0.[0]%":"0%").replace("%",Q&&0!==e?"":"%")}:function(t,e){return void 0===e?lu(n,"value-label-format",n.dataset.column(w[0])):lu(n,"value-label-format",n.dataset.column(w[0]))(t,!!Q&&0!==e,tt)},S=function(){if(O)return function(t){return fa(.01*t.value).format(t.value<5?"0.[0]%":"0%")};if(_||"dot-plot"===d||m||"bars-bullet"===d){var t={};return w.forEach((function(e){void 0===e&&(e=0),t[e]=lu(n,"value-label-format",n.dataset.column(e))})),function(e,r){var n="bars"===d?e[v]:e.row[v],a=!v||0===kt.map((function(t){return t.key})).indexOf(n),o="bars-stacked"===d||"bars-grouped"===d?0===e.row.rowIndex&&0===r:"bars-split"===d?0===e.row.rowIndex:0===r;return t[e.column||w[0]](e.value,!!st&&(!o&&a||!a),st)}}return function(t){return t.value}}(),C=n.get("label-alignment","left"),$=m&&"direct"===C,F=n.get("block-labels",!1)&&("bars"===d||"bars-stacked"===d||"bars-grouped"===d),E=n.get("mirror-bars",!1)&&"bars-split"===d&&2===w.length,L=n.get("independent-scales")&&!E&&"bars-split"===d,B=n.get("compact-group-labels")&&("bars-split"===d||"dot-plot"===d),z=n.get("show-group-labels",!0),U=n.get("custom-range",[]).filter((function(t){return""!==t})),P="date"===k.type()?lu(n,"date-label-format",k):da,Y="bars-split"!==d&&n.get("show-color-key",!0)?n.get("color-key",{}):null,R=n.get("color-by-column",!1),H=iu(u,"style.chart.legend.position","top"),q="bars-stacked"===d||"dot-plot"===d||"bars-grouped"===d,I=("bars-stacked"===d||"bars"===d||"bars-grouped"===d)&&n.get("force-grid",!1)&&!F||"dot-plot"===d||"bars-bullet"===d||m,W=(n.get("custom-grid-lines")||"").trim(),V="bars"===d&&n.get("swap-labels"),G="bars-stacked"===d&&n.get("value-label-row"),Z="bars"===d&&!n.get("show-category-labels",!0),X=n.get("value-label-alignment","left"),K=n.get("tick-position",m||"dot-plot"===d?"bottom":"top");("arrow-plot"===d&&n.get("show-arrow-key")||"range-plot"===d&&n.get("show-color-key"))&&(K="bottom");var J=iu(u,"vis.d3-bars.axes.showBaseline",!1),Q="firstOnly"===iu(u,"style.chart.labels.ticks.horizontal.units.prependAppend","all"),tt="firstOnly"===iu(u,"style.chart.labels.ticks.horizontal.units.numeral","all"),et=iu(u,"vis.d3-bars.axes.tickDist.horizontal",4),rt=Cu(u,"axes.gridlines.horizontal.width",["vis.d3-"+d,"vis.d3-dot-plot"],iu(u,"style.chart.axes.gridlines.width",1)),nt=iu(u,"vis.d3-bars.groups.spaceBetween",25),at=iu(u,"vis.d3-bars.labels.groupTitles.paddingBottom",5),ot=iu(u,"vis.d3-bars.labels.barLabels.outside",!1)&&_&&"right"===X&&!V&&("bars"===d||"bars-grouped"===d),it=iu(u,"vis.d3-bars.labels.barLabels.padding",5),lt=iu(u,"vis.d3-bars.labels.rowLabels.padding",5),st=d.includes("bars")&&"firstOnly"===iu(u,"vis.d3-bars.labels.barLabels.units","all"),ft=iu(u,"vis.d3-dot-plot.circles.size",10),dt=Du(u.colors.background)<.6;("bars-stacked"===d||"bars-grouped"===d||"bars-split"===d||"dot-plot"===d)&&function(){var t=n.get("base-color",0),e=n.get("color-category.map",{}),r=n.get("color-by-column",!1),a={selectedColor:t,keys:n.colorKeys(),customColors:r?e:{}};n.getAutoColor=Kn(u,a)}();var pt={};["bars","bars-split","bars-bullet","bars-stacked","bars-grouped","dot-plot","range-plot","arrow-plot"].forEach((function(t){pt[t]=Su(u,"d3-"+t)}));var gt=W.length?W.split(",").map(Number):[];if(m){var bt=n.axes(!0);"date"===bt.start.type()&&"date"===bt.end.type()&&(p=!0,gt=W.length?dw.column("end",W.split(","),"date").values():[],U=dw.column("end",U,"date").values())}if("dot-plot"===d){var vt=(bt=n.axes(!0))["dots-multiple"].filter((function(t){return"number"===t.type()})).length;bt["dots-multiple"].filter((function(t){return"date"===t.type()})).length>vt&&(p=!0,gt=W.length?dw.column("dots-multiple",W.split(","),"date").values():[],U=dw.column("dots-multiple",U,"date").values())}if(p||(U=U.map((function(t){return+t})).filter(wa)),"dot-plot"===d||m||(U=U.concat(0)),n.get("show-color-key",!0))if(Y={},q)w.forEach((function(t,e){Y[t]={color:Zt(n.dataset.column(t).name(),e),label:n.dataset.column(t).title()}}));else{var mt=n.get("color-category",{}),yt=Object.keys(n.get("color-category.categoryLabels",{})),wt=n.get("color-key.bars.color",Le("base-color",0));yt.forEach((function(t){Y[t]={color:mt.map[t]||wt,label:mt.categoryLabels[t]}}))}var _t=ut(r),Mt=n.dataset.list(),kt=v?ht().key(ia(v)).entries(Mt):[{key:"",values:Mt}];Mt.forEach((function(t,e){t._row=e}));var Nt=n.get("sort-bars",!1),At="bars"===d?n.axes().bars:n.get("sort-by"),jt=n.get("sort-range",!1),Dt=function(t,e,r){switch(t){case"start":return r[0];case"end":return r[1];case"diff":return e.forEach((function(t){t.__diff=t[r[1]]-t[r[0]]})),"__diff";case"change":return e.forEach((function(t){t.__change=(t[r[1]]-t[r[0]])/t[r[0]]})),"__change"}}(jt.by,Mt,w),St=n.get("reverse-order",!1),Ct=function(t){return isNaN(t[At])?-Number.MAX_VALUE:t[At]};kt.forEach((function(t){var e;m?jt.enabled&&t.values.sort(ua((function(t){return t[Dt]}))):Nt&&t.values.sort("function"==typeof(e=Ct)?function(t,r){return e(r)e(t)?1:e(r)>=e(t)?0:NaN}:function(t,r){return r[e]t[e]?1:r[e]>=t[e]?0:NaN}),St&&t.values.reverse(),t.values.forEach((function(t,e){t.rowIndex=e}))})),O&&Mt.forEach((function(t){var e=0;w.forEach((function(r){e+=t[r]})),t.__origValues={},w.forEach((function(r){t.__origValues[r]=t[r],t[r]*=100/e}))}));var $t="diverging"===n.get("value-label-mode","left"),Ft="range-plot"===d?n.get("range-ends",{enabled:!0,shape:"circle"}):{};_t.classed("bc-hr",N).classed("bc-color-bg",A).classed("bc-label-block",F).classed("bc-label-align-left","left"===C).classed("bc-label-align-right","right"===C).classed("bc-mirror-bars",E).classed("bc-stacked-diverging",$t).classed("bc-grid-lines",I).classed("bc-hide-dots",!Ft.enabled||"line"===Ft.shape).classed("bc-range-end-lines","line"===Ft.shape).classed("bc-range-end-none",!1===Ft.enabled).classed("bc-thick",j).classed("bc-direct-labels",$).classed("bc-grid-bottom","bottom"===K).classed("bc-grid-top","top"===K).classed("hidden-labels",Z),$t&&_t.classed("bc-stacked-diverging-"+w.length,!0);var Et,Lt={delay:300,timer:null,current:null,inactive:!0,setForItem:function(t,e){Lt.timer&&clearTimeout(Lt.timer),Lt.timer=setTimeout((function(){Lt.inactive=!1,_t.selectAll(".bc-bar-inner").classed("focus",!1),_t.selectAll(".bc-bar-inner").classed("unfocus",!0),t.classed("focus",!0).classed("unfocus",!1),Ee&&Ee.highlight(e[y])}),Lt.inactive?Lt.delay:1),Lt.current=t},setForColumn:function(t){Lt.current!==t&&(Lt.timer&&clearTimeout(Lt.timer),Lt.timer=setTimeout((function(){Lt.inactive=!1,_t.selectAll(".bc-bar-inner").classed("focus",(function(e){return t&&e.column===t})).classed("unfocus",(function(e){return t&&e.column!==t})),_t.selectAll(".bc-dot-diff").classed("focus",!1),Ee&&Ee.highlight(t),c("highlight.set",{column:t})}),Lt.inactive?Lt.delay:1),Lt.current=t)},setForCategory:function(t){var e=t.key;Lt.current!==e&&(Lt.timer&&clearTimeout(Lt.timer),Lt.timer=setTimeout((function(){Lt.inactive=!1,_t.selectAll(".bc-bar-inner").classed("focus",(function(t){return e&&t[y]===e})).classed("unfocus",(function(t){return e&&t[y]!==e})),_t.selectAll(".bc-dot-diff").classed("unfocus",!0),c("highlight.set",{category:e})}),Lt.inactive?Lt.delay:1),Lt.current=e)},clear:function(){Lt.current=null,Lt.inactive=!0,Lt.timer&&clearTimeout(Lt.timer),_t.selectAll(".bc-bar-inner").classed("focus",!1).classed("unfocus",!1),Ee&&Ee.highlight(),_t.selectAll(".bc-dot-diff").classed("unfocus",!1),c("highlight.clear")}},Bt=Ia(w.map((function(t){return Yi(Mt,t)}))).filter((function(t){return p?La(t):wa(t)})),zt=!1;"bars-stacked"===d&&(Bt=[Tt(Mt.map((function(t){return w.reduce((function(e,r){return t[r]<0?t[r]+e:e}),0)}))),Ot(Mt.map((function(t){return w.reduce((function(e,r){return t[r]>0?t[r]+e:e}),0)})))],zt=Ot(Bt)<=0,_t.classed("all-negative",zt)),"bars-bullet"===d&&(Et={inner:Le("base-color2",1),outer:Le("base-color",0)});var Ut=Bt.concat(gt);("dot-plot"!==d&&!m||"custom"===n.get("range-extent","nice"))&&(Ut=Ut.concat(U));var Pt=p?function(){return $e.apply(Zn(Mr,xr,yr,vr,br,gr,pr,dr,Fr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}():cr();Pt.domain(xt(Ut)).range([0,100]),("dot-plot"===d||m)&&(Pt.range([800/o[0],100-800/o[0]]),"nice"===n.get("range-extent","nice")&&Pt.nice());var Yt={series:[]};Yt.rows=Mt.map((function(t){var e=""+n.chart().columnFormatter(n.axes(!0).labels)(t[M]);if(n.get("highlighted-series",[]).indexOf(e)>-1)return e})).filter((function(t){return void 0!==t})),_t.classed("bc-with-row-highlight",Yt.rows.length);var Rt=_t.append("div.bc-groups").selectAll("div.bc-group").data(kt).enter().append("div.bc-group");Rt.filter((function(t,e){return e>0})).style("margin-top",nt+"px"),_t.selectAll("div.bc-groups").classed(kt.length>1?"grouped-bars":"","bc-groups"),L&&(Pt={},w.forEach((function(t){Pt[t]=cr().domain(xt(Yi(Mt,t).concat(U))).range([0,100])}))),B||Rt.filter((function(t){return"null"!==t.key})).append("div.bc-group-title.group-title.chart-text.label").attr("data-column",v).attr("data-row",(function(t){return Yi(t.values,"_row").join(",")})).style("margin-bottom",z&&v?at+"px":"0px").append("span").html(z?ia("key"):"");var Ht=Rt.append("div.bc-group-content");if(Ht.on("mouseleave",(function(){Lt.clear()})),"bars-split"===d){var qt=iu(u,"vis.d3-bars-split.labels.splitLabels.useBarColor"),It=Ht.append("div.bc-split-label");B?It.append("div.bc-row-label.label.bc-compact-group-label.row-label.chart-text").attr("data-column",v).attr("data-row",(function(t){return Yi(t.values,"_row").join(",")})).append("span").html(ia("key")):It.append("div.bc-row-label.row-label.chart-text.label").append("span"),It.append("div.bc-bars").selectAll("div.bc-split").data(w).enter().append("div.bc-split.label").style("width",100/w.length+"%").classed("highlighted-series",(function(t){return n.get("highlighted-series",[]).indexOf(t)>-1})).attr("data-column",(function(t){return t})).attr("data-row","-1").append("span").html((function(t){return n.dataset.column(t).title()})).style("color",qt&&!y?function(t,e){return s(Zt(t,e))}:null)}var Wt,Vt,Gt=Ht.selectAll("div.bc-row").data(ia("values")).enter().append("div.bc-row").classed("bc-row-highlight",(function(t){var e=""+n.chart().columnFormatter(n.axes(!0).labels)(t[M]);return Yt.rows.indexOf(e)>-1})).classed("first-row",(function(t,e){return 0===e})).classed("row-divider",(function(t,e){if(0!==e)return"bars-split"===d||"bars-stacked"===d||"bars-grouped"===d||"bars-bullet"===d||"bars"===d})).style("border-top-color",(function(t,e){if(0!==e)return"bars-split"===d||"bars-stacked"===d||"bars-grouped"===d||"bars-bullet"===d||"bars"===d?s(pt[d].bars.rowDividerColor):void 0}));function Zt(t,e){var r=ga(t),a=n.getAutoColor(r?t.column:t,e);return r&&(t._color=n.getAutoColor(t.column,e)),a}function Kt(t){var e=n.type(),r=i.column(y).raw("bars"===e||"arrow-plot"===e?t._row:t.row._row),a=n.get("color-category.map",{})[r],o=Le("base-color",0);return t._color=R&&a?a:o,t._color}if(V?_&&Gt.append("div.bc-row-label.row-label.chart-text.label").append("span").html(ia(w[0],T)):Z||Gt.append("div.bc-row-label.row-label.chart-text.label").classed("dw-bold",F&&"bars-grouped"===d).classed("has-label-row","bars-stacked"===d&&G).attr("data-column",M).attr("data-row",ia("_row")).append("span").html(ia(M,P)),"bars"===d)Vt=(Wt=Gt.append("div.bc-bars")).append("div.bc-bar-bg.dw-rect").filter((function(t){return!isNaN(t[w[0]])})).append("div.bc-bar-inner.dw-rect").style("left",(function(t){return t.value=t[w[0]],Pt(Math.min(0,t.value))+"%"})).style("right",(function(t){return 100-Pt(Math.max(0,t.value))+"%"})).style("background",ia(Kt,s));else if("bars-split"===d)Vt=(Wt=Gt.append("div.bc-bars").selectAll("div.bc-split").data((function(t){return w.map((function(e){return{column:e,value:t[e],row:t}}))})).enter().append("div.bc-split").style("width",100/w.length+"%").append("div.bc-split-inner")).append("div.bc-bar-bg.dw-rect").filter((function(t){return!isNaN(t.value)})).style("background",!!A&&pt[d].bars.barBg).append("div.bc-bar-inner.dw-rect").each((function(t){var e=L?Pt[t.column]:Pt;t.__left=e(Math.min(0,t.value))+"%",t.__right=100-e(Math.max(0,t.value))+"%"})).style("left",(function(t,e){return E&&!e?t.__right:t.__left})).style("right",(function(t,e){return E&&!e?t.__left:t.__right})).style("background",(function(t,e){return s(y?Kt(t):Zt(t,e))})).attr("title",S),_t.selectAll(".bc-split").style("padding-right",n.get("space-between-cols",10)+"px"),_t.selectAll(".bc-bars").style("margin-right",-1*n.get("space-between-cols",10)+"px");else if("bars-stacked"===d)Gt.on("mousemove",(function(t){var e=ut(this),r=ct(e.node())[0],n=e.selectAll(".bc-bar-inner").filter((function(){var t=a.getElementBounds(this),e=t.left,n=t.right;return r>=e&&r<=n}));n.empty()?Lt.clear():Lt.setForColumn(n.datum().column)})),Wt=Gt.append("div.bc-bars").classed("has-label-row","bars-stacked"===d&&G),zt&&Wt.lower(),Vt=Wt.append("div.bc-bar-bg.dw-rect").selectAll("div.bc-bar-inner").data((function(t){var e=0,r=0;return w.map((function(n){var a=e,o=r;return e+=isNaN(t[n])||t[n]<0?0:t[n],r+=isNaN(t[n])||t[n]>0?0:t[n],{column:n,row:t,value:t[n],offsetPos:a,offsetNeg:o}})).filter((function(t){return!isNaN(t.value)}))})).enter().append("div.bc-bar-inner.dw-rect").style("left",(function(t){return Pt(t[t.value>0?"offsetPos":"offsetNeg"]+(t.value<0?t.value:0))+"%"})).style("right",(function(t){return 100-Pt(t[t.value>0?"offsetPos":"offsetNeg"]+(t.value<0?0:t.value))+"%"})).style("background",(function(t,e){return s(Zt(t,e))})).attr("data-column",ia("column"));else if("bars-grouped"===d)Gt.on("mousemove",(function(t){var e=ut(this),r=ct(e.node()),n=r[0],o=r[1],i=e.selectAll(".bc-bar-inner").filter((function(t,e){var r=a.getElementBounds(this),i=r.height,u=r.right,l=r.left;return Math.floor(o/i)===e&&nl}));i.empty()?Lt.clear():Lt.setForColumn(i.datum().column)})),Vt=(Wt=Gt.append("div.bc-bars").classed("has-label-row",("bars-stacked"===d||"bars-grouped"===d)&&G)).selectAll("div.bc-bar-bg.dw-rect").data((function(t){return w.map((function(e){return{column:e,row:t,value:t[e]}})).filter((function(t){return!isNaN(t.value)}))})).enter().append("div.bc-bar-bg.dw-rect").append("div.bc-bar-inner.dw-rect").style("left",(function(t){return Pt(Math.min(0,t.value))+"%"})).style("right",(function(t){return 100-Pt(Math.max(0,t.value))+"%"})).style("background",(function(t,e){return s(Zt(t,e))})).attr("data-column",ia("column"));else if("bars-bullet"===d)Vt=(Wt=Gt.append("div.bc-bars")).append("div.bc-bar-bg.dw-rect").selectAll("div.bc-bar-inner").data((function(t){return w.map((function(e,r){return{type:r?"inner":"outer",row:t,column:e,value:t[e]}})).filter((function(t){return!isNaN(t.value)}))})).enter().append("div.bc-bar-inner.dw-rect").classed("bc-bullet-inner",(function(t){return"inner"===t.type})).style("left",(function(t){return Pt(Math.min(0,t.value))+"%"})).style("right",(function(t){return 100-Pt(Math.max(0,t.value))+"%"})).style("background",(function(t){return s(Et[t.type])}));else if("dot-plot"===d){if((Wt=Gt.append("div.bc-bars")).on("mousemove",(function(t){var e=a.getElementBounds(this).width,r=ct(this)[0],n=function(t){return isNaN(t)?1/0:Math.abs(t-r)},o=w.map((function(r){return{col:r,x:Pt(t[r])/100*e}})).sort((function(t,e){return n(e.x)-n(t.x)})).pop();n(o.x)<20?Lt.setForColumn(o.col):Lt.clear()})),(Vt=Wt.append("div.bc-bar-bg.dw-rect.y-gridline").style("border-top-color",s(pt[d].shared.gridline)).selectAll("div.bc-bar-inner").data((function(t){return w.map((function(e){return{column:e,value:t[e],row:t}})).filter((function(t){return null!==t.value}))})).enter().append("div.bc-bar-inner.dw-circle").style("margin-left",-ft/2+"px").style("left",(function(t){return Pt(t.value)+"%"})).style("background",(function(t,e){return s(Zt(t,e))})).style("top",-ft/2-rt/2+"px").classed("bc-dot-highlight",(function(t){var e=n.get("highlighted-series",[]);return e.indexOf(t.column)>-1&&Yt.series.push(t.column),e.indexOf(t.column)>-1}))).filter((function(t){return isNaN(t.value)})).style("display","none"),_t.classed("bc-with-series-highlight",Yt.series.length),w.length>1&&n.get("highlight-range")){var Jt={color:pt[d].rangeBar,width:iu(u,"vis.d3-dot-plot.rangeBar.height",6),opacity:iu(u,"vis.d3-dot-plot.rangeBar.opacity")||(dt?.5:.2)};Wt.select(".bc-bar-bg").insert("div.bc-dot-diff.dw-rect",".bc-bar-inner").each((function(t){var e=w.reduce((function(e,r){return(p?La(t[r]):wa(t[r]))&&e.push(Pt(t[r])),e}),[]),r=Tt(e),n=Ot(e);t._bar0min=ra?"left":"none"})).style("background",ia(Kt,s)).classed("bc-arrow-left",(function(t){return"left"===t._direction})).classed("bc-arrow-right",(function(t){return"right"===t._direction})).classed("bc-arrow-none",(function(t){return"none"===t._direction})).style("left",ia("_min")).style("right",ia("_max")).append("div.bc-arrow-inner.dw-arrow-inner").style("border-color",ia("_color",s))}else if("range-plot"===d){var te={width:iu(u,"vis.d3-range-plot.rangeBar.height",6),opacity:iu(u,"vis.d3-range-plot.rangeBar.opacity")||(dt?.8:.5)},ee=(Wt=Gt.append("div.bc-bars")).append("div.bc-bar-bg");Wt.append("div.bc-bar-bg-line.y-gridline.dw-line").style("border-top-color",s(pt[d].shared.gridline));var re="circle"===n.get("range-ends",{}).shape,ne=iu(u,"vis.d3-range-plot.rangeEnds.circles.outline",!1),ae=iu(u,re?"vis.d3-range-plot.rangeEnds.circles.size":"vis.d3-range-plot.rangeEnds.lines.height",10);Vt=ee.selectAll("div.bc-bar-inner.dw-"+(re?"circle":"rect")).data((function(t){return w.map((function(e){return{row:t,column:e,value:t[e]}}))})).enter().append("div.bc-bar-inner.dw-"+(re?"circle":"rect")).style("margin-left",(function(){return re?"-5px":"-1px"})).style("left",(function(t){return Pt(t.value)+"%"})).style("border-width",!(!ne.width||!re)&&ne.width+"px").style("border-style",!(!ne.width||!re)&&"solid").style("border-color",ne.color||Be).style("top",-(ae+(2*ne.width||0))/2+"px").style("background",ne?ne.fill||u.colors.background:Be).filter((function(t){return isNaN(t.value)})).style("display","none"),Wt.select(".bc-bar-bg").insert("div.bc-range.dw-rect",".bc-bar-inner").each((function(t){var e=Pt(t[w[0]]),r=Pt(t[w[1]]);isNaN(e)&&!isNaN(r)?e=r:!isNaN(e)&&isNaN(r)&&(r=e),t._bar0min=e0)return"+"+e;return e})):"change"===oe?ia("_change",(function(t){return fa(t).format("+0"+(t<.01?".[0]":"")+"%")})):ia(w[1],T))),_&&!V?Vt.append("div.bc-bar-label.chart-text.value.label").classed("label-row",G).classed("inside","bars"===d||"bars-stacked"===d||"bars-grouped"===d||"bars-split"===d).append("span").html(S):V&&!Z&&Vt.append("div.bc-bar-label.chart-text.value.label").attr("data-column",M).attr("data-row",ia("_row")).append("span").html(ia(M,P));var ie=0;$||F||Ht.selectAll(".bc-row-label span, .bc-compact-group-label span").each((function(){ie=Math.max(ie,a.getElementBounds(this).width)})),ie>0&&(ie+=2*lt);var ue=100*ie/o[0]+"%",le=100*(o[0]-ie+("bars-split"===d?+n.get("space-between-cols",10)-4:0))/o[0]+"%";Ht.selectAll(".bc-row-label").style("width",ue),Ht.selectAll(".bc-bars").style("width",le),"right"===C&&"bars-bullet"!==d&&"dot-plot"!==d&&Rt.selectAll("div.bc-group-title.label").style("padding-left",ue),("bars"===d||"bars-split"===d&&!E||"bars-grouped"===d)&&("right"===X?Vt.selectAll("div.bc-bar-label").style("text-align",(function(t){return t.value<0?"left":"right"})):"left"===X&&Vt.selectAll("div.bc-bar-label").style("text-align",(function(t){return t.value<0?"right":"left"}))),"dot-plot"===d&&_t.selectAll(".bc-bar-label span").each((function(){var t=a.getElementBounds(this),e=t.right,r=t.width;e>a.getElementBounds(Ht.node()).right&&ut(this.parentNode).style("left",-r-5+"px")})),A&&Ht.selectAll(".bc-color-bg .bc-bar-bg").style("background",pt[d].bars.barBg),Vt.selectAll("div.bc-bar-label").classed("inverted",(function(t){var e=1===iu(u,"vis.d3-dot-plot.valueLabels.onCircles");if("dot-plot"===d&&!e)return!1;if("bars-stacked"===d&&G)return!1;var r=a.getElementBounds(this.querySelector("span")).width+2*it,n=a.getElementBounds(this.parentNode).width,o=a.getElementBounds(this.parentNode.parentNode).width,i=this.parentNode.offsetLeft,l=t._color;if(r>n||ot){if(o-n>r||ot)"bars-split"===d&&E&&!w.indexOf(t.column)?ut(this).style("margin-left",0-r-it+"px").style("padding-right",it+n+"px"):t.value<0&&(i>=r+n||ot)?ut(this).style("margin-left","-"+(r-it)+"px").style("padding-right",n+it+"px").style("padding-left","0px"):(ut(this).classed("outside",["bars","bars-grouped","bars-split"].includes(d)),ut(this).classed("inside",!["bars","bars-grouped","bars-split"].includes(d)),ut(this).style("margin-left",n+"px"));else if(se(l).l<70)return!0;return("bars-grouped"===d&&!ot&&"show"!==x||"bars-stacked"===d)&&(ut(this).classed("hidden","bars-stacked"===d),r>o-n-i&&ut(this).style("margin-left",0-r-it+"px")),!1}return se(l).l<70}));var ce=Math.min.apply(Math,Ut)<0;if("bars-grouped"!==d&&"bars-stacked"!==d||"hover"!==x||!_||Vt.selectAll("div.bc-bar-label").classed("hidden",!0),(ot||m)&&(e=uu(_t,a,d,w,o[0]-ie,o[0],it,Pt,$,e)).labelsTooLong,I||(J||ce)&&"bars-split"!==d&&!F){var fe=Math.max(100,11*D(Pt.domain()[1]).length),he=!iu(u,"vis.d3-bars-stacked.axes.gridBehind",!1);_t.selectAll("div.bc-groups").classed("grid","bars"===d||"bars-stacked"===d||"bars-grouped"===d||"bars-bullet"===d);var de=iu(u,"vis.d3-bars.axes.gridlines.extendGrid",0);if(Ht.each((function(t){if("bars"===d||"bars-stacked"===d||"bars-grouped"===d||"bars-bullet"===d){var e=ut(this).selectAll(".bc-bar-bg"),r=e.size(),n=a.getElementBounds(this).top,o=a.getElementBounds(e.nodes()[0]).top,i=a.getElementBounds(e.nodes()[r-1]).bottom;t._y=o-n-de+"px",t._h=Math.abs(i-o)+2*de+"px"}else t._h=a.getElementBounds(this).height+"px",t._y=0})).insert("div.bc-grid",".bc-row").style("height",ia("_h")).style("top",ia("_y")).style("width",le).style(zt?"right":"left",ue).selectAll(".bc-grid-line").data(gt.length?gt:0===Pt.domain()[0]&&100===Pt.domain()[1]?[0,25,50,75,100]:Pt.ticks(o[0]/fe)).enter().filter((function(t){return!!I||0===t})).append("div.bc-grid-line.dw-rect").style("z-index",(function(){if("bars-stacked"===d&&he)return 10})).classed("bc-grid-line-left",(function(t){return Pt(t)<.4})).classed("bc-grid-line-right",(function(t){return Pt(t)>97})).classed("bc-grid-baseline",(function(t){return 0===t})).classed("y-axis",(function(t){return 0===t})).classed("dar",(function(t){return 0===t&&("dot-plot"===d||"arrow-plot"===d||"range-plot"===d)})).classed("x-gridline",(function(t){return 0!==t})).style("left",(function(t){return Pt(t)+"%"})).style("border-left-color",(function(t){if("bars-stacked"===d&&he){if(0===Pt(t)||100===Pt(t))return"transparent";var e=Xt(u.colors.background);return"rgba("+e.r+","+e.g+","+e.b+",0.4)"}if((pt[d].shared.axis||0!==t||m||"dot-plot"===d)&&(pt[d].shared.gridline||0===t))return s(0===t?m||"dot-plot"===d?pt[d].dar.darBaseline:pt[d].shared.axis:pt[d].shared.gridline)})).append("div.bc-grid-label.x-tick-values.label.secondary.tick").append("span").style("color",s(pt[d].shared.tickText)).text(D),I){var pe=0;I&&Ht.selectAll(".bc-grid-label span").each((function(){pe=Math.max(a.getElementBounds(this).height,pe)}));var ge=pe+et;Rt.filter((function(t,e){return e>0})).style("margin-top",nt+ge+"px"),"top"===K?_t.selectAll("div.bc-groups").style("padding-top",ge+"px").selectAll(".bc-grid-label, .bc-group-title").style("top",-ge+"px"):"bottom"===K&&_t.selectAll("div.bc-groups").style("padding-bottom",ge+"px").selectAll(".bc-grid-label").style("bottom",-ge+"px")}else _t.selectAll(".label.tick").remove()}if("range-plot"===d&&n.get("show-color-key")||"arrow-plot"===d&&n.get("show-arrow-key")){var be=w.map((function(t,e){return{label:i.column(t).title(),value:kt[0].values[0][t],x:Pt(kt[0].values[0][t]),column:t}})).sort(ua("x")),ve=Math.abs(be[0].x-be[1].x)/100*o[0];be.forEach((function(t,e){t.align=ve>10010?"center":e?"left":"right",t.width="100px",t.left="center"===t.align?t.x-50/o[0]*100+"%":e?t.x+"%":"auto",t.right="center"===t.align||e?"auto":100-t.x+"%",t.class="bc-direct-key-col label align-"+t.align}));var me=_t.select(".bc-group .bc-group-content"),ye=0,we=me.append("div.bc-direct-key").style("width",le).style("left",ue),_e=we.selectAll("div.bc-direct-key-col").data(be).enter().append("div.bc-direct-key-col.label").style("left",ia("left")).style("right",ia("right")).style("width",ia("width")).style("text-align",ia("align")).attr("class",ia("class")).attr("data-column",ia("column")).attr("data-row",-1),Me=_e.append("span").html(ia("label"));"range-plot"===d&&(_||n.get("range-ends.enabled"))&&Me.style("color",Be),_e.append("i.bc-vline.connecting-line.export-text").html("|"),_e.each((function(){ye=Math.max(ye,10+a.getElementBounds(this).height)})),_t.select(".bc-group-title:first-child").style("margin-bottom",ye+"px"),we.style("top",5-ye+"px"),_e.style("bottom",-(ye-10)+"px"),me.style("margin-top",v?"0px":ye+"px"),_e.select("span").style("position","relative").style("left",(function(){var t=a.getElementBounds(this),e=t.left,r=t.width,n=o[0]-10-e-r;return n<0?n+"px":0}))}"bottom"===H&&Y&&_t.select("div.bc-color-key").each((function(){this.parentNode.append(this)}));var ke=n.get("show-color-key",!1),Ne=function(){var t=n.colorKeys();switch(d){case"bars":var e=ze({colorKeys:t,useAutoColor:!1}),r=n.axes(!0).bars.title(),a=Le("base-color",e);return e.length?e:[{label:r,color:s(a)}];case"bars-split":return ze({colorKeys:t,useAutoColor:!y});case"bars-stacked":case"bars-grouped":case"dot-plot":return ze({colorKeys:t,useAutoColor:!0});case"bars-bullet":return[{color:s(Le("base-color")),label:n.axes(!0).bars.title()},{color:s(Le("base-color2")),label:n.axes(!0).bars2.title()}];case"arrow-plot":var o=ze({colorKeys:t,useAutoColor:!1}),i=n.axes(!0).labels.title(),u=Le("base-color",o);return o.length?o:[{label:i,color:s(u)}];case"range-plot":return[]}}();if(ke&&Ne.length){var Ae=_t.append("div.legend-container"),je=iu(u,"style.chart.legend.position","top"),Oe=iu(u,"style.chart.legend.swatch.borderRadius",0),Te="dot-plot"===d||"range-plot"===d||"50%"===Oe,De=iu(u,"style.chart.legend.swatch.width",14),Se=iu(u,"style.chart.legend.swatch.height",14),Ce=iu(u,"style.chart.legend.swatch.size",Se),Fe={swatchWidth:Te?Ce:De,swatchHeight:Te?Ce:Se,swatchBorderRadius:Te?"50%":iu(u,"style.chart.legend.swatch.borderRadius"),swatchLabelDistance:iu(u,"style.chart.legend.swatch.marginRight"),paddingBottom:iu(u,"style.chart.legend.padding.bottom"),itemMarginRight:iu(u,"style.chart.legend.text.marginRight"),itemMarginBottom:iu(u,"style.chart.legend.rowSpacing"),paddingTop:iu(u,"style.chart.legend.padding.top"),textAlign:iu(u,"style.chart.legend.alignment"),color:iu(u,"style.chart.labels.legend.color"),fontSize:iu(u,"style.chart.labels.legend.fontSize"),fontWeight:iu(u,"style.chart.labels.legend.fontWeight"),fontFamily:iu(u,"style.chart.labels.legend.typeface")},Ee=function(t,e){if("svg"===t.nodeName.toLowerCase()||t.ownerSVGElement)throw new Error("can only render in HTML elements");var r,n=Object.assign({},{title:"",horizontal:!0,swatches:[{color:"#dd0000",label:"A red swatch",key:"red"},{color:"#0033dd",label:"A blue swatch",key:"blue"}],reverse:!1,width:"100%",height:"auto",swatchWidth:20,swatchHeight:20,itemMarginBottom:3,itemMarginRight:10,swatchBorderRadius:0,swatchLabelDistance:3,paddingTop:0,paddingBottom:10,color:"inherit",fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit",textAlign:"left",highlight:!1},e),a={},o=ut(t).append("div.category-legend").classed("horizontal",n.horizontal).classed("vertical",!n.horizontal).st({paddingTop:n.paddingTop,paddingBottom:n.paddingBottom,textAlign:n.textAlign,color:n.color,fontSize:n.fontSize,fontFamily:n.fontFamily,width:n.width,height:n.height});return n.title&&o.append("div.legend-title").html(n.title),r=la(o,n,(function(t,e){a[t]&&a[t].length&&a[t].forEach((function(t){"function"==typeof t&&t(e)}))})),r=Object.assign({},{container:o,on:function(t,e){return"function"!=typeof e||"string"!=typeof t||(a[t]||(a[t]=[]),a[t].push(e)),r}},r)}(Ae.node(),Object.assign({},nu(Fe,au),{swatches:Ne,horizontal:!0}));"top"===je&&Ae.lower(),"bars-stacked"!==d&&"bars-grouped"!==d&&"dot-plot"!==d||(Ee.on("mouseenter",(function(t){var e=t.key;return Lt.setForColumn(e)})),Ee.on("mouseleave",Lt.clear))}function Le(t,e){var r=n.get(t,e);return Kn(u,{selectedColor:r})()}function Be(t){var e=t.column===w[0]?"base-color":"base-color2";return s(Le(e,0))}function ze(t){var e=t.colorKeys,r=t.useAutoColor,a=n.get("color-category",{map:{}}),o=e.reduce((function(t,e,n){return r&&(t[e]=Zt(e,n)),t}),{});return Object.keys(Object.assign({},a.map,o)).reduce((function(t,r){var n=R?a.map:o,i=s(n[r]||o[r]),u=iu(a,"categoryLabels",{})[r]||r,l=iu(a,"categoryOrder",[]).indexOf(r),c=e.includes(r),f=!t.find((function(t){return void 0===t&&(t={}),t.color===i&&t.label===u}));return i&&c&&f&&t.push({color:i,label:u,key:r,order:l}),t}),[]).sort((function(t,e){return t.order-e.order}))}n.renderingComplete()},init:function(t){this.svg=t.node(),this.__canvas={w:+t.attr("width"),h:+t.attr("height"),lpad:10,rpad:10}},_svgCanvas:function(){return this.svg},colorKeys:function(){var t=this.axes(!0),e=t.colors||t.labels;if(e){var r=this.chart().columnFormatter(e),n=[];return e.each((function(t){n.push(String(r(t)))})),Wi(n)}return[]},keys:function(){var t=this.axes(!0);if(t.labels){var e=this.chart().columnFormatter(t.labels),r=[];return t.labels.each((function(t){r.push(String(e(t)))})),Wi(r)}return[]},getCenter:function(){return[1,2]}}}))}();