billboard.js
Version:
Re-usable easy interface JavaScript chart library, based on D3 v4+
13 lines • 253 kB
JavaScript
/*!
* Copyright (c) 2017 ~ present NAVER Corp.
* billboard.js project is licensed under the MIT license
*
* billboard.js, JavaScript chart library
* https://naver.github.io/billboard.js/
*
* @version 3.14.2
* @requires billboard.js
* @summary billboard.js plugin
*/(function(kr,$r){typeof exports=="object"&&typeof module=="object"?module.exports=$r():typeof define=="function"&&define.amd?define("bb",[],$r):typeof exports=="object"?exports.bb=$r():(kr.bb=kr.bb||{},kr.bb.plugin=kr.bb.plugin||{},kr.bb.plugin["tableview.pkgd"]=$r())})(this,function(){return function(){"use strict";var Ae={72611:function(i,d,t){t.d(d,{default:function(){return bs}});function r(){}function n(a){return a==null?r:function(){return this.querySelector(a)}}function e(a){typeof a!="function"&&(a=n(a));for(var l=this._groups,h=l.length,E=new Array(h),I=0;I<h;++I)for(var D=l[I],L=D.length,V=E[I]=new Array(L),z,_,tt=0;tt<L;++tt)(z=D[tt])&&(_=a.call(z,z.__data__,tt,D))&&("__data__"in z&&(_.__data__=z.__data__),V[tt]=_);return new Lt(E,this._parents)}function o(a){return a==null?[]:Array.isArray(a)?a:Array.from(a)}function s(){return[]}function u(a){return a==null?s:function(){return this.querySelectorAll(a)}}function f(a){return function(){return o(a.apply(this,arguments))}}function v(a){typeof a=="function"?a=f(a):a=u(a);for(var l=this._groups,h=l.length,E=[],I=[],D=0;D<h;++D)for(var L=l[D],V=L.length,z,_=0;_<V;++_)(z=L[_])&&(E.push(a.call(z,z.__data__,_,L)),I.push(z));return new Lt(E,I)}function c(a){return function(){return this.matches(a)}}function g(a){return function(l){return l.matches(a)}}var y=Array.prototype.find;function p(a){return function(){return y.call(this.children,a)}}function m(){return this.firstElementChild}function S(a){return this.select(a==null?m:p(typeof a=="function"?a:g(a)))}var x=Array.prototype.filter;function O(){return Array.from(this.children)}function P(a){return function(){return x.call(this.children,a)}}function T(a){return this.selectAll(a==null?O:P(typeof a=="function"?a:g(a)))}function R(a){typeof a!="function"&&(a=c(a));for(var l=this._groups,h=l.length,E=new Array(h),I=0;I<h;++I)for(var D=l[I],L=D.length,V=E[I]=[],z,_=0;_<L;++_)(z=D[_])&&a.call(z,z.__data__,_,D)&&V.push(z);return new Lt(E,this._parents)}function N(a){return new Array(a.length)}function A(){return new Lt(this._enter||this._groups.map(N),this._parents)}function C(a,l){this.ownerDocument=a.ownerDocument,this.namespaceURI=a.namespaceURI,this._next=null,this._parent=a,this.__data__=l}C.prototype={constructor:C,appendChild:function(a){return this._parent.insertBefore(a,this._next)},insertBefore:function(a,l){return this._parent.insertBefore(a,l)},querySelector:function(a){return this._parent.querySelector(a)},querySelectorAll:function(a){return this._parent.querySelectorAll(a)}};function M(a){return function(){return a}}function $(a,l,h,E,I,D){for(var L=0,V,z=l.length,_=D.length;L<_;++L)(V=l[L])?(V.__data__=D[L],E[L]=V):h[L]=new C(a,D[L]);for(;L<z;++L)(V=l[L])&&(I[L]=V)}function F(a,l,h,E,I,D,L){var V,z,_=new Map,tt=l.length,Rt=D.length,Mt=new Array(tt),Wt;for(V=0;V<tt;++V)(z=l[V])&&(Mt[V]=Wt=L.call(z,z.__data__,V,l)+"",_.has(Wt)?I[V]=z:_.set(Wt,z));for(V=0;V<Rt;++V)Wt=L.call(a,D[V],V,D)+"",(z=_.get(Wt))?(E[V]=z,z.__data__=D[V],_.delete(Wt)):h[V]=new C(a,D[V]);for(V=0;V<tt;++V)(z=l[V])&&_.get(Mt[V])===z&&(I[V]=z)}function U(a){return a.__data__}function w(a,l){if(!arguments.length)return Array.from(this,U);var h=l?F:$,E=this._parents,I=this._groups;typeof a!="function"&&(a=M(a));for(var D=I.length,L=new Array(D),V=new Array(D),z=new Array(D),_=0;_<D;++_){var tt=E[_],Rt=I[_],Mt=Rt.length,Wt=G(a.call(tt,tt&&tt.__data__,_,E)),fr=Wt.length,xr=V[_]=new Array(fr),Et=L[_]=new Array(fr),Ht=z[_]=new Array(Mt);h(tt,Rt,xr,Et,Ht,Wt,l);for(var Yt=0,Gt=0,tr,rr;Yt<fr;++Yt)if(tr=xr[Yt]){for(Yt>=Gt&&(Gt=Yt+1);!(rr=Et[Gt])&&++Gt<fr;);tr._next=rr||null}}return L=new Lt(L,E),L._enter=V,L._exit=z,L}function G(a){return typeof a=="object"&&"length"in a?a:Array.from(a)}function B(){return new Lt(this._exit||this._groups.map(N),this._parents)}function b(a,l,h){var E=this.enter(),I=this,D=this.exit();return typeof a=="function"?(E=a(E),E&&(E=E.selection())):E=E.append(a+""),l!=null&&(I=l(I),I&&(I=I.selection())),h==null?D.remove():h(D),E&&I?E.merge(I).order():I}function j(a){for(var l=a.selection?a.selection():a,h=this._groups,E=l._groups,I=h.length,D=E.length,L=Math.min(I,D),V=new Array(I),z=0;z<L;++z)for(var _=h[z],tt=E[z],Rt=_.length,Mt=V[z]=new Array(Rt),Wt,fr=0;fr<Rt;++fr)(Wt=_[fr]||tt[fr])&&(Mt[fr]=Wt);for(;z<I;++z)V[z]=h[z];return new Lt(V,this._parents)}function W(){for(var a=this._groups,l=-1,h=a.length;++l<h;)for(var E=a[l],I=E.length-1,D=E[I],L;--I>=0;)(L=E[I])&&(D&&L.compareDocumentPosition(D)^4&&D.parentNode.insertBefore(L,D),D=L);return this}function Q(a){a||(a=X);function l(Rt,Mt){return Rt&&Mt?a(Rt.__data__,Mt.__data__):!Rt-!Mt}for(var h=this._groups,E=h.length,I=new Array(E),D=0;D<E;++D){for(var L=h[D],V=L.length,z=I[D]=new Array(V),_,tt=0;tt<V;++tt)(_=L[tt])&&(z[tt]=_);z.sort(l)}return new Lt(I,this._parents).order()}function X(a,l){return a<l?-1:a>l?1:a>=l?0:NaN}function k(){var a=arguments[0];return arguments[0]=this,a.apply(null,arguments),this}function Z(){return Array.from(this)}function ht(){for(var a=this._groups,l=0,h=a.length;l<h;++l)for(var E=a[l],I=0,D=E.length;I<D;++I){var L=E[I];if(L)return L}return null}function lt(){let a=0;for(const l of this)++a;return a}function pt(){return!this.node()}function Ot(a){for(var l=this._groups,h=0,E=l.length;h<E;++h)for(var I=l[h],D=0,L=I.length,V;D<L;++D)(V=I[D])&&a.call(V,V.__data__,D,I);return this}var Tt="http://www.w3.org/1999/xhtml",Kt={svg:"http://www.w3.org/2000/svg",xhtml:Tt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Vt(a){var l=a+="",h=l.indexOf(":");return h>=0&&(l=a.slice(0,h))!=="xmlns"&&(a=a.slice(h+1)),Kt.hasOwnProperty(l)?{space:Kt[l],local:a}:a}function Ut(a){return function(){this.removeAttribute(a)}}function vt(a){return function(){this.removeAttributeNS(a.space,a.local)}}function mt(a,l){return function(){this.setAttribute(a,l)}}function Dt(a,l){return function(){this.setAttributeNS(a.space,a.local,l)}}function $t(a,l){return function(){var h=l.apply(this,arguments);h==null?this.removeAttribute(a):this.setAttribute(a,h)}}function Nt(a,l){return function(){var h=l.apply(this,arguments);h==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,h)}}function jt(a,l){var h=Vt(a);if(arguments.length<2){var E=this.node();return h.local?E.getAttributeNS(h.space,h.local):E.getAttribute(h)}return this.each((l==null?h.local?vt:Ut:typeof l=="function"?h.local?Nt:$t:h.local?Dt:mt)(h,l))}function kt(a){return a.ownerDocument&&a.ownerDocument.defaultView||a.document&&a||a.defaultView}function _t(a){return function(){this.style.removeProperty(a)}}function Xt(a,l,h){return function(){this.style.setProperty(a,l,h)}}function Bt(a,l,h){return function(){var E=l.apply(this,arguments);E==null?this.style.removeProperty(a):this.style.setProperty(a,E,h)}}function Qt(a,l,h){return arguments.length>1?this.each((l==null?_t:typeof l=="function"?Bt:Xt)(a,l,h==null?"":h)):zt(this.node(),a)}function zt(a,l){return a.style.getPropertyValue(l)||kt(a).getComputedStyle(a,null).getPropertyValue(l)}function wt(a){return function(){delete this[a]}}function st(a,l){return function(){this[a]=l}}function dt(a,l){return function(){var h=l.apply(this,arguments);h==null?delete this[a]:this[a]=h}}function q(a,l){return arguments.length>1?this.each((l==null?wt:typeof l=="function"?dt:st)(a,l)):this.node()[a]}function At(a){return a.trim().split(/^|\s+/)}function Pt(a){return a.classList||new It(a)}function It(a){this._node=a,this._names=At(a.getAttribute("class")||"")}It.prototype={add:function(a){var l=this._names.indexOf(a);l<0&&(this._names.push(a),this._node.setAttribute("class",this._names.join(" ")))},remove:function(a){var l=this._names.indexOf(a);l>=0&&(this._names.splice(l,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(a){return this._names.indexOf(a)>=0}};function St(a,l){for(var h=Pt(a),E=-1,I=l.length;++E<I;)h.add(l[E])}function er(a,l){for(var h=Pt(a),E=-1,I=l.length;++E<I;)h.remove(l[E])}function or(a){return function(){St(this,a)}}function Y(a){return function(){er(this,a)}}function et(a,l){return function(){(l.apply(this,arguments)?St:er)(this,a)}}function ut(a,l){var h=At(a+"");if(arguments.length<2){for(var E=Pt(this.node()),I=-1,D=h.length;++I<D;)if(!E.contains(h[I]))return!1;return!0}return this.each((typeof l=="function"?et:l?or:Y)(h,l))}function ot(){this.textContent=""}function ct(a){return function(){this.textContent=a}}function rt(a){return function(){var l=a.apply(this,arguments);this.textContent=l==null?"":l}}function Ft(a){return arguments.length?this.each(a==null?ot:(typeof a=="function"?rt:ct)(a)):this.node().textContent}function qt(){this.innerHTML=""}function nt(a){return function(){this.innerHTML=a}}function gt(a){return function(){var l=a.apply(this,arguments);this.innerHTML=l==null?"":l}}function yt(a){return arguments.length?this.each(a==null?qt:(typeof a=="function"?gt:nt)(a)):this.node().innerHTML}function xt(){this.nextSibling&&this.parentNode.appendChild(this)}function bt(){return this.each(xt)}function Zt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function nr(){return this.each(Zt)}function ar(a){return function(){var l=this.ownerDocument,h=this.namespaceURI;return h===Tt&&l.documentElement.namespaceURI===Tt?l.createElement(a):l.createElementNS(h,a)}}function ur(a){return function(){return this.ownerDocument.createElementNS(a.space,a.local)}}function cr(a){var l=Vt(a);return(l.local?ur:ar)(l)}function Ur(a){var l=typeof a=="function"?a:cr(a);return this.select(function(){return this.appendChild(l.apply(this,arguments))})}function gn(){return null}function Dn(a,l){var h=typeof a=="function"?a:cr(a),E=l==null?gn:typeof l=="function"?l:n(l);return this.select(function(){return this.insertBefore(h.apply(this,arguments),E.apply(this,arguments)||null)})}function yn(){var a=this.parentNode;a&&a.removeChild(this)}function qr(){return this.each(yn)}function Br(){var a=this.cloneNode(!1),l=this.parentNode;return l?l.insertBefore(a,this.nextSibling):a}function Fn(){var a=this.cloneNode(!0),l=this.parentNode;return l?l.insertBefore(a,this.nextSibling):a}function Kr(a){return this.select(a?Fn:Br)}function br(a){return arguments.length?this.property("__data__",a):this.node().__data__}function pn(a){return function(l){a.call(this,l,this.__data__)}}function _r(a){return a.trim().split(/^|\s+/).map(function(l){var h="",E=l.indexOf(".");return E>=0&&(h=l.slice(E+1),l=l.slice(0,E)),{type:l,name:h}})}function mr(a){return function(){var l=this.__on;if(l){for(var h=0,E=-1,I=l.length,D;h<I;++h)D=l[h],(!a.type||D.type===a.type)&&D.name===a.name?this.removeEventListener(D.type,D.listener,D.options):l[++E]=D;++E?l.length=E:delete this.__on}}}function Dr(a,l,h){return function(){var E=this.__on,I,D=pn(l);if(E){for(var L=0,V=E.length;L<V;++L)if((I=E[L]).type===a.type&&I.name===a.name){this.removeEventListener(I.type,I.listener,I.options),this.addEventListener(I.type,I.listener=D,I.options=h),I.value=l;return}}this.addEventListener(a.type,D,h),I={type:a.type,name:a.name,value:l,listener:D,options:h},E?E.push(I):this.__on=[I]}}function Ln(a,l,h){var E=_r(a+""),I,D=E.length,L;if(arguments.length<2){var V=this.node().__on;if(V){for(var z=0,_=V.length,tt;z<_;++z)for(I=0,tt=V[z];I<D;++I)if((L=E[I]).type===tt.type&&L.name===tt.name)return tt.value}return}for(V=l?Dr:mr,I=0;I<D;++I)this.each(V(E[I],l,h));return this}function mn(a,l,h){var E=kt(a),I=E.CustomEvent;typeof I=="function"?I=new I(l,h):(I=E.document.createEvent("Event"),h?(I.initEvent(l,h.bubbles,h.cancelable),I.detail=h.detail):I.initEvent(l,!1,!1)),a.dispatchEvent(I)}function K(a,l){return function(){return mn(this,a,l)}}function ft(a,l){return function(){return mn(this,a,l.apply(this,arguments))}}function J(a,l){return this.each((typeof l=="function"?ft:K)(a,l))}function*H(){for(var a=this._groups,l=0,h=a.length;l<h;++l)for(var E=a[l],I=0,D=E.length,L;I<D;++I)(L=E[I])&&(yield L)}var at=[null];function Lt(a,l){this._groups=a,this._parents=l}function Ct(){return new Lt([[document.documentElement]],at)}function ir(){return this}Lt.prototype=Ct.prototype={constructor:Lt,select:e,selectAll:v,selectChild:S,selectChildren:T,filter:R,data:w,enter:A,exit:B,join:b,merge:j,selection:ir,order:W,sort:Q,call:k,nodes:Z,node:ht,size:lt,empty:pt,each:Ot,attr:jt,style:Qt,property:q,classed:ut,text:Ft,html:yt,raise:bt,lower:nr,append:Ur,insert:Dn,remove:qr,clone:Kr,datum:br,on:Ln,dispatch:J,[Symbol.iterator]:H};var sr=Ct,dr={value:()=>{}};function Nr(){for(var a=0,l=arguments.length,h={},E;a<l;++a){if(!(E=arguments[a]+"")||E in h||/[\s.]/.test(E))throw new Error("illegal type: "+E);h[E]=[]}return new it(h)}function it(a){this._=a}function lr(a,l){return a.trim().split(/^|\s+/).map(function(h){var E="",I=h.indexOf(".");if(I>=0&&(E=h.slice(I+1),h=h.slice(0,I)),h&&!l.hasOwnProperty(h))throw new Error("unknown type: "+h);return{type:h,name:E}})}it.prototype=Nr.prototype={constructor:it,on:function(a,l){var h=this._,E=lr(a+"",h),I,D=-1,L=E.length;if(arguments.length<2){for(;++D<L;)if((I=(a=E[D]).type)&&(I=jr(h[I],a.name)))return I;return}if(l!=null&&typeof l!="function")throw new Error("invalid callback: "+l);for(;++D<L;)if(I=(a=E[D]).type)h[I]=ln(h[I],a.name,l);else if(l==null)for(I in h)h[I]=ln(h[I],a.name,null);return this},copy:function(){var a={},l=this._;for(var h in l)a[h]=l[h].slice();return new it(a)},call:function(a,l){if((I=arguments.length-2)>0)for(var h=new Array(I),E=0,I,D;E<I;++E)h[E]=arguments[E+2];if(!this._.hasOwnProperty(a))throw new Error("unknown type: "+a);for(D=this._[a],E=0,I=D.length;E<I;++E)D[E].value.apply(l,h)},apply:function(a,l,h){if(!this._.hasOwnProperty(a))throw new Error("unknown type: "+a);for(var E=this._[a],I=0,D=E.length;I<D;++I)E[I].value.apply(l,h)}};function jr(a,l){for(var h=0,E=a.length,I;h<E;++h)if((I=a[h]).name===l)return I.value}function ln(a,l,h){for(var E=0,I=a.length;E<I;++E)if(a[E].name===l){a[E]=dr,a=a.slice(0,E).concat(a.slice(E+1));break}return h!=null&&a.push({name:l,value:h}),a}var $n=Nr,Yr=0,Xr=0,xn=0,Pe=1e3,Un,Sn,Bn=0,on=0,bn=0,En=typeof performance=="object"&&performance.now?performance:Date,Ce=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(a){setTimeout(a,17)};function oe(){return on||(Ce(Sa),on=En.now()+bn)}function Sa(){on=0}function jn(){this._call=this._time=this._next=null}jn.prototype=Ne.prototype={constructor:jn,restart:function(a,l,h){if(typeof a!="function")throw new TypeError("callback is not a function");h=(h==null?oe():+h)+(l==null?0:+l),!this._next&&Sn!==this&&(Sn?Sn._next=this:Un=this,Sn=this),this._call=a,this._time=h,se()},stop:function(){this._call&&(this._call=null,this._time=1/0,se())}};function Ne(a,l,h){var E=new jn;return E.restart(a,l,h),E}function Ea(){oe(),++Yr;for(var a=Un,l;a;)(l=on-a._time)>=0&&a._call.call(void 0,l),a=a._next;--Yr}function Me(){on=(Bn=En.now())+bn,Yr=Xr=0;try{Ea()}finally{Yr=0,Oa(),on=0}}function Ia(){var a=En.now(),l=a-Bn;l>Pe&&(bn-=l,Bn=a)}function Oa(){for(var a,l=Un,h,E=1/0;l;)l._call?(E>l._time&&(E=l._time),a=l,l=l._next):(h=l._next,l._next=null,l=a?a._next=h:Un=h);Sn=a,se(E)}function se(a){if(!Yr){Xr&&(Xr=clearTimeout(Xr));var l=a-on;l>24?(a<1/0&&(Xr=setTimeout(Me,a-En.now()-bn)),xn&&(xn=clearInterval(xn))):(xn||(Bn=En.now(),xn=setInterval(Ia,Pe)),Yr=1,Ce(Me))}}function De(a,l,h){var E=new jn;return l=l==null?0:+l,E.restart(I=>{E.stop(),a(I+l)},l,h),E}var Ta=$n("start","end","cancel","interrupt"),Ra=[],Fe=0,Le=1,ie=2,wn=3,$e=4,ue=5,Gn=6;function Vn(a,l,h,E,I,D){var L=a.__transition;if(!L)a.__transition={};else if(h in L)return;Aa(a,h,{name:l,index:E,group:I,on:Ta,tween:Ra,time:D.time,delay:D.delay,duration:D.duration,ease:D.ease,timer:null,state:Fe})}function fe(a,l){var h=wr(a,l);if(h.state>Fe)throw new Error("too late; already scheduled");return h}function Hr(a,l){var h=wr(a,l);if(h.state>wn)throw new Error("too late; already running");return h}function wr(a,l){var h=a.__transition;if(!h||!(h=h[l]))throw new Error("transition not found");return h}function Aa(a,l,h){var E=a.__transition,I;E[l]=h,h.timer=Ne(D,0,h.time);function D(_){h.state=Le,h.timer.restart(L,h.delay,h.time),h.delay<=_&&L(_-h.delay)}function L(_){var tt,Rt,Mt,Wt;if(h.state!==Le)return z();for(tt in E)if(Wt=E[tt],Wt.name===h.name){if(Wt.state===wn)return De(L);Wt.state===$e?(Wt.state=Gn,Wt.timer.stop(),Wt.on.call("interrupt",a,a.__data__,Wt.index,Wt.group),delete E[tt]):+tt<l&&(Wt.state=Gn,Wt.timer.stop(),Wt.on.call("cancel",a,a.__data__,Wt.index,Wt.group),delete E[tt])}if(De(function(){h.state===wn&&(h.state=$e,h.timer.restart(V,h.delay,h.time),V(_))}),h.state=ie,h.on.call("start",a,a.__data__,h.index,h.group),h.state===ie){for(h.state=wn,I=new Array(Mt=h.tween.length),tt=0,Rt=-1;tt<Mt;++tt)(Wt=h.tween[tt].value.call(a,a.__data__,h.index,h.group))&&(I[++Rt]=Wt);I.length=Rt+1}}function V(_){for(var tt=_<h.duration?h.ease.call(null,_/h.duration):(h.timer.restart(z),h.state=ue,1),Rt=-1,Mt=I.length;++Rt<Mt;)I[Rt].call(a,tt);h.state===ue&&(h.on.call("end",a,a.__data__,h.index,h.group),z())}function z(){h.state=Gn,h.timer.stop(),delete E[l];for(var _ in E)return;delete a.__transition}}function Pa(a,l){var h=a.__transition,E,I,D=!0,L;if(h){l=l==null?null:l+"";for(L in h){if((E=h[L]).name!==l){D=!1;continue}I=E.state>ie&&E.state<ue,E.state=Gn,E.timer.stop(),E.on.call(I?"interrupt":"cancel",a,a.__data__,E.index,E.group),delete h[L]}D&&delete a.__transition}}function Ca(a){return this.each(function(){Pa(this,a)})}function tn(a,l){return a=+a,l=+l,function(h){return a*(1-h)+l*h}}var Ue=180/Math.PI,le={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Be(a,l,h,E,I,D){var L,V,z;return(L=Math.sqrt(a*a+l*l))&&(a/=L,l/=L),(z=a*h+l*E)&&(h-=a*z,E-=l*z),(V=Math.sqrt(h*h+E*E))&&(h/=V,E/=V,z/=V),a*E<l*h&&(a=-a,l=-l,z=-z,L=-L),{translateX:I,translateY:D,rotate:Math.atan2(l,a)*Ue,skewX:Math.atan(z)*Ue,scaleX:L,scaleY:V}}var Hn;function Na(a){const l=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(a+"");return l.isIdentity?le:Be(l.a,l.b,l.c,l.d,l.e,l.f)}function Ma(a){return a==null||(Hn||(Hn=document.createElementNS("http://www.w3.org/2000/svg","g")),Hn.setAttribute("transform",a),!(a=Hn.transform.baseVal.consolidate()))?le:(a=a.matrix,Be(a.a,a.b,a.c,a.d,a.e,a.f))}function be(a,l,h,E){function I(_){return _.length?_.pop()+" ":""}function D(_,tt,Rt,Mt,Wt,fr){if(_!==Rt||tt!==Mt){var xr=Wt.push("translate(",null,l,null,h);fr.push({i:xr-4,x:tn(_,Rt)},{i:xr-2,x:tn(tt,Mt)})}else(Rt||Mt)&&Wt.push("translate("+Rt+l+Mt+h)}function L(_,tt,Rt,Mt){_!==tt?(_-tt>180?tt+=360:tt-_>180&&(_+=360),Mt.push({i:Rt.push(I(Rt)+"rotate(",null,E)-2,x:tn(_,tt)})):tt&&Rt.push(I(Rt)+"rotate("+tt+E)}function V(_,tt,Rt,Mt){_!==tt?Mt.push({i:Rt.push(I(Rt)+"skewX(",null,E)-2,x:tn(_,tt)}):tt&&Rt.push(I(Rt)+"skewX("+tt+E)}function z(_,tt,Rt,Mt,Wt,fr){if(_!==Rt||tt!==Mt){var xr=Wt.push(I(Wt)+"scale(",null,",",null,")");fr.push({i:xr-4,x:tn(_,Rt)},{i:xr-2,x:tn(tt,Mt)})}else(Rt!==1||Mt!==1)&&Wt.push(I(Wt)+"scale("+Rt+","+Mt+")")}return function(_,tt){var Rt=[],Mt=[];return _=a(_),tt=a(tt),D(_.translateX,_.translateY,tt.translateX,tt.translateY,Rt,Mt),L(_.rotate,tt.rotate,Rt,Mt),V(_.skewX,tt.skewX,Rt,Mt),z(_.scaleX,_.scaleY,tt.scaleX,tt.scaleY,Rt,Mt),_=tt=null,function(Wt){for(var fr=-1,xr=Mt.length,Et;++fr<xr;)Rt[(Et=Mt[fr]).i]=Et.x(Wt);return Rt.join("")}}}var Da=be(Na,"px, ","px)","deg)"),Fa=be(Ma,", ",")",")");function La(a,l){var h,E;return function(){var I=Hr(this,a),D=I.tween;if(D!==h){E=h=D;for(var L=0,V=E.length;L<V;++L)if(E[L].name===l){E=E.slice(),E.splice(L,1);break}}I.tween=E}}function $a(a,l,h){var E,I;if(typeof h!="function")throw new Error;return function(){var D=Hr(this,a),L=D.tween;if(L!==E){I=(E=L).slice();for(var V={name:l,value:h},z=0,_=I.length;z<_;++z)if(I[z].name===l){I[z]=V;break}z===_&&I.push(V)}D.tween=I}}function Ua(a,l){var h=this._id;if(a+="",arguments.length<2){for(var E=wr(this.node(),h).tween,I=0,D=E.length,L;I<D;++I)if((L=E[I]).name===a)return L.value;return null}return this.each((l==null?La:$a)(h,a,l))}function ve(a,l,h){var E=a._id;return a.each(function(){var I=Hr(this,E);(I.value||(I.value={}))[l]=h.apply(this,arguments)}),function(I){return wr(I,E).value[l]}}function ce(a,l,h){a.prototype=l.prototype=h,h.constructor=a}function je(a,l){var h=Object.create(a.prototype);for(var E in l)h[E]=l[E];return h}function In(){}var On=.7,Wn=1/On,vn="\\s*([+-]?\\d+)\\s*",Tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ba=/^#([0-9a-f]{3,8})$/,ba=new RegExp(`^rgb\\(${vn},${vn},${vn}\\)$`),ja=new RegExp(`^rgb\\(${Wr},${Wr},${Wr}\\)$`),wa=new RegExp(`^rgba\\(${vn},${vn},${vn},${Tn}\\)$`),Ga=new RegExp(`^rgba\\(${Wr},${Wr},${Wr},${Tn}\\)$`),Va=new RegExp(`^hsl\\(${Tn},${Wr},${Wr}\\)$`),Ha=new RegExp(`^hsla\\(${Tn},${Wr},${Wr},${Tn}\\)$`),we={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};ce(In,Rn,{copy(a){return Object.assign(new this.constructor,this,a)},displayable(){return this.rgb().displayable()},hex:Ge,formatHex:Ge,formatHex8:Wa,formatHsl:za,formatRgb:Ve,toString:Ve});function Ge(){return this.rgb().formatHex()}function Wa(){return this.rgb().formatHex8()}function za(){return Ye(this).formatHsl()}function Ve(){return this.rgb().formatRgb()}function Rn(a){var l,h;return a=(a+"").trim().toLowerCase(),(l=Ba.exec(a))?(h=l[1].length,l=parseInt(l[1],16),h===6?He(l):h===3?new Fr(l>>8&15|l>>4&240,l>>4&15|l&240,(l&15)<<4|l&15,1):h===8?zn(l>>24&255,l>>16&255,l>>8&255,(l&255)/255):h===4?zn(l>>12&15|l>>8&240,l>>8&15|l>>4&240,l>>4&15|l&240,((l&15)<<4|l&15)/255):null):(l=ba.exec(a))?new Fr(l[1],l[2],l[3],1):(l=ja.exec(a))?new Fr(l[1]*255/100,l[2]*255/100,l[3]*255/100,1):(l=wa.exec(a))?zn(l[1],l[2],l[3],l[4]):(l=Ga.exec(a))?zn(l[1]*255/100,l[2]*255/100,l[3]*255/100,l[4]):(l=Va.exec(a))?Ke(l[1],l[2]/100,l[3]/100,1):(l=Ha.exec(a))?Ke(l[1],l[2]/100,l[3]/100,l[4]):we.hasOwnProperty(a)?He(we[a]):a==="transparent"?new Fr(NaN,NaN,NaN,0):null}function He(a){return new Fr(a>>16&255,a>>8&255,a&255,1)}function zn(a,l,h,E){return E<=0&&(a=l=h=NaN),new Fr(a,l,h,E)}function Ka(a){return a instanceof In||(a=Rn(a)),a?(a=a.rgb(),new Fr(a.r,a.g,a.b,a.opacity)):new Fr}function Kn(a,l,h,E){return arguments.length===1?Ka(a):new Fr(a,l,h,E==null?1:E)}function Fr(a,l,h,E){this.r=+a,this.g=+l,this.b=+h,this.opacity=+E}ce(Fr,Kn,je(In,{brighter(a){return a=a==null?Wn:Math.pow(Wn,a),new Fr(this.r*a,this.g*a,this.b*a,this.opacity)},darker(a){return a=a==null?On:Math.pow(On,a),new Fr(this.r*a,this.g*a,this.b*a,this.opacity)},rgb(){return this},clamp(){return new Fr(sn(this.r),sn(this.g),sn(this.b),Yn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:We,formatHex:We,formatHex8:Ya,formatRgb:ze,toString:ze}));function We(){return`#${un(this.r)}${un(this.g)}${un(this.b)}`}function Ya(){return`#${un(this.r)}${un(this.g)}${un(this.b)}${un((isNaN(this.opacity)?1:this.opacity)*255)}`}function ze(){const a=Yn(this.opacity);return`${a===1?"rgb(":"rgba("}${sn(this.r)}, ${sn(this.g)}, ${sn(this.b)}${a===1?")":`, ${a})`}`}function Yn(a){return isNaN(a)?1:Math.max(0,Math.min(1,a))}function sn(a){return Math.max(0,Math.min(255,Math.round(a)||0))}function un(a){return a=sn(a),(a<16?"0":"")+a.toString(16)}function Ke(a,l,h,E){return E<=0?a=l=h=NaN:h<=0||h>=1?a=l=NaN:l<=0&&(a=NaN),new Gr(a,l,h,E)}function Ye(a){if(a instanceof Gr)return new Gr(a.h,a.s,a.l,a.opacity);if(a instanceof In||(a=Rn(a)),!a)return new Gr;if(a instanceof Gr)return a;a=a.rgb();var l=a.r/255,h=a.g/255,E=a.b/255,I=Math.min(l,h,E),D=Math.max(l,h,E),L=NaN,V=D-I,z=(D+I)/2;return V?(l===D?L=(h-E)/V+(h<E)*6:h===D?L=(E-l)/V+2:L=(l-h)/V+4,V/=z<.5?D+I:2-D-I,L*=60):V=z>0&&z<1?0:L,new Gr(L,V,z,a.opacity)}function Xa(a,l,h,E){return arguments.length===1?Ye(a):new Gr(a,l,h,E==null?1:E)}function Gr(a,l,h,E){this.h=+a,this.s=+l,this.l=+h,this.opacity=+E}ce(Gr,Xa,je(In,{brighter(a){return a=a==null?Wn:Math.pow(Wn,a),new Gr(this.h,this.s,this.l*a,this.opacity)},darker(a){return a=a==null?On:Math.pow(On,a),new Gr(this.h,this.s,this.l*a,this.opacity)},rgb(){var a=this.h%360+(this.h<0)*360,l=isNaN(a)||isNaN(this.s)?0:this.s,h=this.l,E=h+(h<.5?h:1-h)*l,I=2*h-E;return new Fr(de(a>=240?a-240:a+120,I,E),de(a,I,E),de(a<120?a+240:a-120,I,E),this.opacity)},clamp(){return new Gr(Xe(this.h),Xn(this.s),Xn(this.l),Yn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const a=Yn(this.opacity);return`${a===1?"hsl(":"hsla("}${Xe(this.h)}, ${Xn(this.s)*100}%, ${Xn(this.l)*100}%${a===1?")":`, ${a})`}`}}));function Xe(a){return a=(a||0)%360,a<0?a+360:a}function Xn(a){return Math.max(0,Math.min(1,a||0))}function de(a,l,h){return(a<60?l+(h-l)*a/60:a<180?h:a<240?l+(h-l)*(240-a)/60:l)*255}function Je(a,l,h,E,I){var D=a*a,L=D*a;return((1-3*a+3*D-L)*l+(4-6*D+3*L)*h+(1+3*a+3*D-3*L)*E+L*I)/6}function Ja(a){var l=a.length-1;return function(h){var E=h<=0?h=0:h>=1?(h=1,l-1):Math.floor(h*l),I=a[E],D=a[E+1],L=E>0?a[E-1]:2*I-D,V=E<l-1?a[E+2]:2*D-I;return Je((h-E/l)*l,L,I,D,V)}}function Qa(a){var l=a.length;return function(h){var E=Math.floor(((h%=1)<0?++h:h)*l),I=a[(E+l-1)%l],D=a[E%l],L=a[(E+1)%l],V=a[(E+2)%l];return Je((h-E/l)*l,I,D,L,V)}}var Qe=a=>()=>a;function Ze(a,l){return function(h){return a+h*l}}function Za(a,l,h){return a=Math.pow(a,h),l=Math.pow(l,h)-a,h=1/h,function(E){return Math.pow(a+E*l,h)}}function Gs(a,l){var h=l-a;return h?Ze(a,h>180||h<-180?h-360*Math.round(h/360):h):constant(isNaN(a)?l:a)}function ka(a){return(a=+a)==1?ke:function(l,h){return h-l?Za(l,h,a):Qe(isNaN(l)?h:l)}}function ke(a,l){var h=l-a;return h?Ze(a,h):Qe(isNaN(a)?l:a)}var qe=function a(l){var h=ka(l);function E(I,D){var L=h((I=Kn(I)).r,(D=Kn(D)).r),V=h(I.g,D.g),z=h(I.b,D.b),_=ke(I.opacity,D.opacity);return function(tt){return I.r=L(tt),I.g=V(tt),I.b=z(tt),I.opacity=_(tt),I+""}}return E.gamma=a,E}(1);function _e(a){return function(l){var h=l.length,E=new Array(h),I=new Array(h),D=new Array(h),L,V;for(L=0;L<h;++L)V=Kn(l[L]),E[L]=V.r||0,I[L]=V.g||0,D[L]=V.b||0;return E=a(E),I=a(I),D=a(D),V.opacity=1,function(z){return V.r=E(z),V.g=I(z),V.b=D(z),V+""}}}var Vs=_e(Ja),Hs=_e(Qa),he=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ge=new RegExp(he.source,"g");function qa(a){return function(){return a}}function _a(a){return function(l){return a(l)+""}}function to(a,l){var h=he.lastIndex=ge.lastIndex=0,E,I,D,L=-1,V=[],z=[];for(a=a+"",l=l+"";(E=he.exec(a))&&(I=ge.exec(l));)(D=I.index)>h&&(D=l.slice(h,D),V[L]?V[L]+=D:V[++L]=D),(E=E[0])===(I=I[0])?V[L]?V[L]+=I:V[++L]=I:(V[++L]=null,z.push({i:L,x:tn(E,I)})),h=ge.lastIndex;return h<l.length&&(D=l.slice(h),V[L]?V[L]+=D:V[++L]=D),V.length<2?z[0]?_a(z[0].x):qa(l):(l=z.length,function(_){for(var tt=0,Rt;tt<l;++tt)V[(Rt=z[tt]).i]=Rt.x(_);return V.join("")})}function ta(a,l){var h;return(typeof l=="number"?tn:l instanceof Rn?qe:(h=Rn(l))?(l=h,qe):to)(a,l)}function ro(a){return function(){this.removeAttribute(a)}}function no(a){return function(){this.removeAttributeNS(a.space,a.local)}}function eo(a,l,h){var E,I=h+"",D;return function(){var L=this.getAttribute(a);return L===I?null:L===E?D:D=l(E=L,h)}}function ao(a,l,h){var E,I=h+"",D;return function(){var L=this.getAttributeNS(a.space,a.local);return L===I?null:L===E?D:D=l(E=L,h)}}function oo(a,l,h){var E,I,D;return function(){var L,V=h(this),z;return V==null?void this.removeAttribute(a):(L=this.getAttribute(a),z=V+"",L===z?null:L===E&&z===I?D:(I=z,D=l(E=L,V)))}}function so(a,l,h){var E,I,D;return function(){var L,V=h(this),z;return V==null?void this.removeAttributeNS(a.space,a.local):(L=this.getAttributeNS(a.space,a.local),z=V+"",L===z?null:L===E&&z===I?D:(I=z,D=l(E=L,V)))}}function io(a,l){var h=Vt(a),E=h==="transform"?Fa:ta;return this.attrTween(a,typeof l=="function"?(h.local?so:oo)(h,E,ve(this,"attr."+a,l)):l==null?(h.local?no:ro)(h):(h.local?ao:eo)(h,E,l))}function uo(a,l){return function(h){this.setAttribute(a,l.call(this,h))}}function fo(a,l){return function(h){this.setAttributeNS(a.space,a.local,l.call(this,h))}}function lo(a,l){var h,E;function I(){var D=l.apply(this,arguments);return D!==E&&(h=(E=D)&&fo(a,D)),h}return I._value=l,I}function vo(a,l){var h,E;function I(){var D=l.apply(this,arguments);return D!==E&&(h=(E=D)&&uo(a,D)),h}return I._value=l,I}function co(a,l){var h="attr."+a;if(arguments.length<2)return(h=this.tween(h))&&h._value;if(l==null)return this.tween(h,null);if(typeof l!="function")throw new Error;var E=Vt(a);return this.tween(h,(E.local?lo:vo)(E,l))}function ho(a,l){return function(){fe(this,a).delay=+l.apply(this,arguments)}}function go(a,l){return l=+l,function(){fe(this,a).delay=l}}function yo(a){var l=this._id;return arguments.length?this.each((typeof a=="function"?ho:go)(l,a)):wr(this.node(),l).delay}function po(a,l){return function(){Hr(this,a).duration=+l.apply(this,arguments)}}function mo(a,l){return l=+l,function(){Hr(this,a).duration=l}}function xo(a){var l=this._id;return arguments.length?this.each((typeof a=="function"?po:mo)(l,a)):wr(this.node(),l).duration}function So(a,l){if(typeof l!="function")throw new Error;return function(){Hr(this,a).ease=l}}function Eo(a){var l=this._id;return arguments.length?this.each(So(l,a)):wr(this.node(),l).ease}function Io(a,l){return function(){var h=l.apply(this,arguments);if(typeof h!="function")throw new Error;Hr(this,a).ease=h}}function Oo(a){if(typeof a!="function")throw new Error;return this.each(Io(this._id,a))}function To(a){typeof a!="function"&&(a=c(a));for(var l=this._groups,h=l.length,E=new Array(h),I=0;I<h;++I)for(var D=l[I],L=D.length,V=E[I]=[],z,_=0;_<L;++_)(z=D[_])&&a.call(z,z.__data__,_,D)&&V.push(z);return new Jr(E,this._parents,this._name,this._id)}function Ro(a){if(a._id!==this._id)throw new Error;for(var l=this._groups,h=a._groups,E=l.length,I=h.length,D=Math.min(E,I),L=new Array(E),V=0;V<D;++V)for(var z=l[V],_=h[V],tt=z.length,Rt=L[V]=new Array(tt),Mt,Wt=0;Wt<tt;++Wt)(Mt=z[Wt]||_[Wt])&&(Rt[Wt]=Mt);for(;V<E;++V)L[V]=l[V];return new Jr(L,this._parents,this._name,this._id)}function Ao(a){return(a+"").trim().split(/^|\s+/).every(function(l){var h=l.indexOf(".");return h>=0&&(l=l.slice(0,h)),!l||l==="start"})}function Po(a,l,h){var E,I,D=Ao(l)?fe:Hr;return function(){var L=D(this,a),V=L.on;V!==E&&(I=(E=V).copy()).on(l,h),L.on=I}}function Co(a,l){var h=this._id;return arguments.length<2?wr(this.node(),h).on.on(a):this.each(Po(h,a,l))}function No(a){return function(){var l=this.parentNode;for(var h in this.__transition)if(+h!==a)return;l&&l.removeChild(this)}}function Mo(){return this.on("end.remove",No(this._id))}function Do(a){var l=this._name,h=this._id;typeof a!="function"&&(a=n(a));for(var E=this._groups,I=E.length,D=new Array(I),L=0;L<I;++L)for(var V=E[L],z=V.length,_=D[L]=new Array(z),tt,Rt,Mt=0;Mt<z;++Mt)(tt=V[Mt])&&(Rt=a.call(tt,tt.__data__,Mt,V))&&("__data__"in tt&&(Rt.__data__=tt.__data__),_[Mt]=Rt,Vn(_[Mt],l,h,Mt,_,wr(tt,h)));return new Jr(D,this._parents,l,h)}function Fo(a){var l=this._name,h=this._id;typeof a!="function"&&(a=u(a));for(var E=this._groups,I=E.length,D=[],L=[],V=0;V<I;++V)for(var z=E[V],_=z.length,tt,Rt=0;Rt<_;++Rt)if(tt=z[Rt]){for(var Mt=a.call(tt,tt.__data__,Rt,z),Wt,fr=wr(tt,h),xr=0,Et=Mt.length;xr<Et;++xr)(Wt=Mt[xr])&&Vn(Wt,l,h,xr,Mt,fr);D.push(Mt),L.push(tt)}return new Jr(D,L,l,h)}var Lo=sr.prototype.constructor;function $o(){return new Lo(this._groups,this._parents)}function Uo(a,l){var h,E,I;return function(){var D=zt(this,a),L=(this.style.removeProperty(a),zt(this,a));return D===L?null:D===h&&L===E?I:I=l(h=D,E=L)}}function ra(a){return function(){this.style.removeProperty(a)}}function Bo(a,l,h){var E,I=h+"",D;return function(){var L=zt(this,a);return L===I?null:L===E?D:D=l(E=L,h)}}function bo(a,l,h){var E,I,D;return function(){var L=zt(this,a),V=h(this),z=V+"";return V==null&&(z=V=(this.style.removeProperty(a),zt(this,a))),L===z?null:L===E&&z===I?D:(I=z,D=l(E=L,V))}}function jo(a,l){var h,E,I,D="style."+l,L="end."+D,V;return function(){var z=Hr(this,a),_=z.on,tt=z.value[D]==null?V||(V=ra(l)):void 0;(_!==h||I!==tt)&&(E=(h=_).copy()).on(L,I=tt),z.on=E}}function wo(a,l,h){var E=(a+="")=="transform"?Da:ta;return l==null?this.styleTween(a,Uo(a,E)).on("end.style."+a,ra(a)):typeof l=="function"?this.styleTween(a,bo(a,E,ve(this,"style."+a,l))).each(jo(this._id,a)):this.styleTween(a,Bo(a,E,l),h).on("end.style."+a,null)}function Go(a,l,h){return function(E){this.style.setProperty(a,l.call(this,E),h)}}function Vo(a,l,h){var E,I;function D(){var L=l.apply(this,arguments);return L!==I&&(E=(I=L)&&Go(a,L,h)),E}return D._value=l,D}function Ho(a,l,h){var E="style."+(a+="");if(arguments.length<2)return(E=this.tween(E))&&E._value;if(l==null)return this.tween(E,null);if(typeof l!="function")throw new Error;return this.tween(E,Vo(a,l,h==null?"":h))}function Wo(a){return function(){this.textContent=a}}function zo(a){return function(){var l=a(this);this.textContent=l==null?"":l}}function Ko(a){return this.tween("text",typeof a=="function"?zo(ve(this,"text",a)):Wo(a==null?"":a+""))}function Yo(a){return function(l){this.textContent=a.call(this,l)}}function Xo(a){var l,h;function E(){var I=a.apply(this,arguments);return I!==h&&(l=(h=I)&&Yo(I)),l}return E._value=a,E}function Jo(a){var l="text";if(arguments.length<1)return(l=this.tween(l))&&l._value;if(a==null)return this.tween(l,null);if(typeof a!="function")throw new Error;return this.tween(l,Xo(a))}function Qo(){for(var a=this._name,l=this._id,h=na(),E=this._groups,I=E.length,D=0;D<I;++D)for(var L=E[D],V=L.length,z,_=0;_<V;++_)if(z=L[_]){var tt=wr(z,l);Vn(z,a,h,_,L,{time:tt.time+tt.delay+tt.duration,delay:0,duration:tt.duration,ease:tt.ease})}return new Jr(E,this._parents,a,h)}function Zo(){var a,l,h=this,E=h._id,I=h.size();return new Promise(function(D,L){var V={value:L},z={value:function(){--I===0&&D()}};h.each(function(){var _=Hr(this,E),tt=_.on;tt!==a&&(l=(a=tt).copy(),l._.cancel.push(V),l._.interrupt.push(V),l._.end.push(z)),_.on=l}),I===0&&D()})}var ko=0;function Jr(a,l,h,E){this._groups=a,this._parents=l,this._name=h,this._id=E}function qo(a){return sr().transition(a)}function na(){return++ko}var Qr=sr.prototype;Jr.prototype=qo.prototype={constructor:Jr,select:Do,selectAll:Fo,selectChild:Qr.selectChild,selectChildren:Qr.selectChildren,filter:To,merge:Ro,selection:$o,transition:Qo,call:Qr.call,nodes:Qr.nodes,node:Qr.node,size:Qr.size,empty:Qr.empty,each:Qr.each,on:Co,attr:io,attrTween:co,style:wo,styleTween:Ho,text:Ko,textTween:Jo,remove:Mo,tween:Ua,delay:yo,duration:xo,ease:Eo,easeVarying:Oo,end:Zo,[Symbol.iterator]:Qr[Symbol.iterator]};function Ws(a){return a*a*a}function zs(a){return--a*a*a+1}function _o(a){return((a*=2)<=1?a*a*a:(a-=2)*a*a+2)/2}var ts={time:null,delay:0,duration:250,ease:_o};function rs(a,l){for(var h;!(h=a.__transition)||!(h=h[l]);)if(!(a=a.parentNode))throw new Error(`transition ${l} not found`);return h}function ns(a){var l,h;a instanceof Jr?(l=a._id,a=a._name):(l=na(),(h=ts).time=oe(),a=a==null?null:a+"");for(var E=this._groups,I=E.length,D=0;D<I;++D)for(var L=E[D],V=L.length,z,_=0;_<V;++_)(z=L[_])&&Vn(z,a,l,_,L,h||rs(z,l));return new Jr(E,this._parents,a,l)}sr.prototype.interrupt=Ca,sr.prototype.transition=ns;var ea={name:"drag"},ye={name:"space"},cn={name:"handle"},dn={name:"center"};const{abs:aa,max:Pr,min:Cr}=Math;function oa(a){return[+a[0],+a[1]]}function pe(a){return[oa(a[0]),oa(a[1])]}var Jn={name:"x",handles:["w","e"].map(An),input:function(a,l){return a==null?null:[[+a[0],l[0][1]],[+a[1],l[1][1]]]},output:function(a){return a&&[a[0][0],a[1][0]]}},Qn={name:"y",handles:["n","s"].map(An),input:function(a,l){return a==null?null:[[l[0][0],+a[0]],[l[1][0],+a[1]]]},output:function(a){return a&&[a[0][1],a[1][1]]}},es={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(An),input:function(a){return a==null?null:pe(a)},output:function(a){return a}},Zr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},sa={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},ia={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},as={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},os={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function An(a){return{type:a}}function ss(a){return!a.ctrlKey&&!a.button}function is(){var a=this.ownerSVGElement||this;return a.hasAttribute("viewBox")?(a=a.viewBox.baseVal,[[a.x,a.y],[a.x+a.width,a.y+a.height]]):[[0,0],[a.width.baseVal.value,a.height.baseVal.value]]}function us(){return navigator.maxTouchPoints||"ontouchstart"in this}function me(a){for(;!a.__brush;)if(!(a=a.parentNode))return;return a.__brush}function fs(a){return a[0][0]===a[1][0]||a[0][1]===a[1][1]}function Ks(a){var l=a.__brush;return l?l.dim.output(l.selection):null}function Ys(){return xe(Jn)}function Xs(){return xe(Qn)}function Js(){return xe(es)}function xe(a){var l=is,h=ss,E=us,I=!0,D=dispatch("start","brush","end"),L=6,V;function z(Et){var Ht=Et.property("__brush",xr).selectAll(".overlay").data([An("overlay")]);Ht.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Zr.overlay).merge(Ht).each(function(){var Gt=me(this).extent;select(this).attr("x",Gt[0][0]).attr("y",Gt[0][1]).attr("width",Gt[1][0]-Gt[0][0]).attr("height",Gt[1][1]-Gt[0][1])}),Et.selectAll(".selection").data([An("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Zr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var Yt=Et.selectAll(".handle").data(a.handles,function(Gt){return Gt.type});Yt.exit().remove(),Yt.enter().append("rect").attr("class",function(Gt){return"handle handle--"+Gt.type}).attr("cursor",function(Gt){return Zr[Gt.type]}),Et.each(_).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",Mt).filter(E).on("touchstart.brush",Mt).on("touchmove.brush",Wt).on("touchend.brush touchcancel.brush",fr).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}z.move=function(Et,Ht,Yt){Et.tween?Et.on("start.brush",function(Gt){tt(this,arguments).beforestart().start(Gt)}).on("interrupt.brush end.brush",function(Gt){tt(this,arguments).end(Gt)}).tween("brush",function(){var Gt=this,tr=Gt.__brush,rr=tt(Gt,arguments),Mr=tr.selection,zr=a.input(typeof Ht=="function"?Ht.apply(this,arguments):Ht,tr.extent),hr=interpolate(Mr,zr);function Vr(vr){tr.selection=vr===1&&zr===null?null:hr(vr),_.call(Gt),rr.brush()}return Mr!==null&&zr!==null?Vr:Vr(1)}):Et.each(function(){var Gt=this,tr=arguments,rr=Gt.__brush,Mr=a.input(typeof Ht=="function"?Ht.apply(Gt,tr):Ht,rr.extent),zr=tt(Gt,tr).beforestart();interrupt(Gt),rr.selection=Mr===null?null:Mr,_.call(Gt),zr.start(Yt).brush(Yt).end(Yt)})},z.clear=function(Et,Ht){z.move(Et,null,Ht)};function _(){var Et=select(this),Ht=me(this).selection;Ht?(Et.selectAll(".selection").style("display",null).attr("x",Ht[0][0]).attr("y",Ht[0][1]).attr("width",Ht[1][0]-Ht[0][0]).attr("height",Ht[1][1]-Ht[0][1]),Et.selectAll(".handle").style("display",null).attr("x",function(Yt){return Yt.type[Yt.type.length-1]==="e"?Ht[1][0]-L/2:Ht[0][0]-L/2}).attr("y",function(Yt){return Yt.type[0]==="s"?Ht[1][1]-L/2:Ht[0][1]-L/2}).attr("width",function(Yt){return Yt.type==="n"||Yt.type==="s"?Ht[1][0]-Ht[0][0]+L:L}).attr("height",function(Yt){return Yt.type==="e"||Yt.type==="w"?Ht[1][1]-Ht[0][1]+L:L})):Et.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function tt(Et,Ht,Yt){var Gt=Et.__brush.emitter;return Gt&&(!Yt||!Gt.clean)?Gt:new Rt(Et,Ht,Yt)}function Rt(Et,Ht,Yt){this.that=Et,this.args=Ht,this.state=Et.__brush,this.active=0,this.clean=Yt}Rt.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(Et,Ht){return this.starting?(this.starting=!1,this.emit("start",Et,Ht)):this.emit("brush",Et),this},brush:function(Et,Ht){return this.emit("brush",Et,Ht),this},end:function(Et,Ht){return--this.active===0&&(delete this.state.emitter,this.emit("end",Et,Ht)),this},emit:function(Et,Ht,Yt){var Gt=select(this.that).datum();D.call(Et,this.that,new BrushEvent(Et,{sourceEvent:Ht,target:z,selection:a.output(this.state.selection),mode:Yt,dispatch:D}),Gt)}};function Mt(Et){if(V&&!Et.touches||!h.apply(this,arguments))return;var Ht=this,Yt=Et.target.__data__.type,Gt=(I&&Et.metaKey?Yt="overlay":Yt)==="selection"?ea:I&&Et.altKey?dn:cn,tr=a===Qn?null:as[Yt],rr=a===Jn?null:os[Yt],Mr=me(Ht),zr=Mr.extent,hr=Mr.selection,Vr=zr[0][0],vr,Sr,rn=zr[0][1],Er,Ir,nn=zr[1][0],Or,Tr,en=zr[1][1],Rr,Ar,gr=0,yr=0,Re,re=tr&&rr&&I&&Et.shiftKey,ne,ee,Lr=Array.from(Et.touches||[Et],Jt=>{const pr=Jt.identifier;return Jt=pointer(Jt,Ht),Jt.point0=Jt.slice(),Jt.identifier=pr,Jt});interrupt(Ht);var Cn=tt(Ht,arguments,!0).beforestart();if(Yt==="overlay"){hr&&(Re=!0);const Jt=[Lr[0],Lr[1]||Lr[0]];Mr.selection=hr=[[vr=a===Qn?Vr:Cr(Jt[0][0],Jt[1][0]),Er=a===Jn?rn:Cr(Jt[0][1],Jt[1][1])],[Or=a===Qn?nn:Pr(Jt[0][0],Jt[1][0]),Rr=a===Jn?en:Pr(Jt[0][1],Jt[1][1])]],Lr.length>1&&fn(Et)}else vr=hr[0][0],Er=hr[0][1],Or=hr[1][0],Rr=hr[1][1];Sr=vr,Ir=Er,Tr=Or,Ar=Rr;var ya=select(Ht).attr("pointer-events","none"),Nn=ya.selectAll(".overlay").attr("cursor",Zr[Yt]);if(Et.touches)Cn.moved=ma,Cn.ended=xa;else{var pa=select(Et.view).on("mousemove.brush",ma,!0).on("mouseup.brush",xa,!0);I&&pa.on("keydown.brush",js,!0).on("keyup.brush",ws,!0),dragDisable(Et.view)}_.call(Ht),Cn.start(Et,Gt.name);function ma(Jt){for(const pr of Jt.changedTouches||[Jt])for(const Mn of Lr)Mn.identifier===pr.identifier&&(Mn.cur=pointer(pr,Ht));if(re&&!ne&&!ee&&Lr.length===1){const pr=Lr[0];aa(pr.cur[0]-pr[0])>aa(pr.cur[1]-pr[1])?ee=!0:ne=!0}for(const pr of Lr)pr.cur&&(pr[0]=pr.cur[0],pr[1]=pr.cur[1]);Re=!0,noevent(Jt),fn(Jt)}function fn(Jt){const pr=Lr[0],Mn=pr.point0;var an;switch(gr=pr[0]-Mn[0],yr=pr[1]-Mn[1],Gt){case ye:case ea:{tr&&(gr=Pr(Vr-vr,Cr(nn-Or,gr)),Sr=vr+gr,Tr=Or+gr),rr&&(yr=Pr(rn-Er,Cr(en-Rr,yr)),Ir=Er+yr,Ar=Rr+yr);break}case cn:{Lr[1]?(tr&&(Sr=Pr(Vr,Cr(nn,Lr[0][0])),Tr=Pr(Vr,Cr(nn,Lr[1][0])),tr=1),rr&&(Ir=Pr(rn,Cr(en,Lr[0][1])),Ar=Pr(rn,Cr(en,Lr[1][1])),rr=1)):(tr<0?(gr=Pr(Vr-vr,Cr(nn-vr,gr)),Sr=vr+gr,Tr=Or):tr>0&&(gr=Pr(Vr-Or,Cr(nn-Or,gr)),Sr=vr,Tr=Or+gr),rr<0?(yr=Pr(rn-Er,Cr(en-Er,yr)),Ir=Er+yr,Ar=Rr):rr>0&&(yr=Pr(rn-Rr,Cr(en-Rr,yr)),Ir=Er,Ar=Rr+yr));break}case dn:{tr&&(Sr=Pr(Vr,Cr(nn,vr-gr*tr)),Tr=Pr(Vr,Cr(nn,Or+gr*tr))),rr&&(Ir=Pr(rn,Cr(en,Er-yr*rr)),Ar=Pr(rn,Cr(en,Rr+yr*rr)));break}}Tr<Sr&&(tr*=-1,an=vr,vr=Or,Or=an,an=Sr,Sr=Tr,Tr=an,Yt in sa&&Nn.attr("cursor",Zr[Yt=sa[Yt]])),Ar<Ir&&(rr*=-1,an=Er,Er=Rr,Rr=an,an=Ir,Ir=Ar,Ar=an,Yt in ia&&Nn.attr("cursor",Zr[Yt=ia[Yt]])),Mr.selection&&(hr=Mr.selection),ne&&(Sr=hr[0][0],Tr=hr[1][0]),ee&&(Ir=hr[0][1],Ar=hr[1][1]),(hr[0][0]!==Sr||hr[0][1]!==Ir||hr[1][0]!==Tr||hr[1][1]!==Ar)&&(Mr.selection=[[Sr,Ir],[Tr,Ar]],_.call(Ht),Cn.brush(Jt,Gt.name))}function xa(Jt){if(nopropagation(Jt),Jt.touches){if(Jt.touches.length)return;V&&clearTimeout(V),V=setTimeout(function(){V=null},500)}else dragEnable(Jt.view,Re),pa.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);ya.attr("pointer-events","all"),Nn.attr("cursor",Zr.overlay),Mr.selection&&(hr=Mr.selection),fs(hr)&&(Mr.selection=null,_.call(Ht)),Cn.end(Jt,Gt.name)}function js(Jt){switch(Jt.keyCode){case 16:{re=tr&&rr;break}case 18:{Gt===cn&&(tr&&(Or=Tr-gr*tr,vr=Sr+gr*tr),rr&&(Rr=Ar-yr*rr,Er=Ir+yr*rr),Gt=dn,fn(Jt));break}case 32:{(Gt===cn||Gt===dn)&&(tr<0?Or=Tr-gr:tr>0&&(vr=Sr-gr),rr<0?Rr=Ar-yr:rr>0&&(Er=Ir-yr),Gt=ye,Nn.attr("cursor",Zr.selection),fn(Jt));break}default:return}noevent(Jt)}function ws(Jt){switch(Jt.keyCode){case 16:{re&&(ne=ee=re=!1,fn(Jt));break}case 18:{Gt===dn&&(tr<0?Or=Tr:tr>0&&(vr=Sr),rr<0?Rr=Ar:rr>0&&(Er=Ir),Gt=cn,fn(Jt));break}case 32:{Gt===ye&&(Jt.altKey?(tr&&(Or=Tr-gr*tr,vr=Sr+gr*tr),rr&&(Rr=Ar-yr*rr,Er=Ir+yr*rr),Gt=dn):(tr<0?Or=Tr:tr>0&&(vr=Sr),rr<0?Rr=Ar:rr>0&&(Er=Ir),Gt=cn),Nn.attr("cursor",Zr[Yt]),fn(Jt));break}default:return}noevent(Jt)}}function Wt(Et){tt(this,arguments).moved(Et)}function fr(Et){tt(this,arguments).ended(Et)}function xr(){var Et=this.__brush||{selection:null};return Et.extent=pe(l.apply(this,arguments)),Et.dim=a,Et}return z.extent=function(Et){return arguments.length?(l=typeof Et=="function"?Et:constant(pe(Et)),z):l},z.filter=function(Et){return arguments.length?(h=typeof Et=="function"?Et:constant(!!Et),z):h},z.touchable=function(Et){return arguments.length?(E=typeof Et=="function"?Et:constant(!!Et),z):E},z.handleSize=function(Et){return arguments.length?(L=+Et,z):L},z.keyModifiers=function(Et){return arguments.length?(I=!!Et,z):I},z.on=function(){var Et=D.on.apply(D,arguments);return Et===D?z:Et},z}function ls(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function vs(a){const l=typeof(a==null?void 0:a.requestAnimationFrame)=="function"&&typeof(a==null?void 0:a.cancelAnimationFrame)=="function",h=typeof(a==null?void 0:a.requestIdleCallback)=="function"&&typeof(a==null?void 0:a.cancelIdleCallback)=="function",E=D=>setTimeout(D,1),I=D=>clearTimeout(D);return[l?a.requestAnimationFrame:E,l?a.cancelAnimationFrame:I,h?a.requestIdleCallback:E,h?a.cancelIdleCallback:I]}const Zn=ls(),cs=Zn==null?void 0:Zn.document,[Qs,Zs,ks,qs]=vs(Zn);var ds=Object.defineProperty,ua=Object.getOwnPropertySymbols,hs=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,fa=(a,l,h)=>l in a?ds(a,l,{enumerable:!0,configurable:!0,writable:!0,value:h}):a[l]=h,la=(a,l)=>{for(var h in l||(l={}))hs.call(l,h)&&fa(a,h,l[h]);if(ua)for(var h of ua(l))gs.call(l,h)&&fa(a,h,l[h]);return a};const _s=a=>a||a===0,ys=a=>typeof a=="function",kn=a=>typeof a=="string",qn=a=>typeof a=="number",ps=a=>typeof a=="undefined",va=a=>typeof a!="undefined",ti=a=>typeof a=="boolean",ri=a=>Math.ceil(a/10)*10,ni=a=>Math.ceil(a)+.5,ei=a=>a[1]-a[0],Se=a=>typeof a=="object",ms=a=>ps(a)||a===null||kn(a)&&a.length===0||Se(a)&&!(a instanceof Date)&&Object.keys(a).length===0||qn(a)&&isNaN(a),xs=a=>!ms(a),Ee=a=>Array.isArray(a),_n=a=>a&&!(a!=null&&a.nodeType)&&Se(a)&&!Ee(a);function ai(a,l,h){return va(a[l])?a[l]:h}function oi(a,l){let h=!1;return Object.keys(a).forEach(E=>a[E]===l&&(h=!0)),h}function si(a,l,...h){const E=ys(a);return E&&a.call(l,...h),E}function ii(a,l){let h=0;const E=function(...I){!--h&&l.apply(this,...I)};"duration"in a?a.each(()=>++h).on("end",E):(++h,a.call(E))}function ui(a){return kn(a)?a.replace(/<(script|img)?/ig,"<").replace(/(script)?>/ig,">"):a}function fi(a,l,h=[-1,1],E=!1){if(!(!a||!kn(l)))if(l.indexOf(`
`)===-1)a.text(l);else{const I=[a.text(),l].map(D=>D.replace(/[\s\n]/g,""));if(I[0]!==I[1]){const D=l.split(`
`),L=E?D.length-1:1;a.html(""),D.forEach((V,z)=>{a.append("tspan").attr("x",0).attr("dy",`${z===0?h[0]*L:h[1]}em`).text(V)})}}}function Ss(a){const{x:l