UNPKG

@carbon/charts

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