@carbon/charts
Version:
Carbon Charts component library
1 lines • 557 kB
JavaScript
(function(q,$e){typeof exports=="object"&&typeof module<"u"?$e(exports):typeof define=="function"&&define.amd?define(["exports"],$e):(q=typeof globalThis<"u"?globalThis:q||self,$e(q.Charts={}))})(this,function(q){"use strict";function $e(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Wv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function bo(e){let t,n,r;e.length!==2?(t=$e,n=(o,l)=>$e(e(o),l),r=(o,l)=>e(o)-l):(t=e===$e||e===Wv?e:Yv,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Yv(){return 0}function qv(e){return e===null?NaN:+e}function*Xv(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const So=bo($e).right;bo(qv).center;function Zv(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function Fe(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let s of e)(s=t(s,++i,e))!=null&&(n===void 0?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}class Gn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const s=n[i],a=t+s,o=Math.abs(t)<Math.abs(s)?t-(a-s):s-(a-t);o&&(n[r++]=o),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,s,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,s=i-(a-r),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(i=s*2,r=a+i,i==r-a&&(a=r))}return a}}class Pu extends Map{constructor(t,n=Qv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(Nu(this,t))}has(t){return super.has(Nu(this,t))}set(t,n){return super.set(jv(this,t),n)}delete(t){return super.delete(Kv(this,t))}}function Nu({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function jv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Kv({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Qv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Jv(e){return e}function t0(e=$e){if(e===$e)return $u;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function $u(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var e0=Array.prototype,n0=e0.slice;function _o(e){return()=>e}const r0=Math.sqrt(50),i0=Math.sqrt(10),s0=Math.sqrt(2);function Os(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=r0?10:s>=i0?5:s>=s0?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Os(e,t,n*2):[o,l,c]}function ws(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?Os(t,e,n):Os(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function vr(e,t,n){return t=+t,e=+e,n=+n,Os(e,t,n)[2]}function To(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?vr(t,e,n):vr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function a0(e,t,n){let r;for(;;){const i=vr(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function o0(e){return Math.max(1,Math.ceil(Math.log(Zv(e))/Math.LN2)+1)}function l0(){var e=Jv,t=Fe,n=o0;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const E=h,b=+f;if(t===Fe&&([d,h]=a0(d,h,b)),f=ws(d,h,b),f[0]<=d&&(l=vr(d,h,b)),f[f.length-1]>=h)if(E>=h&&t===Fe){const x=vr(d,h,b);isFinite(x)&&(x>0?h=(Math.floor(h/x)+1)*x:x<0&&(h=(Math.ceil(h*-x)+1)/-x))}else f.pop()}for(var p=f.length,g=0,m=p;f[g]<=d;)++g;for(;f[m-1]>h;)--m;(g||m<p)&&(f=f.slice(g,m),p=m-g);var v=new Array(p+1),S;for(s=0;s<=p;++s)S=v[s]=[],S.x0=s>0?f[s-1]:d,S.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[Math.min(p,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const E=Math.floor((d-o)*l);v[Math.min(p,E+(f[E]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&v[So(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:_o(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:_o([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:_o(Array.isArray(i)?n0.call(i):i),r):n},r}function Vn(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function kn(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Fu(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?$u:t0(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(r,Math.floor(t+(l-c)*d/l+h));Fu(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(li(e,n,t),i(e[r],s)>0&&li(e,n,r);a<o;){for(li(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?li(e,n,o):(++o,li(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function li(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Oo(e,t,n){if(e=Float64Array.from(Xv(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return kn(e);if(t>=1)return Vn(e);var r,i=(r-1)*t,s=Math.floor(i),a=Vn(Fu(e,s).subarray(0,s+1)),o=kn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*c0(e){for(const t of e)yield*t}function Uu(e){return Array.from(c0(e))}function u0(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function h0(e){return e}var Ms=1,Cs=2,wo=3,ci=4,Bu=1e-6;function d0(e){return"translate("+e+",0)"}function f0(e){return"translate(0,"+e+")"}function p0(e){return t=>+e(t)}function g0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function m0(){return!this.__axis}function As(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Ms||e===ci?-1:1,u=e===ci||e===Cs?"x":"y",d=e===Ms||e===wo?d0:f0;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):h0),m=Math.max(s,0)+o,v=t.range(),S=+v[0]+l,E=+v[v.length-1]+l,b=(t.bandwidth?g0:p0)(t.copy(),l),x=f.selection?f.selection():f,_=x.selectAll(".domain").data([null]),C=x.selectAll(".tick").data(p,t).order(),D=C.exit(),B=C.enter().append("g").attr("class","tick"),P=C.select("line"),w=C.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),C=C.merge(B),P=P.merge(B.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),w=w.merge(B.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",e===Ms?"0em":e===wo?"0.71em":"0.32em")),f!==x&&(_=_.transition(f),C=C.transition(f),P=P.transition(f),w=w.transition(f),D=D.transition(f).attr("opacity",Bu).attr("transform",function(H){return isFinite(H=b(H))?d(H+l):this.getAttribute("transform")}),B.attr("opacity",Bu).attr("transform",function(H){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(H))?N:b(H))+l)})),D.remove(),_.attr("d",e===ci||e===Cs?a?"M"+c*a+","+S+"H"+l+"V"+E+"H"+c*a:"M"+l+","+S+"V"+E:a?"M"+S+","+c*a+"V"+l+"H"+E+"V"+c*a:"M"+S+","+l+"H"+E),C.attr("opacity",1).attr("transform",function(H){return d(b(H)+l)}),P.attr(u+"2",c*s),w.attr(u,c*m).text(g),x.filter(m0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Cs?"start":e===ci?"end":"middle"),x.each(function(){this.__axis=b})}return h.scale=function(f){return arguments.length?(t=f,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),h):n.slice()},h.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),h):r&&r.slice()},h.tickFormat=function(f){return arguments.length?(i=f,h):i},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function v0(e){return As(Ms,e)}function y0(e){return As(Cs,e)}function Mo(e){return As(wo,e)}function Hu(e){return As(ci,e)}var E0={value:()=>{}};function Co(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ds(n)}function Ds(e){this._=e}function x0(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ds.prototype=Co.prototype={constructor:Ds,on:function(e,t){var n=this._,r=x0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=b0(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Gu(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Gu(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ds(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function b0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Gu(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=E0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ao="http://www.w3.org/1999/xhtml";const Vu={svg:"http://www.w3.org/2000/svg",xhtml:Ao,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ls(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Vu.hasOwnProperty(t)?{space:Vu[t],local:e}:e}function S0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ao&&t.documentElement.namespaceURI===Ao?t.createElement(e):t.createElementNS(n,e)}}function _0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zu(e){var t=Ls(e);return(t.local?_0:S0)(t)}function T0(){}function Do(e){return e==null?T0:function(){return this.querySelector(e)}}function O0(e){typeof e!="function"&&(e=Do(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,u=0;u<a;++u)(l=s[u])&&(c=e.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),o[u]=c);return new ye(r,this._parents)}function w0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function M0(){return[]}function Wu(e){return e==null?M0:function(){return this.querySelectorAll(e)}}function C0(e){return function(){return w0(e.apply(this,arguments))}}function A0(e){typeof e=="function"?e=C0(e):e=Wu(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new ye(r,i)}function Yu(e){return function(){return this.matches(e)}}function qu(e){return function(t){return t.matches(e)}}var D0=Array.prototype.find;function L0(e){return function(){return D0.call(this.children,e)}}function R0(){return this.firstElementChild}function I0(e){return this.select(e==null?R0:L0(typeof e=="function"?e:qu(e)))}var k0=Array.prototype.filter;function P0(){return Array.from(this.children)}function N0(e){return function(){return k0.call(this.children,e)}}function $0(e){return this.selectAll(e==null?P0:N0(typeof e=="function"?e:qu(e)))}function F0(e){typeof e!="function"&&(e=Yu(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new ye(r,this._parents)}function Xu(e){return new Array(e.length)}function U0(){return new ye(this._enter||this._groups.map(Xu),this._parents)}function Rs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Rs.prototype={constructor:Rs,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function B0(e){return function(){return e}}function H0(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new Rs(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function G0(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(r[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new Rs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function V0(e){return e.__data__}function z0(e,t){if(!arguments.length)return Array.from(this,V0);var n=t?G0:H0,r=this._parents,i=this._groups;typeof e!="function"&&(e=B0(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,f=W0(e.call(u,u&&u.__data__,c,r)),p=f.length,g=o[c]=new Array(p),m=a[c]=new Array(p),v=l[c]=new Array(h);n(u,d,g,m,v,f,t);for(var S=0,E=0,b,x;S<p;++S)if(b=g[S]){for(S>=E&&(E=S+1);!(x=m[E])&&++E<p;);b._next=x||null}}return a=new ye(a,r),a._enter=o,a._exit=l,a}function W0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Y0(){return new ye(this._exit||this._groups.map(Xu),this._parents)}function q0(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function X0(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<i;++l)o[l]=n[l];return new ye(o,this._parents)}function Z0(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function j0(e){e||(e=K0);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new ye(i,this._parents).order()}function K0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Q0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function J0(){return Array.from(this)}function ty(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function ey(){let e=0;for(const t of this)++e;return e}function ny(){return!this.node()}function ry(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function iy(e){return function(){this.removeAttribute(e)}}function sy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ay(e,t){return function(){this.setAttribute(e,t)}}function oy(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ly(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function cy(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function uy(e,t){var n=Ls(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?sy:iy:typeof t=="function"?n.local?cy:ly:n.local?oy:ay)(n,t))}function Zu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function hy(e){return function(){this.style.removeProperty(e)}}function dy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function fy(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function py(e,t,n){return arguments.length>1?this.each((t==null?hy:typeof t=="function"?fy:dy)(e,t,n??"")):yr(this.node(),e)}function yr(e,t){return e.style.getPropertyValue(t)||Zu(e).getComputedStyle(e,null).getPropertyValue(t)}function gy(e){return function(){delete this[e]}}function my(e,t){return function(){this[e]=t}}function vy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yy(e,t){return arguments.length>1?this.each((t==null?gy:typeof t=="function"?vy:my)(e,t)):this.node()[e]}function ju(e){return e.trim().split(/^|\s+/)}function Lo(e){return e.classList||new Ku(e)}function Ku(e){this._node=e,this._names=ju(e.getAttribute("class")||"")}Ku.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Qu(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Ju(e,t){for(var n=Lo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ey(e){return function(){Qu(this,e)}}function xy(e){return function(){Ju(this,e)}}function by(e,t){return function(){(t.apply(this,arguments)?Qu:Ju)(this,e)}}function Sy(e,t){var n=ju(e+"");if(arguments.length<2){for(var r=Lo(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?by:t?Ey:xy)(n,t))}function _y(){this.textContent=""}function Ty(e){return function(){this.textContent=e}}function Oy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wy(e){return arguments.length?this.each(e==null?_y:(typeof e=="function"?Oy:Ty)(e)):this.node().textContent}function My(){this.innerHTML=""}function Cy(e){return function(){this.innerHTML=e}}function Ay(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Dy(e){return arguments.length?this.each(e==null?My:(typeof e=="function"?Ay:Cy)(e)):this.node().innerHTML}function Ly(){this.nextSibling&&this.parentNode.appendChild(this)}function Ry(){return this.each(Ly)}function Iy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ky(){return this.each(Iy)}function Py(e){var t=typeof e=="function"?e:zu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ny(){return null}function $y(e,t){var n=typeof e=="function"?e:zu(e),r=t==null?Ny:typeof t=="function"?t:Do(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Fy(){var e=this.parentNode;e&&e.removeChild(this)}function Uy(){return this.each(Fy)}function By(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Hy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gy(e){return this.select(e?Hy:By)}function Vy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zy(e){return function(t){e.call(this,t,this.__data__)}}function Wy(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Yy(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function qy(e,t,n){return function(){var r=this.__on,i,s=zy(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Xy(e,t,n){var r=Wy(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,u;l<c;++l)for(i=0,u=o[l];i<s;++i)if((a=r[i]).type===u.type&&a.name===u.name)return u.value}return}for(o=t?qy:Yy,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function th(e,t,n){var r=Zu(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Zy(e,t){return function(){return th(this,e,t)}}function jy(e,t){return function(){return th(this,e,t.apply(this,arguments))}}function Ky(e,t){return this.each((typeof t=="function"?jy:Zy)(e,t))}function*Qy(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var eh=[null];function ye(e,t){this._groups=e,this._parents=t}function ui(){return new ye([[document.documentElement]],eh)}function Jy(){return this}ye.prototype=ui.prototype={constructor:ye,select:O0,selectAll:A0,selectChild:I0,selectChildren:$0,filter:F0,data:z0,enter:U0,exit:Y0,join:q0,merge:X0,selection:Jy,order:Z0,sort:j0,call:Q0,nodes:J0,node:ty,size:ey,empty:ny,each:ry,attr:uy,style:py,property:yy,classed:Sy,text:wy,html:Dy,raise:Ry,lower:ky,append:Py,insert:$y,remove:Uy,clone:Gy,datum:Vy,on:Xy,dispatch:Ky,[Symbol.iterator]:Qy};function I(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],eh)}function t1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function zn(e,t){if(e=t1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ro={capture:!0,passive:!1};function Io(e){e.preventDefault(),e.stopImmediatePropagation()}function e1(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",Io,Ro);"onselectstart"in t?n.on("selectstart.drag",Io,Ro):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function n1(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",Io,Ro),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ko(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nh(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hi(){}var di=.7,Is=1/di,Er="\\s*([+-]?\\d+)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",r1=/^#([0-9a-f]{3,8})$/,i1=new RegExp(`^rgb\\(${Er},${Er},${Er}\\)$`),s1=new RegExp(`^rgb\\(${Ke},${Ke},${Ke}\\)$`),a1=new RegExp(`^rgba\\(${Er},${Er},${Er},${fi}\\)$`),o1=new RegExp(`^rgba\\(${Ke},${Ke},${Ke},${fi}\\)$`),l1=new RegExp(`^hsl\\(${fi},${Ke},${Ke}\\)$`),c1=new RegExp(`^hsla\\(${fi},${Ke},${Ke},${fi}\\)$`),rh={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};ko(hi,dn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ih,formatHex:ih,formatHex8:u1,formatHsl:h1,formatRgb:sh,toString:sh});function ih(){return this.rgb().formatHex()}function u1(){return this.rgb().formatHex8()}function h1(){return uh(this).formatHsl()}function sh(){return this.rgb().formatRgb()}function dn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=r1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ah(t):n===3?new he(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ks(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ks(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=i1.exec(e))?new he(t[1],t[2],t[3],1):(t=s1.exec(e))?new he(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=a1.exec(e))?ks(t[1],t[2],t[3],t[4]):(t=o1.exec(e))?ks(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=l1.exec(e))?ch(t[1],t[2]/100,t[3]/100,1):(t=c1.exec(e))?ch(t[1],t[2]/100,t[3]/100,t[4]):rh.hasOwnProperty(e)?ah(rh[e]):e==="transparent"?new he(NaN,NaN,NaN,0):null}function ah(e){return new he(e>>16&255,e>>8&255,e&255,1)}function ks(e,t,n,r){return r<=0&&(e=t=n=NaN),new he(e,t,n,r)}function d1(e){return e instanceof hi||(e=dn(e)),e?(e=e.rgb(),new he(e.r,e.g,e.b,e.opacity)):new he}function Po(e,t,n,r){return arguments.length===1?d1(e):new he(e,t,n,r??1)}function he(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ko(he,Po,nh(hi,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new he(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new he(Wn(this.r),Wn(this.g),Wn(this.b),Ps(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:oh,formatHex:oh,formatHex8:f1,formatRgb:lh,toString:lh}));function oh(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}`}function f1(){return`#${Yn(this.r)}${Yn(this.g)}${Yn(this.b)}${Yn((isNaN(this.opacity)?1:this.opacity)*255)}`}function lh(){const e=Ps(this.opacity);return`${e===1?"rgb(":"rgba("}${Wn(this.r)}, ${Wn(this.g)}, ${Wn(this.b)}${e===1?")":`, ${e})`}`}function Ps(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yn(e){return e=Wn(e),(e<16?"0":"")+e.toString(16)}function ch(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ue(e,t,n,r)}function uh(e){if(e instanceof Ue)return new Ue(e.h,e.s,e.l,e.opacity);if(e instanceof hi||(e=dn(e)),!e)return new Ue;if(e instanceof Ue)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new Ue(a,o,l,e.opacity)}function hh(e,t,n,r){return arguments.length===1?uh(e):new Ue(e,t,n,r??1)}function Ue(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ko(Ue,hh,nh(hi,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new Ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new Ue(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new he(No(e>=240?e-240:e+120,i,r),No(e,i,r),No(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ue(dh(this.h),Ns(this.s),Ns(this.l),Ps(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 e=Ps(this.opacity);return`${e===1?"hsl(":"hsla("}${dh(this.h)}, ${Ns(this.s)*100}%, ${Ns(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dh(e){return e=(e||0)%360,e<0?e+360:e}function Ns(e){return Math.max(0,Math.min(1,e||0))}function No(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const $o=e=>()=>e;function p1(e,t){return function(n){return e+n*t}}function g1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function m1(e){return(e=+e)==1?fh:function(t,n){return n-t?g1(t,n,e):$o(isNaN(t)?n:t)}}function fh(e,t){var n=t-e;return n?p1(e,n):$o(isNaN(e)?t:e)}const $s=function e(t){var n=m1(t);function r(i,s){var a=n((i=Po(i)).r,(s=Po(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=fh(i.opacity,s.opacity);return function(u){return i.r=a(u),i.g=o(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function v1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function y1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function E1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=pi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function x1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ee(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function b1(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=pi(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Fo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uo=new RegExp(Fo.source,"g");function S1(e){return function(){return e}}function _1(e){return function(t){return e(t)+""}}function ph(e,t){var n=Fo.lastIndex=Uo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=Fo.exec(e))&&(i=Uo.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:Ee(r,i)})),n=Uo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?_1(l[0].x):S1(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function pi(e,t){var n=typeof t,r;return t==null||n==="boolean"?$o(t):(n==="number"?Ee:n==="string"?(r=dn(t))?(t=r,$s):ph:t instanceof dn?$s:t instanceof Date?x1:y1(t)?v1:Array.isArray(t)?E1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?b1:Ee)(e,t)}function gh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var mh=180/Math.PI,Bo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vh(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*mh,skewX:Math.atan(l)*mh,scaleX:a,scaleY:o}}var Fs;function T1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Bo:vh(t.a,t.b,t.c,t.d,t.e,t.f)}function O1(e){return e==null||(Fs||(Fs=document.createElementNS("http://www.w3.org/2000/svg","g")),Fs.setAttribute("transform",e),!(e=Fs.transform.baseVal.consolidate()))?Bo:(e=e.matrix,vh(e.a,e.b,e.c,e.d,e.e,e.f))}function yh(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x:Ee(c,d)},{i:g-2,x:Ee(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Ee(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Ee(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push(i(f)+"scale(",null,",",null,")");p.push({i:g-4,x:Ee(c,d)},{i:g-2,x:Ee(u,h)})}else(d!==1||h!==1)&&f.push(i(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,g=h.length,m;++p<g;)d[(m=h[p]).i]=m.x(f);return d.join("")}}}var w1=yh(T1,"px, ","px)","deg)"),M1=yh(O1,", ",")",")");function C1(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var xr=0,gi=0,mi=0,Eh=1e3,Us,vi,Bs=0,qn=0,Hs=0,yi=typeof performance=="object"&&performance.now?performance:Date,xh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ho(){return qn||(xh(A1),qn=yi.now()+Hs)}function A1(){qn=0}function Gs(){this._call=this._time=this._next=null}Gs.prototype=bh.prototype={constructor:Gs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ho():+n)+(t==null?0:+t),!this._next&&vi!==this&&(vi?vi._next=this:Us=this,vi=this),this._call=e,this._time=n,Go()},stop:function(){this._call&&(this._call=null,this._time=1/0,Go())}};function bh(e,t,n){var r=new Gs;return r.restart(e,t,n),r}function D1(){Ho(),++xr;for(var e=Us,t;e;)(t=qn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xr}function Sh(){qn=(Bs=yi.now())+Hs,xr=gi=0;try{D1()}finally{xr=0,R1(),qn=0}}function L1(){var e=yi.now(),t=e-Bs;t>Eh&&(Hs-=t,Bs=e)}function R1(){for(var e,t=Us,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Us=n);vi=e,Go(r)}function Go(e){if(!xr){gi&&(gi=clearTimeout(gi));var t=e-qn;t>24?(e<1/0&&(gi=setTimeout(Sh,e-yi.now()-Hs)),mi&&(mi=clearInterval(mi))):(mi||(Bs=yi.now(),mi=setInterval(L1,Eh)),xr=1,xh(Sh))}}function _h(e,t,n){var r=new Gs;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var I1=Co("start","end","cancel","interrupt"),k1=[],Th=0,Oh=1,Vo=2,Vs=3,wh=4,zo=5,zs=6;function Ws(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;P1(e,n,{name:t,index:r,group:i,on:I1,tween:k1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Th})}function Wo(e,t){var n=Be(e,t);if(n.state>Th)throw new Error("too late; already scheduled");return n}function Qe(e,t){var n=Be(e,t);if(n.state>Vs)throw new Error("too late; already running");return n}function Be(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function P1(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=bh(s,0,n.time);function s(c){n.state=Oh,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,f;if(n.state!==Oh)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Vs)return _h(a);f.state===wh?(f.state=zs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=zs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(_h(function(){n.state===Vs&&(n.state=wh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Vo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Vo){for(n.state=Vs,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=f);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=zo,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===zo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=zs,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Yo(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Vo&&r.state<zo,r.state=zs,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function N1(e){return this.each(function(){Yo(this,e)})}function $1(e,t){var n,r;return function(){var i=Qe(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function F1(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Qe(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function U1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Be(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?$1:F1)(n,e,t))}function qo(e,t,n){var r=e._id;return e.each(function(){var i=Qe(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Be(i,r).value[t]}}function Mh(e,t){var n;return(typeof t=="number"?Ee:t instanceof dn?$s:(n=dn(t))?(t=n,$s):ph)(e,t)}function B1(e){return function(){this.removeAttribute(e)}}function H1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function G1(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function V1(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function z1(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function W1(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function Y1(e,t){var n=Ls(e),r=n==="transform"?M1:Mh;return this.attrTween(e,typeof t=="function"?(n.local?W1:z1)(n,r,qo(this,"attr."+e,t)):t==null?(n.local?H1:B1)(n):(n.local?V1:G1)(n,r,t))}function q1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function X1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Z1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&X1(e,s)),n}return i._value=t,i}function j1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&q1(e,s)),n}return i._value=t,i}function K1(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Ls(e);return this.tween(n,(r.local?Z1:j1)(r,t))}function Q1(e,t){return function(){Wo(this,e).delay=+t.apply(this,arguments)}}function J1(e,t){return t=+t,function(){Wo(this,e).delay=t}}function tE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Q1:J1)(t,e)):Be(this.node(),t).delay}function eE(e,t){return function(){Qe(this,e).duration=+t.apply(this,arguments)}}function nE(e,t){return t=+t,function(){Qe(this,e).duration=t}}function rE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?eE:nE)(t,e)):Be(this.node(),t).duration}function iE(e,t){if(typeof t!="function")throw new Error;return function(){Qe(this,e).ease=t}}function sE(e){var t=this._id;return arguments.length?this.each(iE(t,e)):Be(this.node(),t).ease}function aE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Qe(this,e).ease=n}}function oE(e){if(typeof e!="function")throw new Error;return this.each(aE(this._id,e))}function lE(e){typeof e!="function"&&(e=Yu(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new fn(r,this._parents,this._name,this._id)}function cE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<r;++o)a[o]=t[o];return new fn(a,this._parents,this._name,this._id)}function uE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function hE(e,t,n){var r,i,s=uE(t)?Wo:Qe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function dE(e,t){var n=this._id;return arguments.length<2?Be(this.node(),n).on.on(e):this.each(hE(n,e,t))}function fE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function pE(){return this.on("end.remove",fE(this._id))}function gE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Do(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,Ws(c[h],t,n,h,c,Be(u,n)));return new fn(s,this._parents,t,n)}function mE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wu(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=Be(u,n),g=0,m=h.length;g<m;++g)(f=h[g])&&Ws(f,t,n,g,h,p);s.push(h),a.push(u)}return new fn(s,a,t,n)}var vE=ui.prototype.constructor;function yE(){return new vE(this._groups,this._parents)}function EE(e,t){var n,r,i;return function(){var s=yr(this,e),a=(this.style.removeProperty(e),yr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Ch(e){return function(){this.style.removeProperty(e)}}function xE(e,t,n){var r,i=n+"",s;return function(){var a=yr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function bE(e,t,n){var r,i,s;return function(){var a=yr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),yr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function SE(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=Qe(this,e),c=l.on,u=l.value[s]==null?o||(o=Ch(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function _E(e,t,n){var r=(e+="")=="transform"?w1:Mh;return t==null?this.styleTween(e,EE(e,r)).on("end.style."+e,Ch(e)):typeof t=="function"?this.styleTween(e,bE(e,r,qo(this,"style."+e,t))).each(SE(this._id,e)):this.styleTween(e,xE(e,r,t),n).on("end.style."+e,null)}function TE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function OE(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&TE(e,a,n)),r}return s._value=t,s}function wE(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,OE(e,t,n??""))}function ME(e){return function(){this.textContent=e}}function CE(e){return function(){var t=e(this);this.textContent=t??""}}function AE(e){return this.tween("text",typeof e=="function"?CE(qo(this,"text",e)):ME(e==null?"":e+""))}function DE(e){return function(t){this.textContent=e.call(this,t)}}function LE(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&DE(i)),t}return r._value=e,r}function RE(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,LE(e))}function IE(){for(var e=this._name,t=this._id,n=Ah(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Be(l,t);Ws(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new fn(r,this._parents,e,n)}function kE(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=Qe(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var PE=0;function fn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ah(){return++PE}var pn=ui.prototype;fn.prototype={constructor:fn,select:gE,selectAll:mE,selectChild:pn.selectChild,selectChildren:pn.selectChildren,filter:lE,merge:cE,selection:yE,transition:IE,call:pn.call,nodes:pn.nodes,node:pn.node,size:pn.size,empty:pn.empty,each:pn.each,on:dE,attr:Y1,attrTween:K1,style:_E,styleTween:wE,text:AE,textTween:RE,remove:pE,tween:U1,delay:tE,duration:rE,ease:sE,easeVarying:oE,end:kE,[Symbol.iterator]:pn[Symbol.iterator]};const NE=e=>+e;function Dh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $E={time:null,delay:0,duration:250,ease:Dh};function FE(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function UE(e){var t,n;e instanceof fn?(t=e._id,e=e._name):(t=Ah(),(n=$E).time=Ho(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&Ws(l,e,t,c,a,n||FE(l,t));return new fn(r,this._parents,e,t)}ui.prototype.interrupt=N1,ui.prototype.transition=UE;const Xo=e=>()=>e;function BE(e,{sourceEvent:t,target:n,selection:r,mode:i,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function HE(e){e.stopImmediatePropagation()}function Zo(e){e.preventDefault(),e.stopImmediatePropagation()}var Lh={name:"drag"},jo={name:"space"},br={name:"handle"},Sr={name:"center"};const{abs:Rh,max:Kt,min:Qt}=Math;function Ih(e){return[+e[0],+e[1]]}function kh(e){return[Ih(e[0]),Ih(e[1])]}var Ys={name:"x",handles:["w","e"].map(Qo),input:function(e,t){return e==null?null:[[+e[0],t[0][1]],[+e[1],t[1][1]]]},output:function(e){return e&&[e[0][0],e[1][0]]}},Ko={},gn={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"},Ph={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Nh={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},GE={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},VE={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Qo(e){return{type:e}}function zE(e){return!e.ctrlKey&&!e.button}function WE(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function YE(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function qE(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function $h(){return XE(Ys)}function XE(e){var t=WE,n=zE,r=YE,i=!0,s=Co("start","brush","end"),a=6,o;function l(m){var v=m.property("__brush",g).selectAll(".overlay").data([Qo("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",gn.overlay).merge(v).each(function(){var E=Jo(this).extent;I(this).attr("x",E[0][0]).attr("y",E[0][1]).attr("width",E[1][0]-E[0][0]).attr("height",E[1][1]-E[0][1])}),m.selectAll(".selection")