@carbon/charts-react 1.11.3 → 1.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- (function(J,re){typeof exports=="object"&&typeof module<"u"?re(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],re):(J=typeof globalThis<"u"?globalThis:J||self,re(J.ChartsReact={},J.React))})(this,function(J,re){"use strict";var FB=Object.defineProperty;var GB=(J,re,be)=>re in J?FB(J,re,{enumerable:!0,configurable:!0,writable:!0,value:be}):J[re]=be;var nu=(J,re,be)=>(GB(J,typeof re!="symbol"?re+"":re,be),be);function be(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function yv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function no(e){let t,n,r;e.length!==2?(t=be,n=(o,l)=>be(e(o),l),r=(o,l)=>e(o)-l):(t=e===be||e===yv?e:bv,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 h=c+u>>>1;n(o[h],l)<0?c=h+1:u=h}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 h=c+u>>>1;n(o[h],l)<=0?c=h+1:u=h}while(c<u)}return c}function a(o,l,c=0,u=o.length){const h=i(o,l,c,u-1);return h>c&&r(o[h-1],l)>-r(o[h],l)?h-1:h}return{left:i,center:a,right:s}}function bv(){return 0}function xv(e){return e===null?NaN:+e}function*wv(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const _v=no(be).right;no(xv).center;const ro=_v;function Ev(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function Re(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 Pn{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 ru extends Map{constructor(t,n=Tv){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(iu(this,t))}has(t){return super.has(iu(this,t))}set(t,n){return super.set(Sv(this,t),n)}delete(t){return super.delete(Ov(this,t))}}function iu({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Sv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Ov({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Tv(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Mv(e){return e}function Cv(e=be){if(e===be)return su;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 su(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Av=Array.prototype,$v=Av.slice;function io(e){return()=>e}const Lv=Math.sqrt(50),Dv=Math.sqrt(10),kv=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>=Lv?10:s>=Dv?5:s>=kv?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 ls(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 lr(e,t,n){return t=+t,e=+e,n=+n,os(e,t,n)[2]}function so(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?lr(t,e,n):lr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Rv(e,t,n){let r;for(;;){const i=lr(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 Iv(e){return Math.max(1,Math.ceil(Math.log(Ev(e))/Math.LN2)+1)}function Pv(){var e=Mv,t=Re,n=Iv;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),h=u[0],d=u[1],f=n(c,h,d);if(!Array.isArray(f)){const w=d,O=+f;if(t===Re&&([h,d]=Rv(h,d,O)),f=ls(h,d,O),f[0]<=h&&(l=lr(h,d,O)),f[f.length-1]>=d)if(w>=d&&t===Re){const E=lr(h,d,O);isFinite(E)&&(E>0?d=(Math.floor(d/E)+1)*E:E<0&&(d=(Math.ceil(d*-E)+1)/-E))}else f.pop()}for(var p=f.length,m=0,g=p;f[m]<=h;)++m;for(;f[g-1]>d;)--g;(m||g<p)&&(f=f.slice(m,g),p=g-m);var v=new Array(p+1),b;for(s=0;s<=p;++s)b=v[s]=[],b.x0=s>0?f[s-1]:h,b.x1=s<p?f[s]:d;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[Math.min(p,Math.floor((o-h)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&h<=o&&o<=d){const w=Math.floor((h-o)*l);v[Math.min(p,w+(f[w]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[ro(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:io(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:io([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:io(Array.isArray(i)?$v.call(i):i),r):n},r}function Nn(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 Sn(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 au(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?su:Cv(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*h/l+d)),p=Math.min(r,Math.floor(t+(l-c)*h/l+d));au(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(Xr(e,n,t),i(e[r],s)>0&&Xr(e,n,r);a<o;){for(Xr(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Xr(e,n,o):(++o,Xr(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Xr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ao(e,t,n){if(e=Float64Array.from(wv(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Sn(e);if(t>=1)return Nn(e);var r,i=(r-1)*t,s=Math.floor(i),a=Nn(au(e,s).subarray(0,s+1)),o=Sn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*Nv(e){for(const t of e)yield*t}function ou(e){return Array.from(Nv(e))}function Uv(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 Bv(e){return e}var cs=1,us=2,oo=3,Zr=4,lu=1e-6;function Vv(e){return"translate("+e+",0)"}function Hv(e){return"translate(0,"+e+")"}function Fv(e){return t=>+e(t)}function Gv(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function zv(){return!this.__axis}function hs(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===cs||e===Zr?-1:1,u=e===Zr||e===us?"x":"y",h=e===cs||e===oo?Vv:Hv;function d(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):Bv),g=Math.max(s,0)+o,v=t.range(),b=+v[0]+l,w=+v[v.length-1]+l,O=(t.bandwidth?Gv:Fv)(t.copy(),l),E=f.selection?f.selection():f,T=E.selectAll(".domain").data([null]),S=E.selectAll(".tick").data(p,t).order(),$=S.exit(),k=S.enter().append("g").attr("class","tick"),L=S.select("line"),M=S.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),S=S.merge(k),L=L.merge(k.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),M=M.merge(k.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",e===cs?"0em":e===oo?"0.71em":"0.32em")),f!==E&&(T=T.transition(f),S=S.transition(f),L=L.transition(f),M=M.transition(f),$=$.transition(f).attr("opacity",lu).attr("transform",function(V){return isFinite(V=O(V))?h(V+l):this.getAttribute("transform")}),k.attr("opacity",lu).attr("transform",function(V){var x=this.parentNode.__axis;return h((x&&isFinite(x=x(V))?x:O(V))+l)})),$.remove(),T.attr("d",e===Zr||e===us?a?"M"+c*a+","+b+"H"+l+"V"+w+"H"+c*a:"M"+l+","+b+"V"+w:a?"M"+b+","+c*a+"V"+l+"H"+w+"V"+c*a:"M"+b+","+l+"H"+w),S.attr("opacity",1).attr("transform",function(V){return h(O(V)+l)}),L.attr(u+"2",c*s),M.attr(u,c*g).text(m),E.filter(zv).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===us?"start":e===Zr?"end":"middle"),E.each(function(){this.__axis=O})}return d.scale=function(f){return arguments.length?(t=f,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),d):n.slice()},d.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),d):r&&r.slice()},d.tickFormat=function(f){return arguments.length?(i=f,d):i},d.tickSize=function(f){return arguments.length?(s=a=+f,d):s},d.tickSizeInner=function(f){return arguments.length?(s=+f,d):s},d.tickSizeOuter=function(f){return arguments.length?(a=+f,d):a},d.tickPadding=function(f){return arguments.length?(o=+f,d):o},d.offset=function(f){return arguments.length?(l=+f,d):l},d}function jv(e){return hs(cs,e)}function Wv(e){return hs(us,e)}function lo(e){return hs(oo,e)}function cu(e){return hs(Zr,e)}var qv={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 Yv(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=Yv(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=Xv(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]=uu(n[i],e.name,t);else if(t==null)for(i in n)n[i]=uu(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 Xv(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function uu(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=qv,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var uo="http://www.w3.org/1999/xhtml";const hu={svg:"http://www.w3.org/2000/svg",xhtml:uo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),hu.hasOwnProperty(t)?{space:hu[t],local:e}:e}function Zv(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===uo&&t.documentElement.namespaceURI===uo?t.createElement(e):t.createElementNS(n,e)}}function Kv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function du(e){var t=fs(e);return(t.local?Kv:Zv)(t)}function Qv(){}function ho(e){return e==null?Qv:function(){return this.querySelector(e)}}function Jv(e){typeof e!="function"&&(e=ho(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 xe(r,this._parents)}function t0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function e0(){return[]}function fu(e){return e==null?e0:function(){return this.querySelectorAll(e)}}function n0(e){return function(){return t0(e.apply(this,arguments))}}function r0(e){typeof e=="function"?e=n0(e):e=fu(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 xe(r,i)}function pu(e){return function(){return this.matches(e)}}function gu(e){return function(t){return t.matches(e)}}var i0=Array.prototype.find;function s0(e){return function(){return i0.call(this.children,e)}}function a0(){return this.firstElementChild}function o0(e){return this.select(e==null?a0:s0(typeof e=="function"?e:gu(e)))}var l0=Array.prototype.filter;function c0(){return Array.from(this.children)}function u0(e){return function(){return l0.call(this.children,e)}}function h0(e){return this.selectAll(e==null?c0:u0(typeof e=="function"?e:gu(e)))}function d0(e){typeof e!="function"&&(e=pu(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 xe(r,this._parents)}function mu(e){return new Array(e.length)}function f0(){return new xe(this._enter||this._groups.map(mu),this._parents)}function ps(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ps.prototype={constructor:ps,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 p0(e){return function(){return e}}function g0(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 ps(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function m0(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,h=s.length,d=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(d[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<h;++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 ps(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(d[o])===l&&(i[o]=l)}function v0(e){return e.__data__}function y0(e,t){if(!arguments.length)return Array.from(this,v0);var n=t?m0:g0,r=this._parents,i=this._groups;typeof e!="function"&&(e=p0(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],h=i[c],d=h.length,f=b0(e.call(u,u&&u.__data__,c,r)),p=f.length,m=o[c]=new Array(p),g=a[c]=new Array(p),v=l[c]=new Array(d);n(u,h,m,g,v,f,t);for(var b=0,w=0,O,E;b<p;++b)if(O=m[b]){for(b>=w&&(w=b+1);!(E=g[w])&&++w<p;);O._next=E||null}}return a=new xe(a,r),a._enter=o,a._exit=l,a}function b0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function x0(){return new xe(this._exit||this._groups.map(mu),this._parents)}function w0(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 _0(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],h=c.length,d=o[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||u[p])&&(d[p]=f);for(;l<i;++l)o[l]=n[l];return new xe(o,this._parents)}function E0(){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 S0(e){e||(e=O0);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}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 xe(i,this._parents).order()}function O0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function T0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function M0(){return Array.from(this)}function C0(){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 A0(){let e=0;for(const t of this)++e;return e}function $0(){return!this.node()}function L0(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 D0(e){return function(){this.removeAttribute(e)}}function k0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function R0(e,t){return function(){this.setAttribute(e,t)}}function I0(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function P0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function N0(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 U0(e,t){var n=fs(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?k0:D0:typeof t=="function"?n.local?N0:P0:n.local?I0:R0)(n,t))}function vu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function B0(e){return function(){this.style.removeProperty(e)}}function V0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function H0(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function F0(e,t,n){return arguments.length>1?this.each((t==null?B0:typeof t=="function"?H0:V0)(e,t,n??"")):cr(this.node(),e)}function cr(e,t){return e.style.getPropertyValue(t)||vu(e).getComputedStyle(e,null).getPropertyValue(t)}function G0(e){return function(){delete this[e]}}function z0(e,t){return function(){this[e]=t}}function j0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function W0(e,t){return arguments.length>1?this.each((t==null?G0:typeof t=="function"?j0:z0)(e,t)):this.node()[e]}function yu(e){return e.trim().split(/^|\s+/)}function fo(e){return e.classList||new bu(e)}function bu(e){this._node=e,this._names=yu(e.getAttribute("class")||"")}bu.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 xu(e,t){for(var n=fo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function wu(e,t){for(var n=fo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function q0(e){return function(){xu(this,e)}}function Y0(e){return function(){wu(this,e)}}function X0(e,t){return function(){(t.apply(this,arguments)?xu:wu)(this,e)}}function Z0(e,t){var n=yu(e+"");if(arguments.length<2){for(var r=fo(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?X0:t?q0:Y0)(n,t))}function K0(){this.textContent=""}function Q0(e){return function(){this.textContent=e}}function J0(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ty(e){return arguments.length?this.each(e==null?K0:(typeof e=="function"?J0:Q0)(e)):this.node().textContent}function ey(){this.innerHTML=""}function ny(e){return function(){this.innerHTML=e}}function ry(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function iy(e){return arguments.length?this.each(e==null?ey:(typeof e=="function"?ry:ny)(e)):this.node().innerHTML}function sy(){this.nextSibling&&this.parentNode.appendChild(this)}function ay(){return this.each(sy)}function oy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ly(){return this.each(oy)}function cy(e){var t=typeof e=="function"?e:du(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function uy(){return null}function hy(e,t){var n=typeof e=="function"?e:du(e),r=t==null?uy:typeof t=="function"?t:ho(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function dy(){var e=this.parentNode;e&&e.removeChild(this)}function fy(){return this.each(dy)}function py(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function my(e){return this.select(e?gy:py)}function vy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function yy(e){return function(t){e.call(this,t,this.__data__)}}function by(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 xy(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 wy(e,t,n){return function(){var r=this.__on,i,s=yy(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 _y(e,t,n){var r=by(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?wy:xy,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function _u(e,t,n){var r=vu(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 Ey(e,t){return function(){return _u(this,e,t)}}function Sy(e,t){return function(){return _u(this,e,t.apply(this,arguments))}}function Oy(e,t){return this.each((typeof t=="function"?Sy:Ey)(e,t))}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,a;i<s;++i)(a=r[i])&&(yield a)}var Eu=[null];function xe(e,t){this._groups=e,this._parents=t}function Kr(){return new xe([[document.documentElement]],Eu)}function My(){return this}xe.prototype=Kr.prototype={constructor:xe,select:Jv,selectAll:r0,selectChild:o0,selectChildren:h0,filter:d0,data:y0,enter:f0,exit:x0,join:w0,merge:_0,selection:My,order:E0,sort:S0,call:T0,nodes:M0,node:C0,size:A0,empty:$0,each:L0,attr:U0,style:F0,property:W0,classed:Z0,text:ty,html:iy,raise:ay,lower:ly,append:cy,insert:hy,remove:fy,clone:my,datum:vy,on:_y,dispatch:Oy,[Symbol.iterator]:Ty};function N(e){return typeof e=="string"?new xe([[document.querySelector(e)]],[document.documentElement]):new xe([[e]],Eu)}function Cy(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Un(e,t){if(e=Cy(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 po={capture:!0,passive:!1};function go(e){e.preventDefault(),e.stopImmediatePropagation()}function Ay(e){var t=e.document.documentElement,n=N(e).on("dragstart.drag",go,po);"onselectstart"in t?n.on("selectstart.drag",go,po):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function $y(e,t){var n=e.document.documentElement,r=N(e).on("dragstart.drag",null);t&&(r.on("click.drag",go,po),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 mo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Su(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Qr(){}var Jr=.7,gs=1/Jr,ur="\\s*([+-]?\\d+)\\s*",ti="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ly=/^#([0-9a-f]{3,8})$/,Dy=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),ky=new RegExp(`^rgb\\(${We},${We},${We}\\)$`),Ry=new RegExp(`^rgba\\(${ur},${ur},${ur},${ti}\\)$`),Iy=new RegExp(`^rgba\\(${We},${We},${We},${ti}\\)$`),Py=new RegExp(`^hsl\\(${ti},${We},${We}\\)$`),Ny=new RegExp(`^hsla\\(${ti},${We},${We},${ti}\\)$`),Ou={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};mo(Qr,en,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Tu,formatHex:Tu,formatHex8:Uy,formatHsl:By,formatRgb:Mu,toString:Mu});function Tu(){return this.rgb().formatHex()}function Uy(){return this.rgb().formatHex8()}function By(){return Du(this).formatHsl()}function Mu(){return this.rgb().formatRgb()}function en(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ly.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Cu(t):n===3?new fe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ms(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ms(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=Dy.exec(e))?new fe(t[1],t[2],t[3],1):(t=ky.exec(e))?new fe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ry.exec(e))?ms(t[1],t[2],t[3],t[4]):(t=Iy.exec(e))?ms(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Py.exec(e))?Lu(t[1],t[2]/100,t[3]/100,1):(t=Ny.exec(e))?Lu(t[1],t[2]/100,t[3]/100,t[4]):Ou.hasOwnProperty(e)?Cu(Ou[e]):e==="transparent"?new fe(NaN,NaN,NaN,0):null}function Cu(e){return new fe(e>>16&255,e>>8&255,e&255,1)}function ms(e,t,n,r){return r<=0&&(e=t=n=NaN),new fe(e,t,n,r)}function Vy(e){return e instanceof Qr||(e=en(e)),e?(e=e.rgb(),new fe(e.r,e.g,e.b,e.opacity)):new fe}function vo(e,t,n,r){return arguments.length===1?Vy(e):new fe(e,t,n,r??1)}function fe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}mo(fe,vo,Su(Qr,{brighter(e){return e=e==null?gs:Math.pow(gs,e),new fe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jr:Math.pow(Jr,e),new fe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fe(Bn(this.r),Bn(this.g),Bn(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:Au,formatHex:Au,formatHex8:Hy,formatRgb:$u,toString:$u}));function Au(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}`}function Hy(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}${Vn((isNaN(this.opacity)?1:this.opacity)*255)}`}function $u(){const e=vs(this.opacity);return`${e===1?"rgb(":"rgba("}${Bn(this.r)}, ${Bn(this.g)}, ${Bn(this.b)}${e===1?")":`, ${e})`}`}function vs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vn(e){return e=Bn(e),(e<16?"0":"")+e.toString(16)}function Lu(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ie(e,t,n,r)}function Du(e){if(e instanceof Ie)return new Ie(e.h,e.s,e.l,e.opacity);if(e instanceof Qr||(e=en(e)),!e)return new Ie;if(e instanceof Ie)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 Ie(a,o,l,e.opacity)}function yo(e,t,n,r){return arguments.length===1?Du(e):new Ie(e,t,n,r??1)}function Ie(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}mo(Ie,yo,Su(Qr,{brighter(e){return e=e==null?gs:Math.pow(gs,e),new Ie(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jr:Math.pow(Jr,e),new Ie(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 fe(bo(e>=240?e-240:e+120,i,r),bo(e,i,r),bo(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ie(ku(this.h),ys(this.s),ys(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("}${ku(this.h)}, ${ys(this.s)*100}%, ${ys(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ku(e){return e=(e||0)%360,e<0?e+360:e}function ys(e){return Math.max(0,Math.min(1,e||0))}function bo(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 xo=e=>()=>e;function Fy(e,t){return function(n){return e+n*t}}function Gy(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 zy(e){return(e=+e)==1?Ru:function(t,n){return n-t?Gy(t,n,e):xo(isNaN(t)?n:t)}}function Ru(e,t){var n=t-e;return n?Fy(e,n):xo(isNaN(e)?t:e)}const bs=function e(t){var n=zy(t);function r(i,s){var a=n((i=vo(i)).r,(s=vo(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Ru(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 jy(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 Wy(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function qy(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]=ei(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 Yy(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function we(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Xy(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]=ei(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var wo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_o=new RegExp(wo.source,"g");function Zy(e){return function(){return e}}function Ky(e){return function(t){return e(t)+""}}function Iu(e,t){var n=wo.lastIndex=_o.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=wo.exec(e))&&(i=_o.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:we(r,i)})),n=_o.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?Ky(l[0].x):Zy(t):(t=l.length,function(c){for(var u=0,h;u<t;++u)o[(h=l[u]).i]=h.x(c);return o.join("")})}function ei(e,t){var n=typeof t,r;return t==null||n==="boolean"?xo(t):(n==="number"?we:n==="string"?(r=en(t))?(t=r,bs):Iu:t instanceof en?bs:t instanceof Date?Yy:Wy(t)?jy:Array.isArray(t)?qy:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Xy:we)(e,t)}function Pu(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Nu=180/Math.PI,Eo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Uu(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)*Nu,skewX:Math.atan(l)*Nu,scaleX:a,scaleY:o}}var xs;function Qy(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Eo:Uu(t.a,t.b,t.c,t.d,t.e,t.f)}function Jy(e){return e==null||(xs||(xs=document.createElementNS("http://www.w3.org/2000/svg","g")),xs.setAttribute("transform",e),!(e=xs.transform.baseVal.consolidate()))?Eo:(e=e.matrix,Uu(e.a,e.b,e.c,e.d,e.e,e.f))}function Bu(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push("translate(",null,t,null,n);p.push({i:m-4,x:we(c,h)},{i:m-2,x:we(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function a(c,u,h,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:h.push(i(h)+"rotate(",null,r)-2,x:we(c,u)})):u&&h.push(i(h)+"rotate("+u+r)}function o(c,u,h,d){c!==u?d.push({i:h.push(i(h)+"skewX(",null,r)-2,x:we(c,u)}):u&&h.push(i(h)+"skewX("+u+r)}function l(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push(i(f)+"scale(",null,",",null,")");p.push({i:m-4,x:we(c,h)},{i:m-2,x:we(u,d)})}else(h!==1||d!==1)&&f.push(i(f)+"scale("+h+","+d+")")}return function(c,u){var h=[],d=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,d),a(c.rotate,u.rotate,h,d),o(c.skewX,u.skewX,h,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,d),c=u=null,function(f){for(var p=-1,m=d.length,g;++p<m;)h[(g=d[p]).i]=g.x(f);return h.join("")}}}var t1=Bu(Qy,"px, ","px)","deg)"),e1=Bu(Jy,", ",")",")");function n1(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var hr=0,ni=0,ri=0,Vu=1e3,ws,ii,_s=0,Hn=0,Es=0,si=typeof performance=="object"&&performance.now?performance:Date,Hu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function So(){return Hn||(Hu(r1),Hn=si.now()+Es)}function r1(){Hn=0}function Ss(){this._call=this._time=this._next=null}Ss.prototype=Fu.prototype={constructor:Ss,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?So():+n)+(t==null?0:+t),!this._next&&ii!==this&&(ii?ii._next=this:ws=this,ii=this),this._call=e,this._time=n,Oo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Oo())}};function Fu(e,t,n){var r=new Ss;return r.restart(e,t,n),r}function i1(){So(),++hr;for(var e=ws,t;e;)(t=Hn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--hr}function Gu(){Hn=(_s=si.now())+Es,hr=ni=0;try{i1()}finally{hr=0,a1(),Hn=0}}function s1(){var e=si.now(),t=e-_s;t>Vu&&(Es-=t,_s=e)}function a1(){for(var e,t=ws,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:ws=n);ii=e,Oo(r)}function Oo(e){if(!hr){ni&&(ni=clearTimeout(ni));var t=e-Hn;t>24?(e<1/0&&(ni=setTimeout(Gu,e-si.now()-Es)),ri&&(ri=clearInterval(ri))):(ri||(_s=si.now(),ri=setInterval(s1,Vu)),hr=1,Hu(Gu))}}function zu(e,t,n){var r=new Ss;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var o1=co("start","end","cancel","interrupt"),l1=[],ju=0,Wu=1,To=2,Os=3,qu=4,Mo=5,Ts=6;function Ms(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;c1(e,n,{name:t,index:r,group:i,on:o1,tween:l1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:ju})}function Co(e,t){var n=Pe(e,t);if(n.state>ju)throw new Error("too late; already scheduled");return n}function qe(e,t){var n=Pe(e,t);if(n.state>Os)throw new Error("too late; already running");return n}function Pe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function c1(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Fu(s,0,n.time);function s(c){n.state=Wu,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,h,d,f;if(n.state!==Wu)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Os)return zu(a);f.state===qu?(f.state=Ts,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=Ts,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(zu(function(){n.state===Os&&(n.state=qu,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=To,n.on.call("start",e,e.__data__,n.index,n.group),n.state===To){for(n.state=Os,i=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=f);i.length=h+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Mo,1),h=-1,d=i.length;++h<d;)i[h].call(e,u);n.state===Mo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ts,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Ao(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>To&&r.state<Mo,r.state=Ts,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function u1(e){return this.each(function(){Ao(this,e)})}function h1(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 d1(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 f1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Pe(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?h1:d1)(n,e,t))}function $o(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 Pe(i,r).value[t]}}function Yu(e,t){var n;return(typeof t=="number"?we:t instanceof en?bs:(n=en(t))?(t=n,bs):Iu)(e,t)}function p1(e){return function(){this.removeAttribute(e)}}function g1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function m1(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 y1(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 b1(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 x1(e,t){var n=fs(e),r=n==="transform"?e1:Yu;return this.attrTween(e,typeof t=="function"?(n.local?b1:y1)(n,r,$o(this,"attr."+e,t)):t==null?(n.local?g1:p1)(n):(n.local?v1:m1)(n,r,t))}function w1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function _1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function E1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&_1(e,s)),n}return i._value=t,i}function S1(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&w1(e,s)),n}return i._value=t,i}function O1(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=fs(e);return this.tween(n,(r.local?E1:S1)(r,t))}function T1(e,t){return function(){Co(this,e).delay=+t.apply(this,arguments)}}function M1(e,t){return t=+t,function(){Co(this,e).delay=t}}function C1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?T1:M1)(t,e)):Pe(this.node(),t).delay}function A1(e,t){return function(){qe(this,e).duration=+t.apply(this,arguments)}}function $1(e,t){return t=+t,function(){qe(this,e).duration=t}}function L1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?A1:$1)(t,e)):Pe(this.node(),t).duration}function D1(e,t){if(typeof t!="function")throw new Error;return function(){qe(this,e).ease=t}}function k1(e){var t=this._id;return arguments.length?this.each(D1(t,e)):Pe(this.node(),t).ease}function R1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qe(this,e).ease=n}}function I1(e){if(typeof e!="function")throw new Error;return this.each(R1(this._id,e))}function P1(e){typeof e!="function"&&(e=pu(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 nn(r,this._parents,this._name,this._id)}function N1(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,h=a[o]=new Array(u),d,f=0;f<u;++f)(d=l[f]||c[f])&&(h[f]=d);for(;o<r;++o)a[o]=t[o];return new nn(a,this._parents,this._name,this._id)}function U1(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 B1(e,t,n){var r,i,s=U1(t)?Co:qe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function V1(e,t){var n=this._id;return arguments.length<2?Pe(this.node(),n).on.on(e):this.each(B1(n,e,t))}function H1(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function F1(){return this.on("end.remove",H1(this._id))}function G1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ho(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,h,d=0;d<l;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),c[d]=h,Ms(c[d],t,n,d,c,Pe(u,n)));return new nn(s,this._parents,t,n)}function z1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fu(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,h=0;h<c;++h)if(u=l[h]){for(var d=e.call(u,u.__data__,h,l),f,p=Pe(u,n),m=0,g=d.length;m<g;++m)(f=d[m])&&Ms(f,t,n,m,d,p);s.push(d),a.push(u)}return new nn(s,a,t,n)}var j1=Kr.prototype.constructor;function W1(){return new j1(this._groups,this._parents)}function q1(e,t){var n,r,i;return function(){var s=cr(this,e),a=(this.style.removeProperty(e),cr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Xu(e){return function(){this.style.removeProperty(e)}}function Y1(e,t,n){var r,i=n+"",s;return function(){var a=cr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function X1(e,t,n){var r,i,s;return function(){var a=cr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),cr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function Z1(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=Xu(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function K1(e,t,n){var r=(e+="")=="transform"?t1:Yu;return t==null?this.styleTween(e,q1(e,r)).on("end.style."+e,Xu(e)):typeof t=="function"?this.styleTween(e,X1(e,r,$o(this,"style."+e,t))).each(Z1(this._id,e)):this.styleTween(e,Y1(e,r,t),n).on("end.style."+e,null)}function Q1(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function J1(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Q1(e,a,n)),r}return s._value=t,s}function tb(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,J1(e,t,n??""))}function eb(e){return function(){this.textContent=e}}function nb(e){return function(){var t=e(this);this.textContent=t??""}}function rb(e){return this.tween("text",typeof e=="function"?nb($o(this,"text",e)):eb(e==null?"":e+""))}function ib(e){return function(t){this.textContent=e.call(this,t)}}function sb(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&ib(i)),t}return r._value=e,r}function ab(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,sb(e))}function ob(){for(var e=this._name,t=this._id,n=Zu(),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=Pe(l,t);Ms(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new nn(r,this._parents,e,n)}function lb(){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 cb=0;function nn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zu(){return++cb}var rn=Kr.prototype;nn.prototype={constructor:nn,select:G1,selectAll:z1,selectChild:rn.selectChild,selectChildren:rn.selectChildren,filter:P1,merge:N1,selection:W1,transition:ob,call:rn.call,nodes:rn.nodes,node:rn.node,size:rn.size,empty:rn.empty,each:rn.each,on:V1,attr:x1,attrTween:O1,style:K1,styleTween:tb,text:rb,textTween:ab,remove:F1,tween:f1,delay:C1,duration:L1,ease:k1,easeVarying:I1,end:lb,[Symbol.iterator]:rn[Symbol.iterator]};const ub=e=>+e;function Ku(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hb={time:null,delay:0,duration:250,ease:Ku};function db(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 fb(e){var t,n;e instanceof nn?(t=e._id,e=e._name):(t=Zu(),(n=hb).time=So(),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])&&Ms(l,e,t,c,a,n||db(l,t));return new nn(r,this._parents,e,t)}Kr.prototype.interrupt=u1,Kr.prototype.transition=fb;const Lo=e=>()=>e;function pb(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 gb(e){e.stopImmediatePropagation()}function Do(e){e.preventDefault(),e.stopImmediatePropagation()}var Qu={name:"drag"},ko={name:"space"},dr={name:"handle"},fr={name:"center"};const{abs:Ju,max:ie,min:se}=Math;function th(e){return[+e[0],+e[1]]}function eh(e){return[th(e[0]),th(e[1])]}var Cs={name:"x",handles:["w","e"].map(As),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]]}},Ro={name:"y",handles:["n","s"].map(As),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},sn={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"},nh={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},rh={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},mb={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},vb={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function As(e){return{type:e}}function yb(e){return!e.ctrlKey&&!e.button}function bb(){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 xb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Io(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function wb(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function ih(){return _b(Cs)}function _b(e){var t=bb,n=yb,r=xb,i=!0,s=co("start","brush","end"),a=6,o;function l(g){var v=g.property("__brush",m).selectAll(".overlay").data([As("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",sn.overlay).merge(v).each(function(){var w=Io(this).extent;N(this).attr("x",w[0][0]).attr("y",w[0][1]).attr("width",w[1][0]-w[0][0]).attr("height",w[1][1]-w[0][1])}),g.selectAll(".selection").data([As("selection")]).enter().append("rect").attr("class","selection").attr("cursor",sn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=g.selectAll(".handle").data(e.handles,function(w){return w.type});b.exit().remove(),b.enter().append("rect").attr("class",function(w){return"handle handle--"+w.type}).attr("cursor",function(w){return sn[w.type]}),g.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(g,v,b){g.tween?g.on("start.brush",function(w){u(this,arguments).beforestart().start(w)}).on("interrupt.brush end.brush",function(w){u(this,arguments).end(w)}).tween("brush",function(){var w=this,O=w.__brush,E=u(w,arguments),T=O.selection,S=e.input(typeof v=="function"?v.apply(this,arguments):v,O.extent),$=ei(T,S);function k(L){O.selection=L===1&&S===null?null:$(L),c.call(w),E.brush()}return T!==null&&S!==null?k:k(1)}):g.each(function(){var w=this,O=arguments,E=w.__brush,T=e.input(typeof v=="function"?v.apply(w,O):v,E.extent),S=u(w,O).beforestart();Ao(w),E.selection=T===null?null:T,c.call(w),S.start(b).brush(b).end(b)})},l.clear=function(g,v){l.move(g,null,v)};function c(){var g=N(this),v=Io(this).selection;v?(g.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(b){return b.type[b.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(b){return b.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(b){return b.type==="n"||b.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(b){return b.type==="e"||b.type==="w"?v[1][1]-v[0][1]+a:a})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(g,v,b){var w=g.__brush.emitter;return w&&(!b||!w.clean)?w:new h(g,v,b)}function h(g,v,b){this.that=g,this.args=v,this.state=g.__brush,this.active=0,this.clean=b}h.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,v){return this.starting?(this.starting=!1,this.emit("start",g,v)):this.emit("brush",g),this},brush:function(g,v){return this.emit("brush",g,v),this},end:function(g,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,v)),this},emit:function(g,v,b){var w=N(this.that).datum();s.call(g,this.that,new pb(g,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:b,dispatch:s}),w)}};function d(g){if(o&&!g.touches||!n.apply(this,arguments))return;var v=this,b=g.target.__data__.type,w=(i&&g.metaKey?b="overlay":b)==="selection"?Qu:i&&g.altKey?fr:dr,O=e===Ro?null:mb[b],E=e===Cs?null:vb[b],T=Io(v),S=T.extent,$=T.selection,k=S[0][0],L,M,V=S[0][1],x,C,y=S[1][0],R,I,B=S[1][1],U,z,j=0,G=0,et,q=O&&E&&i&&g.shiftKey,Q,lt,rt=Array.from(g.touches||[g],it=>{const At=it.identifier;return it=Un(it,v),it.point0=it.slice(),it.identifier=At,it});Ao(v);var ot=u(v,arguments,!0).beforestart();if(b==="overlay"){$&&(et=!0);const it=[rt[0],rt[1]||rt[0]];T.selection=$=[[L=e===Ro?k:se(it[0][0],it[1][0]),x=e===Cs?V:se(it[0][1],it[1][1])],[R=e===Ro?y:ie(it[0][0],it[1][0]),U=e===Cs?B:ie(it[0][1],it[1][1])]],rt.length>1&&wt(g)}else L=$[0][0],x=$[0][1],R=$[1][0],U=$[1][1];M=L,C=x,I=R,z=U;var Y=N(v).attr("pointer-events","none"),X=Y.selectAll(".overlay").attr("cursor",sn[b]);if(g.touches)ot.moved=F,ot.ended=yt;else{var K=N(g.view).on("mousemove.brush",F,!0).on("mouseup.brush",yt,!0);i&&K.on("keydown.brush",Ht,!0).on("keyup.brush",zt,!0),Ay(g.view)}c.call(v),ot.start(g,w.name);function F(it){for(const At of it.changedTouches||[it])for(const Le of rt)Le.identifier===At.identifier&&(Le.cur=Un(At,v));if(q&&!Q&&!lt&&rt.length===1){const At=rt[0];Ju(At.cur[0]-At[0])>Ju(At.cur[1]-At[1])?lt=!0:Q=!0}for(const At of rt)At.cur&&(At[0]=At.cur[0],At[1]=At.cur[1]);et=!0,Do(it),wt(it)}function wt(it){const At=rt[0],Le=At.point0;var De;switch(j=At[0]-Le[0],G=At[1]-Le[1],w){case ko:case Qu:{O&&(j=ie(k-L,se(y-R,j)),M=L+j,I=R+j),E&&(G=ie(V-x,se(B-U,G)),C=x+G,z=U+G);break}case dr:{rt[1]?(O&&(M=ie(k,se(y,rt[0][0])),I=ie(k,se(y,rt[1][0])),O=1),E&&(C=ie(V,se(B,rt[0][1])),z=ie(V,se(B,rt[1][1])),E=1)):(O<0?(j=ie(k-L,se(y-L,j)),M=L+j,I=R):O>0&&(j=ie(k-R,se(y-R,j)),M=L,I=R+j),E<0?(G=ie(V-x,se(B-x,G)),C=x+G,z=U):E>0&&(G=ie(V-U,se(B-U,G)),C=x,z=U+G));break}case fr:{O&&(M=ie(k,se(y,L-j*O)),I=ie(k,se(y,R+j*O))),E&&(C=ie(V,se(B,x-G*E)),z=ie(V,se(B,U+G*E)));break}}I<M&&(O*=-1,De=L,L=R,R=De,De=M,M=I,I=De,b in nh&&X.attr("cursor",sn[b=nh[b]])),z<C&&(E*=-1,De=x,x=U,U=De,De=C,C=z,z=De,b in rh&&X.attr("cursor",sn[b=rh[b]])),T.selection&&($=T.selection),Q&&(M=$[0][0],I=$[1][0]),lt&&(C=$[0][1],z=$[1][1]),($[0][0]!==M||$[0][1]!==C||$[1][0]!==I||$[1][1]!==z)&&(T.selection=[[M,C],[I,z]],c.call(v),ot.brush(it,w.name))}function yt(it){if(gb(it),it.touches){if(it.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else $y(it.view,et),K.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Y.attr("pointer-events","all"),X.attr("cursor",sn.overlay),T.selection&&($=T.selection),wb($)&&(T.selection=null,c.call(v)),ot.end(it,w.name)}function Ht(it){switch(it.keyCode){case 16:{q=O&&E;break}case 18:{w===dr&&(O&&(R=I-j*O,L=M+j*O),E&&(U=z-G*E,x=C+G*E),w=fr,wt(it));break}case 32:{(w===dr||w===fr)&&(O<0?R=I-j:O>0&&(L=M-j),E<0?U=z-G:E>0&&(x=C-G),w=ko,X.attr("cursor",sn.selection),wt(it));break}default:return}Do(it)}function zt(it){switch(it.keyCode){case 16:{q&&(Q=lt=q=!1,wt(it));break}case 18:{w===fr&&(O<0?R=I:O>0&&(L=M),E<0?U=z:E>0&&(x=C),w=dr,wt(it));break}case 32:{w===ko&&(it.altKey?(O&&(R=I-j*O,L=M+j*O),E&&(U=z-G*E,x=C+G*E),w=fr):(O<0?R=I:O>0&&(L=M),E<0?U=z:E>0&&(x=C),w=dr),X.attr("cursor",sn[b]),wt(it));break}default:return}Do(it)}}function f(g){u(this,arguments).moved(g)}function p(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=eh(t.apply(this,arguments)),g.dim=e,g}return l.extent=function(g){return arguments.length?(t=typeof g=="function"?g:Lo(eh(g)),l):t},l.filter=function(g){return arguments.length?(n=typeof g=="function"?g:Lo(!!g),l):n},l.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:Lo(!!g),l):r},l.handleSize=function(g){return arguments.length?(a=+g,l):a},l.keyModifiers=function(g){return arguments.length?(i=!!g,l):i},l.on=function(){var g=s.on.apply(s,arguments);return g===s?l:g},l}const Po=Math.PI,No=2*Po,Fn=1e-6,Eb=No-Fn;function sh(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Sb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return sh;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let Uo=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?sh:Sb(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,h=o-n,d=u*u+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>Fn)if(!(Math.abs(h*l-c*u)>Fn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,m=l*l+c*c,g=f*f+p*p,v=Math.sqrt(m),b=Math.sqrt(d),w=s*Math.tan((Po-Math.acos((m+d-g)/(2*v*b)))/2),O=w/b,E=w/v;Math.abs(O-1)>Fn&&this._append`L${t+O*u},${n+O*h}`,this._append`A${s},${s},0,0,${+(h*f>u*p)},${this._x1=t+E*l},${this._y1=n+E*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,h=1^a,d=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Fn||Math.abs(this._y1-u)>Fn)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%No+No),d>Eb?this._append`A${r},${r},0,1,${h},${t-o},${n-l}A${r},${r},0,1,${h},${this._x1=c},${this._y1=u}`:d>Fn&&this._append`A${r},${r},0,${+(d>=Po)},${h},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function ah(){return new Uo}ah.prototype=Uo.prototype;function Ob(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function $s(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function pr(e){return e=$s(Math.abs(e)),e?e[1]:NaN}function Tb(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function Mb(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Cb=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ai(e){if(!(t=Cb.exec(e)))throw new Error("invalid format: "+e);var t;return new Bo({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ai.prototype=Bo.prototype;function Bo(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Bo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Ab(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var oh;function $b(e,t){var n=$s(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(oh=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+$s(e,Math.max(0,t+s-1))[0]}function lh(e,t){var n=$s(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const ch={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ob,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>lh(e*100,t),r:lh,s:$b,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function uh(e){return e}var hh=Array.prototype.map,dh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lb(e){var t=e.grouping===void 0||e.thousands===void 0?uh:Tb(hh.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?uh:Mb(hh.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(h){h=ai(h);var d=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,v=h.width,b=h.comma,w=h.precision,O=h.trim,E=h.type;E==="n"?(b=!0,E="g"):ch[E]||(w===void 0&&(w=12),O=!0,E="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var T=m==="$"?n:m==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",S=m==="$"?r:/[%p]/.test(E)?a:"",$=ch[E],k=/[defgprs%]/.test(E);w=w===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function L(M){var V=T,x=S,C,y,R;if(E==="c")x=$(M)+x,M="";else{M=+M;var I=M<0||1/M<0;if(M=isNaN(M)?l:$(Math.abs(M),w),O&&(M=Ab(M)),I&&+M==0&&p!=="+"&&(I=!1),V=(I?p==="("?p:o:p==="-"||p==="("?"":p)+V,x=(E==="s"?dh[8+oh/3]:"")+x+(I&&p==="("?")":""),k){for(C=-1,y=M.length;++C<y;)if(R=M.charCodeAt(C),48>R||R>57){x=(R===46?i+M.slice(C+1):M.slice(C))+x,M=M.slice(0,C);break}}}b&&!g&&(M=t(M,1/0));var B=V.length+M.length+x.length,U=B<v?new Array(v-B+1).join(d):"";switch(b&&g&&(M=t(U+M,U.length?v-x.length:1/0),U=""),f){case"<":M=V+M+x+U;break;case"=":M=V+U+M+x;break;case"^":M=U.slice(0,B=U.length>>1)+V+M+x+U.slice(B);break;default:M=U+V+M+x;break}return s(M)}return L.toString=function(){return h+""},L}function u(h,d){var f=c((h=ai(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(pr(d)/3)))*3,m=Math.pow(10,-p),g=dh[8+p/3];return function(v){return f(m*v)+g}}return{format:c,formatPrefix:u}}var Ls,Vo,fh;Db({thousands:",",grouping:[3],currency:["$",""]});function Db(e){return Ls=Lb(e),Vo=Ls.format,fh=Ls.formatPrefix,Ls}function kb(e){return Math.max(0,-pr(Math.abs(e)))}function Rb(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(pr(t)/3)))*3-pr(Math.abs(e)))}function Ib(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,pr(t)-pr(e))+1}var St=1e-6,ph=1e-12,pt=Math.PI,pe=pt/2,gh=pt/4,_e=pt*2,ce=180/pt,Ft=pt/180,Ot=Math.abs,mh=Math.atan,Gn=Math.atan2,Mt=Math.cos,Pb=Math.exp,Nb=Math.log,Et=Math.sin,On=Math.sign||function(e){return e>0?1:e<0?-1:0},Ne=Math.sqrt,Ub=Math.tan;function Bb(e){return e>1?0:e<-1?pt:Math.acos(e)}function an(e){return e>1?pe:e<-1?-pe:Math.asin(e)}function Oe(){}function Ds(e,t){e&&yh.hasOwnProperty(e.type)&&yh[e.type](e,t)}var vh={Feature:function(e,t){Ds(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Ds(n[r].geometry,t)}},yh={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Ho(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Ho(n[r],t,0)},Polygon:function(e,t){bh(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)bh(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Ds(n[r],t)}};function Ho(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function bh(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Ho(e[n],t,1);t.polygonEnd()}function gr(e,t){e&&vh.hasOwnProperty(e.type)?vh[e.type](e,t):Ds(e,t)}function Fo(e){return[Gn(e[1],e[0]),an(e[2])]}function mr(e){var t=e[0],n=e[1],r=Mt(n);return[r*Mt(t),r*Et(t),Et(n)]}function ks(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Rs(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Go(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Is(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function zo(e){var t=Ne(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function jo(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function Wo(e,t){return Ot(e)>pt&&(e-=Math.round(e/_e)*_e),[e,t]}Wo.invert=Wo;function xh(e,t,n){return(e%=_e)?t||n?jo(_h(e),Eh(t,n)):_h(e):t||n?Eh(t,n):Wo}function wh(e){return function(t,n){return t+=e,Ot(t)>pt&&(t-=Math.round(t/_e)*_e),[t,n]}}function _h(e){var t=wh(e);return t.invert=wh(-e),t}function Eh(e,t){var n=Mt(e),r=Et(e),i=Mt(t),s=Et(t);function a(o,l){var c=Mt(l),u=Mt(o)*c,h=Et(o)*c,d=Et(l),f=d*n+u*r;return[Gn(h*i-f*s,u*n-d*r),an(f*i+h*s)]}return a.invert=function(o,l){var c=Mt(l),u=Mt(o)*c,h=Et(o)*c,d=Et(l),f=d*i-h*s;return[Gn(h*i+d*s,u*n+f*r),an(f*n-u*r)]},a}function Vb(e){e=xh(e[0]*Ft,e[1]*Ft,e.length>2?e[2]*Ft:0);function t(n){return n=e(n[0]*Ft,n[1]*Ft),n[0]*=ce,n[1]*=ce,n}return t.invert=function(n){return n=e.invert(n[0]*Ft,n[1]*Ft),n[0]*=ce,n[1]*=ce,n},t}function Hb(e,t,n,r,i,s){if(n){var a=Mt(t),o=Et(t),l=r*n;i==null?(i=t+r*_e,s=t-l/2):(i=Sh(a,i),s=Sh(a,s),(r>0?i<s:i>s)&&(i+=r*_e));for(var c,u=i;r>0?u>s:u<s;u-=l)c=Fo([a,-o*Mt(u),-o*Et(u)]),e.point(c[0],c[1])}}function Sh(e,t){t=mr(t),t[0]-=e,zo(t);var n=Bb(-t[1]);return((-t[2]<0?-n:n)+_e-St)%_e}function Oh(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Oe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ps(e,t){return Ot(e[0]-t[0])<St&&Ot(e[1]-t[1])<St}function Ns(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Th(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],v=p[m],b;if(Ps(g,v)){if(!g[2]&&!v[2]){for(i.lineStart(),o=0;o<m;++o)i.point((g=p[o])[0],g[1]);i.lineEnd();return}v[0]+=2*St}s.push(b=new Ns(g,p,null,!0)),a.push(b.o=new Ns(g,null,b,!1)),s.push(b=new Ns(v,p,null,!1)),a.push(b.o=new Ns(v,null,b,!0))}}),!!s.length){for(a.sort(t),Mh(s),Mh(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,h;;){for(var d=c,f=!0;d.v;)if((d=d.n)===c)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((h=u[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(f)for(u=d.p.z,o=u.length-1;o>=0;--o)i.point((h=u[o])[0],h[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,f=!f}while(!d.v);i.lineEnd()}}}function Mh(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function qo(e){return Ot(e[0])<=pt?e[0]:On(e[0])*((Ot(e[0])+pt)%_e-pt)}function Fb(e,t){var n=qo(t),r=t[1],i=Et(r),s=[Et(n),-Mt(n),0],a=0,o=0,l=new Pn;i===1?r=pe+St:i===-1&&(r=-pe-St);for(var c=0,u=e.length;c<u;++c)if(d=(h=e[c]).length)for(var h,d,f=h[d-1],p=qo(f),m=f[1]/2+gh,g=Et(m),v=Mt(m),b=0;b<d;++b,p=O,g=T,v=S,f=w){var w=h[b],O=qo(w),E=w[1]/2+gh,T=Et(E),S=Mt(E),$=O-p,k=$>=0?1:-1,L=k*$,M=L>pt,V=g*T;if(l.add(Gn(V*k*Et(L),v*S+V*Mt(L))),a+=M?$+k*_e:$,M^p>=n^O>=n){var x=Rs(mr(f),mr(w));zo(x);var C=Rs(s,x);zo(C);var y=(M^$>=0?-1:1)*an(C[2]);(r>y||r===y&&(x[0]||x[1]))&&(o+=M^$>=0?1:-1)}}return(a<-St||a<St&&l<-ph)^o&1}function Ch(e,t,n,r){return function(i){var s=t(i),a=Oh(),o=t(a),l=!1,c,u,h,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=b,d.lineEnd=w,u=[],c=[]},polygonEnd:function(){d.point=f,d.lineStart=m,d.lineEnd=g,u=ou(u);var O=Fb(c,r);u.length?(l||(i.polygonStart(),l=!0),Th(u,zb,O,n,i)):O&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(O,E){e(O,E)&&i.point(O,E)}function p(O,E){s.point(O,E)}function m(){d.point=p,s.lineStart()}function g(){d.point=f,s.lineEnd()}function v(O,E){h.push([O,E]),o.point(O,E)}function b(){o.lineStart(),h=[]}function w(){v(h[0][0],h[0][1]),o.lineEnd();var O=o.clean(),E=a.result(),T,S=E.length,$,k,L;if(h.pop(),c.push(h),h=null,!!S){if(O&1){if(k=E[0],($=k.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),T=0;T<$;++T)i.point((L=k[T])[0],L[1]);i.lineEnd()}return}S>1&&O&2&&E.push(E.pop().concat(E.shift())),u.push(E.filter(Gb))}}return d}}function Gb(e){return e.length>1}function zb(e,t){return((e=e.x)[0]<0?e[1]-pe-St:pe-e[1])-((t=t.x)[0]<0?t[1]-pe-St:pe-t[1])}const Ah=Ch(function(){return!0},jb,qb,[-pt,-pe]);function jb(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?pt:-pt,l=Ot(s-t);Ot(l-pt)<St?(e.point(t,n=(n+a)/2>0?pe:-pe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=pt&&(Ot(t-r)<St&&(t-=r*St),Ot(s-o)<St&&(s-=o*St),n=Wb(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function Wb(e,t,n,r){var i,s,a=Et(e-n);return Ot(a)>St?mh((Et(t)*(s=Mt(r))*Et(n)-Et(r)*(i=Mt(t))*Et(e))/(i*s*a)):(t+r)/2}function qb(e,t,n,r){var i;if(e==null)i=n*pe,r.point(-pt,i),r.point(0,i),r.point(pt,i),r.point(pt,0),r.point(pt,-i),r.point(0,-i),r.point(-pt,-i),r.point(-pt,0),r.point(-pt,i);else if(Ot(e[0]-t[0])>St){var s=e[0]<t[0]?pt:-pt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function Yb(e){var t=Mt(e),n=6*Ft,r=t>0,i=Ot(t)>St;function s(u,h,d,f){Hb(f,e,n,d,u,h)}function a(u,h){return Mt(u)*Mt(h)>t}function o(u){var h,d,f,p,m;return{lineStart:function(){p=f=!1,m=1},point:function(g,v){var b=[g,v],w,O=a(g,v),E=r?O?0:c(g,v):O?c(g+(g<0?pt:-pt),v):0;if(!h&&(p=f=O)&&u.lineStart(),O!==f&&(w=l(h,b),(!w||Ps(h,w)||Ps(b,w))&&(b[2]=1)),O!==f)m=0,O?(u.lineStart(),w=l(b,h),u.point(w[0],w[1])):(w=l(h,b),u.point(w[0],w[1],2),u.lineEnd()),h=w;else if(i&&h&&r^O){var T;!(E&d)&&(T=l(b,h,!0))&&(m=0,r?(u.lineStart(),u.point(T[0][0],T[0][1]),u.point(T[1][0],T[1][1]),u.lineEnd()):(u.point(T[1][0],T[1][1]),u.lineEnd(),u.lineStart(),u.point(T[0][0],T[0][1],3)))}O&&(!h||!Ps(h,b))&&u.point(b[0],b[1]),h=b,f=O,d=E},lineEnd:function(){f&&u.lineEnd(),h=null},clean:function(){return m|(p&&f)<<1}}}function l(u,h,d){var f=mr(u),p=mr(h),m=[1,0,0],g=Rs(f,p),v=ks(g,g),b=g[0],w=v-b*b;if(!w)return!d&&u;var O=t*v/w,E=-t*b/w,T=Rs(m,g),S=Is(m,O),$=Is(g,E);Go(S,$);var k=T,L=ks(S,k),M=ks(k,k),V=L*L-M*(ks(S,S)-1);if(!(V<0)){var x=Ne(V),C=Is(k,(-L-x)/M);if(Go(C,S),C=Fo(C),!d)return C;var y=u[0],R=h[0],I=u[1],B=h[1],U;R<y&&(U=y,y=R,R=U);var z=R-y,j=Ot(z-pt)<St,G=j||z<St;if(!j&&B<I&&(U=I,I=B,B=U),G?j?I+B>0^C[1]<(Ot(C[0]-y)<St?I:B):I<=C[1]&&C[1]<=B:z>pt^(y<=C[0]&&C[0]<=R)){var et=Is(k,(-L+x)/M);return Go(et,S),[C,Fo(et)]}}}function c(u,h){var d=r?e:pt-e,f=0;return u<-d?f|=1:u>d&&(f|=2),h<-d?f|=4:h>d&&(f|=8),f}return Ch(a,o,s,r?[0,-e]:[-pt,e-pt])}function Xb(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,h=1,d=l-a,f=c-o,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<h&&(h=p)}else if(d>0){if(p>h)return;p>u&&(u=p)}if(p=i-a,!(!d&&p<0)){if(p/=d,d<0){if(p>h)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<h&&(h=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<h&&(h=p)}else if(f>0){if(p>h)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>h)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<h&&(h=p)}return u>0&&(e[0]=a+u*d,e[1]=o+u*f),h<1&&(t[0]=a+h*d,t[1]=o+h*f),!0}}}}}var oi=1e9,Us=-oi;function Zb(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,h,d){var f=0,p=0;if(c==null||(f=a(c,h))!==(p=a(u,h))||l(c,u)<0^h>0)do d.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+h+4)%4)!==p);else d.point(u[0],u[1])}function a(c,u){return Ot(c[0]-e)<St?u>0?0:3:Ot(c[0]-n)<St?u>0?2:1:Ot(c[1]-t)<St?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var h=a(c,1),d=a(u,1);return h!==d?h-d:h===0?u[1]-c[1]:h===1?c[0]-u[0]:h===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,h=Oh(),d,f,p,m,g,v,b,w,O,E,T,S={point:$,lineStart:V,lineEnd:x,polygonStart:L,polygonEnd:M};function $(y,R){i(y,R)&&u.point(y,R)}function k(){for(var y=0,R=0,I=f.length;R<I;++R)for(var B=f[R],U=1,z=B.length,j=B[0],G,et,q=j[0],Q=j[1];U<z;++U)G=q,et=Q,j=B[U],q=j[0],Q=j[1],et<=r?Q>r&&(q-G)*(r-et)>(Q-et)*(e-G)&&++y:Q<=r&&(q-G)*(r-et)<(Q-et)*(e-G)&&--y;return y}function L(){u=h,d=[],f=[],T=!0}function M(){var y=k(),R=T&&y,I=(d=ou(d)).length;(R||I)&&(c.polygonStart(),R&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),I&&Th(d,o,y,s,c),c.polygonEnd()),u=c,d=f=p=null}function V(){S.point=C,f&&f.push(p=[]),E=!0,O=!1,b=w=NaN}function x(){d&&(C(m,g),v&&O&&h.rejoin(),d.push(h.result())),S.point=$,O&&u.lineEnd()}function C(y,R){var I=i(y,R);if(f&&p.push([y,R]),E)m=y,g=R,v=I,E=!1,I&&(u.lineStart(),u.point(y,R));else if(I&&O)u.point(y,R);else{var B=[b=Math.max(Us,Math.min(oi,b)),w=Math.max(Us,Math.min(oi,w))],U=[y=Math.max(Us,Math.min(oi,y)),R=Math.max(Us,Math.min(oi,R))];Xb(B,U,e,t,n,r)?(O||(u.lineStart(),u.point(B[0],B[1])),u.point(U[0],U[1]),I||u.lineEnd(),T=!1):I&&(u.lineStart(),u.point(y,R),T=!1)}b=y,w=R,O=I}return S}}const Yo=e=>e;var Xo=new Pn,Zo=new Pn,$h,Lh,Ko,Qo,Tn={point:Oe,lineStart:Oe,lineEnd:Oe,polygonStart:function(){Tn.lineStart=Kb,Tn.lineEnd=Jb},polygonEnd:function(){Tn.lineStart=Tn.lineEnd=Tn.point=Oe,Xo.add(Ot(Zo)),Zo=new Pn},result:function(){var e=Xo/2;return Xo=new Pn,e}};function Kb(){Tn.point=Qb}function Qb(e,t){Tn.point=Dh,$h=Ko=e,Lh=Qo=t}function Dh(e,t){Zo.add(Qo*e-Ko*t),Ko=e,Qo=t}function Jb(){Dh($h,Lh)}const kh=Tn;var vr=1/0,Bs=vr,li=-vr,Vs=li,tx={point:ex,lineStart:Oe,lineEnd:Oe,polygonStart:Oe,polygonEnd:Oe,result:function(){var e=[[vr,Bs],[li,Vs]];return li=Vs=-(Bs=vr=1/0),e}};function ex(e,t){e<vr&&(vr=e),e>li&&(li=e),t<Bs&&(Bs=t),t>Vs&&(Vs=t)}const Hs=tx;var Jo=0,tl=0,ci=0,Fs=0,Gs=0,yr=0,el=0,nl=0,ui=0,Rh,Ih,Ye,Xe,Ue={point:zn,lineStart:Ph,lineEnd:Nh,polygonStart:function(){Ue.lineStart=ix,Ue.lineEnd=sx},polygonEnd:function(){Ue.point=zn,Ue.lineStart=Ph,Ue.lineEnd=Nh},result:function(){var e=ui?[el/ui,nl/ui]:yr?[Fs/yr,Gs/yr]:ci?[Jo/ci,tl/ci]:[NaN,NaN];return Jo=tl=ci=Fs=Gs=yr=el=nl=ui=0,e}};function zn(e,t){Jo+=e,tl+=t,++ci}function Ph(){Ue.point=nx}function nx(e,t){Ue.point=rx,zn(Ye=e,Xe=t)}function rx(e,t){var n=e-Ye,r=t-Xe,i=Ne(n*n+r*r);Fs+=i*(Ye+e)/2,Gs+=i*(Xe+t)/2,yr+=i,zn(Ye=e,Xe=t)}function Nh(){Ue.point=zn}function ix(){Ue.point=ax}function sx(){Uh(Rh,Ih)}function ax(e,t){Ue.point=Uh,zn(Rh=Ye=e,Ih=Xe=t)}function Uh(e,t){var n=e-Ye,r=t-Xe,i=Ne(n*n+r*r);Fs+=i*(Ye+e)/2,Gs+=i*(Xe+t)/2,yr+=i,i=Xe*e-Ye*t,el+=i*(Ye+e),nl+=i*(Xe+t),ui+=i*3,zn(Ye=e,Xe=t)}const Bh=Ue;function Vh(e){this._context=e}Vh.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,_e);break}}},result:Oe};var rl=new Pn,il,Hh,Fh,hi,di,zs={point:Oe,lineStart:function(){zs.point=ox},lineEnd:function(){il&&Gh(Hh,Fh),zs.point=Oe},polygonStart:function(){il=!0},polygonEnd:function(){il=null},result:function(){var e=+rl;return rl=new Pn,e}};function ox(e,t){zs.point=Gh,Hh=hi=e,Fh=di=t}function Gh(e,t){hi-=e,di-=t,rl.add(Ne(hi*hi+di*di)),hi=e,di=t}const zh=zs;let jh,js,Wh,qh;class Yh{constructor(t){this._append=t==null?Xh:lx(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==Wh||this._append!==js){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,Wh=r,js=this._append,qh=this._,this._=i}this._+=qh;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Xh(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function lx(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Xh;if(t!==jh){const n=10**t;jh=t,js=function(i){let s=1;this._+=i[0];for(const a=i.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+i[s]}}return js}function cx(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),gr(o,i(s))),s.result()}return a.area=function(o){return gr(o,i(kh)),kh.result()},a.measure=function(o){return gr(o,i(zh)),zh.result()},a.bounds=function(o){return gr(o,i(Hs)),Hs.result()},a.centroid=function(o){return gr(o,i(Bh)),Bh.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Yo):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new Yh(n)):new Vh(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new Yh(n)),a},a.projection(e).digits(n).context(t)}function sl(e){return function(t){var n=new al;for(var r in e)n[r]=e[r];return n.stream=t,n}}function al(){}al.prototype={constructor:al,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function ol(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),gr(n,e.stream(Hs)),t(Hs.result()),r!=null&&e.clipExtent(r),e}function Zh(e,t,n){return ol(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function ux(e,t,n){return Zh(e,[[0,0],t],n)}function hx(e,t,n){return ol(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function dx(e,t,n){return ol(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var Kh=16,fx=Mt(30*Ft);function Qh(e,t){return+t?gx(e,t):px(e)}function px(e){return sl({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function gx(e,t){function n(r,i,s,a,o,l,c,u,h,d,f,p,m,g){var v=c-r,b=u-i,w=v*v+b*b;if(w>4*t&&m--){var O=a+d,E=o+f,T=l+p,S=Ne(O*O+E*E+T*T),$=an(T/=S),k=Ot(Ot(T)-1)<St||Ot(s-h)<St?(s+h)/2:Gn(E,O),L=e(k,$),M=L[0],V=L[1],x=M-r,C=V-i,y=b*x-v*C;(y*y/w>t||Ot((v*x+b*C)/w-.5)>.3||a*d+o*f+l*p<fx)&&(n(r,i,s,a,o,l,M,V,k,O/=S,E/=S,T,m,g),g.point(M,V),n(M,V,k,O,E,T,c,u,h,d,f,p,m,g))}}return function(r){var i,s,a,o,l,c,u,h,d,f,p,m,g={point:v,lineStart:b,lineEnd:O,polygonStart:function(){r.polygonStart(),g.lineStart=E},polygonEnd:function(){r.polygonEnd(),g.lineStart=b}};function v($,k){$=e($,k),r.point($[0],$[1])}function b(){h=NaN,g.point=w,r.lineStart()}function w($,k){var L=mr([$,k]),M=e($,k);n(h,d,u,f,p,m,h=M[0],d=M[1],u=$,f=L[0],p=L[1],m=L[2],Kh,r),r.point(h,d)}function O(){g.point=v,r.lineEnd()}function E(){b(),g.point=T,g.lineEnd=S}function T($,k){w(i=$,k),s=h,a=d,o=f,l=p,c=m,g.point=w}function S(){n(h,d,u,f,p,m,s,a,i,o,l,c,Kh,r),g.lineEnd=O,O()}return g}}var mx=sl({point:function(e,t){this.stream.point(e*Ft,t*Ft)}});function vx(e){return sl({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function yx(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function Jh(e,t,n,r,i,s){if(!s)return yx(e,t,n,r,i);var a=Mt(s),o=Et(s),l=a*e,c=o*e,u=a/e,h=o/e,d=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(m,g){return m*=r,g*=i,[l*m-c*g+t,n-c*m-l*g]}return p.invert=function(m,g){return[r*(u*m-h*g+d),i*(f-h*m-u*g)]},p}function Ws(e){return td(function(){return e})()}function td(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,h=0,d=1,f=1,p=null,m=Ah,g=null,v,b,w,O=Yo,E=.5,T,S,$,k,L;function M(y){return $(y[0]*Ft,y[1]*Ft)}function V(y){return y=$.invert(y[0],y[1]),y&&[y[0]*ce,y[1]*ce]}M.stream=function(y){return k&&L===y?k:k=mx(vx(u)(m(T(O(L=y)))))},M.preclip=function(y){return arguments.length?(m=y,p=void 0,C()):m},M.postclip=function(y){return arguments.length?(O=y,g=v=b=w=null,C()):O},M.clipAngle=function(y){return arguments.length?(m=+y?Yb(p=y*Ft):(p=null,Ah),C()):p*ce},M.clipExtent=function(y){return arguments.length?(O=y==null?(g=v=b=w=null,Yo):Zb(g=+y[0][0],v=+y[0][1],b=+y[1][0],w=+y[1][1]),C()):g==null?null:[[g,v],[b,w]]},M.scale=function(y){return arguments.length?(n=+y,x()):n},M.translate=function(y){return arguments.length?(r=+y[0],i=+y[1],x()):[r,i]},M.center=function(y){return arguments.length?(s=y[0]%360*Ft,a=y[1]%360*Ft,x()):[s*ce,a*ce]},M.rotate=function(y){return arguments.length?(o=y[0]%360*Ft,l=y[1]%360*Ft,c=y.length>2?y[2]%360*Ft:0,x()):[o*ce,l*ce,c*ce]},M.angle=function(y){return arguments.length?(h=y%360*Ft,x()):h*ce},M.reflectX=function(y){return arguments.length?(d=y?-1:1,x()):d<0},M.reflectY=function(y){return arguments.length?(f=y?-1:1,x()):f<0},M.precision=function(y){return arguments.length?(T=Qh(S,E=y*y),C()):Ne(E)},M.fitExtent=function(y,R){return Zh(M,y,R)},M.fitSize=function(y,R){return ux(M,y,R)},M.fitWidth=function(y,R){return hx(M,y,R)},M.fitHeight=function(y,R){return dx(M,y,R)};function x(){var y=Jh(n,0,0,d,f,h).apply(null,t(s,a)),R=Jh(n,r-y[0],i-y[1],d,f,h);return u=xh(o,l,c),S=jo(t,R),$=jo(u,S),T=Qh(S,E),C()}function C(){return k=L=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&V,x()}}function ed(e){var t=0,n=pt/3,r=td(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Ft,n=s[1]*Ft):[t*ce,n*ce]},i}function bx(e){var t=Mt(e);function n(r,i){return[r*t,Et(i)/t]}return n.invert=function(r,i){return[r/t,an(i*t)]},n}function xx(e,t){var n=Et(e),r=(n+Et(t))/2;if(Ot(r)<St)return bx(e);var i=1+n*(2*r-n),s=Ne(i)/r;function a(o,l){var c=Ne(i-2*r*Et(l))/r;return[c*Et(o*=r),s-c*Mt(o)]}return a.invert=function(o,l){var c=s-l,u=Gn(o,Ot(c))*On(c);return c*r<0&&(u-=pt*On(o)*On(c)),[u/r,an((i-(o*o+c*c)*r*r)/(2*r))]},a}function nd(){return ed(xx).scale(155.424).center([0,33.6442])}function wx(){return nd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ll(e,t){return[e,Nb(Ub((pe+t)/2))]}ll.invert=function(e,t){return[e,2*mh(Pb(t))-pe]};function _x(){return Ex(ll).scale(961/_e)}function Ex(e){var t=Ws(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(h){return arguments.length?(r(h),u()):r()},t.translate=function(h){return arguments.length?(i(h),u()):i()},t.center=function(h){return arguments.length?(n(h),u()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=o=l=c=null:(a=+h[0][0],o=+h[0][1],l=+h[1][0],c=+h[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var h=pt*r(),d=t(Vb(t.rotate()).invert([0,0]));return s(a==null?[[d[0]-h,d[1]-h],[d[0]+h,d[1]+h]]:e===ll?[[Math.max(d[0]-h,a),o],[Math.min(d[0]+h,l),c]]:[[a,Math.max(d[1]-h,o)],[l,Math.min(d[1]+h,c)]])}return u()}function qs(e,t){return[e,t]}qs.invert=qs;function Sx(){return Ws(qs).scale(152.63)}function Ox(e,t){var n=Mt(e),r=e===t?Et(e):(n-Mt(t))/(t-e),i=n/r+e;if(Ot(r)<St)return qs;function s(a,o){var l=i-o,c=r*a;return[l*Et(c),i-l*Mt(c)]}return s.invert=function(a,o){var l=i-o,c=Gn(a,Ot(l))*On(l);return l*r<0&&(c-=pt*On(a)*On(l)),[c/r,i-On(r)*Ne(a*a+l*l)]},s}function Tx(){return ed(Ox).scale(131.154).center([0,13.9389])}var fi=1.340264,pi=-.081106,gi=893e-6,mi=.003796,Ys=Ne(3)/2,Mx=12;function rd(e,t){var n=an(Ys*Et(t)),r=n*n,i=r*r*r;return[e*Mt(n)/(Ys*(fi+3*pi*r+i*(7*gi+9*mi*r))),n*(fi+pi*r+i*(gi+mi*r))]}rd.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<Mx&&(o=n*(fi+pi*r+i*(gi+mi*r))-t,l=fi+3*pi*r+i*(7*gi+9*mi*r),n-=a=o/l,r=n*n,i=r*r*r,!(Ot(a)<ph));++s);return[Ys*e*(fi+3*pi*r+i*(7*gi+9*mi*r))/Mt(n),an(Et(n)/Ys)]};function Cx(){return Ws(rd).scale(177.158)}function id(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}id.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Ot(i)>St&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Ax(){return Ws(id).scale(175.295)}function $x(e,t){return e.parent===t.parent?1:2}function Lx(e){return e.reduce(Dx,0)/e.length}function Dx(e,t){return e+t.x}function kx(e){return 1+e.reduce(Rx,0)}function Rx(e,t){return Math.max(e,t.y)}function Ix(e){for(var t;t=e.children;)e=t[0];return e}function Px(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Nx(){var e=$x,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(d){var f=d.children;f?(d.x=Lx(f),d.y=kx(f)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var l=Ix(s),c=Px(s),u=l.x-e(l,c)/2,h=c.x+e(c,l)/2;return s.eachAfter(r?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-u)/(h-u)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function Ux(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Bx(){return this.eachAfter(Ux)}function Vx(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Hx(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function Fx(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function Gx(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function zx(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function jx(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Wx(e){for(var t=this,n=qx(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function qx(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function Yx(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Xx(){return Array.from(this)}function Zx(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Kx(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Qx(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function vi(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=ew)):t===void 0&&(t=tw);for(var n=new yi(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new yi(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(rw)}function Jx(){return vi(this).eachBefore(nw)}function tw(e){return e.children}function ew(e){return Array.isArray(e)?e[1]:null}function nw(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function rw(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function yi(e){this.data=e,this.depth=this.height=0,this.parent=null}yi.prototype=vi.prototype={constructor:yi,count:Bx,each:Vx,eachAfter:Fx,eachBefore:Hx,find:Gx,sum:zx,sort:jx,path:Wx,ancestors:Yx,descendants:Xx,leaves:Zx,links:Kx,copy:Jx,[Symbol.iterator]:Qx};function iw(e){return e==null?null:sd(e)}function sd(e){if(typeof e!="function")throw new Error;return e}function jn(){return 0}function br(e){return function(){return e}}const sw=1664525,aw=1013904223,ad=4294967296;function ow(){let e=1;return()=>(e=(sw*e+aw)%ad)/ad}function lw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function cw(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function uw(e,t){for(var n=0,r=(e=cw(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&od(a,s)?++n:(a=dw(i=hw(i,s)),n=0);return a}function hw(e,t){var n,r;if(cl(t,e))return[t];for(n=0;n<e.length;++n)if(Xs(t,e[n])&&cl(bi(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Xs(bi(e[n],e[r]),t)&&Xs(bi(e[n],t),e[r])&&Xs(bi(e[r],t),e[n])&&cl(ld(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Xs(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function od(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function cl(e,t){for(var n=0;n<t.length;++n)if(!od(e,t[n]))return!1;return!0}function dw(e){switch(e.length){case 1:return fw(e[0]);case 2:return bi(e[0],e[1]);case 3:return ld(e[0],e[1],e[2])}}function fw(e){return{x:e.x,y:e.y,r:e.r}}function bi(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,h=Math.sqrt(l*l+c*c);return{x:(n+s+l/h*u)/2,y:(r+a+c/h*u)/2,r:(h+i+o)/2}}function ld(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,h=n.r,d=r-a,f=r-c,p=i-o,m=i-u,g=l-s,v=h-s,b=r*r+i*i-s*s,w=b-a*a-o*o+l*l,O=b-c*c-u*u+h*h,E=f*p-d*m,T=(p*O-m*w)/(E*2)-r,S=(m*g-p*v)/E,$=(f*w-d*O)/(E*2)-i,k=(d*v-f*g)/E,L=S*S+k*k-1,M=2*(s+T*S+$*k),V=T*T+$*$-s*s,x=-(Math.abs(L)>1e-6?(M+Math.sqrt(M*M-4*L*V))/(2*L):V/M);return{x:r+T+S*x,y:i+$+k*x,r:x}}function cd(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function ud(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function hd(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function Zs(e){this._=e,this.next=null,this.previous=null}function pw(e,t){if(!(s=(e=lw(e)).length))return 0;var n,r,i,s,a,o,l,c,u,h,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;cd(r,n,i=e[2]),n=new Zs(n),r=new Zs(r),i=new Zs(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){cd(n._,r._,i=e[l]),i=new Zs(i),c=r.next,u=n.previous,h=r._.r,d=n._.r;do if(h<=d){if(ud(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}h+=c._.r,c=c.next}else{if(ud(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}d+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=hd(n);(i=i.next)!==r;)(o=hd(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=uw(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function gw(e){return Math.sqrt(e.value)}function mw(){var e=null,t=1,n=1,r=jn;function i(s){const a=ow();return s.x=t/2,s.y=n/2,e?s.eachBefore(dd(e)).eachAfter(ul(r,.5,a)).eachBefore(fd(1)):s.eachBefore(dd(gw)).eachAfter(ul(jn,1,a)).eachAfter(ul(r,s.r/Math.min(t,n),a)).eachBefore(fd(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=iw(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:br(+s),i):r},i}function dd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function ul(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=pw(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function fd(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function vw(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function yw(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function bw(e,t){return e.parent===t.parent?1:2}function hl(e){var t=e.children;return t?t[0]:e.t}function dl(e){var t=e.children;return t?t[t.length-1]:e.t}function xw(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function ww(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function _w(e,t,n){return e.a.parent===t.parent?e.a:n}function Ks(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Ks.prototype=Object.create(yi.prototype);function Ew(e){for(var t=new Ks(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new Ks(s[a],a)),i.parent=n;return(t.parent=new Ks(null,0)).children=[t],t}function Sw(){var e=bw,t=1,n=1,r=null;function i(c){var u=Ew(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var h=c,d=c,f=c;c.eachBefore(function(b){b.x<h.x&&(h=b),b.x>d.x&&(d=b),b.depth>f.depth&&(f=b)});var p=h===d?1:e(h,d)/2,m=p-h.x,g=t/(d.x+p+m),v=n/(f.depth||1);c.eachBefore(function(b){b.x=(b.x+m)*g,b.y=b.depth*v})}return c}function s(c){var u=c.children,h=c.parent.children,d=c.i?h[c.i-1]:null;if(u){ww(c);var f=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-f):c.z=f}else d&&(c.z=d.z+e(c._,d._));c.parent.A=o(c,d,c.parent.A||h[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,h){if(u){for(var d=c,f=c,p=u,m=d.parent.children[0],g=d.m,v=f.m,b=p.m,w=m.m,O;p=dl(p),d=hl(d),p&&d;)m=hl(m),f=dl(f),f.a=c,O=p.z+b-d.z-g+e(p._,d._),O>0&&(xw(_w(p,c,h),c,O),g+=O,v+=O),b+=p.m,g+=d.m,w+=m.m,v+=f.m;p&&!dl(f)&&(f.t=p,f.m+=b-v),d&&!hl(m)&&(m.t=d,m.m+=g-w,h=c)}return h}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function Ow(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var Tw=(1+Math.sqrt(5))/2;function Mw(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,h=0,d=o.length,f,p,m=t.value,g,v,b,w,O,E,T;u<d;){f=i-n,p=s-r;do g=o[h++].value;while(!g&&h<d);for(v=b=g,E=Math.max(p/f,f/p)/(m*e),T=g*g*E,O=Math.max(b/T,T/v);h<d;++h){if(g+=c=o[h].value,c<v&&(v=c),c>b&&(b=c),T=g*g*E,w=Math.max(b/T,T/v),w>O){g-=c;break}O=w}a.push(l={value:g,dice:f<p,children:o.slice(u,h)}),l.dice?yw(l,n,r,i,m?r+=p*g/m:s):Ow(l,n,r,m?n+=f*g/m:i,s),m-=g,u=h}return a}const Cw=function e(t){function n(r,i,s,a,o){Mw(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(Tw);function Aw(){var e=Cw,t=!1,n=1,r=1,i=[0],s=jn,a=jn,o=jn,l=jn,c=jn;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(h),i=[0],t&&d.eachBefore(vw),d}function h(d){var f=i[d.depth],p=d.x0+f,m=d.y0+f,g=d.x1-f,v=d.y1-f;g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),d.x0=p,d.y0=m,d.x1=g,d.y1=v,d.children&&(f=i[d.depth+1]=s(d)/2,p+=c(d)-f,m+=a(d)-f,g-=o(d)-f,v-=l(d)-f,g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),e(d,p,m,g,v))}return u.round=function(d){return arguments.length?(t=!!d,u):t},u.size=function(d){return arguments.length?(n=+d[0],r=+d[1],u):[n,r]},u.tile=function(d){return arguments.length?(e=sd(d),u):e},u.padding=function(d){return arguments.length?u.paddingInner(d).paddingOuter(d):u.paddingInner()},u.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:br(+d),u):s},u.paddingOuter=function(d){return arguments.length?u.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):u.paddingTop()},u.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:br(+d),u):a},u.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:br(+d),u):o},u.paddingBottom=function(d){return arguments.length?(l=typeof d=="function"?d:br(+d),u):l},u.paddingLeft=function(d){return arguments.length?(c=typeof d=="function"?d:br(+d),u):c},u}function xr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const pd=Symbol("implicit");function Qs(){var e=new ru,t=[],n=[],r=pd;function i(s){let a=e.get(s);if(a===void 0){if(r!==pd)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new ru;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return Qs(t,n).unknown(r)},xr.apply(i,arguments),i}function xi(){var e=Qs().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function h(){var d=t().length,f=i<r,p=f?i:r,m=f?r:i;s=(m-p)/Math.max(1,d-l+c*2),o&&(s=Math.floor(s)),p+=(m-p-s*(d-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var g=Uv(d).map(function(v){return p+s*v});return n(f?g.reverse():g)}return e.domain=function(d){return arguments.length?(t(d),h()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(d){return arguments.length?(o=!!d,h()):o},e.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),h()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),h()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,h()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),h()):u},e.copy=function(){return xi(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},xr.apply(h(),arguments)}function $w(e){return function(){return e}}function Lw(e){return+e}var gd=[0,1];function wr(e){return e}function fl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:$w(isNaN(t)?NaN:.5)}function Dw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function kw(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=fl(i,r),s=n(a,s)):(r=fl(r,i),s=n(s,a)),function(o){return s(r(o))}}function Rw(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=fl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=ro(e,o,1,r)-1;return s[l](i[l](o))}}function pl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function md(){var e=gd,t=gd,n=ei,r,i,s,a=wr,o,l,c;function u(){var d=Math.min(e.length,t.length);return a!==wr&&(a=Dw(e[0],e[d-1])),o=d>2?Rw:kw,l=c=null,h}function h(d){return d==null||isNaN(d=+d)?s:(l||(l=o(e.map(r),t,n)))(r(a(d)))}return h.invert=function(d){return a(i((c||(c=o(t,e.map(r),we)))(d)))},h.domain=function(d){return arguments.length?(e=Array.from(d,Lw),u()):e.slice()},h.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},h.rangeRound=function(d){return t=Array.from(d),n=Pu,u()},h.clamp=function(d){return arguments.length?(a=d?!0:wr,u()):a!==wr},h.interpolate=function(d){return arguments.length?(n=d,u()):n},h.unknown=function(d){return arguments.length?(s=d,h):s},function(d,f){return r=d,i=f,u()}}function vd(){return md()(wr,wr)}function Iw(e,t,n,r){var i=so(e,t,n),s;switch(r=ai(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Rb(i,a))&&(r.precision=s),fh(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Ib(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=kb(i))&&(r.precision=s-(r.type==="%")*2);break}}return Vo(r)}function yd(e){var t=e.domain;return e.ticks=function(n){var r=t();return ls(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Iw(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=lr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Be(){var e=vd();return e.copy=function(){return pl(e,Be())},xr.apply(e,arguments),yd(e)}function bd(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function xd(e){return Math.log(e)}function wd(e){return Math.exp(e)}function Pw(e){return-Math.log(-e)}function Nw(e){return-Math.exp(-e)}function Uw(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Bw(e){return e===10?Uw:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Vw(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function _d(e){return(t,n)=>-e(-t,n)}function Hw(e){const t=e(xd,wd),n=t.domain;let r=10,i,s;function a(){return i=Vw(r),s=Bw(r),n()[0]<0?(i=_d(i),s=_d(s),e(Pw,Nw)):e(xd,wd),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const h=u<c;h&&([c,u]=[u,c]);let d=i(c),f=i(u),p,m;const g=o==null?10:+o;let v=[];if(!(r%1)&&f-d<g){if(d=Math.floor(d),f=Math.ceil(f),c>0){for(;d<=f;++d)for(p=1;p<r;++p)if(m=d<0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}}else for(;d<=f;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}v.length*2<g&&(v=ls(c,u,g))}else v=ls(d,f,Math.min(f-d,g)).map(s);return h?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=ai(l)).precision==null&&(l.trim=!0),l=Vo(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let h=u/s(Math.round(i(u)));return h*r<r-.5&&(h*=r),h<=c?l(u):""}},t.nice=()=>n(bd(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Ed(){const e=Hw(md()).domain([1,10]);return e.copy=()=>pl(e,Ed()).base(e.base()),xr.apply(e,arguments),e}function gl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[ro(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return gl().domain([e,t]).range(i).unknown(s)},xr.apply(yd(a),arguments)}const ml=new Date,vl=new Date;function qt(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>qt(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(ml.setTime(+s),vl.setTime(+a),e(ml),e(vl),Math.floor(n(ml,vl))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Js=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Js.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Js),Js.range;const on=1e3,Te=on*60,ln=Te*60,cn=ln*24,yl=cn*7,Sd=cn*30,bl=cn*365,_r=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*on)},(e,t)=>(t-e)/on,e=>e.getUTCSeconds());_r.range;const xl=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*on)},(e,t)=>{e.setTime(+e+t*Te)},(e,t)=>(t-e)/Te,e=>e.getMinutes());xl.range,qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Te)},(e,t)=>(t-e)/Te,e=>e.getUTCMinutes()).range;const wl=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*on-e.getMinutes()*Te)},(e,t)=>{e.setTime(+e+t*ln)},(e,t)=>(t-e)/ln,e=>e.getHours());wl.range,qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ln)},(e,t)=>(t-e)/ln,e=>e.getUTCHours()).range;const wi=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Te)/cn,e=>e.getDate()-1);wi.range;const _l=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/cn,e=>e.getUTCDate()-1);_l.range,qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/cn,e=>Math.floor(e/cn)).range;function Wn(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Te)/yl)}const ta=Wn(0),ea=Wn(1),Fw=Wn(2),Gw=Wn(3),Er=Wn(4),zw=Wn(5),jw=Wn(6);ta.range,ea.range,Fw.range,Gw.range,Er.range,zw.range,jw.range;function qn(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/yl)}const Od=qn(0),na=qn(1),Ww=qn(2),qw=qn(3),Sr=qn(4),Yw=qn(5),Xw=qn(6);Od.range,na.range,Ww.range,qw.range,Sr.range,Yw.range,Xw.range;const El=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());El.range,qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const un=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());un.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),un.range;const Yn=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Yn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Yn.range;function Zw(e,t,n,r,i,s){const a=[[_r,1,on],[_r,5,5*on],[_r,15,15*on],[_r,30,30*on],[s,1,Te],[s,5,5*Te],[s,15,15*Te],[s,30,30*Te],[i,1,ln],[i,3,3*ln],[i,6,6*ln],[i,12,12*ln],[r,1,cn],[r,2,2*cn],[n,1,yl],[t,1,Sd],[t,3,3*Sd],[e,1,bl]];function o(c,u,h){const d=u<c;d&&([c,u]=[u,c]);const f=h&&typeof h.range=="function"?h:l(c,u,h),p=f?f.range(c,+u+1):[];return d?p.reverse():p}function l(c,u,h){const d=Math.abs(u-c)/h,f=no(([,,g])=>g).right(a,d);if(f===a.length)return e.every(so(c/bl,u/bl,h));if(f===0)return Js.every(Math.max(so(c,u,h),1));const[p,m]=a[d/a[f-1][2]<a[f][2]/d?f-1:f];return p.every(m)}return[o,l]}const[Kw,Qw]=Zw(un,El,ta,wi,wl,xl);function Sl(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ol(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function _i(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Jw(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=Ei(i),u=Si(i),h=Ei(s),d=Si(s),f=Ei(a),p=Si(a),m=Ei(o),g=Si(o),v=Ei(l),b=Si(l),w={a:I,A:B,b:U,B:z,c:null,d:Ld,e:Ld,f:__,g:D_,G:R_,H:b_,I:x_,j:w_,L:Dd,m:E_,M:S_,p:j,q:G,Q:Ud,s:Bd,S:O_,u:T_,U:M_,V:C_,w:A_,W:$_,x:null,X:null,y:L_,Y:k_,Z:I_,"%":Nd},O={a:et,A:q,b:Q,B:lt,c:null,d:Rd,e:Rd,f:B_,g:X_,G:K_,H:P_,I:N_,j:U_,L:Id,m:V_,M:H_,p:rt,q:ot,Q:Ud,s:Bd,S:F_,u:G_,U:z_,V:j_,w:W_,W:q_,x:null,X:null,y:Y_,Y:Z_,Z:Q_,"%":Nd},E={a:L,A:M,b:V,B:x,c:C,d:Ad,e:Ad,f:g_,g:Cd,G:Md,H:$d,I:$d,j:h_,L:p_,m:u_,M:d_,p:k,q:c_,Q:v_,s:y_,S:f_,u:i_,U:s_,V:a_,w:r_,W:o_,x:y,X:R,y:Cd,Y:Md,Z:l_,"%":m_};w.x=T(n,w),w.X=T(r,w),w.c=T(t,w),O.x=T(n,O),O.X=T(r,O),O.c=T(t,O);function T(Y,X){return function(K){var F=[],wt=-1,yt=0,Ht=Y.length,zt,it,At;for(K instanceof Date||(K=new Date(+K));++wt<Ht;)Y.charCodeAt(wt)===37&&(F.push(Y.slice(yt,wt)),(it=Td[zt=Y.charAt(++wt)])!=null?zt=Y.charAt(++wt):it=zt==="e"?" ":"0",(At=X[zt])&&(zt=At(K,it)),F.push(zt),yt=wt+1);return F.push(Y.slice(yt,wt)),F.join("")}}function S(Y,X){return function(K){var F=_i(1900,void 0,1),wt=$(F,Y,K+="",0),yt,Ht;if(wt!=K.length)return null;if("Q"in F)return new Date(F.Q);if("s"in F)return new Date(F.s*1e3+("L"in F?F.L:0));if(X&&!("Z"in F)&&(F.Z=0),"p"in F&&(F.H=F.H%12+F.p*12),F.m===void 0&&(F.m="q"in F?F.q:0),"V"in F){if(F.V<1||F.V>53)return null;"w"in F||(F.w=1),"Z"in F?(yt=Ol(_i(F.y,0,1)),Ht=yt.getUTCDay(),yt=Ht>4||Ht===0?na.ceil(yt):na(yt),yt=_l.offset(yt,(F.V-1)*7),F.y=yt.getUTCFullYear(),F.m=yt.getUTCMonth(),F.d=yt.getUTCDate()+(F.w+6)%7):(yt=Sl(_i(F.y,0,1)),Ht=yt.getDay(),yt=Ht>4||Ht===0?ea.ceil(yt):ea(yt),yt=wi.offset(yt,(F.V-1)*7),F.y=yt.getFullYear(),F.m=yt.getMonth(),F.d=yt.getDate()+(F.w+6)%7)}else("W"in F||"U"in F)&&("w"in F||(F.w="u"in F?F.u%7:"W"in F?1:0),Ht="Z"in F?Ol(_i(F.y,0,1)).getUTCDay():Sl(_i(F.y,0,1)).getDay(),F.m=0,F.d="W"in F?(F.w+6)%7+F.W*7-(Ht+5)%7:F.w+F.U*7-(Ht+6)%7);return"Z"in F?(F.H+=F.Z/100|0,F.M+=F.Z%100,Ol(F)):Sl(F)}}function $(Y,X,K,F){for(var wt=0,yt=X.length,Ht=K.length,zt,it;wt<yt;){if(F>=Ht)return-1;if(zt=X.charCodeAt(wt++),zt===37){if(zt=X.charAt(wt++),it=E[zt in Td?X.charAt(wt++):zt],!it||(F=it(Y,K,F))<0)return-1}else if(zt!=K.charCodeAt(F++))return-1}return F}function k(Y,X,K){var F=c.exec(X.slice(K));return F?(Y.p=u.get(F[0].toLowerCase()),K+F[0].length):-1}function L(Y,X,K){var F=f.exec(X.slice(K));return F?(Y.w=p.get(F[0].toLowerCase()),K+F[0].length):-1}function M(Y,X,K){var F=h.exec(X.slice(K));return F?(Y.w=d.get(F[0].toLowerCase()),K+F[0].length):-1}function V(Y,X,K){var F=v.exec(X.slice(K));return F?(Y.m=b.get(F[0].toLowerCase()),K+F[0].length):-1}function x(Y,X,K){var F=m.exec(X.slice(K));return F?(Y.m=g.get(F[0].toLowerCase()),K+F[0].length):-1}function C(Y,X,K){return $(Y,t,X,K)}function y(Y,X,K){return $(Y,n,X,K)}function R(Y,X,K){return $(Y,r,X,K)}function I(Y){return a[Y.getDay()]}function B(Y){return s[Y.getDay()]}function U(Y){return l[Y.getMonth()]}function z(Y){return o[Y.getMonth()]}function j(Y){return i[+(Y.getHours()>=12)]}function G(Y){return 1+~~(Y.getMonth()/3)}function et(Y){return a[Y.getUTCDay()]}function q(Y){return s[Y.getUTCDay()]}function Q(Y){return l[Y.getUTCMonth()]}function lt(Y){return o[Y.getUTCMonth()]}function rt(Y){return i[+(Y.getUTCHours()>=12)]}function ot(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var X=T(Y+="",w);return X.toString=function(){return Y},X},parse:function(Y){var X=S(Y+="",!1);return X.toString=function(){return Y},X},utcFormat:function(Y){var X=T(Y+="",O);return X.toString=function(){return Y},X},utcParse:function(Y){var X=S(Y+="",!0);return X.toString=function(){return Y},X}}}var Td={"-":"",_:" ",0:"0"},Qt=/^\s*\d+/,t_=/^%/,e_=/[\\^$*+?|[\]().{}]/g;function bt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function n_(e){return e.replace(e_,"\\$&")}function Ei(e){return new RegExp("^(?:"+e.map(n_).join("|")+")","i")}function Si(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function r_(e,t,n){var r=Qt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function i_(e,t,n){var r=Qt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function s_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function a_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function o_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Md(e,t,n){var r=Qt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Cd(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function l_(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function c_(e,t,n){var r=Qt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function u_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Ad(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function h_(e,t,n){var r=Qt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function $d(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function d_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function f_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function p_(e,t,n){var r=Qt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function g_(e,t,n){var r=Qt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function m_(e,t,n){var r=t_.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function v_(e,t,n){var r=Qt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function y_(e,t,n){var r=Qt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Ld(e,t){return bt(e.getDate(),t,2)}function b_(e,t){return bt(e.getHours(),t,2)}function x_(e,t){return bt(e.getHours()%12||12,t,2)}function w_(e,t){return bt(1+wi.count(un(e),e),t,3)}function Dd(e,t){return bt(e.getMilliseconds(),t,3)}function __(e,t){return Dd(e,t)+"000"}function E_(e,t){return bt(e.getMonth()+1,t,2)}function S_(e,t){return bt(e.getMinutes(),t,2)}function O_(e,t){return bt(e.getSeconds(),t,2)}function T_(e){var t=e.getDay();return t===0?7:t}function M_(e,t){return bt(ta.count(un(e)-1,e),t,2)}function kd(e){var t=e.getDay();return t>=4||t===0?Er(e):Er.ceil(e)}function C_(e,t){return e=kd(e),bt(Er.count(un(e),e)+(un(e).getDay()===4),t,2)}function A_(e){return e.getDay()}function $_(e,t){return bt(ea.count(un(e)-1,e),t,2)}function L_(e,t){return bt(e.getFullYear()%100,t,2)}function D_(e,t){return e=kd(e),bt(e.getFullYear()%100,t,2)}function k_(e,t){return bt(e.getFullYear()%1e4,t,4)}function R_(e,t){var n=e.getDay();return e=n>=4||n===0?Er(e):Er.ceil(e),bt(e.getFullYear()%1e4,t,4)}function I_(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+bt(t/60|0,"0",2)+bt(t%60,"0",2)}function Rd(e,t){return bt(e.getUTCDate(),t,2)}function P_(e,t){return bt(e.getUTCHours(),t,2)}function N_(e,t){return bt(e.getUTCHours()%12||12,t,2)}function U_(e,t){return bt(1+_l.count(Yn(e),e),t,3)}function Id(e,t){return bt(e.getUTCMilliseconds(),t,3)}function B_(e,t){return Id(e,t)+"000"}function V_(e,t){return bt(e.getUTCMonth()+1,t,2)}function H_(e,t){return bt(e.getUTCMinutes(),t,2)}function F_(e,t){return bt(e.getUTCSeconds(),t,2)}function G_(e){var t=e.getUTCDay();return t===0?7:t}function z_(e,t){return bt(Od.count(Yn(e)-1,e),t,2)}function Pd(e){var t=e.getUTCDay();return t>=4||t===0?Sr(e):Sr.ceil(e)}function j_(e,t){return e=Pd(e),bt(Sr.count(Yn(e),e)+(Yn(e).getUTCDay()===4),t,2)}function W_(e){return e.getUTCDay()}function q_(e,t){return bt(na.count(Yn(e)-1,e),t,2)}function Y_(e,t){return bt(e.getUTCFullYear()%100,t,2)}function X_(e,t){return e=Pd(e),bt(e.getUTCFullYear()%100,t,2)}function Z_(e,t){return bt(e.getUTCFullYear()%1e4,t,4)}function K_(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Sr(e):Sr.ceil(e),bt(e.getUTCFullYear()%1e4,t,4)}function Q_(){return"+0000"}function Nd(){return"%"}function Ud(e){return+e}function Bd(e){return Math.floor(+e/1e3)}var Or,Vd;J_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function J_(e){return Or=Jw(e),Vd=Or.format,Or.parse,Or.utcFormat,Or.utcParse,Or}function tE(e){return new Date(e)}function eE(e){return e instanceof Date?+e:+new Date(+e)}function Hd(e,t,n,r,i,s,a,o,l,c){var u=vd(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),b=c("%b %d"),w=c("%B"),O=c("%Y");function E(T){return(l(T)<T?f:o(T)<T?p:a(T)<T?m:s(T)<T?g:r(T)<T?i(T)<T?v:b:n(T)<T?w:O)(T)}return u.invert=function(T){return new Date(h(T))},u.domain=function(T){return arguments.length?d(Array.from(T,eE)):d().map(tE)},u.ticks=function(T){var S=d();return e(S[0],S[S.length-1],T??10)},u.tickFormat=function(T,S){return S==null?E:c(S)},u.nice=function(T){var S=d();return(!T||typeof T.range!="function")&&(T=t(S[0],S[S.length-1],T??10)),T?d(bd(S,T)):u},u.copy=function(){return pl(u,Hd(e,t,n,r,i,s,a,o,l,c))},u}function Fd(){return xr.apply(Hd(Kw,Qw,un,El,ta,wi,wl,xl,_r,Vd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ft(e){return function(){return e}}const Gd=Math.abs,ae=Math.atan2,Xn=Math.cos,nE=Math.max,Tl=Math.min,Ze=Math.sin,Tr=Math.sqrt,oe=1e-12,Oi=Math.PI,ra=Oi/2,ia=2*Oi;function rE(e){return e>1?0:e<-1?Oi:Math.acos(e)}function zd(e){return e>=1?ra:e<=-1?-ra:Math.asin(e)}function sa(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Uo(t)}function iE(e){return e.innerRadius}function sE(e){return e.outerRadius}function aE(e){return e.startAngle}function oE(e){return e.endAngle}function lE(e){return e&&e.padAngle}function cE(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,h=o-s,d=h*l-u*c;if(!(d*d<oe))return d=(u*(t-s)-h*(e-i))/d,[e+d*l,t+d*c]}function aa(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Tr(o*o+l*l),u=c*l,h=-c*o,d=e+u,f=t+h,p=n+u,m=r+h,g=(d+p)/2,v=(f+m)/2,b=p-d,w=m-f,O=b*b+w*w,E=i-s,T=d*m-p*f,S=(w<0?-1:1)*Tr(nE(0,E*E*O-T*T)),$=(T*w-b*S)/O,k=(-T*b-w*S)/O,L=(T*w+b*S)/O,M=(-T*b+w*S)/O,V=$-g,x=k-v,C=L-g,y=M-v;return V*V+x*x>C*C+y*y&&($=L,k=M),{cx:$,cy:k,x01:-u,y01:-h,x11:$*(i/E-1),y11:k*(i/E-1)}}function Ti(){var e=iE,t=sE,n=ft(0),r=null,i=aE,s=oE,a=lE,o=null,l=sa(c);function c(){var u,h,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-ra,m=s.apply(this,arguments)-ra,g=Gd(m-p),v=m>p;if(o||(o=u=l()),f<d&&(h=f,f=d,d=h),!(f>oe))o.moveTo(0,0);else if(g>ia-oe)o.moveTo(f*Xn(p),f*Ze(p)),o.arc(0,0,f,p,m,!v),d>oe&&(o.moveTo(d*Xn(m),d*Ze(m)),o.arc(0,0,d,m,p,v));else{var b=p,w=m,O=p,E=m,T=g,S=g,$=a.apply(this,arguments)/2,k=$>oe&&(r?+r.apply(this,arguments):Tr(d*d+f*f)),L=Tl(Gd(f-d)/2,+n.apply(this,arguments)),M=L,V=L,x,C;if(k>oe){var y=zd(k/d*Ze($)),R=zd(k/f*Ze($));(T-=y*2)>oe?(y*=v?1:-1,O+=y,E-=y):(T=0,O=E=(p+m)/2),(S-=R*2)>oe?(R*=v?1:-1,b+=R,w-=R):(S=0,b=w=(p+m)/2)}var I=f*Xn(b),B=f*Ze(b),U=d*Xn(E),z=d*Ze(E);if(L>oe){var j=f*Xn(w),G=f*Ze(w),et=d*Xn(O),q=d*Ze(O),Q;if(g<Oi)if(Q=cE(I,B,et,q,j,G,U,z)){var lt=I-Q[0],rt=B-Q[1],ot=j-Q[0],Y=G-Q[1],X=1/Ze(rE((lt*ot+rt*Y)/(Tr(lt*lt+rt*rt)*Tr(ot*ot+Y*Y)))/2),K=Tr(Q[0]*Q[0]+Q[1]*Q[1]);M=Tl(L,(d-K)/(X-1)),V=Tl(L,(f-K)/(X+1))}else M=V=0}S>oe?V>oe?(x=aa(et,q,I,B,f,V,v),C=aa(j,G,U,z,f,V,v),o.moveTo(x.cx+x.x01,x.cy+x.y01),V<L?o.arc(x.cx,x.cy,V,ae(x.y01,x.x01),ae(C.y01,C.x01),!v):(o.arc(x.cx,x.cy,V,ae(x.y01,x.x01),ae(x.y11,x.x11),!v),o.arc(0,0,f,ae(x.cy+x.y11,x.cx+x.x11),ae(C.cy+C.y11,C.cx+C.x11),!v),o.arc(C.cx,C.cy,V,ae(C.y11,C.x11),ae(C.y01,C.x01),!v))):(o.moveTo(I,B),o.arc(0,0,f,b,w,!v)):o.moveTo(I,B),!(d>oe)||!(T>oe)?o.lineTo(U,z):M>oe?(x=aa(U,z,j,G,d,-M,v),C=aa(I,B,et,q,d,-M,v),o.lineTo(x.cx+x.x01,x.cy+x.y01),M<L?o.arc(x.cx,x.cy,M,ae(x.y01,x.x01),ae(C.y01,C.x01),!v):(o.arc(x.cx,x.cy,M,ae(x.y01,x.x01),ae(x.y11,x.x11),!v),o.arc(0,0,d,ae(x.cy+x.y11,x.cx+x.x11),ae(C.cy+C.y11,C.cx+C.x11),v),o.arc(C.cx,C.cy,M,ae(C.y11,C.x11),ae(C.y01,C.x01),!v))):o.arc(0,0,d,E,O,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Oi/2;return[Xn(h)*u,Ze(h)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ft(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ft(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ft(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ft(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ft(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ft(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ft(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var uE=Array.prototype.slice;function oa(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jd(e){this._context=e}jd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function la(e){return new jd(e)}function Ml(e){return e[0]}function Cl(e){return e[1]}function Mi(e,t){var n=ft(!0),r=null,i=la,s=null,a=sa(o);e=typeof e=="function"?e:e===void 0?Ml:ft(e),t=typeof t=="function"?t:t===void 0?Cl:ft(t);function o(l){var c,u=(l=oa(l)).length,h,d=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(h=l[c],c,l))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,c,l),+t(h,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:ft(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ft(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ft(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function Al(e,t,n){var r=null,i=ft(!0),s=null,a=la,o=null,l=sa(c);e=typeof e=="function"?e:e===void 0?Ml:ft(+e),t=typeof t=="function"?t:ft(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Cl:ft(+n);function c(h){var d,f,p,m=(h=oa(h)).length,g,v=!1,b,w=new Array(m),O=new Array(m);for(s==null&&(o=a(b=l())),d=0;d<=m;++d){if(!(d<m&&i(g=h[d],d,h))===v)if(v=!v)f=d,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=d-1;p>=f;--p)o.point(w[p],O[p]);o.lineEnd(),o.areaEnd()}v&&(w[d]=+e(g,d,h),O[d]=+t(g,d,h),o.point(r?+r(g,d,h):w[d],n?+n(g,d,h):O[d]))}if(b)return o=null,b+""||null}function u(){return Mi().defined(i).curve(a).context(s)}return c.x=function(h){return arguments.length?(e=typeof h=="function"?h:ft(+h),r=null,c):e},c.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ft(+h),c):e},c.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ft(+h),c):r},c.y=function(h){return arguments.length?(t=typeof h=="function"?h:ft(+h),n=null,c):t},c.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ft(+h),c):t},c.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ft(+h),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(h){return arguments.length?(i=typeof h=="function"?h:ft(!!h),c):i},c.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),c):a},c.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),c):s},c}function hE(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function dE(e){return e}function fE(){var e=dE,t=hE,n=null,r=ft(0),i=ft(ia),s=ft(0);function a(o){var l,c=(o=oa(o)).length,u,h,d=0,f=new Array(c),p=new Array(c),m=+r.apply(this,arguments),g=Math.min(ia,Math.max(-ia,i.apply(this,arguments)-m)),v,b=Math.min(Math.abs(g)/c,s.apply(this,arguments)),w=b*(g<0?-1:1),O;for(l=0;l<c;++l)(O=p[f[l]=l]=+e(o[l],l,o))>0&&(d+=O);for(t!=null?f.sort(function(E,T){return t(p[E],p[T])}):n!=null&&f.sort(function(E,T){return n(o[E],o[T])}),l=0,h=d?(g-c*w)/d:0;l<c;++l,m=v)u=f[l],O=p[u],v=m+(O>0?O*h:0)+w,p[u]={data:o[u],index:l,value:O,startAngle:m,endAngle:v,padAngle:b};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ft(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:ft(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ft(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ft(+o),a):s},a}var pE=qd(la);function Wd(e){this._curve=e}Wd.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function qd(e){function t(n){return new Wd(e(n))}return t._curve=e,t}function gE(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(qd(n)):t()._curve},e}function mE(){return gE(Mi().curve(pE))}class vE{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function yE(e){return new vE(e,!0)}function bE(e){return e.source}function xE(e){return e.target}function wE(e){let t=bE,n=xE,r=Ml,i=Cl,s=null,a=null,o=sa(l);function l(){let c;const u=uE.call(arguments),h=t.apply(this,u),d=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:ft(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ft(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function _E(){return wE(yE)}function Mn(){}function ca(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ua(e){this._context=e}ua.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ca(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ca(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EE(e){return new ua(e)}function Yd(e){this._context=e}Yd.prototype={areaStart:Mn,areaEnd:Mn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ca(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function SE(e){return new Yd(e)}function Xd(e){this._context=e}Xd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ca(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OE(e){return new Xd(e)}function Zd(e,t){this._basis=new ua(e),this._beta=t}Zd.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const TE=function e(t){function n(r){return t===1?new ua(r):new Zd(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function ha(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function $l(e,t){this._context=e,this._k=(1-t)/6}$l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ha(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ME=function e(t){function n(r){return new $l(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ll(e,t){this._context=e,this._k=(1-t)/6}Ll.prototype={areaStart:Mn,areaEnd:Mn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const CE=function e(t){function n(r){return new Ll(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Dl(e,t){this._context=e,this._k=(1-t)/6}Dl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const AE=function e(t){function n(r){return new Dl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function kl(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>oe){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>oe){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function Kd(e,t){this._context=e,this._alpha=t}Kd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:kl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const $E=function e(t){function n(r){return t?new Kd(r,t):new $l(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Qd(e,t){this._context=e,this._alpha=t}Qd.prototype={areaStart:Mn,areaEnd:Mn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:kl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const LE=function e(t){function n(r){return t?new Qd(r,t):new Ll(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Jd(e,t){this._context=e,this._alpha=t}Jd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kl(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const DE=function e(t){function n(r){return t?new Jd(r,t):new Dl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function tf(e){this._context=e}tf.prototype={areaStart:Mn,areaEnd:Mn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ef(e){return new tf(e)}function nf(e){return e<0?-1:1}function rf(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(nf(s)+nf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function sf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Rl(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function da(e){this._context=e}da.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Rl(this,this._t0,sf(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Rl(this,sf(this,n=rf(this,e,t)),n);break;default:Rl(this,this._t0,n=rf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function af(e){this._context=new of(e)}(af.prototype=Object.create(da.prototype)).point=function(e,t){da.prototype.point.call(this,t,e)};function of(e){this._context=e}of.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function kE(e){return new da(e)}function RE(e){return new af(e)}function lf(e){this._context=e}lf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=cf(e),i=cf(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function cf(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function IE(e){return new lf(e)}function fa(e,t){this._context=e,this._t=t}fa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function PE(e){return new fa(e,.5)}function NE(e){return new fa(e,0)}function UE(e){return new fa(e,1)}function uf(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function hf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function BE(e,t){return e[t]}function VE(e){const t=[];return t.key=e,t}function Il(){var e=ft([]),t=hf,n=uf,r=BE;function i(s){var a=Array.from(e.apply(this,arguments),VE),o,l=a.length,c=-1,u;for(const h of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(h,a[o].key,c,s)]).data=h;for(o=0,u=oa(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:ft(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ft(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?hf:typeof s=="function"?s:ft(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??uf,i):n},i}function HE(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function Ci(e,t,n){this.k=e,this.x=t,this.y=n}Ci.prototype={constructor:Ci,scale:function(e){return e===1?this:new Ci(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ci(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Ci.prototype;var df=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(df||{}),ff=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(ff||{}),pf=(e=>(e.UPDATE="model-update",e))(pf||{}),gf=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(gf||{}),mf=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(mf||{}),vf=(e=>(e.CHANGE="zoom-domain-change",e))(vf||{}),yf=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(yf||{}),bf=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(bf||{}),xf=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(xf||{}),wf=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(wf||{}),_f=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(_f||{}),Ef=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(Ef||{}),Sf=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Sf||{}),Of=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(Of||{}),Tf=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Tf||{}),Mf=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Mf||{}),Cf=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(Cf||{}),Af=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Af||{}),$f=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))($f||{}),Ai=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Ai||{}),Lf=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Lf||{}),Df=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Df||{}),kf=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(kf||{}),Rf=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(Rf||{}),If=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(If||{}),Pf=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Pf||{}),Mr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Mr||{});const FE=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Rf,Area:xf,Axis:bf,Bar:Sf,Boxplot:Of,CanvasZoom:yf,Chart:df,Choropleth:Mr,CirclePack:kf,Gauge:Ef,Heatmap:Pf,Legend:Df,Line:Mf,Meter:If,Modal:ff,Model:pf,Pie:_f,Radar:Cf,Scatter:Tf,Threshold:Lf,Toolbar:gf,Tooltip:Ai,Tree:Af,Treemap:$f,WordCloud:wf,ZoomBar:mf,ZoomDomain:vf},Symbol.toStringTag,{value:"Module"})),A=FE;var nt=(e=>(e.HTML="html",e.SVG="svg",e))(nt||{}),Nf=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Nf||{}),st=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(st||{}),H=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(H||{}),Ke=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ke||{}),Ve=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ve||{}),Jt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Jt||{}),tt=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(tt||{}),$i=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))($i||{}),Yt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Yt||{}),Li=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Li||{}),Pl=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Pl||{}),Lt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(Lt||{}),ut=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(ut||{}),Cr=(e=>(e.CENTER="center",e))(Cr||{}),pa=(e=>(e.LEFT="left",e.RIGHT="right",e))(pa||{}),Xt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Xt||{}),hn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(hn||{}),dn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(dn||{}),Ar=(e=>(e.SEMI="semi",e.FULL="full",e))(Ar||{}),Nl=(e=>(e.UP="up",e.DOWN="down",e))(Nl||{}),ga=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(ga||{}),ma=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(ma||{}),Me=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))(Me||{}),Bt=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(Bt||{}),Ul=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ul||{}),Zt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Zt||{}),va=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(va||{}),Di=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Di||{}),ya=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(ya||{}),fn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(fn||{});function Bl(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}function ki(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&e.formattingValues){var s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{var o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[o]}var c=e.argumentCallback?e.argumentCallback(t):t;return i[c]}}function Ri(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;var a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?zE(o,function(h){return h.test(a)}):GE(o,function(h){return h.test(a)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(a.length);return{value:c,rest:u}}}function GE(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function zE(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function jE(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],s=t.match(e.parsePattern);if(!s)return null;var a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;var o=t.slice(i.length);return{value:a,rest:o}}}function ba(e){"@babel/helpers - typeof";return ba=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ba(e)}function Kt(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ht(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function xt(e){ht(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||ba(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function xa(e,t){ht(2,arguments);var n=xt(e).getTime(),r=Kt(t);return new Date(n+r)}var WE={};function wa(){return WE}function Vl(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function qE(e){return ht(1,arguments),e instanceof Date||ba(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function YE(e){if(ht(1,arguments),!qE(e)&&typeof e!="number")return!1;var t=xt(e);return!isNaN(Number(t))}function XE(e,t){ht(2,arguments);var n=Kt(t);return xa(e,-n)}var ZE=864e5;function KE(e){ht(1,arguments);var t=xt(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=n-r;return Math.floor(i/ZE)+1}function _a(e){ht(1,arguments);var t=1,n=xt(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function Uf(e){ht(1,arguments);var t=xt(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=_a(r),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=_a(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function QE(e){ht(1,arguments);var t=Uf(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=_a(n);return r}var JE=6048e5;function tS(e){ht(1,arguments);var t=xt(e),n=_a(t).getTime()-QE(t).getTime();return Math.round(n/JE)+1}function Ea(e,t){var n,r,i,s,a,o,l,c;ht(1,arguments);var u=wa(),h=Kt((n=(r=(i=(s=t==null?void 0:t.weekStartsOn)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=xt(e),f=d.getUTCDay(),p=(f<h?7:0)+f-h;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}function Bf(e,t){var n,r,i,s,a,o,l,c;ht(1,arguments);var u=xt(e),h=u.getUTCFullYear(),d=wa(),f=Kt((n=(r=(i=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(h+1,0,f),p.setUTCHours(0,0,0,0);var m=Ea(p,t),g=new Date(0);g.setUTCFullYear(h,0,f),g.setUTCHours(0,0,0,0);var v=Ea(g,t);return u.getTime()>=m.getTime()?h+1:u.getTime()>=v.getTime()?h:h-1}function eS(e,t){var n,r,i,s,a,o,l,c;ht(1,arguments);var u=wa(),h=Kt((n=(r=(i=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=Bf(e,t),f=new Date(0);f.setUTCFullYear(d,0,h),f.setUTCHours(0,0,0,0);var p=Ea(f,t);return p}var nS=6048e5;function rS(e,t){ht(1,arguments);var n=xt(e),r=Ea(n,t).getTime()-eS(n,t).getTime();return Math.round(r/nS)+1}function Tt(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var iS={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return Tt(t==="yy"?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):Tt(n+1,2)},d:function(e,t){return Tt(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(e,t){return Tt(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Tt(e.getUTCHours(),t.length)},m:function(e,t){return Tt(e.getUTCMinutes(),t.length)},s:function(e,t){return Tt(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,n-3));return Tt(i,t.length)}};const Cn=iS;var $r={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sS={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Cn.y(e,t)},Y:function(e,t,n,r){var i=Bf(e,r),s=i>0?i:1-i;if(t==="YY"){var a=s%100;return Tt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Tt(s,t.length)},R:function(e,t){var n=Uf(e);return Tt(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return Tt(n,t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Tt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Tt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return Cn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return Tt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=rS(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},I:function(e,t,n){var r=tS(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Tt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Cn.d(e,t)},D:function(e,t,n){var r=KE(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Tt(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Tt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Tt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Tt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours(),i=r/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r=e.getUTCHours(),i;switch(r===12?i=$r.noon:r===0?i=$r.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r=e.getUTCHours(),i;switch(r>=17?i=$r.evening:r>=12?i=$r.afternoon:r>=4?i=$r.morning:i=$r.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var r=e.getUTCHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Cn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Cn.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Tt(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Tt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Cn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Cn.s(e,t)},S:function(e,t){return Cn.S(e,t)},X:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Hf(s);case"XXXX":case"XX":return Zn(s);case"XXXXX":case"XXX":default:return Zn(s,":")}},x:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"x":return Hf(s);case"xxxx":case"xx":return Zn(s);case"xxxxx":case"xxx":default:return Zn(s,":")}},O:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vf(s,":");case"OOOO":default:return"GMT"+Zn(s,":")}},z:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vf(s,":");case"zzzz":default:return"GMT"+Zn(s,":")}},t:function(e,t,n,r){var i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return Tt(s,t.length)},T:function(e,t,n,r){var i=r._originalDate||e,s=i.getTime();return Tt(s,t.length)}};function Vf(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;if(s===0)return n+String(i);var a=t||"";return n+String(i)+a+Tt(s,2)}function Hf(e,t){if(e%60===0){var n=e>0?"-":"+";return n+Tt(Math.abs(e)/60,2)}return Zn(e,t)}function Zn(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e),s=Tt(Math.floor(i/60),2),a=Tt(i%60,2);return r+s+n+a}const aS=sS;var Ff=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Gf=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},oS=function(e,t){var n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Ff(e,t);var s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Ff(r,t)).replace("{{time}}",Gf(i,t))},lS={p:Gf,P:oS};const cS=lS;var uS=["D","DD"],hS=["YY","YYYY"];function dS(e){return uS.indexOf(e)!==-1}function fS(e){return hS.indexOf(e)!==-1}function zf(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var pS={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},gS=function(e,t,n){var r,i=pS[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};const mS=gS;var vS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xS={date:Bl({formats:vS,defaultWidth:"full"}),time:Bl({formats:yS,defaultWidth:"full"}),dateTime:Bl({formats:bS,defaultWidth:"full"})};const wS=xS;var _S={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ES=function(e,t,n,r){return _S[e]};const SS=ES;var OS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},TS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},MS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},CS={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},AS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$S={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},LS=function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},DS={ordinalNumber:LS,era:ki({values:OS,defaultWidth:"wide"}),quarter:ki({values:TS,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:ki({values:MS,defaultWidth:"wide"}),day:ki({values:CS,defaultWidth:"wide"}),dayPeriod:ki({values:AS,defaultWidth:"wide",formattingValues:$S,defaultFormattingWidth:"wide"})};const kS=DS;var RS=/^(\d+)(th|st|nd|rd)?/i,IS=/\d+/i,PS={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},NS={any:[/^b/i,/^(a|c)/i]},US={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BS={any:[/1/i,/2/i,/3/i,/4/i]},VS={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},HS={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},FS={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},GS={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},zS={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jS={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},WS={ordinalNumber:jE({matchPattern:RS,parsePattern:IS,valueCallback:function(e){return parseInt(e,10)}}),era:Ri({matchPatterns:PS,defaultMatchWidth:"wide",parsePatterns:NS,defaultParseWidth:"any"}),quarter:Ri({matchPatterns:US,defaultMatchWidth:"wide",parsePatterns:BS,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Ri({matchPatterns:VS,defaultMatchWidth:"wide",parsePatterns:HS,defaultParseWidth:"any"}),day:Ri({matchPatterns:FS,defaultMatchWidth:"wide",parsePatterns:GS,defaultParseWidth:"any"}),dayPeriod:Ri({matchPatterns:zS,defaultMatchWidth:"any",parsePatterns:jS,defaultParseWidth:"any"})},qS={code:"en-US",formatDistance:mS,formatLong:wS,formatRelative:SS,localize:kS,match:WS,options:{weekStartsOn:0,firstWeekContainsDate:1}};const jf=qS;var YS=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,XS=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZS=/^'([^]*?)'?$/,KS=/''/g,QS=/[a-zA-Z]/;function Lr(e,t,n){var r,i,s,a,o,l,c,u,h,d,f,p,m,g,v,b,w,O;ht(2,arguments);var E=String(t),T=wa(),S=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:T.locale)!==null&&r!==void 0?r:jf,$=Kt((s=(a=(o=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:T.firstWeekContainsDate)!==null&&a!==void 0?a:(h=T.locale)===null||h===void 0||(d=h.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!($>=1&&$<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=Kt((f=(p=(m=(g=n==null?void 0:n.weekStartsOn)!==null&&g!==void 0?g:n==null||(v=n.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&p!==void 0?p:(w=T.locale)===null||w===void 0||(O=w.options)===null||O===void 0?void 0:O.weekStartsOn)!==null&&f!==void 0?f:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var L=xt(e);if(!YE(L))throw new RangeError("Invalid time value");var M=Vl(L),V=XE(L,M),x={firstWeekContainsDate:$,weekStartsOn:k,locale:S,_originalDate:L},C=E.match(XS).map(function(y){var R=y[0];if(R==="p"||R==="P"){var I=cS[R];return I(y,S.formatLong)}return y}).join("").match(YS).map(function(y){if(y==="''")return"'";var R=y[0];if(R==="'")return JS(y);var I=aS[R];if(I)return!(n!=null&&n.useAdditionalWeekYearTokens)&&fS(y)&&zf(y,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&dS(y)&&zf(y,t,String(e)),I(V,y,S.localize,x);if(R.match(QS))throw new RangeError("Format string contains an unescaped latin alphabet character `"+R+"`");return y}).join("");return C}function JS(e){var t=e.match(ZS);return t?t[1].replace(KS,"'"):e}const ge="cds",pn={opacity:{unselected:.05,selected:.4}},An={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Dr={duration:1e3,ease:Ku,zoomLevel:3},kr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},Wf={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ce={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},tO={defaultBins:10},Vt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},gn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},te={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Dt={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},Kn={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},He={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},qf={minCellDividerDimension:16,chartPadding:.5},Yf={default:{size:24}},eO={horizontalOffset:10},Xf={default:{duration:300},pie_slice_mouseover:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},Ee={height:{[Ke.GRAPH_VIEW]:32,[Ke.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},nO=[{type:Zt.RADIUS,name:"Radius"},{type:Zt.AREA,name:"Poor area"},{type:Zt.AREA,name:"Satisfactory area"},{type:Zt.AREA,name:"Great area"},{type:Zt.QUARTILE,name:"Quartiles"}];var rO=typeof global=="object"&&global&&global.Object===Object&&global;const Zf=rO;var iO=typeof self=="object"&&self&&self.Object===Object&&self,sO=Zf||iO||Function("return this")();const Fe=sO;var aO=Fe.Symbol;const Ae=aO;var Kf=Object.prototype,oO=Kf.hasOwnProperty,lO=Kf.toString,Ii=Ae?Ae.toStringTag:void 0;function cO(e){var t=oO.call(e,Ii),n=e[Ii];try{e[Ii]=void 0;var r=!0}catch{}var i=lO.call(e);return r&&(t?e[Ii]=n:delete e[Ii]),i}var uO=Object.prototype,hO=uO.toString;function dO(e){return hO.call(e)}var fO="[object Null]",pO="[object Undefined]",Qf=Ae?Ae.toStringTag:void 0;function Qn(e){return e==null?e===void 0?pO:fO:Qf&&Qf in Object(e)?cO(e):dO(e)}function Qe(e){return e!=null&&typeof e=="object"}var gO="[object Symbol]";function Sa(e){return typeof e=="symbol"||Qe(e)&&Qn(e)==gO}function Jf(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var mO=Array.isArray;const ee=mO;var vO=1/0,tp=Ae?Ae.prototype:void 0,ep=tp?tp.toString:void 0;function np(e){if(typeof e=="string")return e;if(ee(e))return Jf(e,np)+"";if(Sa(e))return ep?ep.call(e):"";var t=e+"";return t=="0"&&1/e==-vO?"-0":t}function $e(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Hl(e){return e}var yO="[object AsyncFunction]",bO="[object Function]",xO="[object GeneratorFunction]",wO="[object Proxy]";function Fl(e){if(!$e(e))return!1;var t=Qn(e);return t==bO||t==xO||t==yO||t==wO}var _O=Fe["__core-js_shared__"];const Gl=_O;var rp=function(){var e=/[^.]+$/.exec(Gl&&Gl.keys&&Gl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function EO(e){return!!rp&&rp in e}var SO=Function.prototype,OO=SO.toString;function Jn(e){if(e!=null){try{return OO.call(e)}catch{}try{return e+""}catch{}}return""}var TO=/[\\^$.*+?()[\]{}|]/g,MO=/^\[object .+?Constructor\]$/,CO=Function.prototype,AO=Object.prototype,$O=CO.toString,LO=AO.hasOwnProperty,DO=RegExp("^"+$O.call(LO).replace(TO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kO(e){if(!$e(e)||EO(e))return!1;var t=Fl(e)?DO:MO;return t.test(Jn(e))}function RO(e,t){return e==null?void 0:e[t]}function tr(e,t){var n=RO(e,t);return kO(n)?n:void 0}var IO=tr(Fe,"WeakMap");const zl=IO;var ip=Object.create,PO=function(){function e(){}return function(t){if(!$e(t))return{};if(ip)return ip(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const NO=PO;function UO(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function BO(){}function sp(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var VO=800,HO=16,FO=Date.now;function GO(e){var t=0,n=0;return function(){var r=FO(),i=HO-(r-n);if(n=r,i>0){if(++t>=VO)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function zO(e){return function(){return e}}var jO=function(){try{var e=tr(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Oa=jO;var WO=Oa?function(e,t){return Oa(e,"toString",{configurable:!0,enumerable:!1,value:zO(t),writable:!0})}:Hl,qO=GO(WO);const YO=qO;function XO(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function ZO(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function KO(e){return e!==e}function QO(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function JO(e,t,n){return t===t?QO(e,t,n):ZO(e,KO,n)}function tT(e,t){var n=e==null?0:e.length;return!!n&&JO(e,t,0)>-1}var eT=9007199254740991,nT=/^(?:0|[1-9]\d*)$/;function jl(e,t){var n=typeof e;return t=t??eT,!!t&&(n=="number"||n!="symbol"&&nT.test(e))&&e>-1&&e%1==0&&e<t}function Ta(e,t,n){t=="__proto__"&&Oa?Oa(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Pi(e,t){return e===t||e!==e&&t!==t}var rT=Object.prototype,iT=rT.hasOwnProperty;function ap(e,t,n){var r=e[t];(!(iT.call(e,t)&&Pi(r,n))||n===void 0&&!(t in e))&&Ta(e,t,n)}function Ni(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),i?Ta(n,o,l):ap(n,o,l)}return n}var op=Math.max;function sT(e,t,n){return t=op(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=op(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),UO(e,this,o)}}function lp(e,t){return YO(sT(e,t,Hl),e+"")}var aT=9007199254740991;function Wl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=aT}function er(e){return e!=null&&Wl(e.length)&&!Fl(e)}function cp(e,t,n){if(!$e(n))return!1;var r=typeof t;return(r=="number"?er(n)&&jl(t,n.length):r=="string"&&t in n)?Pi(n[t],e):!1}function oT(e){return lp(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&cp(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var lT=Object.prototype;function Ma(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||lT;return e===n}function cT(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var uT="[object Arguments]";function up(e){return Qe(e)&&Qn(e)==uT}var hp=Object.prototype,hT=hp.hasOwnProperty,dT=hp.propertyIsEnumerable,fT=up(function(){return arguments}())?up:function(e){return Qe(e)&&hT.call(e,"callee")&&!dT.call(e,"callee")};const Rr=fT;function pT(){return!1}var dp=typeof J=="object"&&J&&!J.nodeType&&J,fp=dp&&typeof module=="object"&&module&&!module.nodeType&&module,gT=fp&&fp.exports===dp,pp=gT?Fe.Buffer:void 0,mT=pp?pp.isBuffer:void 0,vT=mT||pT;const Ir=vT;var yT="[object Arguments]",bT="[object Array]",xT="[object Boolean]",wT="[object Date]",_T="[object Error]",ET="[object Function]",ST="[object Map]",OT="[object Number]",TT="[object Object]",MT="[object RegExp]",CT="[object Set]",AT="[object String]",$T="[object WeakMap]",LT="[object ArrayBuffer]",DT="[object DataView]",kT="[object Float32Array]",RT="[object Float64Array]",IT="[object Int8Array]",PT="[object Int16Array]",NT="[object Int32Array]",UT="[object Uint8Array]",BT="[object Uint8ClampedArray]",VT="[object Uint16Array]",HT="[object Uint32Array]",It={};It[kT]=It[RT]=It[IT]=It[PT]=It[NT]=It[UT]=It[BT]=It[VT]=It[HT]=!0,It[yT]=It[bT]=It[LT]=It[xT]=It[DT]=It[wT]=It[_T]=It[ET]=It[ST]=It[OT]=It[TT]=It[MT]=It[CT]=It[AT]=It[$T]=!1;function FT(e){return Qe(e)&&Wl(e.length)&&!!It[Qn(e)]}function ql(e){return function(t){return e(t)}}var gp=typeof J=="object"&&J&&!J.nodeType&&J,Ui=gp&&typeof module=="object"&&module&&!module.nodeType&&module,GT=Ui&&Ui.exports===gp,Yl=GT&&Zf.process,zT=function(){try{var e=Ui&&Ui.require&&Ui.require("util").types;return e||Yl&&Yl.binding&&Yl.binding("util")}catch{}}();const Pr=zT;var mp=Pr&&Pr.isTypedArray,jT=mp?ql(mp):FT;const Ca=jT;var WT=Object.prototype,qT=WT.hasOwnProperty;function vp(e,t){var n=ee(e),r=!n&&Rr(e),i=!n&&!r&&Ir(e),s=!n&&!r&&!i&&Ca(e),a=n||r||i||s,o=a?cT(e.length,String):[],l=o.length;for(var c in e)(t||qT.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||jl(c,l)))&&o.push(c);return o}function yp(e,t){return function(n){return e(t(n))}}var YT=yp(Object.keys,Object);const XT=YT;var ZT=Object.prototype,KT=ZT.hasOwnProperty;function bp(e){if(!Ma(e))return XT(e);var t=[];for(var n in Object(e))KT.call(e,n)&&n!="constructor"&&t.push(n);return t}function Bi(e){return er(e)?vp(e):bp(e)}function QT(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var JT=Object.prototype,tM=JT.hasOwnProperty;function eM(e){if(!$e(e))return QT(e);var t=Ma(e),n=[];for(var r in e)r=="constructor"&&(t||!tM.call(e,r))||n.push(r);return n}function Vi(e){return er(e)?vp(e,!0):eM(e)}var nM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rM=/^\w*$/;function Xl(e,t){if(ee(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Sa(e)?!0:rM.test(e)||!nM.test(e)||t!=null&&e in Object(t)}var iM=tr(Object,"create");const Hi=iM;function sM(){this.__data__=Hi?Hi(null):{},this.size=0}function aM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var oM="__lodash_hash_undefined__",lM=Object.prototype,cM=lM.hasOwnProperty;function uM(e){var t=this.__data__;if(Hi){var n=t[e];return n===oM?void 0:n}return cM.call(t,e)?t[e]:void 0}var hM=Object.prototype,dM=hM.hasOwnProperty;function fM(e){var t=this.__data__;return Hi?t[e]!==void 0:dM.call(t,e)}var pM="__lodash_hash_undefined__";function gM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Hi&&t===void 0?pM:t,this}function nr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nr.prototype.clear=sM,nr.prototype.delete=aM,nr.prototype.get=uM,nr.prototype.has=fM,nr.prototype.set=gM;function mM(){this.__data__=[],this.size=0}function Aa(e,t){for(var n=e.length;n--;)if(Pi(e[n][0],t))return n;return-1}var vM=Array.prototype,yM=vM.splice;function bM(e){var t=this.__data__,n=Aa(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():yM.call(t,n,1),--this.size,!0}function xM(e){var t=this.__data__,n=Aa(t,e);return n<0?void 0:t[n][1]}function wM(e){return Aa(this.__data__,e)>-1}function _M(e,t){var n=this.__data__,r=Aa(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function mn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mn.prototype.clear=mM,mn.prototype.delete=bM,mn.prototype.get=xM,mn.prototype.has=wM,mn.prototype.set=_M;var EM=tr(Fe,"Map");const Fi=EM;function SM(){this.size=0,this.__data__={hash:new nr,map:new(Fi||mn),string:new nr}}function OM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function $a(e,t){var n=e.__data__;return OM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function TM(e){var t=$a(this,e).delete(e);return this.size-=t?1:0,t}function MM(e){return $a(this,e).get(e)}function CM(e){return $a(this,e).has(e)}function AM(e,t){var n=$a(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function vn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vn.prototype.clear=SM,vn.prototype.delete=TM,vn.prototype.get=MM,vn.prototype.has=CM,vn.prototype.set=AM;var $M="Expected a function";function Zl(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError($M);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(Zl.Cache||vn),n}Zl.Cache=vn;var LM=500;function DM(e){var t=Zl(e,function(r){return n.size===LM&&n.clear(),r}),n=t.cache;return t}var kM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,RM=/\\(\\)?/g,IM=DM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(kM,function(n,r,i,s){t.push(i?s.replace(RM,"$1"):r||n)}),t});const PM=IM;function Gi(e){return e==null?"":np(e)}function xp(e,t){return ee(e)?e:Xl(e,t)?[e]:PM(Gi(e))}var NM=1/0;function La(e){if(typeof e=="string"||Sa(e))return e;var t=e+"";return t=="0"&&1/e==-NM?"-0":t}function wp(e,t){t=xp(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[La(t[n++])];return n&&n==r?e:void 0}function kt(e,t,n){var r=e==null?void 0:wp(e,t);return r===void 0?n:r}function Kl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var _p=Ae?Ae.isConcatSpreadable:void 0;function UM(e){return ee(e)||Rr(e)||!!(_p&&e&&e[_p])}function Da(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=UM),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Da(o,t-1,n,r,i):Kl(i,o):r||(i[i.length]=o)}return i}var BM=yp(Object.getPrototypeOf,Object);const Ql=BM;var VM="[object Object]",HM=Function.prototype,FM=Object.prototype,Ep=HM.toString,GM=FM.hasOwnProperty,zM=Ep.call(Object);function jM(e){if(!Qe(e)||Qn(e)!=VM)return!1;var t=Ql(e);if(t===null)return!0;var n=GM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ep.call(n)==zM}function WM(){this.__data__=new mn,this.size=0}function qM(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function YM(e){return this.__data__.get(e)}function XM(e){return this.__data__.has(e)}var ZM=200;function KM(e,t){var n=this.__data__;if(n instanceof mn){var r=n.__data__;if(!Fi||r.length<ZM-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new vn(r)}return n.set(e,t),this.size=n.size,this}function Ge(e){var t=this.__data__=new mn(e);this.size=t.size}Ge.prototype.clear=WM,Ge.prototype.delete=qM,Ge.prototype.get=YM,Ge.prototype.has=XM,Ge.prototype.set=KM;function QM(e,t){return e&&Ni(t,Bi(t),e)}function JM(e,t){return e&&Ni(t,Vi(t),e)}var Sp=typeof J=="object"&&J&&!J.nodeType&&J,Op=Sp&&typeof module=="object"&&module&&!module.nodeType&&module,tC=Op&&Op.exports===Sp,Tp=tC?Fe.Buffer:void 0,Mp=Tp?Tp.allocUnsafe:void 0;function Cp(e,t){if(t)return e.slice();var n=e.length,r=Mp?Mp(n):new e.constructor(n);return e.copy(r),r}function eC(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Ap(){return[]}var nC=Object.prototype,rC=nC.propertyIsEnumerable,$p=Object.getOwnPropertySymbols,iC=$p?function(e){return e==null?[]:(e=Object(e),eC($p(e),function(t){return rC.call(e,t)}))}:Ap;const Jl=iC;function sC(e,t){return Ni(e,Jl(e),t)}var aC=Object.getOwnPropertySymbols,oC=aC?function(e){for(var t=[];e;)Kl(t,Jl(e)),e=Ql(e);return t}:Ap;const Lp=oC;function lC(e,t){return Ni(e,Lp(e),t)}function Dp(e,t,n){var r=t(e);return ee(e)?r:Kl(r,n(e))}function tc(e){return Dp(e,Bi,Jl)}function cC(e){return Dp(e,Vi,Lp)}var uC=tr(Fe,"DataView");const ec=uC;var hC=tr(Fe,"Promise");const nc=hC;var dC=tr(Fe,"Set");const Nr=dC;var kp="[object Map]",fC="[object Object]",Rp="[object Promise]",Ip="[object Set]",Pp="[object WeakMap]",Np="[object DataView]",pC=Jn(ec),gC=Jn(Fi),mC=Jn(nc),vC=Jn(Nr),yC=Jn(zl),rr=Qn;(ec&&rr(new ec(new ArrayBuffer(1)))!=Np||Fi&&rr(new Fi)!=kp||nc&&rr(nc.resolve())!=Rp||Nr&&rr(new Nr)!=Ip||zl&&rr(new zl)!=Pp)&&(rr=function(e){var t=Qn(e),n=t==fC?e.constructor:void 0,r=n?Jn(n):"";if(r)switch(r){case pC:return Np;case gC:return kp;case mC:return Rp;case vC:return Ip;case yC:return Pp}return t});const Ur=rr;var bC=Object.prototype,xC=bC.hasOwnProperty;function wC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&xC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var _C=Fe.Uint8Array;const ka=_C;function rc(e){var t=new e.constructor(e.byteLength);return new ka(t).set(new ka(e)),t}function EC(e,t){var n=t?rc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var SC=/\w*$/;function OC(e){var t=new e.constructor(e.source,SC.exec(e));return t.lastIndex=e.lastIndex,t}var Up=Ae?Ae.prototype:void 0,Bp=Up?Up.valueOf:void 0;function TC(e){return Bp?Object(Bp.call(e)):{}}function Vp(e,t){var n=t?rc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var MC="[object Boolean]",CC="[object Date]",AC="[object Map]",$C="[object Number]",LC="[object RegExp]",DC="[object Set]",kC="[object String]",RC="[object Symbol]",IC="[object ArrayBuffer]",PC="[object DataView]",NC="[object Float32Array]",UC="[object Float64Array]",BC="[object Int8Array]",VC="[object Int16Array]",HC="[object Int32Array]",FC="[object Uint8Array]",GC="[object Uint8ClampedArray]",zC="[object Uint16Array]",jC="[object Uint32Array]";function WC(e,t,n){var r=e.constructor;switch(t){case IC:return rc(e);case MC:case CC:return new r(+e);case PC:return EC(e,n);case NC:case UC:case BC:case VC:case HC:case FC:case GC:case zC:case jC:return Vp(e,n);case AC:return new r;case $C:case kC:return new r(e);case LC:return OC(e);case DC:return new r;case RC:return TC(e)}}function Hp(e){return typeof e.constructor=="function"&&!Ma(e)?NO(Ql(e)):{}}var qC="[object Map]";function YC(e){return Qe(e)&&Ur(e)==qC}var Fp=Pr&&Pr.isMap,XC=Fp?ql(Fp):YC;const ZC=XC;var KC="[object Set]";function QC(e){return Qe(e)&&Ur(e)==KC}var Gp=Pr&&Pr.isSet,JC=Gp?ql(Gp):QC;const tA=JC;var eA=1,nA=2,rA=4,zp="[object Arguments]",iA="[object Array]",sA="[object Boolean]",aA="[object Date]",oA="[object Error]",jp="[object Function]",lA="[object GeneratorFunction]",cA="[object Map]",uA="[object Number]",Wp="[object Object]",hA="[object RegExp]",dA="[object Set]",fA="[object String]",pA="[object Symbol]",gA="[object WeakMap]",mA="[object ArrayBuffer]",vA="[object DataView]",yA="[object Float32Array]",bA="[object Float64Array]",xA="[object Int8Array]",wA="[object Int16Array]",_A="[object Int32Array]",EA="[object Uint8Array]",SA="[object Uint8ClampedArray]",OA="[object Uint16Array]",TA="[object Uint32Array]",Rt={};Rt[zp]=Rt[iA]=Rt[mA]=Rt[vA]=Rt[sA]=Rt[aA]=Rt[yA]=Rt[bA]=Rt[xA]=Rt[wA]=Rt[_A]=Rt[cA]=Rt[uA]=Rt[Wp]=Rt[hA]=Rt[dA]=Rt[fA]=Rt[pA]=Rt[EA]=Rt[SA]=Rt[OA]=Rt[TA]=!0,Rt[oA]=Rt[jp]=Rt[gA]=!1;function Ra(e,t,n,r,i,s){var a,o=t&eA,l=t&nA,c=t&rA;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!$e(e))return e;var u=ee(e);if(u){if(a=wC(e),!o)return sp(e,a)}else{var h=Ur(e),d=h==jp||h==lA;if(Ir(e))return Cp(e,o);if(h==Wp||h==zp||d&&!i){if(a=l||d?{}:Hp(e),!o)return l?lC(e,JM(a,e)):sC(e,QM(a,e))}else{if(!Rt[h])return i?e:{};a=WC(e,h,o)}}s||(s=new Ge);var f=s.get(e);if(f)return f;s.set(e,a),tA(e)?e.forEach(function(g){a.add(Ra(g,t,n,g,e,s))}):ZC(e)&&e.forEach(function(g,v){a.set(v,Ra(g,t,n,v,e,s))});var p=c?l?cC:tc:l?Vi:Bi,m=u?void 0:p(e);return XO(m||e,function(g,v){m&&(v=g,g=e[v]),ap(a,v,Ra(g,t,n,v,e,s))}),a}var MA=1,CA=4;function AA(e){return Ra(e,MA|CA)}var $A="__lodash_hash_undefined__";function LA(e){return this.__data__.set(e,$A),this}function DA(e){return this.__data__.has(e)}function zi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new vn;++t<n;)this.add(e[t])}zi.prototype.add=zi.prototype.push=LA,zi.prototype.has=DA;function qp(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Yp(e,t){return e.has(t)}var kA=1,RA=2;function Xp(e,t,n,r,i,s){var a=n&kA,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=n&RA?new zi:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(r)var g=a?r(m,p,h,t,e,s):r(p,m,h,e,t,s);if(g!==void 0){if(g)continue;d=!1;break}if(f){if(!qp(t,function(v,b){if(!Yp(f,b)&&(p===v||i(p,v,n,r,s)))return f.push(b)})){d=!1;break}}else if(!(p===m||i(p,m,n,r,s))){d=!1;break}}return s.delete(e),s.delete(t),d}function IA(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function ic(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var PA=1,NA=2,UA="[object Boolean]",BA="[object Date]",VA="[object Error]",HA="[object Map]",FA="[object Number]",GA="[object RegExp]",zA="[object Set]",jA="[object String]",WA="[object Symbol]",qA="[object ArrayBuffer]",YA="[object DataView]",Zp=Ae?Ae.prototype:void 0,sc=Zp?Zp.valueOf:void 0;function XA(e,t,n,r,i,s,a){switch(n){case YA:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case qA:return!(e.byteLength!=t.byteLength||!s(new ka(e),new ka(t)));case UA:case BA:case FA:return Pi(+e,+t);case VA:return e.name==t.name&&e.message==t.message;case GA:case jA:return e==t+"";case HA:var o=IA;case zA:var l=r&PA;if(o||(o=ic),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=NA,a.set(e,t);var u=Xp(o(e),o(t),r,i,s,a);return a.delete(e),u;case WA:if(sc)return sc.call(e)==sc.call(t)}return!1}var ZA=1,KA=Object.prototype,QA=KA.hasOwnProperty;function JA(e,t,n,r,i,s){var a=n&ZA,o=tc(e),l=o.length,c=tc(t),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var d=o[h];if(!(a?d in t:QA.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<l;){d=o[h];var v=e[d],b=t[d];if(r)var w=a?r(b,v,d,t,e,s):r(v,b,d,e,t,s);if(!(w===void 0?v===b||i(v,b,n,r,s):w)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var O=e.constructor,E=t.constructor;O!=E&&"constructor"in e&&"constructor"in t&&!(typeof O=="function"&&O instanceof O&&typeof E=="function"&&E instanceof E)&&(m=!1)}return s.delete(e),s.delete(t),m}var t2=1,Kp="[object Arguments]",Qp="[object Array]",Ia="[object Object]",e2=Object.prototype,Jp=e2.hasOwnProperty;function n2(e,t,n,r,i,s){var a=ee(e),o=ee(t),l=a?Qp:Ur(e),c=o?Qp:Ur(t);l=l==Kp?Ia:l,c=c==Kp?Ia:c;var u=l==Ia,h=c==Ia,d=l==c;if(d&&Ir(e)){if(!Ir(t))return!1;a=!0,u=!1}if(d&&!u)return s||(s=new Ge),a||Ca(e)?Xp(e,t,n,r,i,s):XA(e,t,l,n,r,i,s);if(!(n&t2)){var f=u&&Jp.call(e,"__wrapped__"),p=h&&Jp.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new Ge),i(m,g,n,r,s)}}return d?(s||(s=new Ge),JA(e,t,n,r,i,s)):!1}function Pa(e,t,n,r,i){return e===t?!0:e==null||t==null||!Qe(e)&&!Qe(t)?e!==e&&t!==t:n2(e,t,n,r,Pa,i)}var r2=1,i2=2;function s2(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var l=o[0],c=e[l],u=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var h=new Ge;if(r)var d=r(c,u,l,e,t,h);if(!(d===void 0?Pa(u,c,r2|i2,r,h):d))return!1}}return!0}function tg(e){return e===e&&!$e(e)}function a2(e){for(var t=Bi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,tg(i)]}return t}function eg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function o2(e){var t=a2(e);return t.length==1&&t[0][2]?eg(t[0][0],t[0][1]):function(n){return n===e||s2(n,e,t)}}function l2(e,t){return e!=null&&t in Object(e)}function c2(e,t,n){t=xp(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=La(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Wl(i)&&jl(a,i)&&(ee(e)||Rr(e)))}function u2(e,t){return e!=null&&c2(e,t,l2)}var h2=1,d2=2;function f2(e,t){return Xl(e)&&tg(t)?eg(La(e),t):function(n){var r=kt(n,e);return r===void 0&&r===t?u2(n,e):Pa(t,r,h2|d2)}}function p2(e){return function(t){return t==null?void 0:t[e]}}function g2(e){return function(t){return wp(t,e)}}function m2(e){return Xl(e)?p2(La(e)):g2(e)}function Na(e){return typeof e=="function"?e:e==null?Hl:typeof e=="object"?ee(e)?f2(e[0],e[1]):o2(e):m2(e)}function v2(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(n(s[l],l,s)===!1)break}return t}}var y2=v2();const ng=y2;function ac(e,t,n){(n!==void 0&&!Pi(e[t],n)||n===void 0&&!(t in e))&&Ta(e,t,n)}function oc(e){return Qe(e)&&er(e)}function lc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function b2(e){return Ni(e,Vi(e))}function x2(e,t,n,r,i,s,a){var o=lc(e,n),l=lc(t,n),c=a.get(l);if(c){ac(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,h=u===void 0;if(h){var d=ee(l),f=!d&&Ir(l),p=!d&&!f&&Ca(l);u=l,d||f||p?ee(o)?u=o:oc(o)?u=sp(o):f?(h=!1,u=Cp(l,!0)):p?(h=!1,u=Vp(l,!0)):u=[]:jM(l)||Rr(l)?(u=o,Rr(o)?u=b2(o):(!$e(o)||Fl(o))&&(u=Hp(l))):h=!1}h&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),ac(e,n,u)}function rg(e,t,n,r,i){e!==t&&ng(t,function(s,a){if(i||(i=new Ge),$e(s))x2(e,t,a,n,rg,r,i);else{var o=r?r(lc(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),ac(e,a,o)}},Vi)}function w2(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function _2(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var E2="[object Map]",S2="[object Set]",O2=Object.prototype,T2=O2.hasOwnProperty;function ze(e){if(e==null)return!0;if(er(e)&&(ee(e)||typeof e=="string"||typeof e.splice=="function"||Ir(e)||Ca(e)||Rr(e)))return!e.length;var t=Ur(e);if(t==E2||t==S2)return!e.size;if(Ma(e))return!bp(e).length;for(var n in e)if(T2.call(e,n))return!1;return!0}var M2=oT(function(e,t,n){rg(e,t,n)});const at=M2;var C2=1/0,A2=Nr&&1/ic(new Nr([,-0]))[1]==C2?function(e){return new Nr(e)}:BO;const $2=A2;var L2=200;function ig(e,t,n){var r=-1,i=tT,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=w2;else if(s>=L2){var c=t?null:$2(e);if(c)return ic(c);a=!1,i=Yp,l=new zi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],h=t?t(u):u;if(u=n||u!==0?u:0,a&&h===h){for(var d=l.length;d--;)if(l[d]===h)continue t;t&&l.push(h),o.push(u)}else i(l,h,n)||(l!==o&&l.push(h),o.push(u))}return o}var D2=lp(function(e){var t=_2(e);return oc(t)&&(t=void 0),ig(Da(e,1,oc,!0),Na(t))});const k2=D2;function R2(e){return e&&e.length?ig(e):[]}const yn=AA,ji=R2;function I2(e,t,n){let r=null;return(...i)=>{const s=this;s.mousePosition=Un(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Nt(e,t){var n;const r=yn(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===tt.TIME?a.mapsTo="date":l===tt.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return cc(r,t),at(r,t)}function bn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function Wi(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function sg(e,t,n="value"){const r=e/t.reduce((i,s)=>i+s[n],0)*100;return r%1!==0?parseFloat(r.toFixed(1)):r}function qi(e,t,n){if(n>e.length)return e;if(t===Ve.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ve.FRONT_LINE)return"..."+e.substr(-n);if(t===Ve.END_LINE)return e.substr(0,n)+"..."}function cc(e,t){const n=_(e,"legend","additionalItems"),r=_(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=nO.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=k2(a,r,"name")}}const _=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},ag=(e,t)=>t===Jt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ue=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=ag(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function xn(e,t,n){return n===Jt.VERTICAL?[e,t]:[t,e]}const Br={type:Ve.END_LINE,threshold:16,numCharacter:14},P2={enabled:!0,position:$i.BOTTOM,clickable:!0,truncation:Br,alignment:Yt.LEFT,order:null,additionalItems:[]},N2={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},U2={enabled:!0},og={enabled:!0,showTotal:!0,truncation:Br,groupLabel:"Group"},lg={top:{visible:!0,includeZero:!0,truncation:Br},bottom:{visible:!0,includeZero:!0,truncation:Br},left:{visible:!0,includeZero:!0,truncation:Br},right:{visible:!0,includeZero:!0,truncation:Br}},Ua={addSpaceOnEdges:1,showDayName:!1,localeObject:jf,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}},B2=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),le={width:null,height:null,resizable:!0,theme:Nf.WHITE,tooltip:og,legend:P2,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:Bt.SHOW_AS_DATATABLE},...B2?[{type:Bt.MAKE_FULLSCREEN}]:[],{type:Bt.EXPORT_CSV},{type:Bt.EXPORT_PNG},{type:Bt.EXPORT_JPG}]}},cg=at({},le,{thematic:{projection:fn.geoNaturalEarth1}}),Yi=at({},le,{axes:lg,timeScale:Ua,grid:N2,ruler:U2,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ke.GRAPH_VIEW}}}),ir=at({},Yi,{bars:{maxWidth:16,spacingFactor:.25},timeScale:at(Ua,{addSpaceOnEdges:1})}),V2=at({},ir,{}),H2=at({},ir,{}),F2=at({},ir,{bars:at({},ir.bars,{dividerSize:1.5})}),G2=at({},ir,{}),uc=at({},Yi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),z2=uc,ug=at({},uc,{points:{radius:3,filled:!1,enabled:!0}}),hg=at({},ug,{timeScale:at(Ua,{addSpaceOnEdges:0})}),j2=hg,W2=at({},Yi,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:Zt.RADIUS,name:"Radius"}]}}),q2=at({},Yi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Zt.AREA,name:"Poor area"},{type:Zt.AREA,name:"Satisfactory area"},{type:Zt.AREA,name:"Great area"},{type:Zt.QUARTILE,name:"Quartiles"}]}}),Y2=at({},ir,{bars:{dividerSize:1.5},timeScale:at(Ua,{addSpaceOnEdges:0})}),X2=at({},le,{tooltip:at({},og,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),dg=at({},le,{pie:{labels:{formatter:null,enabled:!0},alignment:Yt.LEFT,sortFunction:null,valueMapsTo:"value"}}),Z2=at({},le,{legend:{enabled:!1},gauge:{type:Ar.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,numberFormatter:e=>Number(e.toFixed(2))%1!==0?e.toFixed(2).toLocaleString():e.toFixed().toLocaleString(),alignment:Yt.LEFT}}),K2=at({},dg,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20),numberFormatter:e=>Math.floor(e).toLocaleString()},alignment:Yt.LEFT}}),fg=at({},le,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),Q2=at({},fg,{legend:{enabled:!0}}),J2=at({},le,{radar:{axes:{angle:"key",value:"value"},alignment:Yt.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),t$=at({},ir,{comboChartTypes:[]}),e$=at({tree:{type:Pl.TREE}},le,{}),n$=at({},le,{data:at(le.data,{groupMapsTo:"name"})}),r$=at({},le,kr,{data:at(le.data,{groupMapsTo:"name"})}),i$=at({},le,{alluvial:{data:at(le.data,{groupMapsTo:"source"}),nodeAlignment:Yt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),s$=at({},le,{axes:lg,heatmap:{divider:{state:Di.AUTO},colorLegend:{type:"linear"}}}),a$=at({},cg,{choropleth:{colorLegend:{type:"linear"}}}),Ct={alluvialChart:i$,areaChart:hg,axisChart:Yi,boxplotChart:G2,bubbleChart:W2,bulletChart:q2,chart:le,circlePackChart:r$,choroplethChart:a$,comboChart:t$,donutChart:K2,gaugeChart:Z2,groupedBarChart:H2,heatmapChart:s$,histogramChart:Y2,lineChart:ug,lollipopChart:z2,meterChart:fg,pieChart:dg,proportionalMeterChart:Q2,radarChart:J2,scatterChart:uc,simpleBarChart:V2,stackedAreaChart:j2,stackedBarChart:F2,thematicChart:cg,treeChart:e$,treemapChart:n$,wordCloudChart:X2};var pg=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(pg||{});const hc=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function gg(e,t,n,r,i){const s=t===0,a=Number(Lr(new Date(e),"c"))===2,o=Number(Lr(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Va(e)||Xi(e,l)||$n(e);case"minute":return s||Va(e)||Xi(e,l)||$n(e);case"30minutes":return s||Va(e)||Xi(e,l)||$n(e);case"hourly":return s||Va(e)||Xi(e,l)||$n(e);case"daily":return i?s||a||$n(e):s||Xi(e,l)||$n(e);case"weekly":return s||a||$n(e);case"monthly":return s||$n(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function dc(e,t,n,r,i){const s=i.showDayName,a=r==="daily"&&s?"weekly":r,o=new Date(e),l=_(i,"timeIntervalFormats")[a],c=_(l,"primary"),u=_(l,"secondary");let h=gg(e,t,n,r,s)?c:u;r==="15seconds"&&o.getMilliseconds()!==0&&(h=h.replace("pp","h:mm:ss.SSS a"));const d=i.localeObject;return Lr(o,h,{locale:d})}function Ba(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function o$(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function l$(e){const t=hc.reduce((n,[,r],i)=>{const s=hc[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return hc[t][0]}function fc(e,t){if(pg[t])return t;if(e.length===1)return"15seconds";const n=o$(e),r=Sn(n);return l$(r)}function Va(e){const{s:t,m:n,H:r}=Ba(e);return r===0&&n===0&&t===0}function Xi(e,t){const n=Ba(e).M,r=Ba(t).M;return n!==r}function $n(e){const{M:t,d:n,s:r,m:i,H:s}=Ba(e);return t===1&&n===1&&s===0&&i===0&&r===0}function mg(e){return e===void 0?"":e.toISOString()}var c$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yg={exports:{}};/*! dom-to-image-more 26-04-2023 */(function(e,t){(function(n){const r=function(){let S=0;return{escape:function(x){return x.replace(/([.*+?^${}()|[]\/\\])/g,"\\$1")},isDataUrl:function(x){return x.search(/^(data:)/)!==-1},canvasToBlob:function(x){return x.toBlob?new Promise(function(C){x.toBlob(C)}):function(C){return new Promise(function(y){var R=f(C.toDataURL().split(",")[1]),I=R.length,B=new Uint8Array(I);for(let U=0;U<I;U++)B[U]=R.charCodeAt(U);y(new Blob([B],{type:"image/png"}))})}(x)},resolveUrl:function(x,C){var y=document.implementation.createHTMLDocument(),R=y.createElement("base"),I=(y.head.appendChild(R),y.createElement("a"));return y.body.appendChild(I),R.href=C,I.href=x,I.href},getAndEncode:function(x){let C=u.impl.urlCache.find(function(y){return y.url===x});return C||(C={url:x,promise:null},u.impl.urlCache.push(C)),C.promise===null&&(u.impl.options.cacheBust&&(x+=(/\?/.test(x)?"&":"?")+new Date().getTime()),C.promise=new Promise(function(y){const R=u.impl.options.httpTimeout,I=new XMLHttpRequest;I.onreadystatechange=function(){if(I.readyState===4)if(I.status!==200)B?y(B):z(`cannot fetch resource: ${x}, status: `+I.status);else{const j=new FileReader;j.onloadend=function(){y(j.result)},j.readAsDataURL(I.response)}},I.ontimeout=function(){B?y(B):z(`timeout of ${R}ms occured while fetching resource: `+x)},I.responseType="blob",I.timeout=R,u.impl.options.useCredentials&&(I.withCredentials=!0),I.open("GET",x,!0),I.send();let B;var U;function z(j){console.error(j),y("")}u.impl.options.imagePlaceholder&&(U=u.impl.options.imagePlaceholder.split(/,/))&&U[1]&&(B=U[1])})),C.promise},uid:function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+S++},delay:function(x){return function(C){return new Promise(function(y){setTimeout(function(){y(C)},x)})}},asArray:function(x){var C=[],y=x.length;for(let R=0;R<y;R++)C.push(x[R]);return C},escapeXhtml:function(x){return x.replace(/%/g,"%25").replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(x){return x!=="data:,"?new Promise(function(C,y){const R=new Image;u.impl.options.useCredentials&&(R.crossOrigin="use-credentials"),R.onload=function(){window&&window.requestAnimationFrame?window.requestAnimationFrame(function(){C(R)}):C(R)},R.onerror=y,R.src=x}):Promise.resolve()},width:function(x){var C=V(x,"width");if(!isNaN(C))return C;var C=V(x,"border-left-width"),y=V(x,"border-right-width");return x.scrollWidth+C+y},height:function(x){var C=V(x,"height");if(!isNaN(C))return C;var C=V(x,"border-top-width"),y=V(x,"border-bottom-width");return x.scrollHeight+C+y},getWindow:$,isElement:M,isElementHostForOpenShadowRoot:function(x){return M(x)&&x.shadowRoot!==null},isShadowRoot:k,isInShadowRoot:L,isHTMLElement:function(x){return x instanceof $(x).HTMLElement},isHTMLCanvasElement:function(x){return x instanceof $(x).HTMLCanvasElement},isHTMLInputElement:function(x){return x instanceof $(x).HTMLInputElement},isHTMLImageElement:function(x){return x instanceof $(x).HTMLImageElement},isHTMLLinkElement:function(x){return x instanceof $(x).HTMLLinkElement},isHTMLScriptElement:function(x){return x instanceof $(x).HTMLScriptElement},isHTMLStyleElement:function(x){return x instanceof $(x).HTMLStyleElement},isHTMLTextAreaElement:function(x){return x instanceof $(x).HTMLTextAreaElement},isShadowSlotElement:function(x){return L(x)&&x instanceof $(x).HTMLSlotElement},isSVGElement:function(x){return x instanceof $(x).SVGElement},isSVGRectElement:function(x){return x instanceof $(x).SVGRectElement},isDimensionMissing:function(x){return isNaN(x)||x<=0}};function $(x){return x=x?x.ownerDocument:void 0,(x?x.defaultView:void 0)||n||window}function k(x){return x instanceof $(x).ShadowRoot}function L(x){return x!==null&&Object.prototype.hasOwnProperty.call(x,"getRootNode")&&k(x.getRootNode())}function M(x){return x instanceof $(x).Element}function V(x,C){if(x.nodeType===h){let y=d(x).getPropertyValue(C);if(y.slice(-2)==="px")return y=y.slice(0,-2),parseFloat(y)}return NaN}}(),i=function(){const S=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(M,V,x){return $(M)?Promise.resolve(M).then(k).then(function(C){let y=Promise.resolve(M);return C.forEach(function(R){y=y.then(function(I){return L(I,R,V,x)})}),y}):Promise.resolve(M)},shouldProcess:$,impl:{readUrls:k,inline:L}};function $(M){return M.search(S)!==-1}function k(M){for(var V,x=[];(V=S.exec(M))!==null;)x.push(V[1]);return x.filter(function(C){return!r.isDataUrl(C)})}function L(M,V,x,C){return Promise.resolve(V).then(function(y){return x?r.resolveUrl(y,x):y}).then(C||r.getAndEncode).then(function(y){return M.replace((R=V,new RegExp(`(url\\(['"]?)(${r.escape(R)})(['"]?\\))`,"g")),`$1${y}$3`);var R})}}(),s={resolveAll:function(){return a().then(function(S){return Promise.all(S.map(function($){return $.resolve()}))}).then(function(S){return S.join(`
2
- `)})},impl:{readAll:a}};function a(){return Promise.resolve(r.asArray(document.styleSheets)).then(function($){const k=[];return $.forEach(function(L){if(Object.prototype.hasOwnProperty.call(Object.getPrototypeOf(L),"cssRules"))try{r.asArray(L.cssRules||[]).forEach(k.push.bind(k))}catch(M){console.error("domtoimage: Error while reading CSS rules from "+L.href,M.toString())}}),k}).then(function($){return $.filter(function(k){return k.type===CSSRule.FONT_FACE_RULE}).filter(function(k){return i.shouldProcess(k.style.getPropertyValue("src"))})}).then(function($){return $.map(S)});function S($){return{resolve:function(){var k=($.parentStyleSheet||{}).href;return i.inlineAll($.cssText,k)},src:function(){return $.style.getPropertyValue("src")}}}}const o={inlineAll:function S($){if(!r.isElement($))return Promise.resolve($);return k($).then(function(){return r.isHTMLImageElement($)?l($).inline():Promise.all(r.asArray($.childNodes).map(function(L){return S(L)}))});function k(L){const M=["background","background-image"],V=M.map(function(x){const C=L.style.getPropertyValue(x),y=L.style.getPropertyPriority(x);return C?i.inlineAll(C).then(function(R){L.style.setProperty(x,R,y)}):Promise.resolve()});return Promise.all(V).then(function(){return L})}},impl:{newImage:l}};function l(S){return{inline:function($){return r.isDataUrl(S.src)?Promise.resolve():Promise.resolve(S.src).then($||r.getAndEncode).then(function(k){return new Promise(function(L){S.onload=L,S.onerror=L,S.src=k})})}}}const c={copyDefaultStyles:!0,imagePlaceholder:void 0,cacheBust:!1,useCredentials:!1,httpTimeout:3e4,styleCaching:"strict"},u={toSvg:p,toPng:function(S,$){return m(S,$).then(function(k){return k.toDataURL()})},toJpeg:function(S,$){return m(S,$).then(function(k){return k.toDataURL("image/jpeg",($?$.quality:void 0)||1)})},toBlob:function(S,$){return m(S,$).then(r.canvasToBlob)},toPixelData:function(S,$){return m(S,$).then(function(k){return k.getContext("2d").getImageData(0,0,r.width(S),r.height(S)).data})},toCanvas:m,impl:{fontFaces:s,images:o,util:r,inliner:i,urlCache:[],options:{}}},h=(e.exports=u,(typeof Node<"u"?Node.ELEMENT_NODE:void 0)||1),d=(n!==void 0?n.getComputedStyle:void 0)||(typeof window<"u"?window.getComputedStyle:void 0)||globalThis.getComputedStyle,f=(n!==void 0?n.atob:void 0)||(typeof window<"u"?window.atob:void 0)||globalThis.atob;function p(S,$){u.impl.util.getWindow(S);var k=$=$||{};k.copyDefaultStyles===void 0?u.impl.options.copyDefaultStyles=c.copyDefaultStyles:u.impl.options.copyDefaultStyles=k.copyDefaultStyles,k.imagePlaceholder===void 0?u.impl.options.imagePlaceholder=c.imagePlaceholder:u.impl.options.imagePlaceholder=k.imagePlaceholder,k.cacheBust===void 0?u.impl.options.cacheBust=c.cacheBust:u.impl.options.cacheBust=k.cacheBust,k.useCredentials===void 0?u.impl.options.useCredentials=c.useCredentials:u.impl.options.useCredentials=k.useCredentials,k.httpTimeout===void 0?u.impl.options.httpTimeout=c.httpTimeout:u.impl.options.httpTimeout=k.httpTimeout,k.styleCaching===void 0?u.impl.options.styleCaching=c.styleCaching:u.impl.options.styleCaching=k.styleCaching;let L=[];return Promise.resolve(S).then(function(M){if(M.nodeType===h)return M;var V=M,x=M.parentNode,C=document.createElement("span");return x.replaceChild(C,V),C.append(M),L.push({parent:x,child:V,wrapper:C}),C}).then(function(M){return function V(x,C,y,R){const I=C.filter;if(x===g||r.isHTMLScriptElement(x)||r.isHTMLStyleElement(x)||r.isHTMLLinkElement(x)||y!==null&&I&&!I(x))return Promise.resolve();return Promise.resolve(x).then(B).then(function(G){return z(G,U(x))}).then(function(G){return j(G,x)});function B(G){return r.isHTMLCanvasElement(G)?r.makeImage(G.toDataURL()):G.cloneNode(!1)}function U(G){return r.isElementHostForOpenShadowRoot(G)?G.shadowRoot:G}function z(G,et){const q=rt(et);let Q=Promise.resolve();if(q.length!==0){const ot=d(lt(et));r.asArray(q).forEach(function(Y){Q=Q.then(function(){return V(Y,C,ot).then(function(X){X&&G.appendChild(X)})})})}return Q.then(function(){return G});function lt(ot){return r.isShadowRoot(ot)?ot.host:ot}function rt(ot){return r.isShadowSlotElement(ot)?ot.assignedNodes():ot.childNodes}}function j(G,et){return!r.isElement(G)||r.isShadowSlotElement(et)?Promise.resolve(G):Promise.resolve().then(q).then(Q).then(lt).then(rt).then(function(){return G});function q(){function ot(X,K){K.font=X.font,K.fontFamily=X.fontFamily,K.fontFeatureSettings=X.fontFeatureSettings,K.fontKerning=X.fontKerning,K.fontSize=X.fontSize,K.fontStretch=X.fontStretch,K.fontStyle=X.fontStyle,K.fontVariant=X.fontVariant,K.fontVariantCaps=X.fontVariantCaps,K.fontVariantEastAsian=X.fontVariantEastAsian,K.fontVariantLigatures=X.fontVariantLigatures,K.fontVariantNumeric=X.fontVariantNumeric,K.fontVariationSettings=X.fontVariationSettings,K.fontWeight=X.fontWeight}function Y(X,K){const F=d(X);F.cssText?(K.style.cssText=F.cssText,ot(F,K.style)):(w(C,X,F,y,K),y===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(wt=>K.style.removeProperty(wt)),["left","right","top","bottom"].forEach(wt=>{K.style.getPropertyValue(wt)&&K.style.setProperty(wt,"0px")})))}Y(et,G)}function Q(){const ot=r.uid();function Y(X){const K=d(et,X),F=K.getPropertyValue("content");if(F!==""&&F!=="none"){let wt=function(){const zt=`.${ot}:`+X,it=(K.cssText?At:Le)();return document.createTextNode(zt+`{${it}}`);function At(){return`${K.cssText} content: ${F};`}function Le(){return r.asArray(K).map(De).join("; ")+";";function De(is){const ss=K.getPropertyValue(is),Kc=K.getPropertyPriority(is)?" !important":"";return is+": "+ss+Kc}}};const yt=G.getAttribute("class")||"",Ht=(G.setAttribute("class",yt+" "+ot),document.createElement("style"));Ht.appendChild(wt()),G.appendChild(Ht)}}[":before",":after"].forEach(function(X){Y(X)})}function lt(){r.isHTMLTextAreaElement(et)&&(G.innerHTML=et.value),r.isHTMLInputElement(et)&&G.setAttribute("value",et.value)}function rt(){r.isSVGElement(G)&&(G.setAttribute("xmlns","http://www.w3.org/2000/svg"),r.isSVGRectElement(G))&&["width","height"].forEach(function(ot){const Y=G.getAttribute(ot);Y&&G.style.setProperty(ot,Y)})}}}(M,$,null)}).then(v).then(b).then(function(M){$.bgcolor&&(M.style.backgroundColor=$.bgcolor),$.width&&(M.style.width=$.width+"px"),$.height&&(M.style.height=$.height+"px"),$.style&&Object.keys($.style).forEach(function(x){M.style[x]=$.style[x]});let V=null;return typeof $.onclone=="function"&&(V=$.onclone(M)),Promise.resolve(V).then(function(){return M})}).then(function(M){let V=$.width||r.width(M),x=$.height||r.height(M);return Promise.resolve(M).then(function(C){return C.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(C)}).then(r.escapeXhtml).then(function(C){var y=(r.isDimensionMissing(V)?' width="100%"':` width="${V}"`)+(r.isDimensionMissing(x)?' height="100%"':` height="${x}"`);return`<svg xmlns="http://www.w3.org/2000/svg"${(r.isDimensionMissing(V)?"":` width="${V}"`)+(r.isDimensionMissing(x)?"":` height="${x}"`)}><foreignObject${y}>${C}</foreignObject></svg>`}).then(function(C){return"data:image/svg+xml;charset=utf-8,"+C})}).then(function(M){for(;0<L.length;){var V=L.pop();V.parent.replaceChild(V.child,V.wrapper)}return M}).then(function(M){return u.impl.urlCache=[],function(){g&&(document.body.removeChild(g),g=null),O&&clearTimeout(O),O=setTimeout(()=>{O=null,E={}},2e4)}(),M})}function m(S,$){return p(S,$=$||{}).then(r.makeImage).then(function(k){var L=typeof $.scale!="number"?1:$.scale,M=function(x,C){let y=$.width||r.width(x),R=$.height||r.height(x);return r.isDimensionMissing(y)&&(y=r.isDimensionMissing(R)?300:2*R),r.isDimensionMissing(R)&&(R=y/2),x=document.createElement("canvas"),x.width=y*C,x.height=R*C,$.bgcolor&&((C=x.getContext("2d")).fillStyle=$.bgcolor,C.fillRect(0,0,x.width,x.height)),x}(S,L),V=M.getContext("2d");return V.msImageSmoothingEnabled=!1,V.imageSmoothingEnabled=!1,k&&(V.scale(L,L),V.drawImage(k,0,0)),M})}let g=null;function v(S){return s.resolveAll().then(function($){var k;return $!==""&&(k=document.createElement("style"),S.appendChild(k),k.appendChild(document.createTextNode($))),S})}function b(S){return o.inlineAll(S).then(function(){return S})}function w(S,$,k,L,M){const V=u.impl.options.copyDefaultStyles?function(C,I){var I=function(U){var z=[];do if(U.nodeType===h){var j=U.tagName;if(z.push(j),T.includes(j))break}while(U=U.parentNode,U);return z}(I),R=function(U){return(C.styleCaching!=="relaxed"?U:U.filter((z,j,G)=>j===0||j===G.length-1)).join(">")}(I);if(E[R])return E[R];var B=function(){if(g)return g.contentWindow;var U=document.characterSet||"UTF-8",z=document.doctype,z=z?(`<!DOCTYPE ${j(z.name)} ${j(z.publicId)} `+j(z.systemId)).trim()+">":"";return(g=document.createElement("iframe")).id="domtoimage-sandbox-"+r.uid(),g.style.visibility="hidden",g.style.position="fixed",document.body.appendChild(g),function(G,et,q,Q){try{return G.contentWindow.document.write(et+`<html><head><meta charset='${q}'><title>${Q}</title></head><body></body></html>`),G.contentWindow}catch{}var lt=document.createElement("meta");lt.setAttribute("charset",q);try{var rt=document.implementation.createHTMLDocument(Q),ot=(rt.head.appendChild(lt),et+rt.documentElement.outerHTML);return G.setAttribute("srcdoc",ot),G.contentWindow}catch{}return G.contentDocument.head.appendChild(lt),G.contentDocument.title=Q,G.contentWindow}(g,z,U,"domtoimage-sandbox");function j(G){var et;return G?((et=document.createElement("div")).innerText=G,et.innerHTML):""}}(),I=function(U,z){let j=U.body;do{var G=z.pop(),G=U.createElement(G);j.appendChild(G),j=G}while(0<z.length);return j.textContent="​",j}(B.document,I),B=function(U,z){const j={},G=U.getComputedStyle(z);return r.asArray(G).forEach(function(et){j[et]=et==="width"||et==="height"?"auto":G.getPropertyValue(et)}),j}(B,I);return function(U){do{var z=U.parentElement;z!==null&&z.removeChild(U),U=z}while(U&&U.tagName!=="BODY")}(I),E[R]=B}(S,$):{},x=M.style;r.asArray(k).forEach(function(C){var y,R=k.getPropertyValue(C),I=V[C],B=L?L.getPropertyValue(C):void 0;(R!==I||L&&R!==B)&&(I=k.getPropertyPriority(C),B=x,R=R,I=I,y=0<=["background-clip"].indexOf(C=C),I?(B.setProperty(C,R,I),y&&B.setProperty("-webkit-"+C,R,I)):(B.setProperty(C,R),y&&B.setProperty("-webkit-"+C,R)))})}let O=null,E={};const T=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"]})(c$)})(yg);var u$=yg.exports;const bg=vg(u$);function xg(e){const t=Re(e,r=>r.value),n=Be().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function wg(e,t){const n=_(t,"gradient","colors"),r=!ze(n);let i=_(t,"pairing","option");const s=xg(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${i}-${c}`)}return gl().domain(s).range(o)}var dt=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(dt||{});function h$(e,t){return e&&ng(e,t,Bi)}function d$(e,t){return function(n,r){if(n==null)return n;if(!er(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var f$=d$(h$);const pc=f$;function p$(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function g$(e,t,n,r){return pc(e,function(i,s,a){t(r,i,n(i),a)}),r}function m$(e,t){return function(n,r){var i=ee(n)?p$:g$,s=t?t():{};return i(n,e,Na(r),s)}}function v$(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var y$=Object.prototype,b$=y$.hasOwnProperty,x$=m$(function(e,t,n){b$.call(e,n)?e[n].push(t):Ta(e,n,[t])});const w$=x$;class Je{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=_(n,"data"),a=_(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===tt.LINEAR||c===tt.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===tt.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,h]=a[o].domain;r=r.filter(d=>!(l in d)||d[l]>=u&&d[l]<=h)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Vt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(yn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return _(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Vt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return w$(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=tO.defaultBins}=s,l=Array.isArray(o),c=Pv().value(f=>f[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],h=Array.from(new Set(t.map(f=>f[a]))),d=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,m=this.aggregateBinDataByGroup(f);h.forEach(g=>{d.push({group:g,key:p,value:m[g]||0,bin:f.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return Il().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}-${l.x1}`):s=ji(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?mg(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===tt.TIME?s.sort((l,c)=>{const u=new Date(l),h=new Date(c);return u-h}):(o===tt.LOG||o===tt.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split("-"),h={x0:c,x1:u},d=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{h[f]=d.filter(p=>p[i]===f).length}),h}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const h=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?mg(f[p])===l:f[p].toString()===l)}),d=this.services.cartesianScales.getRangeIdentifier(c);c[u]=h?h[d]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=v$(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const h=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/h*100:c[u]=0})})}return(r?Il().offset(HE):Il()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const h=l[u];return h[s]=a[c],h}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();cc(n,t),this.set({options:at(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(A.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Vt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(A.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=_(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=_(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=_(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=_(s,"label");if(c===null){const h=_(i,o);h?l=h:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(i=>i.map(s=>`"${s==="&ndash;"?"–":s}"`));let n="",r="";t.forEach(function(i,s){r=i.join(","),n+=s<t.length?r+`
3
- `:r}),this.services.files.downloadCSV(n,"myChart.csv")}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:r,DISABLED:i}=Vt.items.status,s=this.getOptions(),a=ji(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=_(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=_(this.getOptions(),"color","pairing");let n=_(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=_(t,"option");const i=Wf.pairingOptions,s=n>5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=Qs().range(o).domain(this.allDataGroups)}}let sr=class extends Je{constructor(t){super(t),this.axisFlavor=ya.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:_(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{cartesianScales:i}=this.services,{primaryDomain:s,primaryRange:a,secondaryDomain:o,secondaryRange:l}=this.assignRangeAndDomains(),c=i.getDomainAxisScaleType();let u;return c===tt.TIME&&(u=h=>Lr(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...l?[l.label]:[]],...t.map(h=>[h[r],h[s.identifier]===null?"&ndash;":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"&ndash;":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"&ndash;":h[o.identifier]]:[],...l?[h[l.identifier]===null||isNaN(h[l.identifier])?"&ndash;":h[l.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),_(this.getOptions(),"zoomBar",H.TOP,"enabled"))){const r=_(this.getOptions(),"zoomBar",H.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(yn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=ji(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(h=>{h[s].getTime()===l&&(c+=h[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:r})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const r=[];return Object.keys(H).forEach(i=>{const s=H[i],a=n.axes[s];if(a&&a.scaleType===tt.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{_(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}},_$=class extends sr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();return t.sort((n,r)=>n.source.localeCompare(r.source)),[["Source","Target","Value"],...t.map(n=>[n.source,n.target,n.value])]}},E$=class extends sr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:ao(t,.25),q_50:ao(t,.5),q_75:ao(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(w=>w[o]).sort(be),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,h=c.quartiles.q_75,d=(h-u)*1.5,f=u-d,p=h+d,m=[],g=[];for(const w of l)w<f||w>p?m.push(w):g.push(w);c.outliers=m;const v=Sn(g),b=Nn(g);c.whiskers={min:v||Sn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:b||Nn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},i.push(c)}return i}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBoxplotData();return[["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],...r.map(i=>{let s=_(i,"outliers");return(s===null||s.length===0)&&(s=["&ndash;"]),[i[n],_(i,"whiskers","min")!==null?_(i,"whiskers","min").toLocaleString():"&ndash;",_(i,"quartiles","q_25")!==null?_(i,"quartiles","q_25").toLocaleString():"&ndash;",_(i,"quartiles","q_50")!==null?_(i,"quartiles","q_50").toLocaleString():"&ndash;",_(i,"quartiles","q_75")!==null?_(i,"quartiles","q_75").toLocaleString():"&ndash;",_(i,"whiskers","max")!==null?_(i,"whiskers","max").toLocaleString():"&ndash;",_(i,"quartiles","q_75")!==null&&_(i,"quartiles","q_25")!==null?(_(i,"quartiles","q_75")-_(i,"quartiles","q_25")).toLocaleString():"&ndash;",s.map(a=>a.toLocaleString()).join(",")]})]}setColorClassNames(){const t=_(this.getOptions(),"color","pairing");let n=_(t,"option");const r=Wf.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Qs().range(i).domain(this.allDataGroups)}},S$=class extends sr{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),s=_(n,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(a=>[a.title,a[r],a.value===null?"&ndash;":a.value,_(a,"marker")===null?"&ndash;":a.marker,_(a,"marker")===null?"&ndash;":`${Math.floor(a[i]/a.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(a)]])]}},O$=class extends Je{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(ze(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!ze(n)&&!ze(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(r=>{this._matrix[r.properties.NAME]=r}),n.forEach(r=>{this._matrix[r.name]?this._matrix[r.name].value=r.value||null:console.warn(`Data point ${r} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData();return[["Country ID","Country Name","Value"],...t.map(n=>[n.id===null?"&ndash;":n.id,n.name,n.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=_(this.getOptions(),"color");this._colorScale=wg(this.getDisplayData(),t)}},T$=class extends Je{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=at({},t,this.getZoomOptions(t));cc(n,r);const i=this.getHierarchyLevel(),s=_(n,"circlePack","hierarchyLevel");this.set({options:at(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&_(n,0,"children")?_(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),_(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Zt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent","Value"]];return t.forEach(r=>{let i=r.value?r.value:0;r.children&&(i+=this.getChildrenDatums(r.children,r.name,n,0)),n.push(["&ndash;",r.name,i])}),n}getChildrenDatums(t,n,r=[],i=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(i+=a.value),l+=this.getChildrenDatums(a.children,o,r,l),r.push([o,s,l]),i+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,i+=a.value),r.push([a.name,s,c])}}),i}},M$=class extends Je{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(i=>[i[r],i.value===null?"&ndash;":i.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},C$=class extends Je{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(i=>[i[r],i.value===null?"&ndash;":i.value.toLocaleString()])]}},A$=class extends sr{constructor(t){super(t),this.axisFlavor=ya.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=_(this.getOptions(),"axes");if(_(n,"left","scaleType")&&_(n,"left","scaleType")!==tt.LABELS||_(n,"right","scaleType")&&_(n,"right","scaleType")!==tt.LABELS||_(n,"top","scaleType")&&_(n,"top","scaleType")!==tt.LABELS||_(n,"bottom","scaleType")&&_(n,"bottom","scaleType")!==tt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Re(this.getDisplayData(),r=>r.value),n=Be().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(ze(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(ze(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(ze(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=yn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(yn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){ze(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains();return[[n.label,r.label,"Value"],...t.map(i=>[i[n.identifier]===null?"&ndash;":i[n.identifier],i[r.identifier]===null?"&ndash;":i[r.identifier].toLocaleString(),i.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=_(t,"color","gradient","colors"),r=!ze(n);let i=_(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=gl().domain(s).range(o);const l=_(this.getOptions(),"color");this._colorScale=wg(this.getDisplayData(),l)}},$$=class extends sr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[kt(t,"bins.rangeLabel")||"Range",...r.map(i=>kt(i,`0.${n}`))],...kt(r,0).map((i,s)=>[`${kt(i,"data.x0")} – ${kt(i,"data.x1")}`,...r.map(a=>kt(a[s],`data.${kt(a[s],n)}`))])]}},L$=class extends Je{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=_(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=_(this.getDisplayData()),{value:r}=n?n.reduce((a,o)=>({value:a.value+o.value})):0,i=_(t,"meter","proportional")?r:r>100?100:r,s=_(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=_(n,"meter","proportional");let a=[],o;if(s===null){o=100;const l=t[0];a=[["Group","Value",...i?["Status"]:[]],[l[r],l.value,...i?[i]:[]]]}else o=_(s,"total")||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[r],c.value,(c.value/o*100).toFixed(2)+" %"])];return a}},D$=class extends sr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=_(t,"radar","axes"),s=_(n,"0","data").map(a=>a[r]);return[["Group",...s],...n.map(a=>[a.name,...s.map((o,l)=>_(a,"data",l,i)!==null?_(a,"data",l,i).toLocaleString():"&ndash;")])]}},k$=class extends Je{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"&ndash;"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}},R$=class extends Je{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(r=>{Array.isArray(r.children)?r.children.forEach(i=>{n.push([i.name,r.name,i.value])}):_(r.name)!==null&&_(r.value)&&n.push(["–",r.name,r.value])}),n}};class I$ extends Je{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data;return[[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],...t.map(a=>[a[i],a[s],a[r]])]}}var P$=/\s/;function N$(e){for(var t=e.length;t--&&P$.test(e.charAt(t)););return t}var U$=/^\s+/;function B$(e){return e&&e.slice(0,N$(e)+1).replace(U$,"")}var _g=0/0,V$=/^[-+]0x[0-9a-f]+$/i,H$=/^0b[01]+$/i,F$=/^0o[0-7]+$/i,G$=parseInt;function Zi(e){if(typeof e=="number")return e;if(Sa(e))return _g;if($e(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$e(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=B$(e);var n=H$.test(e);return n||F$.test(e)?G$(e.slice(2),n?2:8):V$.test(e)?_g:+e}var z$=function(){return Fe.Date.now()};const gc=z$;var j$="Expected a function",W$=Math.max,q$=Math.min;function Ha(e,t,n){var r,i,s,a,o,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(j$);t=Zi(t)||0,$e(n)&&(u=!!n.leading,h="maxWait"in n,s=h?W$(Zi(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function f(T){var S=r,$=i;return r=i=void 0,c=T,a=e.apply($,S),a}function p(T){return c=T,o=setTimeout(v,t),u?f(T):a}function m(T){var S=T-l,$=T-c,k=t-S;return h?q$(k,s-$):k}function g(T){var S=T-l,$=T-c;return l===void 0||S>=t||S<0||h&&$>=s}function v(){var T=gc();if(g(T))return b(T);o=setTimeout(v,m(T))}function b(T){return o=void 0,d&&r?f(T):(r=i=void 0,a)}function w(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function O(){return o===void 0?a:b(gc())}function E(){var T=gc(),S=g(T);if(r=arguments,i=this,l=T,S){if(o===void 0)return p(l);if(h)return clearTimeout(o),o=setTimeout(v,t),f(l)}return o===void 0&&(o=setTimeout(v,t)),a}return E.cancel=w,E.flush=O,E}let wn=class{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}};const Y$="DONT_STYLE_ME_css_styles_verifier";class P extends wn{constructor(t,n){super(t,n),this.chartID=""}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=N(t));const r={width:0,height:0},i=d=>{d&&Object.keys(r).forEach(f=>{if(d[f]){const p=d[f],m=parseFloat(p);p&&m>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=m)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(d){console.error(d)}let h;if(a instanceof SVGSVGElement&&(h={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(h),r.width>0&&r.height>0))return h;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const d={width:_(t.node(),"width","baseVal","value"),height:_(t.node(),"height","baseVal","value")};i(d)}catch{i(h),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.styleHolderElement(),this.initializeID(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=_(t,"style","prefix"),r=N(this.getHolder()).append("div").classed(`${ge}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",Y$),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),N(this.getHolder()).classed(`${ge}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.getHolder(),r=N(n);r.classed("filled",!0),bg.toJpeg(this.getMainContainer(),{bgcolor:typeof window<"u"?window.getComputedStyle(n).getPropertyValue("background-color"):void 0,quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.jpg"),r.classed("filled",!1)})}exportToPNG(){const t=this,n=this.getHolder(),r=N(n);r.classed("filled",!0),bg.toPng(this.getMainContainer(),{bgcolor:typeof window<"u"?window.getComputedStyle(n).getPropertyValue("background-color"):void 0,quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.png"),r.classed("filled",!1)}).catch(function(i){console.error("oops, something went wrong!",i)})}toggleFullscreen(){const t=this.getHolder();N(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=N(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=P.getSVGElementSize(N(this.mainContainer),{useBBox:!0}),n=N(this.mainContainer).attr("class"),r=N(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(P.getSVGElementSize(N(s),{useBBox:!0}).height)}),i<=t?N(this.mainContainer).attr("height",i):N(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&N(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(A.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(A.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Ha(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(A.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}}let mc=class vv extends wn{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:vv.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function Eg(e){const t=X$(Sg(e),360);return Ln(t,[0,10])||Ln(t,[350,0])?{textAnchor:hn.START,dominantBaseline:dn.MIDDLE}:Ln(t,[10,80])?{textAnchor:hn.START,dominantBaseline:dn.HANGING}:Ln(t,[80,100])?{textAnchor:hn.MIDDLE,dominantBaseline:dn.HANGING}:Ln(t,[100,170])?{textAnchor:hn.END,dominantBaseline:dn.HANGING}:Ln(t,[170,190])?{textAnchor:hn.END,dominantBaseline:dn.MIDDLE}:Ln(t,[190,260])?{textAnchor:hn.END,dominantBaseline:dn.BASELINE}:Ln(t,[260,280])?{textAnchor:hn.MIDDLE,dominantBaseline:dn.BASELINE}:{textAnchor:hn.START,dominantBaseline:dn.BASELINE}}function X$(e,t){return(e%t+t)%t}function Ln(e,[t,n]){return e>=t&&e<=n}function Sg(e){return e*(180/Math.PI)}function Gt(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function Z$(e,t){return t*Math.sin(e-Math.PI/2)}function Og(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 K$(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 vc(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function Q$(e){return e.depth}function J$(e,t){return t-1-e.height}function Tg(e,t){return e.sourceLinks.length?e.depth:t-1}function Fa(e){return function(){return e}}function Mg(e,t){return Ga(e.source,t.source)||e.index-t.index}function Cg(e,t){return Ga(e.target,t.target)||e.index-t.index}function Ga(e,t){return e.y0-t.y0}function yc(e){return e.value}function tL(e){return e.index}function eL(e){return e.nodes}function nL(e){return e.links}function Ag(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function $g({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function rL(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=tL,l=Tg,c,u,h=eL,d=nL,f=6;function p(){const y={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return m(y),g(y),v(y),b(y),E(y),$g(y),y}p.update=function(y){return $g(y),y},p.nodeId=function(y){return arguments.length?(o=typeof y=="function"?y:Fa(y),p):o},p.nodeAlign=function(y){return arguments.length?(l=typeof y=="function"?y:Fa(y),p):l},p.nodeSort=function(y){return arguments.length?(c=y,p):c},p.nodeWidth=function(y){return arguments.length?(i=+y,p):i},p.nodePadding=function(y){return arguments.length?(s=a=+y,p):s},p.nodes=function(y){return arguments.length?(h=typeof y=="function"?y:Fa(y),p):h},p.links=function(y){return arguments.length?(d=typeof y=="function"?y:Fa(y),p):d},p.linkSort=function(y){return arguments.length?(u=y,p):u},p.size=function(y){return arguments.length?(e=t=0,n=+y[0],r=+y[1],p):[n-e,r-t]},p.extent=function(y){return arguments.length?(e=+y[0][0],n=+y[1][0],t=+y[0][1],r=+y[1][1],p):[[e,t],[n,r]]},p.iterations=function(y){return arguments.length?(f=+y,p):f};function m({nodes:y,links:R}){for(const[B,U]of y.entries())U.index=B,U.sourceLinks=[],U.targetLinks=[];const I=new Map(y.map((B,U)=>[o(B,U,y),B]));for(const[B,U]of R.entries()){U.index=B;let{source:z,target:j}=U;typeof z!="object"&&(z=U.source=Ag(I,z)),typeof j!="object"&&(j=U.target=Ag(I,j)),z.sourceLinks.push(U),j.targetLinks.push(U)}if(u!=null)for(const{sourceLinks:B,targetLinks:U}of y)B.sort(u),U.sort(u)}function g({nodes:y}){for(const R of y)R.value=R.fixedValue===void 0?Math.max(vc(R.sourceLinks,yc),vc(R.targetLinks,yc)):R.fixedValue}function v({nodes:y}){const R=y.length;let I=new Set(y),B=new Set,U=0;for(;I.size;){for(const z of I){z.depth=U;for(const{target:j}of z.sourceLinks)B.add(j)}if(++U>R)throw new Error("circular link");I=B,B=new Set}}function b({nodes:y}){const R=y.length;let I=new Set(y),B=new Set,U=0;for(;I.size;){for(const z of I){z.height=U;for(const{source:j}of z.targetLinks)B.add(j)}if(++U>R)throw new Error("circular link");I=B,B=new Set}}function w({nodes:y}){const R=Og(y,U=>U.depth)+1,I=(n-e-i)/(R-1),B=new Array(R);for(const U of y){const z=Math.max(0,Math.min(R-1,Math.floor(l.call(null,U,R))));U.layer=z,U.x0=e+z*I,U.x1=U.x0+i,B[z]?B[z].push(U):B[z]=[U]}if(c)for(const U of B)U.sort(c);return B}function O(y){const R=K$(y,I=>(r-t-(I.length-1)*a)/vc(I,yc));for(const I of y){let B=t;for(const U of I){U.y0=B,U.y1=B+U.value*R,B=U.y1+a;for(const z of U.sourceLinks)z.width=z.value*R}B=(r-B+a)/(I.length+1);for(let U=0;U<I.length;++U){const z=I[U];z.y0+=B*(U+1),z.y1+=B*(U+1)}V(I)}}function E(y){const R=w(y);a=Math.min(s,(r-t)/(Og(R,I=>I.length)-1)),O(R);for(let I=0;I<f;++I){const B=Math.pow(.99,I),U=Math.max(1-B,(I+1)/f);S(R,B,U),T(R,B,U)}}function T(y,R,I){for(let B=1,U=y.length;B<U;++B){const z=y[B];for(const j of z){let G=0,et=0;for(const{source:Q,value:lt}of j.targetLinks){let rt=lt*(j.layer-Q.layer);G+=x(Q,j)*rt,et+=rt}if(!(et>0))continue;let q=(G/et-j.y0)*R;j.y0+=q,j.y1+=q,M(j)}c===void 0&&z.sort(Ga),$(z,I)}}function S(y,R,I){for(let B=y.length,U=B-2;U>=0;--U){const z=y[U];for(const j of z){let G=0,et=0;for(const{target:Q,value:lt}of j.sourceLinks){let rt=lt*(Q.layer-j.layer);G+=C(j,Q)*rt,et+=rt}if(!(et>0))continue;let q=(G/et-j.y0)*R;j.y0+=q,j.y1+=q,M(j)}c===void 0&&z.sort(Ga),$(z,I)}}function $(y,R){const I=y.length>>1,B=y[I];L(y,B.y0-a,I-1,R),k(y,B.y1+a,I+1,R),L(y,r,y.length-1,R),k(y,t,0,R)}function k(y,R,I,B){for(;I<y.length;++I){const U=y[I],z=(R-U.y0)*B;z>1e-6&&(U.y0+=z,U.y1+=z),R=U.y1+a}}function L(y,R,I,B){for(;I>=0;--I){const U=y[I],z=(U.y1-R)*B;z>1e-6&&(U.y0-=z,U.y1-=z),R=U.y0-a}}function M({sourceLinks:y,targetLinks:R}){if(u===void 0){for(const{source:{sourceLinks:I}}of R)I.sort(Cg);for(const{target:{targetLinks:I}}of y)I.sort(Mg)}}function V(y){if(u===void 0)for(const{sourceLinks:R,targetLinks:I}of y)R.sort(Cg),I.sort(Mg)}function x(y,R){let I=y.y0-(y.sourceLinks.length-1)*a/2;for(const{target:B,width:U}of y.sourceLinks){if(B===R)break;I+=U+a}for(const{source:B,width:U}of R.targetLinks){if(B===y)break;I-=U}return I}function C(y,R){let I=R.y0-(R.targetLinks.length-1)*a/2;for(const{source:B,width:U}of R.targetLinks){if(B===y)break;I+=U+a}for(const{target:B,width:U}of y.sourceLinks){if(B===R)break;I-=U}return I}return p}var bc=Math.PI,xc=2*bc,ar=1e-6,iL=xc-ar;function wc(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Lg(){return new wc}wc.prototype=Lg.prototype={constructor:wc,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,h=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>ar)if(!(Math.abs(u*o-l*c)>ar)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var d=n-s,f=r-a,p=o*o+l*l,m=d*d+f*f,g=Math.sqrt(p),v=Math.sqrt(h),b=i*Math.tan((bc-Math.acos((p+h-m)/(2*g*v)))/2),w=b/v,O=b/g;Math.abs(w-1)>ar&&(this._+="L"+(e+w*c)+","+(t+w*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+O*o)+","+(this._y1=t+O*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,h=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>ar||Math.abs(this._y1-c)>ar)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%xc+xc),h>iL?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>ar&&(this._+="A"+n+","+n+",0,"+ +(h>=bc)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function Dg(e){return function(){return e}}function sL(e){return e[0]}function aL(e){return e[1]}var oL=Array.prototype.slice;function lL(e){return e.source}function cL(e){return e.target}function uL(e){var t=lL,n=cL,r=sL,i=aL,s=null;function a(){var o,l=oL.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Lg()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:Dg(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Dg(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function hL(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function dL(){return uL(hL)}function fL(e){return[e.source.x1,e.y0]}function pL(e){return[e.target.x0,e.y1]}function gL(){return dL().source(fL).target(pL)}function kg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mL(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var s=Function.bind.apply(t,i);return new s}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var vL={value:function(){}};function Rg(){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 za(n)}function za(e){this._=e}function yL(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}})}za.prototype=Rg.prototype={constructor:za,on:function(e,t){var n=this._,r=yL(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=bL(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]=Ig(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ig(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 za(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 bL(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ig(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=vL,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var xL=mL(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Rg},Symbol.toStringTag,{value:"Module"}))).dispatch,_c=Math.PI/180,Ki=64,ja=2048,wL=function(){var e=[256,256],t=_L,n=EL,r=SL,i=Pg,s=Pg,a=OL,o=TL,l=Ng,c=[],u=1/0,h=xL("word","end"),d=null,f=Math.random,p={},m=kL;p.canvas=function(b){return arguments.length?(m=Dn(b),p):m},p.start=function(){var b=g(m()),w=DL((e[0]>>5)*e[1]),O=null,E=c.length,T=-1,S=[],$=c.map(function(L,M){return L.text=t.call(this,L,M),L.font=n.call(this,L,M),L.style=i.call(this,L,M),L.weight=s.call(this,L,M),L.rotate=a.call(this,L,M),L.size=~~r.call(this,L,M),L.padding=o.call(this,L,M),L}).sort(function(L,M){return M.size-L.size});return d&&clearInterval(d),d=setInterval(k,0),k(),p;function k(){for(var L=Date.now();Date.now()-L<u&&++T<E&&d;){var M=$[T];M.x=e[0]*(f()+.5)>>1,M.y=e[1]*(f()+.5)>>1,ML(b,M,$,T),M.hasText&&v(w,M,O)&&(S.push(M),h.call("word",p,M),O?AL(O,M):O=[{x:M.x+M.x0,y:M.y+M.y0},{x:M.x+M.x1,y:M.y+M.y1}],M.x-=e[0]>>1,M.y-=e[1]>>1)}T>=E&&(p.stop(),h.call("end",p,S,O))}},p.stop=function(){return d&&(clearInterval(d),d=null),p};function g(b){b.width=b.height=1;var w=Math.sqrt(b.getContext("2d").getImageData(0,0,1,1).data.length>>2);b.width=(Ki<<5)/w,b.height=ja/w;var O=b.getContext("2d");return O.fillStyle=O.strokeStyle="red",O.textAlign="center",{context:O,ratio:w}}function v(b,w,O){e[0],e[1];for(var E=w.x,T=w.y,S=Math.sqrt(e[0]*e[0]+e[1]*e[1]),$=l(e),k=f()<.5?1:-1,L=-k,M,V,x;(M=$(L+=k))&&(V=~~M[0],x=~~M[1],!(Math.min(Math.abs(V),Math.abs(x))>=S));)if(w.x=E+V,w.y=T+x,!(w.x+w.x0<0||w.y+w.y0<0||w.x+w.x1>e[0]||w.y+w.y1>e[1])&&(!O||!CL(w,b,e[0]))&&(!O||$L(w,O))){for(var C=w.sprite,y=w.width>>5,R=e[0]>>5,I=w.x-(y<<4),B=I&127,U=32-B,z=w.y1-w.y0,j=(w.y+w.y0)*R+(I>>5),G,et=0;et<z;et++){G=0;for(var q=0;q<=y;q++)b[j+q]|=G<<U|(q<y?(G=C[et*y+q])>>>B:0);j+=R}return delete w.sprite,!0}return!1}return p.timeInterval=function(b){return arguments.length?(u=b??1/0,p):u},p.words=function(b){return arguments.length?(c=b,p):c},p.size=function(b){return arguments.length?(e=[+b[0],+b[1]],p):e},p.font=function(b){return arguments.length?(n=Dn(b),p):n},p.fontStyle=function(b){return arguments.length?(i=Dn(b),p):i},p.fontWeight=function(b){return arguments.length?(s=Dn(b),p):s},p.rotate=function(b){return arguments.length?(a=Dn(b),p):a},p.text=function(b){return arguments.length?(t=Dn(b),p):t},p.spiral=function(b){return arguments.length?(l=RL[b]||b,p):l},p.fontSize=function(b){return arguments.length?(r=Dn(b),p):r},p.padding=function(b){return arguments.length?(o=Dn(b),p):o},p.random=function(b){return arguments.length?(f=b,p):f},p.on=function(){var b=h.on.apply(h,arguments);return b===h?p:b},p};function _L(e){return e.text}function EL(){return"serif"}function Pg(){return"normal"}function SL(e){return Math.sqrt(e.value)}function OL(){return(~~(Math.random()*6)-3)*30}function TL(){return 1}function ML(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Ki<<5)/s,ja/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;var u=i.measureText(t.text+"m").width*s,h=t.size<<1;if(t.rotate){var d=Math.sin(t.rotate*_c),f=Math.cos(t.rotate*_c),p=u*f,m=u*d,g=h*f,v=h*d;u=Math.max(Math.abs(p+v),Math.abs(p-v))+31>>5<<5,h=~~Math.max(Math.abs(m+g),Math.abs(m-g))}else u=u+31>>5<<5;if(h>l&&(l=h),a+u>=Ki<<5&&(a=0,o+=l,l=0),o+h>=ja)break;i.translate((a+(u>>1))/s,(o+(h>>1))/s),t.rotate&&i.rotate(t.rotate*_c),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=u,t.height=h,t.xoff=a,t.yoff=o,t.x1=u>>1,t.y1=h>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=u}for(var b=i.getImageData(0,0,(Ki<<5)/s,ja/s).data,w=[];--r>=0;)if(t=n[r],!!t.hasText){for(var u=t.width,O=u>>5,h=t.y1-t.y0,E=0;E<h*O;E++)w[E]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var T=0,S=-1,$=0;$<h;$++){for(var E=0;E<u;E++){var k=O*$+(E>>5),L=b[(o+$)*(Ki<<5)+(a+E)<<2]?1<<31-E%32:0;w[k]|=L,T|=L}T?S=$:(t.y0++,h--,$--,o++)}t.y1=t.y0+S,t.sprite=w.slice(0,(t.y1-t.y0)*O)}}}function CL(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,h=0;h<l;h++){u=0;for(var d=0;d<=i;d++)if((u<<o|(d<i?(u=r[h*i+d])>>>a:0))&t[c+d])return!0;c+=n}return!1}function AL(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function $L(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function Ng(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function LL(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function DL(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function kL(){return document.createElement("canvas")}function Dn(e){return typeof e=="function"?e:function(){return e}}var RL={archimedean:Ng,rectangular:LL};const IL=kg(wL);function PL(e,t,n,r){var i=-1,s=e==null?0:e.length;for(r&&s&&(n=e[++i]);++i<s;)n=t(n,e[i],i,e);return n}function NL(e){return function(t){return e==null?void 0:e[t]}}var UL={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},BL=NL(UL);const VL=BL;var HL=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,FL="\\u0300-\\u036f",GL="\\ufe20-\\ufe2f",zL="\\u20d0-\\u20ff",jL=FL+GL+zL,WL="["+jL+"]",qL=RegExp(WL,"g");function YL(e){return e=Gi(e),e&&e.replace(HL,VL).replace(qL,"")}var XL=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function ZL(e){return e.match(XL)||[]}var KL=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function QL(e){return KL.test(e)}var Ug="\\ud800-\\udfff",JL="\\u0300-\\u036f",tD="\\ufe20-\\ufe2f",eD="\\u20d0-\\u20ff",nD=JL+tD+eD,Bg="\\u2700-\\u27bf",Vg="a-z\\xdf-\\xf6\\xf8-\\xff",rD="\\xac\\xb1\\xd7\\xf7",iD="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",sD="\\u2000-\\u206f",aD=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Hg="A-Z\\xc0-\\xd6\\xd8-\\xde",oD="\\ufe0e\\ufe0f",Fg=rD+iD+sD+aD,Gg="['’]",zg="["+Fg+"]",lD="["+nD+"]",jg="\\d+",cD="["+Bg+"]",Wg="["+Vg+"]",qg="[^"+Ug+Fg+jg+Bg+Vg+Hg+"]",uD="\\ud83c[\\udffb-\\udfff]",hD="(?:"+lD+"|"+uD+")",dD="[^"+Ug+"]",Yg="(?:\\ud83c[\\udde6-\\uddff]){2}",Xg="[\\ud800-\\udbff][\\udc00-\\udfff]",Vr="["+Hg+"]",fD="\\u200d",Zg="(?:"+Wg+"|"+qg+")",pD="(?:"+Vr+"|"+qg+")",Kg="(?:"+Gg+"(?:d|ll|m|re|s|t|ve))?",Qg="(?:"+Gg+"(?:D|LL|M|RE|S|T|VE))?",Jg=hD+"?",tm="["+oD+"]?",gD="(?:"+fD+"(?:"+[dD,Yg,Xg].join("|")+")"+tm+Jg+")*",mD="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vD="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",yD=tm+Jg+gD,bD="(?:"+[cD,Yg,Xg].join("|")+")"+yD,xD=RegExp([Vr+"?"+Wg+"+"+Kg+"(?="+[zg,Vr,"$"].join("|")+")",pD+"+"+Qg+"(?="+[zg,Vr+Zg,"$"].join("|")+")",Vr+"?"+Zg+"+"+Kg,Vr+"+"+Qg,vD,mD,jg,bD].join("|"),"g");function wD(e){return e.match(xD)||[]}function _D(e,t,n){return e=Gi(e),t=n?void 0:t,t===void 0?QL(e)?wD(e):ZL(e):e.match(t)||[]}var ED="['’]",SD=RegExp(ED,"g");function em(e){return function(t){return PL(_D(YL(t).replace(SD,"")),e,"")}}function OD(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function nm(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Zi(n),n=n===n?n:0),t!==void 0&&(t=Zi(t),t=t===t?t:0),OD(Zi(e),t,n)}function TD(e,t){var n=-1,r=er(e)?Array(e.length):[];return pc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function MD(e,t){var n=ee(e)?Jf:TD;return n(e,Na(t))}var CD=1/0;function AD(e,t){return Da(MD(e,t),CD)}function rm(e,t){return Pa(e,t)}var $D=em(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Hr=$D;function LD(e,t){var n;return pc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function DD(e,t,n){var r=ee(e)?qp:LD;return n&&cp(e,t,n)&&(t=void 0),r(e,Na(t))}class gt{constructor(t,n,r){if(this.type="",this.renderType=nt.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=_(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(N(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=_(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${ge}--${i}--${this.type}`,!0),r&&r.classed(`${ge}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=_(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=P.appendOrSelect(this.parent,`${this.renderType===nt.SVG?"svg":"div"}${r}.${ge}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=N(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?at({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const im=class extends gt{constructor(){super(...arguments),this.type="toolbar",this.renderType=nt.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(A.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(A.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(_(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
1
+ (function(X,re){typeof exports=="object"&&typeof module<"u"?re(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],re):(X=typeof globalThis<"u"?globalThis:X||self,re(X.ChartsReact={},X.React))})(this,function(X,re){"use strict";var eV=Object.defineProperty;var nV=(X,re,xe)=>re in X?eV(X,re,{enumerable:!0,configurable:!0,writable:!0,value:xe}):X[re]=xe;var hu=(X,re,xe)=>(nV(X,typeof re!="symbol"?re+"":re,xe),xe);function xe(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Bv(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function oo(e){let t,n,r;e.length!==2?(t=xe,n=(o,l)=>xe(e(o),l),r=(o,l)=>e(o)-l):(t=e===xe||e===Bv?e:Vv,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 h=c+u>>>1;n(o[h],l)<0?c=h+1:u=h}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 h=c+u>>>1;n(o[h],l)<=0?c=h+1:u=h}while(c<u)}return c}function a(o,l,c=0,u=o.length){const h=i(o,l,c,u-1);return h>c&&r(o[h-1],l)>-r(o[h],l)?h-1:h}return{left:i,center:a,right:s}}function Vv(){return 0}function Hv(e){return e===null?NaN:+e}function*Fv(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const Gv=oo(xe).right;oo(Hv).center;const lo=Gv;function zv(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function De(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 Bn{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 du 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(fu(this,t))}has(t){return super.has(fu(this,t))}set(t,n){return super.set(jv(this,t),n)}delete(t){return super.delete(Wv(this,t))}}function fu({_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 Wv({_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 Yv(e){return e}function Xv(e=xe){if(e===xe)return pu;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 pu(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Zv=Array.prototype,Kv=Zv.slice;function co(e){return()=>e}const Qv=Math.sqrt(50),Jv=Math.sqrt(10),t0=Math.sqrt(2);function ls(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>=Qv?10:s>=Jv?5:s>=t0?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?ls(e,t,n*2):[o,l,c]}function cs(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?ls(t,e,n):ls(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 hr(e,t,n){return t=+t,e=+e,n=+n,ls(e,t,n)[2]}function uo(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?hr(t,e,n):hr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function e0(e,t,n){let r;for(;;){const i=hr(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 n0(e){return Math.max(1,Math.ceil(Math.log(zv(e))/Math.LN2)+1)}function r0(){var e=Yv,t=De,n=n0;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),h=u[0],d=u[1],f=n(c,h,d);if(!Array.isArray(f)){const b=d,S=+f;if(t===De&&([h,d]=e0(h,d,S)),f=cs(h,d,S),f[0]<=h&&(l=hr(h,d,S)),f[f.length-1]>=d)if(b>=d&&t===De){const _=hr(h,d,S);isFinite(_)&&(_>0?d=(Math.floor(d/_)+1)*_:_<0&&(d=(Math.ceil(d*-_)+1)/-_))}else f.pop()}for(var p=f.length,m=0,g=p;f[m]<=h;)++m;for(;f[g-1]>d;)--g;(m||g<p)&&(f=f.slice(m,g),p=g-m);var v=new Array(p+1),y;for(s=0;s<=p;++s)y=v[s]=[],y.x0=s>0?f[s-1]:h,y.x1=s<p?f[s]:d;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[Math.min(p,Math.floor((o-h)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&h<=o&&o<=d){const b=Math.floor((h-o)*l);v[Math.min(p,b+(f[b]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&h<=o&&o<=d&&v[lo(f,o,0,p)].push(i[s]);return v}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:co(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:co([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:co(Array.isArray(i)?Kv.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 Mn(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 gu(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?pu:Xv(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*h/l+d)),p=Math.min(r,Math.floor(t+(l-c)*h/l+d));gu(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(Qr(e,n,t),i(e[r],s)>0&&Qr(e,n,r);a<o;){for(Qr(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Qr(e,n,o):(++o,Qr(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Qr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ho(e,t,n){if(e=Float64Array.from(Fv(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Mn(e);if(t>=1)return Vn(e);var r,i=(r-1)*t,s=Math.floor(i),a=Vn(gu(e,s).subarray(0,s+1)),o=Mn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*i0(e){for(const t of e)yield*t}function mu(e){return Array.from(i0(e))}function s0(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 a0(e){return e}var us=1,hs=2,fo=3,Jr=4,vu=1e-6;function o0(e){return"translate("+e+",0)"}function l0(e){return"translate(0,"+e+")"}function c0(e){return t=>+e(t)}function u0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function h0(){return!this.__axis}function ds(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===us||e===Jr?-1:1,u=e===Jr||e===hs?"x":"y",h=e===us||e===fo?o0:l0;function d(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):a0),g=Math.max(s,0)+o,v=t.range(),y=+v[0]+l,b=+v[v.length-1]+l,S=(t.bandwidth?u0:c0)(t.copy(),l),_=f.selection?f.selection():f,E=_.selectAll(".domain").data([null]),T=_.selectAll(".tick").data(p,t).order(),R=T.exit(),N=T.enter().append("g").attr("class","tick"),A=T.select("line"),C=T.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),T=T.merge(N),A=A.merge(N.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),C=C.merge(N.append("text").attr("fill","currentColor").attr(u,c*g).attr("dy",e===us?"0em":e===fo?"0.71em":"0.32em")),f!==_&&(E=E.transition(f),T=T.transition(f),A=A.transition(f),C=C.transition(f),R=R.transition(f).attr("opacity",vu).attr("transform",function(V){return isFinite(V=S(V))?h(V+l):this.getAttribute("transform")}),N.attr("opacity",vu).attr("transform",function(V){var M=this.parentNode.__axis;return h((M&&isFinite(M=M(V))?M:S(V))+l)})),R.remove(),E.attr("d",e===Jr||e===hs?a?"M"+c*a+","+y+"H"+l+"V"+b+"H"+c*a:"M"+l+","+y+"V"+b:a?"M"+y+","+c*a+"V"+l+"H"+b+"V"+c*a:"M"+y+","+l+"H"+b),T.attr("opacity",1).attr("transform",function(V){return h(S(V)+l)}),A.attr(u+"2",c*s),C.attr(u,c*g).text(m),_.filter(h0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===hs?"start":e===Jr?"end":"middle"),_.each(function(){this.__axis=S})}return d.scale=function(f){return arguments.length?(t=f,d):t},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),d):n.slice()},d.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),d):r&&r.slice()},d.tickFormat=function(f){return arguments.length?(i=f,d):i},d.tickSize=function(f){return arguments.length?(s=a=+f,d):s},d.tickSizeInner=function(f){return arguments.length?(s=+f,d):s},d.tickSizeOuter=function(f){return arguments.length?(a=+f,d):a},d.tickPadding=function(f){return arguments.length?(o=+f,d):o},d.offset=function(f){return arguments.length?(l=+f,d):l},d}function d0(e){return ds(us,e)}function f0(e){return ds(hs,e)}function po(e){return ds(fo,e)}function yu(e){return ds(Jr,e)}var p0={value:()=>{}};function go(){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 fs(n)}function fs(e){this._=e}function g0(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}})}fs.prototype=go.prototype={constructor:fs,on:function(e,t){var n=this._,r=g0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=m0(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]=bu(n[i],e.name,t);else if(t==null)for(i in n)n[i]=bu(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 fs(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 m0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function bu(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=p0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var mo="http://www.w3.org/1999/xhtml";const xu={svg:"http://www.w3.org/2000/svg",xhtml:mo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ps(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),xu.hasOwnProperty(t)?{space:xu[t],local:e}:e}function v0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mo&&t.documentElement.namespaceURI===mo?t.createElement(e):t.createElementNS(n,e)}}function y0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wu(e){var t=ps(e);return(t.local?y0:v0)(t)}function b0(){}function vo(e){return e==null?b0:function(){return this.querySelector(e)}}function x0(e){typeof e!="function"&&(e=vo(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 we(r,this._parents)}function w0(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function _0(){return[]}function _u(e){return e==null?_0:function(){return this.querySelectorAll(e)}}function E0(e){return function(){return w0(e.apply(this,arguments))}}function S0(e){typeof e=="function"?e=E0(e):e=_u(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 we(r,i)}function Eu(e){return function(){return this.matches(e)}}function Su(e){return function(t){return t.matches(e)}}var O0=Array.prototype.find;function T0(e){return function(){return O0.call(this.children,e)}}function M0(){return this.firstElementChild}function C0(e){return this.select(e==null?M0:T0(typeof e=="function"?e:Su(e)))}var $0=Array.prototype.filter;function A0(){return Array.from(this.children)}function k0(e){return function(){return $0.call(this.children,e)}}function L0(e){return this.selectAll(e==null?A0:k0(typeof e=="function"?e:Su(e)))}function R0(e){typeof e!="function"&&(e=Eu(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 we(r,this._parents)}function Ou(e){return new Array(e.length)}function D0(){return new we(this._enter||this._groups.map(Ou),this._parents)}function gs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}gs.prototype={constructor:gs,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 I0(e){return function(){return e}}function N0(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 gs(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function P0(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,h=s.length,d=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(d[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<h;++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 gs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(d[o])===l&&(i[o]=l)}function U0(e){return e.__data__}function B0(e,t){if(!arguments.length)return Array.from(this,U0);var n=t?P0:N0,r=this._parents,i=this._groups;typeof e!="function"&&(e=I0(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],h=i[c],d=h.length,f=V0(e.call(u,u&&u.__data__,c,r)),p=f.length,m=o[c]=new Array(p),g=a[c]=new Array(p),v=l[c]=new Array(d);n(u,h,m,g,v,f,t);for(var y=0,b=0,S,_;y<p;++y)if(S=m[y]){for(y>=b&&(b=y+1);!(_=g[b])&&++b<p;);S._next=_||null}}return a=new we(a,r),a._enter=o,a._exit=l,a}function V0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function H0(){return new we(this._exit||this._groups.map(Ou),this._parents)}function F0(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 G0(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],h=c.length,d=o[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||u[p])&&(d[p]=f);for(;l<i;++l)o[l]=n[l];return new we(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=W0);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}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 we(i,this._parents).order()}function W0(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 Y0(){return Array.from(this)}function X0(){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 Z0(){let e=0;for(const t of this)++e;return e}function K0(){return!this.node()}function Q0(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 J0(e){return function(){this.removeAttribute(e)}}function ty(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ey(e,t){return function(){this.setAttribute(e,t)}}function ny(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ry(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function iy(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 sy(e,t){var n=ps(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?ty:J0:typeof t=="function"?n.local?iy:ry:n.local?ny:ey)(n,t))}function Tu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ay(e){return function(){this.style.removeProperty(e)}}function oy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ly(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function cy(e,t,n){return arguments.length>1?this.each((t==null?ay:typeof t=="function"?ly:oy)(e,t,n??"")):dr(this.node(),e)}function dr(e,t){return e.style.getPropertyValue(t)||Tu(e).getComputedStyle(e,null).getPropertyValue(t)}function uy(e){return function(){delete this[e]}}function hy(e,t){return function(){this[e]=t}}function dy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function fy(e,t){return arguments.length>1?this.each((t==null?uy:typeof t=="function"?dy:hy)(e,t)):this.node()[e]}function Mu(e){return e.trim().split(/^|\s+/)}function yo(e){return e.classList||new Cu(e)}function Cu(e){this._node=e,this._names=Mu(e.getAttribute("class")||"")}Cu.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 $u(e,t){for(var n=yo(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Au(e,t){for(var n=yo(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function py(e){return function(){$u(this,e)}}function gy(e){return function(){Au(this,e)}}function my(e,t){return function(){(t.apply(this,arguments)?$u:Au)(this,e)}}function vy(e,t){var n=Mu(e+"");if(arguments.length<2){for(var r=yo(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?my:t?py:gy)(n,t))}function yy(){this.textContent=""}function by(e){return function(){this.textContent=e}}function xy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function wy(e){return arguments.length?this.each(e==null?yy:(typeof e=="function"?xy:by)(e)):this.node().textContent}function _y(){this.innerHTML=""}function Ey(e){return function(){this.innerHTML=e}}function Sy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Oy(e){return arguments.length?this.each(e==null?_y:(typeof e=="function"?Sy:Ey)(e)):this.node().innerHTML}function Ty(){this.nextSibling&&this.parentNode.appendChild(this)}function My(){return this.each(Ty)}function Cy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $y(){return this.each(Cy)}function Ay(e){var t=typeof e=="function"?e:wu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ky(){return null}function Ly(e,t){var n=typeof e=="function"?e:wu(e),r=t==null?ky:typeof t=="function"?t:vo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ry(){var e=this.parentNode;e&&e.removeChild(this)}function Dy(){return this.each(Ry)}function Iy(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ny(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Py(e){return this.select(e?Ny:Iy)}function Uy(e){return arguments.length?this.property("__data__",e):this.node().__data__}function By(e){return function(t){e.call(this,t,this.__data__)}}function Vy(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 Hy(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 Fy(e,t,n){return function(){var r=this.__on,i,s=By(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 Gy(e,t,n){var r=Vy(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?Fy:Hy,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function ku(e,t,n){var r=Tu(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 ku(this,e,t)}}function jy(e,t){return function(){return ku(this,e,t.apply(this,arguments))}}function Wy(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 Lu=[null];function we(e,t){this._groups=e,this._parents=t}function ti(){return new we([[document.documentElement]],Lu)}function Yy(){return this}we.prototype=ti.prototype={constructor:we,select:x0,selectAll:S0,selectChild:C0,selectChildren:L0,filter:R0,data:B0,enter:D0,exit:H0,join:F0,merge:G0,selection:Yy,order:z0,sort:j0,call:q0,nodes:Y0,node:X0,size:Z0,empty:K0,each:Q0,attr:sy,style:cy,property:fy,classed:vy,text:wy,html:Oy,raise:My,lower:$y,append:Ay,insert:Ly,remove:Dy,clone:Py,datum:Uy,on:Gy,dispatch:Wy,[Symbol.iterator]:qy};function D(e){return typeof e=="string"?new we([[document.querySelector(e)]],[document.documentElement]):new we([[e]],Lu)}function Xy(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Hn(e,t){if(e=Xy(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 bo={capture:!0,passive:!1};function xo(e){e.preventDefault(),e.stopImmediatePropagation()}function Zy(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",xo,bo);"onselectstart"in t?n.on("selectstart.drag",xo,bo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ky(e,t){var n=e.document.documentElement,r=D(e).on("dragstart.drag",null);t&&(r.on("click.drag",xo,bo),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 wo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ru(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ei(){}var ni=.7,ms=1/ni,fr="\\s*([+-]?\\d+)\\s*",ri="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",We="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qy=/^#([0-9a-f]{3,8})$/,Jy=new RegExp(`^rgb\\(${fr},${fr},${fr}\\)$`),t1=new RegExp(`^rgb\\(${We},${We},${We}\\)$`),e1=new RegExp(`^rgba\\(${fr},${fr},${fr},${ri}\\)$`),n1=new RegExp(`^rgba\\(${We},${We},${We},${ri}\\)$`),r1=new RegExp(`^hsl\\(${ri},${We},${We}\\)$`),i1=new RegExp(`^hsla\\(${ri},${We},${We},${ri}\\)$`),Du={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};wo(ei,rn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Iu,formatHex:Iu,formatHex8:s1,formatHsl:a1,formatRgb:Nu,toString:Nu});function Iu(){return this.rgb().formatHex()}function s1(){return this.rgb().formatHex8()}function a1(){return Hu(this).formatHsl()}function Nu(){return this.rgb().formatRgb()}function rn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Qy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Pu(t):n===3?new fe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vs(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=Jy.exec(e))?new fe(t[1],t[2],t[3],1):(t=t1.exec(e))?new fe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=e1.exec(e))?vs(t[1],t[2],t[3],t[4]):(t=n1.exec(e))?vs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=r1.exec(e))?Vu(t[1],t[2]/100,t[3]/100,1):(t=i1.exec(e))?Vu(t[1],t[2]/100,t[3]/100,t[4]):Du.hasOwnProperty(e)?Pu(Du[e]):e==="transparent"?new fe(NaN,NaN,NaN,0):null}function Pu(e){return new fe(e>>16&255,e>>8&255,e&255,1)}function vs(e,t,n,r){return r<=0&&(e=t=n=NaN),new fe(e,t,n,r)}function o1(e){return e instanceof ei||(e=rn(e)),e?(e=e.rgb(),new fe(e.r,e.g,e.b,e.opacity)):new fe}function _o(e,t,n,r){return arguments.length===1?o1(e):new fe(e,t,n,r??1)}function fe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}wo(fe,_o,Ru(ei,{brighter(e){return e=e==null?ms:Math.pow(ms,e),new fe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ni:Math.pow(ni,e),new fe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fe(Fn(this.r),Fn(this.g),Fn(this.b),ys(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:Uu,formatHex:Uu,formatHex8:l1,formatRgb:Bu,toString:Bu}));function Uu(){return`#${Gn(this.r)}${Gn(this.g)}${Gn(this.b)}`}function l1(){return`#${Gn(this.r)}${Gn(this.g)}${Gn(this.b)}${Gn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bu(){const e=ys(this.opacity);return`${e===1?"rgb(":"rgba("}${Fn(this.r)}, ${Fn(this.g)}, ${Fn(this.b)}${e===1?")":`, ${e})`}`}function ys(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gn(e){return e=Fn(e),(e<16?"0":"")+e.toString(16)}function Vu(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ie(e,t,n,r)}function Hu(e){if(e instanceof Ie)return new Ie(e.h,e.s,e.l,e.opacity);if(e instanceof ei||(e=rn(e)),!e)return new Ie;if(e instanceof Ie)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 Ie(a,o,l,e.opacity)}function Eo(e,t,n,r){return arguments.length===1?Hu(e):new Ie(e,t,n,r??1)}function Ie(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}wo(Ie,Eo,Ru(ei,{brighter(e){return e=e==null?ms:Math.pow(ms,e),new Ie(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ni:Math.pow(ni,e),new Ie(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 fe(So(e>=240?e-240:e+120,i,r),So(e,i,r),So(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ie(Fu(this.h),bs(this.s),bs(this.l),ys(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=ys(this.opacity);return`${e===1?"hsl(":"hsla("}${Fu(this.h)}, ${bs(this.s)*100}%, ${bs(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Fu(e){return e=(e||0)%360,e<0?e+360:e}function bs(e){return Math.max(0,Math.min(1,e||0))}function So(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 Oo=e=>()=>e;function c1(e,t){return function(n){return e+n*t}}function u1(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 h1(e){return(e=+e)==1?Gu:function(t,n){return n-t?u1(t,n,e):Oo(isNaN(t)?n:t)}}function Gu(e,t){var n=t-e;return n?c1(e,n):Oo(isNaN(e)?t:e)}const xs=function e(t){var n=h1(t);function r(i,s){var a=n((i=_o(i)).r,(s=_o(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Gu(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 d1(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 f1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function p1(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]=ii(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 g1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function _e(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function m1(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]=ii(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var To=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mo=new RegExp(To.source,"g");function v1(e){return function(){return e}}function y1(e){return function(t){return e(t)+""}}function zu(e,t){var n=To.lastIndex=Mo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=To.exec(e))&&(i=Mo.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:_e(r,i)})),n=Mo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?y1(l[0].x):v1(t):(t=l.length,function(c){for(var u=0,h;u<t;++u)o[(h=l[u]).i]=h.x(c);return o.join("")})}function ii(e,t){var n=typeof t,r;return t==null||n==="boolean"?Oo(t):(n==="number"?_e:n==="string"?(r=rn(t))?(t=r,xs):zu:t instanceof rn?xs:t instanceof Date?g1:f1(t)?d1:Array.isArray(t)?p1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?m1:_e)(e,t)}function ju(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var Wu=180/Math.PI,Co={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qu(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)*Wu,skewX:Math.atan(l)*Wu,scaleX:a,scaleY:o}}var ws;function b1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Co:qu(t.a,t.b,t.c,t.d,t.e,t.f)}function x1(e){return e==null||(ws||(ws=document.createElementNS("http://www.w3.org/2000/svg","g")),ws.setAttribute("transform",e),!(e=ws.transform.baseVal.consolidate()))?Co:(e=e.matrix,qu(e.a,e.b,e.c,e.d,e.e,e.f))}function Yu(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push("translate(",null,t,null,n);p.push({i:m-4,x:_e(c,h)},{i:m-2,x:_e(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function a(c,u,h,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:h.push(i(h)+"rotate(",null,r)-2,x:_e(c,u)})):u&&h.push(i(h)+"rotate("+u+r)}function o(c,u,h,d){c!==u?d.push({i:h.push(i(h)+"skewX(",null,r)-2,x:_e(c,u)}):u&&h.push(i(h)+"skewX("+u+r)}function l(c,u,h,d,f,p){if(c!==h||u!==d){var m=f.push(i(f)+"scale(",null,",",null,")");p.push({i:m-4,x:_e(c,h)},{i:m-2,x:_e(u,d)})}else(h!==1||d!==1)&&f.push(i(f)+"scale("+h+","+d+")")}return function(c,u){var h=[],d=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,h,d),a(c.rotate,u.rotate,h,d),o(c.skewX,u.skewX,h,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,h,d),c=u=null,function(f){for(var p=-1,m=d.length,g;++p<m;)h[(g=d[p]).i]=g.x(f);return h.join("")}}}var w1=Yu(b1,"px, ","px)","deg)"),_1=Yu(x1,", ",")",")");function E1(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var pr=0,si=0,ai=0,Xu=1e3,_s,oi,Es=0,zn=0,Ss=0,li=typeof performance=="object"&&performance.now?performance:Date,Zu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $o(){return zn||(Zu(S1),zn=li.now()+Ss)}function S1(){zn=0}function Os(){this._call=this._time=this._next=null}Os.prototype=Ku.prototype={constructor:Os,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?$o():+n)+(t==null?0:+t),!this._next&&oi!==this&&(oi?oi._next=this:_s=this,oi=this),this._call=e,this._time=n,Ao()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ao())}};function Ku(e,t,n){var r=new Os;return r.restart(e,t,n),r}function O1(){$o(),++pr;for(var e=_s,t;e;)(t=zn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--pr}function Qu(){zn=(Es=li.now())+Ss,pr=si=0;try{O1()}finally{pr=0,M1(),zn=0}}function T1(){var e=li.now(),t=e-Es;t>Xu&&(Ss-=t,Es=e)}function M1(){for(var e,t=_s,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:_s=n);oi=e,Ao(r)}function Ao(e){if(!pr){si&&(si=clearTimeout(si));var t=e-zn;t>24?(e<1/0&&(si=setTimeout(Qu,e-li.now()-Ss)),ai&&(ai=clearInterval(ai))):(ai||(Es=li.now(),ai=setInterval(T1,Xu)),pr=1,Zu(Qu))}}function Ju(e,t,n){var r=new Os;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var C1=go("start","end","cancel","interrupt"),$1=[],th=0,eh=1,ko=2,Ts=3,nh=4,Lo=5,Ms=6;function Cs(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;A1(e,n,{name:t,index:r,group:i,on:C1,tween:$1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:th})}function Ro(e,t){var n=Ne(e,t);if(n.state>th)throw new Error("too late; already scheduled");return n}function qe(e,t){var n=Ne(e,t);if(n.state>Ts)throw new Error("too late; already running");return n}function Ne(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function A1(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Ku(s,0,n.time);function s(c){n.state=eh,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,h,d,f;if(n.state!==eh)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Ts)return Ju(a);f.state===nh?(f.state=Ms,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=Ms,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Ju(function(){n.state===Ts&&(n.state=nh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=ko,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ko){for(n.state=Ts,i=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=f);i.length=h+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Lo,1),h=-1,d=i.length;++h<d;)i[h].call(e,u);n.state===Lo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Ms,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Do(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>ko&&r.state<Lo,r.state=Ms,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function k1(e){return this.each(function(){Do(this,e)})}function L1(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 R1(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 D1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ne(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?L1:R1)(n,e,t))}function Io(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 Ne(i,r).value[t]}}function rh(e,t){var n;return(typeof t=="number"?_e:t instanceof rn?xs:(n=rn(t))?(t=n,xs):zu)(e,t)}function I1(e){return function(){this.removeAttribute(e)}}function N1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function P1(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 U1(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 B1(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 V1(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 H1(e,t){var n=ps(e),r=n==="transform"?_1:rh;return this.attrTween(e,typeof t=="function"?(n.local?V1:B1)(n,r,Io(this,"attr."+e,t)):t==null?(n.local?N1:I1)(n):(n.local?U1:P1)(n,r,t))}function F1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function G1(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)&&G1(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)&&F1(e,s)),n}return i._value=t,i}function W1(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=ps(e);return this.tween(n,(r.local?z1:j1)(r,t))}function q1(e,t){return function(){Ro(this,e).delay=+t.apply(this,arguments)}}function Y1(e,t){return t=+t,function(){Ro(this,e).delay=t}}function X1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?q1:Y1)(t,e)):Ne(this.node(),t).delay}function Z1(e,t){return function(){qe(this,e).duration=+t.apply(this,arguments)}}function K1(e,t){return t=+t,function(){qe(this,e).duration=t}}function Q1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Z1:K1)(t,e)):Ne(this.node(),t).duration}function J1(e,t){if(typeof t!="function")throw new Error;return function(){qe(this,e).ease=t}}function tb(e){var t=this._id;return arguments.length?this.each(J1(t,e)):Ne(this.node(),t).ease}function eb(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qe(this,e).ease=n}}function nb(e){if(typeof e!="function")throw new Error;return this.each(eb(this._id,e))}function rb(e){typeof e!="function"&&(e=Eu(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 sn(r,this._parents,this._name,this._id)}function ib(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,h=a[o]=new Array(u),d,f=0;f<u;++f)(d=l[f]||c[f])&&(h[f]=d);for(;o<r;++o)a[o]=t[o];return new sn(a,this._parents,this._name,this._id)}function sb(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 ab(e,t,n){var r,i,s=sb(t)?Ro:qe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function ob(e,t){var n=this._id;return arguments.length<2?Ne(this.node(),n).on.on(e):this.each(ab(n,e,t))}function lb(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function cb(){return this.on("end.remove",lb(this._id))}function ub(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vo(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,h,d=0;d<l;++d)(u=o[d])&&(h=e.call(u,u.__data__,d,o))&&("__data__"in u&&(h.__data__=u.__data__),c[d]=h,Cs(c[d],t,n,d,c,Ne(u,n)));return new sn(s,this._parents,t,n)}function hb(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_u(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,h=0;h<c;++h)if(u=l[h]){for(var d=e.call(u,u.__data__,h,l),f,p=Ne(u,n),m=0,g=d.length;m<g;++m)(f=d[m])&&Cs(f,t,n,m,d,p);s.push(d),a.push(u)}return new sn(s,a,t,n)}var db=ti.prototype.constructor;function fb(){return new db(this._groups,this._parents)}function pb(e,t){var n,r,i;return function(){var s=dr(this,e),a=(this.style.removeProperty(e),dr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function ih(e){return function(){this.style.removeProperty(e)}}function gb(e,t,n){var r,i=n+"",s;return function(){var a=dr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function mb(e,t,n){var r,i,s;return function(){var a=dr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),dr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function vb(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=ih(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function yb(e,t,n){var r=(e+="")=="transform"?w1:rh;return t==null?this.styleTween(e,pb(e,r)).on("end.style."+e,ih(e)):typeof t=="function"?this.styleTween(e,mb(e,r,Io(this,"style."+e,t))).each(vb(this._id,e)):this.styleTween(e,gb(e,r,t),n).on("end.style."+e,null)}function bb(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function xb(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&bb(e,a,n)),r}return s._value=t,s}function wb(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,xb(e,t,n??""))}function _b(e){return function(){this.textContent=e}}function Eb(e){return function(){var t=e(this);this.textContent=t??""}}function Sb(e){return this.tween("text",typeof e=="function"?Eb(Io(this,"text",e)):_b(e==null?"":e+""))}function Ob(e){return function(t){this.textContent=e.call(this,t)}}function Tb(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Ob(i)),t}return r._value=e,r}function Mb(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,Tb(e))}function Cb(){for(var e=this._name,t=this._id,n=sh(),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=Ne(l,t);Cs(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new sn(r,this._parents,e,n)}function $b(){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 Ab=0;function sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function sh(){return++Ab}var an=ti.prototype;sn.prototype={constructor:sn,select:ub,selectAll:hb,selectChild:an.selectChild,selectChildren:an.selectChildren,filter:rb,merge:ib,selection:fb,transition:Cb,call:an.call,nodes:an.nodes,node:an.node,size:an.size,empty:an.empty,each:an.each,on:ob,attr:H1,attrTween:W1,style:yb,styleTween:wb,text:Sb,textTween:Mb,remove:cb,tween:D1,delay:X1,duration:Q1,ease:tb,easeVarying:nb,end:$b,[Symbol.iterator]:an[Symbol.iterator]};const kb=e=>+e;function ah(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Lb={time:null,delay:0,duration:250,ease:ah};function Rb(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 Db(e){var t,n;e instanceof sn?(t=e._id,e=e._name):(t=sh(),(n=Lb).time=$o(),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])&&Cs(l,e,t,c,a,n||Rb(l,t));return new sn(r,this._parents,e,t)}ti.prototype.interrupt=k1,ti.prototype.transition=Db;const No=e=>()=>e;function Ib(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 Nb(e){e.stopImmediatePropagation()}function Po(e){e.preventDefault(),e.stopImmediatePropagation()}var oh={name:"drag"},Uo={name:"space"},gr={name:"handle"},mr={name:"center"};const{abs:lh,max:ie,min:se}=Math;function ch(e){return[+e[0],+e[1]]}function uh(e){return[ch(e[0]),ch(e[1])]}var $s={name:"x",handles:["w","e"].map(As),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]]}},Bo={name:"y",handles:["n","s"].map(As),input:function(e,t){return e==null?null:[[t[0][0],+e[0]],[t[1][0],+e[1]]]},output:function(e){return e&&[e[0][1],e[1][1]]}},on={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"},dh={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Pb={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Ub={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function As(e){return{type:e}}function Bb(e){return!e.ctrlKey&&!e.button}function Vb(){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 Hb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function Fb(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function fh(){return Gb($s)}function Gb(e){var t=Vb,n=Bb,r=Hb,i=!0,s=go("start","brush","end"),a=6,o;function l(g){var v=g.property("__brush",m).selectAll(".overlay").data([As("overlay")]);v.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",on.overlay).merge(v).each(function(){var b=Vo(this).extent;D(this).attr("x",b[0][0]).attr("y",b[0][1]).attr("width",b[1][0]-b[0][0]).attr("height",b[1][1]-b[0][1])}),g.selectAll(".selection").data([As("selection")]).enter().append("rect").attr("class","selection").attr("cursor",on.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=g.selectAll(".handle").data(e.handles,function(b){return b.type});y.exit().remove(),y.enter().append("rect").attr("class",function(b){return"handle handle--"+b.type}).attr("cursor",function(b){return on[b.type]}),g.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(r).on("touchstart.brush",d).on("touchmove.brush",f).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}l.move=function(g,v,y){g.tween?g.on("start.brush",function(b){u(this,arguments).beforestart().start(b)}).on("interrupt.brush end.brush",function(b){u(this,arguments).end(b)}).tween("brush",function(){var b=this,S=b.__brush,_=u(b,arguments),E=S.selection,T=e.input(typeof v=="function"?v.apply(this,arguments):v,S.extent),R=ii(E,T);function N(A){S.selection=A===1&&T===null?null:R(A),c.call(b),_.brush()}return E!==null&&T!==null?N:N(1)}):g.each(function(){var b=this,S=arguments,_=b.__brush,E=e.input(typeof v=="function"?v.apply(b,S):v,_.extent),T=u(b,S).beforestart();Do(b),_.selection=E===null?null:E,c.call(b),T.start(y).brush(y).end(y)})},l.clear=function(g,v){l.move(g,null,v)};function c(){var g=D(this),v=Vo(this).selection;v?(g.selectAll(".selection").style("display",null).attr("x",v[0][0]).attr("y",v[0][1]).attr("width",v[1][0]-v[0][0]).attr("height",v[1][1]-v[0][1]),g.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?v[1][0]-a/2:v[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?v[1][1]-a/2:v[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?v[1][0]-v[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.type==="w"?v[1][1]-v[0][1]+a:a})):g.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(g,v,y){var b=g.__brush.emitter;return b&&(!y||!b.clean)?b:new h(g,v,y)}function h(g,v,y){this.that=g,this.args=v,this.state=g.__brush,this.active=0,this.clean=y}h.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(g,v){return this.starting?(this.starting=!1,this.emit("start",g,v)):this.emit("brush",g),this},brush:function(g,v){return this.emit("brush",g,v),this},end:function(g,v){return--this.active===0&&(delete this.state.emitter,this.emit("end",g,v)),this},emit:function(g,v,y){var b=D(this.that).datum();s.call(g,this.that,new Ib(g,{sourceEvent:v,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),b)}};function d(g){if(o&&!g.touches||!n.apply(this,arguments))return;var v=this,y=g.target.__data__.type,b=(i&&g.metaKey?y="overlay":y)==="selection"?oh:i&&g.altKey?mr:gr,S=e===Bo?null:Pb[y],_=e===$s?null:Ub[y],E=Vo(v),T=E.extent,R=E.selection,N=T[0][0],A,C,V=T[0][1],M,k,w=T[1][0],P,U,I=T[1][1],B,j,Y=0,et=0,pt,z=S&&_&&i&&g.shiftKey,K,ht,it=Array.from(g.touches||[g],nt=>{const It=nt.identifier;return nt=Hn(nt,v),nt.point0=nt.slice(),nt.identifier=It,nt});Do(v);var Mt=u(v,arguments,!0).beforestart();if(y==="overlay"){R&&(pt=!0);const nt=[it[0],it[1]||it[0]];E.selection=R=[[A=e===Bo?N:se(nt[0][0],nt[1][0]),M=e===$s?V:se(nt[0][1],nt[1][1])],[P=e===Bo?w:ie(nt[0][0],nt[1][0]),B=e===$s?I:ie(nt[0][1],nt[1][1])]],it.length>1&&Ut(g)}else A=R[0][0],M=R[0][1],P=R[1][0],B=R[1][1];C=A,k=M,U=P,j=B;var W=D(v).attr("pointer-events","none"),J=W.selectAll(".overlay").attr("cursor",on[y]);if(g.touches)Mt.moved=F,Mt.ended=bt;else{var ct=D(g.view).on("mousemove.brush",F,!0).on("mouseup.brush",bt,!0);i&&ct.on("keydown.brush",zt,!0).on("keyup.brush",jt,!0),Zy(g.view)}c.call(v),Mt.start(g,b.name);function F(nt){for(const It of nt.changedTouches||[nt])for(const en of it)en.identifier===It.identifier&&(en.cur=Hn(It,v));if(z&&!K&&!ht&&it.length===1){const It=it[0];lh(It.cur[0]-It[0])>lh(It.cur[1]-It[1])?ht=!0:K=!0}for(const It of it)It.cur&&(It[0]=It.cur[0],It[1]=It.cur[1]);pt=!0,Po(nt),Ut(nt)}function Ut(nt){const It=it[0],en=It.point0;var nn;switch(Y=It[0]-en[0],et=It[1]-en[1],b){case Uo:case oh:{S&&(Y=ie(N-A,se(w-P,Y)),C=A+Y,U=P+Y),_&&(et=ie(V-M,se(I-B,et)),k=M+et,j=B+et);break}case gr:{it[1]?(S&&(C=ie(N,se(w,it[0][0])),U=ie(N,se(w,it[1][0])),S=1),_&&(k=ie(V,se(I,it[0][1])),j=ie(V,se(I,it[1][1])),_=1)):(S<0?(Y=ie(N-A,se(w-A,Y)),C=A+Y,U=P):S>0&&(Y=ie(N-P,se(w-P,Y)),C=A,U=P+Y),_<0?(et=ie(V-M,se(I-M,et)),k=M+et,j=B):_>0&&(et=ie(V-B,se(I-B,et)),k=M,j=B+et));break}case mr:{S&&(C=ie(N,se(w,A-Y*S)),U=ie(N,se(w,P+Y*S))),_&&(k=ie(V,se(I,M-et*_)),j=ie(V,se(I,B+et*_)));break}}U<C&&(S*=-1,nn=A,A=P,P=nn,nn=C,C=U,U=nn,y in hh&&J.attr("cursor",on[y=hh[y]])),j<k&&(_*=-1,nn=M,M=B,B=nn,nn=k,k=j,j=nn,y in dh&&J.attr("cursor",on[y=dh[y]])),E.selection&&(R=E.selection),K&&(C=R[0][0],U=R[1][0]),ht&&(k=R[0][1],j=R[1][1]),(R[0][0]!==C||R[0][1]!==k||R[1][0]!==U||R[1][1]!==j)&&(E.selection=[[C,k],[U,j]],c.call(v),Mt.brush(nt,b.name))}function bt(nt){if(Nb(nt),nt.touches){if(nt.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else Ky(nt.view,pt),ct.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);W.attr("pointer-events","all"),J.attr("cursor",on.overlay),E.selection&&(R=E.selection),Fb(R)&&(E.selection=null,c.call(v)),Mt.end(nt,b.name)}function zt(nt){switch(nt.keyCode){case 16:{z=S&&_;break}case 18:{b===gr&&(S&&(P=U-Y*S,A=C+Y*S),_&&(B=j-et*_,M=k+et*_),b=mr,Ut(nt));break}case 32:{(b===gr||b===mr)&&(S<0?P=U-Y:S>0&&(A=C-Y),_<0?B=j-et:_>0&&(M=k-et),b=Uo,J.attr("cursor",on.selection),Ut(nt));break}default:return}Po(nt)}function jt(nt){switch(nt.keyCode){case 16:{z&&(K=ht=z=!1,Ut(nt));break}case 18:{b===mr&&(S<0?P=U:S>0&&(A=C),_<0?B=j:_>0&&(M=k),b=gr,Ut(nt));break}case 32:{b===Uo&&(nt.altKey?(S&&(P=U-Y*S,A=C+Y*S),_&&(B=j-et*_,M=k+et*_),b=mr):(S<0?P=U:S>0&&(A=C),_<0?B=j:_>0&&(M=k),b=gr),J.attr("cursor",on[y]),Ut(nt));break}default:return}Po(nt)}}function f(g){u(this,arguments).moved(g)}function p(g){u(this,arguments).ended(g)}function m(){var g=this.__brush||{selection:null};return g.extent=uh(t.apply(this,arguments)),g.dim=e,g}return l.extent=function(g){return arguments.length?(t=typeof g=="function"?g:No(uh(g)),l):t},l.filter=function(g){return arguments.length?(n=typeof g=="function"?g:No(!!g),l):n},l.touchable=function(g){return arguments.length?(r=typeof g=="function"?g:No(!!g),l):r},l.handleSize=function(g){return arguments.length?(a=+g,l):a},l.keyModifiers=function(g){return arguments.length?(i=!!g,l):i},l.on=function(){var g=s.on.apply(s,arguments);return g===s?l:g},l}const Ho=Math.PI,Fo=2*Ho,jn=1e-6,zb=Fo-jn;function ph(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function jb(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ph;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let Go=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?ph:jb(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,u=a-t,h=o-n,d=u*u+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>jn)if(!(Math.abs(h*l-c*u)>jn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,m=l*l+c*c,g=f*f+p*p,v=Math.sqrt(m),y=Math.sqrt(d),b=s*Math.tan((Ho-Math.acos((m+d-g)/(2*v*y)))/2),S=b/y,_=b/v;Math.abs(S-1)>jn&&this._append`L${t+S*u},${n+S*h}`,this._append`A${s},${s},0,0,${+(h*f>u*p)},${this._x1=t+_*l},${this._y1=n+_*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,u=n+l,h=1^a,d=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>jn||Math.abs(this._y1-u)>jn)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%Fo+Fo),d>zb?this._append`A${r},${r},0,1,${h},${t-o},${n-l}A${r},${r},0,1,${h},${this._x1=c},${this._y1=u}`:d>jn&&this._append`A${r},${r},0,${+(d>=Ho)},${h},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function gh(){return new Go}gh.prototype=Go.prototype;function Wb(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ks(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function vr(e){return e=ks(Math.abs(e)),e?e[1]:NaN}function qb(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function Yb(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Xb=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ci(e){if(!(t=Xb.exec(e)))throw new Error("invalid format: "+e);var t;return new zo({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ci.prototype=zo.prototype;function zo(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}zo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Zb(e){t:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break t;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var mh;function Kb(e,t){var n=ks(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(mh=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+ks(e,Math.max(0,t+s-1))[0]}function vh(e,t){var n=ks(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const yh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Wb,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vh(e*100,t),r:vh,s:Kb,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function bh(e){return e}var xh=Array.prototype.map,wh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Qb(e){var t=e.grouping===void 0||e.thousands===void 0?bh:qb(xh.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?bh:Yb(xh.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(h){h=ci(h);var d=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,v=h.width,y=h.comma,b=h.precision,S=h.trim,_=h.type;_==="n"?(y=!0,_="g"):yh[_]||(b===void 0&&(b=12),S=!0,_="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var E=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",T=m==="$"?r:/[%p]/.test(_)?a:"",R=yh[_],N=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function A(C){var V=E,M=T,k,w,P;if(_==="c")M=R(C)+M,C="";else{C=+C;var U=C<0||1/C<0;if(C=isNaN(C)?l:R(Math.abs(C),b),S&&(C=Zb(C)),U&&+C==0&&p!=="+"&&(U=!1),V=(U?p==="("?p:o:p==="-"||p==="("?"":p)+V,M=(_==="s"?wh[8+mh/3]:"")+M+(U&&p==="("?")":""),N){for(k=-1,w=C.length;++k<w;)if(P=C.charCodeAt(k),48>P||P>57){M=(P===46?i+C.slice(k+1):C.slice(k))+M,C=C.slice(0,k);break}}}y&&!g&&(C=t(C,1/0));var I=V.length+C.length+M.length,B=I<v?new Array(v-I+1).join(d):"";switch(y&&g&&(C=t(B+C,B.length?v-M.length:1/0),B=""),f){case"<":C=V+C+M+B;break;case"=":C=V+B+C+M;break;case"^":C=B.slice(0,I=B.length>>1)+V+C+M+B.slice(I);break;default:C=B+V+C+M;break}return s(C)}return A.toString=function(){return h+""},A}function u(h,d){var f=c((h=ci(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(vr(d)/3)))*3,m=Math.pow(10,-p),g=wh[8+p/3];return function(v){return f(m*v)+g}}return{format:c,formatPrefix:u}}var Ls,jo,_h;Jb({thousands:",",grouping:[3],currency:["$",""]});function Jb(e){return Ls=Qb(e),jo=Ls.format,_h=Ls.formatPrefix,Ls}function tx(e){return Math.max(0,-vr(Math.abs(e)))}function ex(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vr(t)/3)))*3-vr(Math.abs(e)))}function nx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vr(t)-vr(e))+1}var _t=1e-6,Eh=1e-12,dt=Math.PI,pe=dt/2,Sh=dt/4,Ee=dt*2,ce=180/dt,Ht=dt/180,Et=Math.abs,Oh=Math.atan,Wn=Math.atan2,Ot=Math.cos,rx=Math.exp,ix=Math.log,wt=Math.sin,Cn=Math.sign||function(e){return e>0?1:e<0?-1:0},Pe=Math.sqrt,sx=Math.tan;function ax(e){return e>1?0:e<-1?dt:Math.acos(e)}function ln(e){return e>1?pe:e<-1?-pe:Math.asin(e)}function Me(){}function Rs(e,t){e&&Mh.hasOwnProperty(e.type)&&Mh[e.type](e,t)}var Th={Feature:function(e,t){Rs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Rs(n[r].geometry,t)}},Mh={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Wo(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Wo(n[r],t,0)},Polygon:function(e,t){Ch(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Ch(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Rs(n[r],t)}};function Wo(e,t,n){var r=-1,i=e.length-n,s;for(t.lineStart();++r<i;)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function Ch(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Wo(e[n],t,1);t.polygonEnd()}function yr(e,t){e&&Th.hasOwnProperty(e.type)?Th[e.type](e,t):Rs(e,t)}function qo(e){return[Wn(e[1],e[0]),ln(e[2])]}function br(e){var t=e[0],n=e[1],r=Ot(n);return[r*Ot(t),r*wt(t),wt(n)]}function Ds(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Is(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Yo(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ns(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Xo(e){var t=Pe(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Zo(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function Ko(e,t){return Et(e)>dt&&(e-=Math.round(e/Ee)*Ee),[e,t]}Ko.invert=Ko;function $h(e,t,n){return(e%=Ee)?t||n?Zo(kh(e),Lh(t,n)):kh(e):t||n?Lh(t,n):Ko}function Ah(e){return function(t,n){return t+=e,Et(t)>dt&&(t-=Math.round(t/Ee)*Ee),[t,n]}}function kh(e){var t=Ah(e);return t.invert=Ah(-e),t}function Lh(e,t){var n=Ot(e),r=wt(e),i=Ot(t),s=wt(t);function a(o,l){var c=Ot(l),u=Ot(o)*c,h=wt(o)*c,d=wt(l),f=d*n+u*r;return[Wn(h*i-f*s,u*n-d*r),ln(f*i+h*s)]}return a.invert=function(o,l){var c=Ot(l),u=Ot(o)*c,h=wt(o)*c,d=wt(l),f=d*i-h*s;return[Wn(h*i+d*s,u*n+f*r),ln(f*n-u*r)]},a}function ox(e){e=$h(e[0]*Ht,e[1]*Ht,e.length>2?e[2]*Ht:0);function t(n){return n=e(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n}return t.invert=function(n){return n=e.invert(n[0]*Ht,n[1]*Ht),n[0]*=ce,n[1]*=ce,n},t}function lx(e,t,n,r,i,s){if(n){var a=Ot(t),o=wt(t),l=r*n;i==null?(i=t+r*Ee,s=t-l/2):(i=Rh(a,i),s=Rh(a,s),(r>0?i<s:i>s)&&(i+=r*Ee));for(var c,u=i;r>0?u>s:u<s;u-=l)c=qo([a,-o*Ot(u),-o*wt(u)]),e.point(c[0],c[1])}}function Rh(e,t){t=br(t),t[0]-=e,Xo(t);var n=ax(-t[1]);return((-t[2]<0?-n:n)+Ee-_t)%Ee}function Dh(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Me,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ps(e,t){return Et(e[0]-t[0])<_t&&Et(e[1]-t[1])<_t}function Us(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Ih(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((m=p.length-1)<=0)){var m,g=p[0],v=p[m],y;if(Ps(g,v)){if(!g[2]&&!v[2]){for(i.lineStart(),o=0;o<m;++o)i.point((g=p[o])[0],g[1]);i.lineEnd();return}v[0]+=2*_t}s.push(y=new Us(g,p,null,!0)),a.push(y.o=new Us(g,null,y,!1)),s.push(y=new Us(v,p,null,!1)),a.push(y.o=new Us(v,null,y,!0))}}),!!s.length){for(a.sort(t),Nh(s),Nh(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,h;;){for(var d=c,f=!0;d.v;)if((d=d.n)===c)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((h=u[o])[0],h[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(f)for(u=d.p.z,o=u.length-1;o>=0;--o)i.point((h=u[o])[0],h[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,f=!f}while(!d.v);i.lineEnd()}}}function Nh(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function Qo(e){return Et(e[0])<=dt?e[0]:Cn(e[0])*((Et(e[0])+dt)%Ee-dt)}function cx(e,t){var n=Qo(t),r=t[1],i=wt(r),s=[wt(n),-Ot(n),0],a=0,o=0,l=new Bn;i===1?r=pe+_t:i===-1&&(r=-pe-_t);for(var c=0,u=e.length;c<u;++c)if(d=(h=e[c]).length)for(var h,d,f=h[d-1],p=Qo(f),m=f[1]/2+Sh,g=wt(m),v=Ot(m),y=0;y<d;++y,p=S,g=E,v=T,f=b){var b=h[y],S=Qo(b),_=b[1]/2+Sh,E=wt(_),T=Ot(_),R=S-p,N=R>=0?1:-1,A=N*R,C=A>dt,V=g*E;if(l.add(Wn(V*N*wt(A),v*T+V*Ot(A))),a+=C?R+N*Ee:R,C^p>=n^S>=n){var M=Is(br(f),br(b));Xo(M);var k=Is(s,M);Xo(k);var w=(C^R>=0?-1:1)*ln(k[2]);(r>w||r===w&&(M[0]||M[1]))&&(o+=C^R>=0?1:-1)}}return(a<-_t||a<_t&&l<-Eh)^o&1}function Ph(e,t,n,r){return function(i){var s=t(i),a=Dh(),o=t(a),l=!1,c,u,h,d={point:f,lineStart:m,lineEnd:g,polygonStart:function(){d.point=v,d.lineStart=y,d.lineEnd=b,u=[],c=[]},polygonEnd:function(){d.point=f,d.lineStart=m,d.lineEnd=g,u=mu(u);var S=cx(c,r);u.length?(l||(i.polygonStart(),l=!0),Ih(u,hx,S,n,i)):S&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(S,_){e(S,_)&&i.point(S,_)}function p(S,_){s.point(S,_)}function m(){d.point=p,s.lineStart()}function g(){d.point=f,s.lineEnd()}function v(S,_){h.push([S,_]),o.point(S,_)}function y(){o.lineStart(),h=[]}function b(){v(h[0][0],h[0][1]),o.lineEnd();var S=o.clean(),_=a.result(),E,T=_.length,R,N,A;if(h.pop(),c.push(h),h=null,!!T){if(S&1){if(N=_[0],(R=N.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),E=0;E<R;++E)i.point((A=N[E])[0],A[1]);i.lineEnd()}return}T>1&&S&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(ux))}}return d}}function ux(e){return e.length>1}function hx(e,t){return((e=e.x)[0]<0?e[1]-pe-_t:pe-e[1])-((t=t.x)[0]<0?t[1]-pe-_t:pe-t[1])}const Uh=Ph(function(){return!0},dx,px,[-dt,-pe]);function dx(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?dt:-dt,l=Et(s-t);Et(l-dt)<_t?(e.point(t,n=(n+a)/2>0?pe:-pe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=dt&&(Et(t-r)<_t&&(t-=r*_t),Et(s-o)<_t&&(s-=o*_t),n=fx(t,n,s,a),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),i=0),e.point(t=s,n=a),r=o},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function fx(e,t,n,r){var i,s,a=wt(e-n);return Et(a)>_t?Oh((wt(t)*(s=Ot(r))*wt(n)-wt(r)*(i=Ot(t))*wt(e))/(i*s*a)):(t+r)/2}function px(e,t,n,r){var i;if(e==null)i=n*pe,r.point(-dt,i),r.point(0,i),r.point(dt,i),r.point(dt,0),r.point(dt,-i),r.point(0,-i),r.point(-dt,-i),r.point(-dt,0),r.point(-dt,i);else if(Et(e[0]-t[0])>_t){var s=e[0]<t[0]?dt:-dt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function gx(e){var t=Ot(e),n=6*Ht,r=t>0,i=Et(t)>_t;function s(u,h,d,f){lx(f,e,n,d,u,h)}function a(u,h){return Ot(u)*Ot(h)>t}function o(u){var h,d,f,p,m;return{lineStart:function(){p=f=!1,m=1},point:function(g,v){var y=[g,v],b,S=a(g,v),_=r?S?0:c(g,v):S?c(g+(g<0?dt:-dt),v):0;if(!h&&(p=f=S)&&u.lineStart(),S!==f&&(b=l(h,y),(!b||Ps(h,b)||Ps(y,b))&&(y[2]=1)),S!==f)m=0,S?(u.lineStart(),b=l(y,h),u.point(b[0],b[1])):(b=l(h,y),u.point(b[0],b[1],2),u.lineEnd()),h=b;else if(i&&h&&r^S){var E;!(_&d)&&(E=l(y,h,!0))&&(m=0,r?(u.lineStart(),u.point(E[0][0],E[0][1]),u.point(E[1][0],E[1][1]),u.lineEnd()):(u.point(E[1][0],E[1][1]),u.lineEnd(),u.lineStart(),u.point(E[0][0],E[0][1],3)))}S&&(!h||!Ps(h,y))&&u.point(y[0],y[1]),h=y,f=S,d=_},lineEnd:function(){f&&u.lineEnd(),h=null},clean:function(){return m|(p&&f)<<1}}}function l(u,h,d){var f=br(u),p=br(h),m=[1,0,0],g=Is(f,p),v=Ds(g,g),y=g[0],b=v-y*y;if(!b)return!d&&u;var S=t*v/b,_=-t*y/b,E=Is(m,g),T=Ns(m,S),R=Ns(g,_);Yo(T,R);var N=E,A=Ds(T,N),C=Ds(N,N),V=A*A-C*(Ds(T,T)-1);if(!(V<0)){var M=Pe(V),k=Ns(N,(-A-M)/C);if(Yo(k,T),k=qo(k),!d)return k;var w=u[0],P=h[0],U=u[1],I=h[1],B;P<w&&(B=w,w=P,P=B);var j=P-w,Y=Et(j-dt)<_t,et=Y||j<_t;if(!Y&&I<U&&(B=U,U=I,I=B),et?Y?U+I>0^k[1]<(Et(k[0]-w)<_t?U:I):U<=k[1]&&k[1]<=I:j>dt^(w<=k[0]&&k[0]<=P)){var pt=Ns(N,(-A+M)/C);return Yo(pt,T),[k,qo(pt)]}}}function c(u,h){var d=r?e:dt-e,f=0;return u<-d?f|=1:u>d&&(f|=2),h<-d?f|=4:h>d&&(f|=8),f}return Ph(a,o,s,r?[0,-e]:[-dt,e-dt])}function mx(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,h=1,d=l-a,f=c-o,p;if(p=n-a,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<h&&(h=p)}else if(d>0){if(p>h)return;p>u&&(u=p)}if(p=i-a,!(!d&&p<0)){if(p/=d,d<0){if(p>h)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<h&&(h=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<h&&(h=p)}else if(f>0){if(p>h)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>h)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<h&&(h=p)}return u>0&&(e[0]=a+u*d,e[1]=o+u*f),h<1&&(t[0]=a+h*d,t[1]=o+h*f),!0}}}}}var ui=1e9,Bs=-ui;function vx(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,h,d){var f=0,p=0;if(c==null||(f=a(c,h))!==(p=a(u,h))||l(c,u)<0^h>0)do d.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+h+4)%4)!==p);else d.point(u[0],u[1])}function a(c,u){return Et(c[0]-e)<_t?u>0?0:3:Et(c[0]-n)<_t?u>0?2:1:Et(c[1]-t)<_t?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var h=a(c,1),d=a(u,1);return h!==d?h-d:h===0?u[1]-c[1]:h===1?c[0]-u[0]:h===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,h=Dh(),d,f,p,m,g,v,y,b,S,_,E,T={point:R,lineStart:V,lineEnd:M,polygonStart:A,polygonEnd:C};function R(w,P){i(w,P)&&u.point(w,P)}function N(){for(var w=0,P=0,U=f.length;P<U;++P)for(var I=f[P],B=1,j=I.length,Y=I[0],et,pt,z=Y[0],K=Y[1];B<j;++B)et=z,pt=K,Y=I[B],z=Y[0],K=Y[1],pt<=r?K>r&&(z-et)*(r-pt)>(K-pt)*(e-et)&&++w:K<=r&&(z-et)*(r-pt)<(K-pt)*(e-et)&&--w;return w}function A(){u=h,d=[],f=[],E=!0}function C(){var w=N(),P=E&&w,U=(d=mu(d)).length;(P||U)&&(c.polygonStart(),P&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),U&&Ih(d,o,w,s,c),c.polygonEnd()),u=c,d=f=p=null}function V(){T.point=k,f&&f.push(p=[]),_=!0,S=!1,y=b=NaN}function M(){d&&(k(m,g),v&&S&&h.rejoin(),d.push(h.result())),T.point=R,S&&u.lineEnd()}function k(w,P){var U=i(w,P);if(f&&p.push([w,P]),_)m=w,g=P,v=U,_=!1,U&&(u.lineStart(),u.point(w,P));else if(U&&S)u.point(w,P);else{var I=[y=Math.max(Bs,Math.min(ui,y)),b=Math.max(Bs,Math.min(ui,b))],B=[w=Math.max(Bs,Math.min(ui,w)),P=Math.max(Bs,Math.min(ui,P))];mx(I,B,e,t,n,r)?(S||(u.lineStart(),u.point(I[0],I[1])),u.point(B[0],B[1]),U||u.lineEnd(),E=!1):U&&(u.lineStart(),u.point(w,P),E=!1)}y=w,b=P,S=U}return T}}const Jo=e=>e;var tl=new Bn,el=new Bn,Bh,Vh,nl,rl,$n={point:Me,lineStart:Me,lineEnd:Me,polygonStart:function(){$n.lineStart=yx,$n.lineEnd=xx},polygonEnd:function(){$n.lineStart=$n.lineEnd=$n.point=Me,tl.add(Et(el)),el=new Bn},result:function(){var e=tl/2;return tl=new Bn,e}};function yx(){$n.point=bx}function bx(e,t){$n.point=Hh,Bh=nl=e,Vh=rl=t}function Hh(e,t){el.add(rl*e-nl*t),nl=e,rl=t}function xx(){Hh(Bh,Vh)}const Fh=$n;var xr=1/0,Vs=xr,hi=-xr,Hs=hi,wx={point:_x,lineStart:Me,lineEnd:Me,polygonStart:Me,polygonEnd:Me,result:function(){var e=[[xr,Vs],[hi,Hs]];return hi=Hs=-(Vs=xr=1/0),e}};function _x(e,t){e<xr&&(xr=e),e>hi&&(hi=e),t<Vs&&(Vs=t),t>Hs&&(Hs=t)}const Fs=wx;var il=0,sl=0,di=0,Gs=0,zs=0,wr=0,al=0,ol=0,fi=0,Gh,zh,Ye,Xe,Ue={point:qn,lineStart:jh,lineEnd:Wh,polygonStart:function(){Ue.lineStart=Ox,Ue.lineEnd=Tx},polygonEnd:function(){Ue.point=qn,Ue.lineStart=jh,Ue.lineEnd=Wh},result:function(){var e=fi?[al/fi,ol/fi]:wr?[Gs/wr,zs/wr]:di?[il/di,sl/di]:[NaN,NaN];return il=sl=di=Gs=zs=wr=al=ol=fi=0,e}};function qn(e,t){il+=e,sl+=t,++di}function jh(){Ue.point=Ex}function Ex(e,t){Ue.point=Sx,qn(Ye=e,Xe=t)}function Sx(e,t){var n=e-Ye,r=t-Xe,i=Pe(n*n+r*r);Gs+=i*(Ye+e)/2,zs+=i*(Xe+t)/2,wr+=i,qn(Ye=e,Xe=t)}function Wh(){Ue.point=qn}function Ox(){Ue.point=Mx}function Tx(){qh(Gh,zh)}function Mx(e,t){Ue.point=qh,qn(Gh=Ye=e,zh=Xe=t)}function qh(e,t){var n=e-Ye,r=t-Xe,i=Pe(n*n+r*r);Gs+=i*(Ye+e)/2,zs+=i*(Xe+t)/2,wr+=i,i=Xe*e-Ye*t,al+=i*(Ye+e),ol+=i*(Xe+t),fi+=i*3,qn(Ye=e,Xe=t)}const Yh=Ue;function Xh(e){this._context=e}Xh.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ee);break}}},result:Me};var ll=new Bn,cl,Zh,Kh,pi,gi,js={point:Me,lineStart:function(){js.point=Cx},lineEnd:function(){cl&&Qh(Zh,Kh),js.point=Me},polygonStart:function(){cl=!0},polygonEnd:function(){cl=null},result:function(){var e=+ll;return ll=new Bn,e}};function Cx(e,t){js.point=Qh,Zh=pi=e,Kh=gi=t}function Qh(e,t){pi-=e,gi-=t,ll.add(Pe(pi*pi+gi*gi)),pi=e,gi=t}const Jh=js;let td,Ws,ed,nd;class rd{constructor(t){this._append=t==null?id:$x(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==ed||this._append!==Ws){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,ed=r,Ws=this._append,nd=this._,this._=i}this._+=nd;break}}}result(){const t=this._;return this._="",t.length?t:null}}function id(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function $x(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return id;if(t!==td){const n=10**t;td=t,Ws=function(i){let s=1;this._+=i[0];for(const a=i.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+i[s]}}return Ws}function Ax(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),yr(o,i(s))),s.result()}return a.area=function(o){return yr(o,i(Fh)),Fh.result()},a.measure=function(o){return yr(o,i(Jh)),Jh.result()},a.bounds=function(o){return yr(o,i(Fs)),Fs.result()},a.centroid=function(o){return yr(o,i(Yh)),Yh.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Jo):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new rd(n)):new Xh(t=o),typeof r!="function"&&s.pointRadius(r),a):t},a.pointRadius=function(o){return arguments.length?(r=typeof o=="function"?o:(s.pointRadius(+o),+o),a):r},a.digits=function(o){if(!arguments.length)return n;if(o==null)n=null;else{const l=Math.floor(o);if(!(l>=0))throw new RangeError(`invalid digits: ${o}`);n=l}return t===null&&(s=new rd(n)),a},a.projection(e).digits(n).context(t)}function ul(e){return function(t){var n=new hl;for(var r in e)n[r]=e[r];return n.stream=t,n}}function hl(){}hl.prototype={constructor:hl,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function dl(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),yr(n,e.stream(Fs)),t(Fs.result()),r!=null&&e.clipExtent(r),e}function sd(e,t,n){return dl(e,function(r){var i=t[1][0]-t[0][0],s=t[1][1]-t[0][1],a=Math.min(i/(r[1][0]-r[0][0]),s/(r[1][1]-r[0][1])),o=+t[0][0]+(i-a*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(s-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,l])},n)}function kx(e,t,n){return sd(e,[[0,0],t],n)}function Lx(e,t,n){return dl(e,function(r){var i=+t,s=i/(r[1][0]-r[0][0]),a=(i-s*(r[1][0]+r[0][0]))/2,o=-s*r[0][1];e.scale(150*s).translate([a,o])},n)}function Rx(e,t,n){return dl(e,function(r){var i=+t,s=i/(r[1][1]-r[0][1]),a=-s*r[0][0],o=(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,o])},n)}var ad=16,Dx=Ot(30*Ht);function od(e,t){return+t?Nx(e,t):Ix(e)}function Ix(e){return ul({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Nx(e,t){function n(r,i,s,a,o,l,c,u,h,d,f,p,m,g){var v=c-r,y=u-i,b=v*v+y*y;if(b>4*t&&m--){var S=a+d,_=o+f,E=l+p,T=Pe(S*S+_*_+E*E),R=ln(E/=T),N=Et(Et(E)-1)<_t||Et(s-h)<_t?(s+h)/2:Wn(_,S),A=e(N,R),C=A[0],V=A[1],M=C-r,k=V-i,w=y*M-v*k;(w*w/b>t||Et((v*M+y*k)/b-.5)>.3||a*d+o*f+l*p<Dx)&&(n(r,i,s,a,o,l,C,V,N,S/=T,_/=T,E,m,g),g.point(C,V),n(C,V,N,S,_,E,c,u,h,d,f,p,m,g))}}return function(r){var i,s,a,o,l,c,u,h,d,f,p,m,g={point:v,lineStart:y,lineEnd:S,polygonStart:function(){r.polygonStart(),g.lineStart=_},polygonEnd:function(){r.polygonEnd(),g.lineStart=y}};function v(R,N){R=e(R,N),r.point(R[0],R[1])}function y(){h=NaN,g.point=b,r.lineStart()}function b(R,N){var A=br([R,N]),C=e(R,N);n(h,d,u,f,p,m,h=C[0],d=C[1],u=R,f=A[0],p=A[1],m=A[2],ad,r),r.point(h,d)}function S(){g.point=v,r.lineEnd()}function _(){y(),g.point=E,g.lineEnd=T}function E(R,N){b(i=R,N),s=h,a=d,o=f,l=p,c=m,g.point=b}function T(){n(h,d,u,f,p,m,s,a,i,o,l,c,ad,r),g.lineEnd=S,S()}return g}}var Px=ul({point:function(e,t){this.stream.point(e*Ht,t*Ht)}});function Ux(e){return ul({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Bx(e,t,n,r,i){function s(a,o){return a*=r,o*=i,[t+e*a,n-e*o]}return s.invert=function(a,o){return[(a-t)/e*r,(n-o)/e*i]},s}function ld(e,t,n,r,i,s){if(!s)return Bx(e,t,n,r,i);var a=Ot(s),o=wt(s),l=a*e,c=o*e,u=a/e,h=o/e,d=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(m,g){return m*=r,g*=i,[l*m-c*g+t,n-c*m-l*g]}return p.invert=function(m,g){return[r*(u*m-h*g+d),i*(f-h*m-u*g)]},p}function qs(e){return cd(function(){return e})()}function cd(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,h=0,d=1,f=1,p=null,m=Uh,g=null,v,y,b,S=Jo,_=.5,E,T,R,N,A;function C(w){return R(w[0]*Ht,w[1]*Ht)}function V(w){return w=R.invert(w[0],w[1]),w&&[w[0]*ce,w[1]*ce]}C.stream=function(w){return N&&A===w?N:N=Px(Ux(u)(m(E(S(A=w)))))},C.preclip=function(w){return arguments.length?(m=w,p=void 0,k()):m},C.postclip=function(w){return arguments.length?(S=w,g=v=y=b=null,k()):S},C.clipAngle=function(w){return arguments.length?(m=+w?gx(p=w*Ht):(p=null,Uh),k()):p*ce},C.clipExtent=function(w){return arguments.length?(S=w==null?(g=v=y=b=null,Jo):vx(g=+w[0][0],v=+w[0][1],y=+w[1][0],b=+w[1][1]),k()):g==null?null:[[g,v],[y,b]]},C.scale=function(w){return arguments.length?(n=+w,M()):n},C.translate=function(w){return arguments.length?(r=+w[0],i=+w[1],M()):[r,i]},C.center=function(w){return arguments.length?(s=w[0]%360*Ht,a=w[1]%360*Ht,M()):[s*ce,a*ce]},C.rotate=function(w){return arguments.length?(o=w[0]%360*Ht,l=w[1]%360*Ht,c=w.length>2?w[2]%360*Ht:0,M()):[o*ce,l*ce,c*ce]},C.angle=function(w){return arguments.length?(h=w%360*Ht,M()):h*ce},C.reflectX=function(w){return arguments.length?(d=w?-1:1,M()):d<0},C.reflectY=function(w){return arguments.length?(f=w?-1:1,M()):f<0},C.precision=function(w){return arguments.length?(E=od(T,_=w*w),k()):Pe(_)},C.fitExtent=function(w,P){return sd(C,w,P)},C.fitSize=function(w,P){return kx(C,w,P)},C.fitWidth=function(w,P){return Lx(C,w,P)},C.fitHeight=function(w,P){return Rx(C,w,P)};function M(){var w=ld(n,0,0,d,f,h).apply(null,t(s,a)),P=ld(n,r-w[0],i-w[1],d,f,h);return u=$h(o,l,c),T=Zo(t,P),R=Zo(u,T),E=od(T,_),k()}function k(){return N=A=null,C}return function(){return t=e.apply(this,arguments),C.invert=t.invert&&V,M()}}function ud(e){var t=0,n=dt/3,r=cd(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Ht,n=s[1]*Ht):[t*ce,n*ce]},i}function Vx(e){var t=Ot(e);function n(r,i){return[r*t,wt(i)/t]}return n.invert=function(r,i){return[r/t,ln(i*t)]},n}function Hx(e,t){var n=wt(e),r=(n+wt(t))/2;if(Et(r)<_t)return Vx(e);var i=1+n*(2*r-n),s=Pe(i)/r;function a(o,l){var c=Pe(i-2*r*wt(l))/r;return[c*wt(o*=r),s-c*Ot(o)]}return a.invert=function(o,l){var c=s-l,u=Wn(o,Et(c))*Cn(c);return c*r<0&&(u-=dt*Cn(o)*Cn(c)),[u/r,ln((i-(o*o+c*c)*r*r)/(2*r))]},a}function hd(){return ud(Hx).scale(155.424).center([0,33.6442])}function Fx(){return hd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function fl(e,t){return[e,ix(sx((pe+t)/2))]}fl.invert=function(e,t){return[e,2*Oh(rx(t))-pe]};function Gx(){return zx(fl).scale(961/Ee)}function zx(e){var t=qs(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(h){return arguments.length?(r(h),u()):r()},t.translate=function(h){return arguments.length?(i(h),u()):i()},t.center=function(h){return arguments.length?(n(h),u()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=o=l=c=null:(a=+h[0][0],o=+h[0][1],l=+h[1][0],c=+h[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var h=dt*r(),d=t(ox(t.rotate()).invert([0,0]));return s(a==null?[[d[0]-h,d[1]-h],[d[0]+h,d[1]+h]]:e===fl?[[Math.max(d[0]-h,a),o],[Math.min(d[0]+h,l),c]]:[[a,Math.max(d[1]-h,o)],[l,Math.min(d[1]+h,c)]])}return u()}function Ys(e,t){return[e,t]}Ys.invert=Ys;function jx(){return qs(Ys).scale(152.63)}function Wx(e,t){var n=Ot(e),r=e===t?wt(e):(n-Ot(t))/(t-e),i=n/r+e;if(Et(r)<_t)return Ys;function s(a,o){var l=i-o,c=r*a;return[l*wt(c),i-l*Ot(c)]}return s.invert=function(a,o){var l=i-o,c=Wn(a,Et(l))*Cn(l);return l*r<0&&(c-=dt*Cn(a)*Cn(l)),[c/r,i-Cn(r)*Pe(a*a+l*l)]},s}function qx(){return ud(Wx).scale(131.154).center([0,13.9389])}var mi=1.340264,vi=-.081106,yi=893e-6,bi=.003796,Xs=Pe(3)/2,Yx=12;function dd(e,t){var n=ln(Xs*wt(t)),r=n*n,i=r*r*r;return[e*Ot(n)/(Xs*(mi+3*vi*r+i*(7*yi+9*bi*r))),n*(mi+vi*r+i*(yi+bi*r))]}dd.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<Yx&&(o=n*(mi+vi*r+i*(yi+bi*r))-t,l=mi+3*vi*r+i*(7*yi+9*bi*r),n-=a=o/l,r=n*n,i=r*r*r,!(Et(a)<Eh));++s);return[Xs*e*(mi+3*vi*r+i*(7*yi+9*bi*r))/Ot(n),ln(wt(n)/Xs)]};function Xx(){return qs(dd).scale(177.158)}function fd(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}fd.invert=function(e,t){var n=t,r=25,i;do{var s=n*n,a=s*s;n-=i=(n*(1.007226+s*(.015085+a*(-.044475+.028874*s-.005916*a)))-t)/(1.007226+s*(.015085*3+a*(-.044475*7+.028874*9*s-.005916*11*a)))}while(Et(i)>_t&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Zx(){return qs(fd).scale(175.295)}function Kx(e,t){return e.parent===t.parent?1:2}function Qx(e){return e.reduce(Jx,0)/e.length}function Jx(e,t){return e+t.x}function tw(e){return 1+e.reduce(ew,0)}function ew(e,t){return Math.max(e,t.y)}function nw(e){for(var t;t=e.children;)e=t[0];return e}function rw(e){for(var t;t=e.children;)e=t[t.length-1];return e}function iw(){var e=Kx,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(d){var f=d.children;f?(d.x=Qx(f),d.y=tw(f)):(d.x=a?o+=e(d,a):0,d.y=0,a=d)});var l=nw(s),c=rw(s),u=l.x-e(l,c)/2,h=c.x+e(c,l)/2;return s.eachAfter(r?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-u)/(h-u)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return i.separation=function(s){return arguments.length?(e=s,i):e},i.size=function(s){return arguments.length?(r=!1,t=+s[0],n=+s[1],i):r?null:[t,n]},i.nodeSize=function(s){return arguments.length?(r=!0,t=+s[0],n=+s[1],i):r?[t,n]:null},i}function sw(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function aw(){return this.eachAfter(sw)}function ow(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function lw(e,t){for(var n=this,r=[n],i,s,a=-1;n=r.pop();)if(e.call(t,n,++a,this),i=n.children)for(s=i.length-1;s>=0;--s)r.push(i[s]);return this}function cw(e,t){for(var n=this,r=[n],i=[],s,a,o,l=-1;n=r.pop();)if(i.push(n),s=n.children)for(a=0,o=s.length;a<o;++a)r.push(s[a]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function uw(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function hw(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function dw(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function fw(e){for(var t=this,n=pw(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function pw(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function gw(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function mw(){return Array.from(this)}function vw(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function yw(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*bw(){var e=this,t,n=[e],r,i,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,s=r.length;i<s;++i)n.push(r[i]);while(n.length)}function xi(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=_w)):t===void 0&&(t=ww);for(var n=new wi(e),r,i=[n],s,a,o,l;r=i.pop();)if((a=t(r.data))&&(l=(a=Array.from(a)).length))for(r.children=a,o=l-1;o>=0;--o)i.push(s=a[o]=new wi(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Sw)}function xw(){return xi(this).eachBefore(Ew)}function ww(e){return e.children}function _w(e){return Array.isArray(e)?e[1]:null}function Ew(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Sw(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function wi(e){this.data=e,this.depth=this.height=0,this.parent=null}wi.prototype=xi.prototype={constructor:wi,count:aw,each:ow,eachAfter:cw,eachBefore:lw,find:uw,sum:hw,sort:dw,path:fw,ancestors:gw,descendants:mw,leaves:vw,links:yw,copy:xw,[Symbol.iterator]:bw};function Ow(e){return e==null?null:pd(e)}function pd(e){if(typeof e!="function")throw new Error;return e}function Yn(){return 0}function _r(e){return function(){return e}}const Tw=1664525,Mw=1013904223,gd=4294967296;function Cw(){let e=1;return()=>(e=(Tw*e+Mw)%gd)/gd}function $w(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Aw(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function kw(e,t){for(var n=0,r=(e=Aw(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&md(a,s)?++n:(a=Rw(i=Lw(i,s)),n=0);return a}function Lw(e,t){var n,r;if(pl(t,e))return[t];for(n=0;n<e.length;++n)if(Zs(t,e[n])&&pl(_i(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(Zs(_i(e[n],e[r]),t)&&Zs(_i(e[n],t),e[r])&&Zs(_i(e[r],t),e[n])&&pl(vd(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Zs(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function md(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function pl(e,t){for(var n=0;n<t.length;++n)if(!md(e,t[n]))return!1;return!0}function Rw(e){switch(e.length){case 1:return Dw(e[0]);case 2:return _i(e[0],e[1]);case 3:return vd(e[0],e[1],e[2])}}function Dw(e){return{x:e.x,y:e.y,r:e.r}}function _i(e,t){var n=e.x,r=e.y,i=e.r,s=t.x,a=t.y,o=t.r,l=s-n,c=a-r,u=o-i,h=Math.sqrt(l*l+c*c);return{x:(n+s+l/h*u)/2,y:(r+a+c/h*u)/2,r:(h+i+o)/2}}function vd(e,t,n){var r=e.x,i=e.y,s=e.r,a=t.x,o=t.y,l=t.r,c=n.x,u=n.y,h=n.r,d=r-a,f=r-c,p=i-o,m=i-u,g=l-s,v=h-s,y=r*r+i*i-s*s,b=y-a*a-o*o+l*l,S=y-c*c-u*u+h*h,_=f*p-d*m,E=(p*S-m*b)/(_*2)-r,T=(m*g-p*v)/_,R=(f*b-d*S)/(_*2)-i,N=(d*v-f*g)/_,A=T*T+N*N-1,C=2*(s+E*T+R*N),V=E*E+R*R-s*s,M=-(Math.abs(A)>1e-6?(C+Math.sqrt(C*C-4*A*V))/(2*A):V/C);return{x:r+E+T*M,y:i+R+N*M,r:M}}function yd(e,t,n){var r=e.x-t.x,i,s,a=e.y-t.y,o,l,c=r*r+a*a;c?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(i=(c+l-s)/(2*c),o=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-o*a,n.y=e.y-i*a+o*r):(i=(c+s-l)/(2*c),o=Math.sqrt(Math.max(0,s/c-i*i)),n.x=t.x+i*r-o*a,n.y=t.y+i*a+o*r)):(n.x=t.x+n.r,n.y=t.y)}function bd(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function xd(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,s=(t.y*n.r+n.y*t.r)/r;return i*i+s*s}function Ks(e){this._=e,this.next=null,this.previous=null}function Iw(e,t){if(!(s=(e=$w(e)).length))return 0;var n,r,i,s,a,o,l,c,u,h,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(s>2))return n.r+r.r;yd(r,n,i=e[2]),n=new Ks(n),r=new Ks(r),i=new Ks(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){yd(n._,r._,i=e[l]),i=new Ks(i),c=r.next,u=n.previous,h=r._.r,d=n._.r;do if(h<=d){if(bd(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}h+=c._.r,c=c.next}else{if(bd(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}d+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=xd(n);(i=i.next)!==r;)(o=xd(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=kw(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function Nw(e){return Math.sqrt(e.value)}function Pw(){var e=null,t=1,n=1,r=Yn;function i(s){const a=Cw();return s.x=t/2,s.y=n/2,e?s.eachBefore(wd(e)).eachAfter(gl(r,.5,a)).eachBefore(_d(1)):s.eachBefore(wd(Nw)).eachAfter(gl(Yn,1,a)).eachAfter(gl(r,s.r/Math.min(t,n),a)).eachBefore(_d(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=Ow(s),i):e},i.size=function(s){return arguments.length?(t=+s[0],n=+s[1],i):[t,n]},i.padding=function(s){return arguments.length?(r=typeof s=="function"?s:_r(+s),i):r},i}function wd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function gl(e,t,n){return function(r){if(i=r.children){var i,s,a=i.length,o=e(r)*t||0,l;if(o)for(s=0;s<a;++s)i[s].r+=o;if(l=Iw(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function _d(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function Uw(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Bw(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(r-t)/e.value;++o<l;)a=s[o],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*c}function Vw(e,t){return e.parent===t.parent?1:2}function ml(e){var t=e.children;return t?t[0]:e.t}function vl(e){var t=e.children;return t?t[t.length-1]:e.t}function Hw(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Fw(e){for(var t=0,n=0,r=e.children,i=r.length,s;--i>=0;)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Gw(e,t,n){return e.a.parent===t.parent?e.a:n}function Qs(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Qs.prototype=Object.create(wi.prototype);function zw(e){for(var t=new Qs(e,0),n,r=[t],i,s,a,o;n=r.pop();)if(s=n._.children)for(n.children=new Array(o=s.length),a=o-1;a>=0;--a)r.push(i=n.children[a]=new Qs(s[a],a)),i.parent=n;return(t.parent=new Qs(null,0)).children=[t],t}function jw(){var e=Vw,t=1,n=1,r=null;function i(c){var u=zw(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var h=c,d=c,f=c;c.eachBefore(function(y){y.x<h.x&&(h=y),y.x>d.x&&(d=y),y.depth>f.depth&&(f=y)});var p=h===d?1:e(h,d)/2,m=p-h.x,g=t/(d.x+p+m),v=n/(f.depth||1);c.eachBefore(function(y){y.x=(y.x+m)*g,y.y=y.depth*v})}return c}function s(c){var u=c.children,h=c.parent.children,d=c.i?h[c.i-1]:null;if(u){Fw(c);var f=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-f):c.z=f}else d&&(c.z=d.z+e(c._,d._));c.parent.A=o(c,d,c.parent.A||h[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,h){if(u){for(var d=c,f=c,p=u,m=d.parent.children[0],g=d.m,v=f.m,y=p.m,b=m.m,S;p=vl(p),d=ml(d),p&&d;)m=ml(m),f=vl(f),f.a=c,S=p.z+y-d.z-g+e(p._,d._),S>0&&(Hw(Gw(p,c,h),c,S),g+=S,v+=S),y+=p.m,g+=d.m,b+=m.m,v+=f.m;p&&!vl(f)&&(f.t=p,f.m+=y-v),d&&!ml(m)&&(m.t=d,m.m+=g-b,h=c)}return h}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function Ww(e,t,n,r,i){for(var s=e.children,a,o=-1,l=s.length,c=e.value&&(i-n)/e.value;++o<l;)a=s[o],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*c}var qw=(1+Math.sqrt(5))/2;function Yw(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,h=0,d=o.length,f,p,m=t.value,g,v,y,b,S,_,E;u<d;){f=i-n,p=s-r;do g=o[h++].value;while(!g&&h<d);for(v=y=g,_=Math.max(p/f,f/p)/(m*e),E=g*g*_,S=Math.max(y/E,E/v);h<d;++h){if(g+=c=o[h].value,c<v&&(v=c),c>y&&(y=c),E=g*g*_,b=Math.max(y/E,E/v),b>S){g-=c;break}S=b}a.push(l={value:g,dice:f<p,children:o.slice(u,h)}),l.dice?Bw(l,n,r,i,m?r+=p*g/m:s):Ww(l,n,r,m?n+=f*g/m:i,s),m-=g,u=h}return a}const Xw=function e(t){function n(r,i,s,a,o){Yw(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(qw);function Zw(){var e=Xw,t=!1,n=1,r=1,i=[0],s=Yn,a=Yn,o=Yn,l=Yn,c=Yn;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(h),i=[0],t&&d.eachBefore(Uw),d}function h(d){var f=i[d.depth],p=d.x0+f,m=d.y0+f,g=d.x1-f,v=d.y1-f;g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),d.x0=p,d.y0=m,d.x1=g,d.y1=v,d.children&&(f=i[d.depth+1]=s(d)/2,p+=c(d)-f,m+=a(d)-f,g-=o(d)-f,v-=l(d)-f,g<p&&(p=g=(p+g)/2),v<m&&(m=v=(m+v)/2),e(d,p,m,g,v))}return u.round=function(d){return arguments.length?(t=!!d,u):t},u.size=function(d){return arguments.length?(n=+d[0],r=+d[1],u):[n,r]},u.tile=function(d){return arguments.length?(e=pd(d),u):e},u.padding=function(d){return arguments.length?u.paddingInner(d).paddingOuter(d):u.paddingInner()},u.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:_r(+d),u):s},u.paddingOuter=function(d){return arguments.length?u.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):u.paddingTop()},u.paddingTop=function(d){return arguments.length?(a=typeof d=="function"?d:_r(+d),u):a},u.paddingRight=function(d){return arguments.length?(o=typeof d=="function"?d:_r(+d),u):o},u.paddingBottom=function(d){return arguments.length?(l=typeof d=="function"?d:_r(+d),u):l},u.paddingLeft=function(d){return arguments.length?(c=typeof d=="function"?d:_r(+d),u):c},u}function Er(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const Ed=Symbol("implicit");function Js(){var e=new du,t=[],n=[],r=Ed;function i(s){let a=e.get(s);if(a===void 0){if(r!==Ed)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new du;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return Js(t,n).unknown(r)},Er.apply(i,arguments),i}function Ei(){var e=Js().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,u=.5;delete e.unknown;function h(){var d=t().length,f=i<r,p=f?i:r,m=f?r:i;s=(m-p)/Math.max(1,d-l+c*2),o&&(s=Math.floor(s)),p+=(m-p-s*(d-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var g=s0(d).map(function(v){return p+s*v});return n(f?g.reverse():g)}return e.domain=function(d){return arguments.length?(t(d),h()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(d){return arguments.length?(o=!!d,h()):o},e.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),h()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),h()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,h()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),h()):u},e.copy=function(){return Ei(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Er.apply(h(),arguments)}function Kw(e){return function(){return e}}function Qw(e){return+e}var Sd=[0,1];function Sr(e){return e}function yl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Kw(isNaN(t)?NaN:.5)}function Jw(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function t_(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=yl(i,r),s=n(a,s)):(r=yl(r,i),s=n(s,a)),function(o){return s(r(o))}}function e_(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=yl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=lo(e,o,1,r)-1;return s[l](i[l](o))}}function bl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Od(){var e=Sd,t=Sd,n=ii,r,i,s,a=Sr,o,l,c;function u(){var d=Math.min(e.length,t.length);return a!==Sr&&(a=Jw(e[0],e[d-1])),o=d>2?e_:t_,l=c=null,h}function h(d){return d==null||isNaN(d=+d)?s:(l||(l=o(e.map(r),t,n)))(r(a(d)))}return h.invert=function(d){return a(i((c||(c=o(t,e.map(r),_e)))(d)))},h.domain=function(d){return arguments.length?(e=Array.from(d,Qw),u()):e.slice()},h.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},h.rangeRound=function(d){return t=Array.from(d),n=ju,u()},h.clamp=function(d){return arguments.length?(a=d?!0:Sr,u()):a!==Sr},h.interpolate=function(d){return arguments.length?(n=d,u()):n},h.unknown=function(d){return arguments.length?(s=d,h):s},function(d,f){return r=d,i=f,u()}}function Td(){return Od()(Sr,Sr)}function n_(e,t,n,r){var i=uo(e,t,n),s;switch(r=ci(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=ex(i,a))&&(r.precision=s),_h(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=nx(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=tx(i))&&(r.precision=s-(r.type==="%")*2);break}}return jo(r)}function Md(e){var t=e.domain;return e.ticks=function(n){var r=t();return cs(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return n_(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,u=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);u-- >0;){if(c=hr(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function Be(){var e=Td();return e.copy=function(){return bl(e,Be())},Er.apply(e,arguments),Md(e)}function Cd(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function $d(e){return Math.log(e)}function Ad(e){return Math.exp(e)}function r_(e){return-Math.log(-e)}function i_(e){return-Math.exp(-e)}function s_(e){return isFinite(e)?+("1e"+e):e<0?0:e}function a_(e){return e===10?s_:e===Math.E?Math.exp:t=>Math.pow(e,t)}function o_(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function kd(e){return(t,n)=>-e(-t,n)}function l_(e){const t=e($d,Ad),n=t.domain;let r=10,i,s;function a(){return i=o_(r),s=a_(r),n()[0]<0?(i=kd(i),s=kd(s),e(r_,i_)):e($d,Ad),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],u=l[l.length-1];const h=u<c;h&&([c,u]=[u,c]);let d=i(c),f=i(u),p,m;const g=o==null?10:+o;let v=[];if(!(r%1)&&f-d<g){if(d=Math.floor(d),f=Math.ceil(f),c>0){for(;d<=f;++d)for(p=1;p<r;++p)if(m=d<0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}}else for(;d<=f;++d)for(p=r-1;p>=1;--p)if(m=d>0?p/s(-d):p*s(d),!(m<c)){if(m>u)break;v.push(m)}v.length*2<g&&(v=cs(c,u,g))}else v=cs(d,f,Math.min(f-d,g)).map(s);return h?v.reverse():v},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=ci(l)).precision==null&&(l.trim=!0),l=jo(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let h=u/s(Math.round(i(u)));return h*r<r-.5&&(h*=r),h<=c?l(u):""}},t.nice=()=>n(Cd(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function Ld(){const e=l_(Od()).domain([1,10]);return e.copy=()=>bl(e,Ld()).base(e.base()),Er.apply(e,arguments),e}function xl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[lo(r,l,0,n)]:s}function o(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,o()):[e,t]},a.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,o()):i.slice()},a.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(s=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return xl().domain([e,t]).range(i).unknown(s)},Er.apply(Md(a),arguments)}const wl=new Date,_l=new Date;function qt(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>qt(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(wl.setTime(+s),_l.setTime(+a),e(wl),e(_l),Math.floor(n(wl,_l))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const ta=qt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ta.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ta),ta.range;const cn=1e3,Ce=cn*60,un=Ce*60,hn=un*24,El=hn*7,Rd=hn*30,Sl=hn*365,Or=qt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*cn)},(e,t)=>(t-e)/cn,e=>e.getUTCSeconds());Or.range;const Ol=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*cn)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getMinutes());Ol.range,qt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ce)},(e,t)=>(t-e)/Ce,e=>e.getUTCMinutes()).range;const Tl=qt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*cn-e.getMinutes()*Ce)},(e,t)=>{e.setTime(+e+t*un)},(e,t)=>(t-e)/un,e=>e.getHours());Tl.range,qt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*un)},(e,t)=>(t-e)/un,e=>e.getUTCHours()).range;const Si=qt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ce)/hn,e=>e.getDate()-1);Si.range;const Ml=qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/hn,e=>e.getUTCDate()-1);Ml.range,qt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/hn,e=>Math.floor(e/hn)).range;function Xn(e){return qt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ce)/El)}const ea=Xn(0),na=Xn(1),c_=Xn(2),u_=Xn(3),Tr=Xn(4),h_=Xn(5),d_=Xn(6);ea.range,na.range,c_.range,u_.range,Tr.range,h_.range,d_.range;function Zn(e){return qt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/El)}const Dd=Zn(0),ra=Zn(1),f_=Zn(2),p_=Zn(3),Mr=Zn(4),g_=Zn(5),m_=Zn(6);Dd.range,ra.range,f_.range,p_.range,Mr.range,g_.range,m_.range;const Cl=qt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Cl.range,qt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()).range;const dn=qt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());dn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),dn.range;const Kn=qt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Kn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Kn.range;function v_(e,t,n,r,i,s){const a=[[Or,1,cn],[Or,5,5*cn],[Or,15,15*cn],[Or,30,30*cn],[s,1,Ce],[s,5,5*Ce],[s,15,15*Ce],[s,30,30*Ce],[i,1,un],[i,3,3*un],[i,6,6*un],[i,12,12*un],[r,1,hn],[r,2,2*hn],[n,1,El],[t,1,Rd],[t,3,3*Rd],[e,1,Sl]];function o(c,u,h){const d=u<c;d&&([c,u]=[u,c]);const f=h&&typeof h.range=="function"?h:l(c,u,h),p=f?f.range(c,+u+1):[];return d?p.reverse():p}function l(c,u,h){const d=Math.abs(u-c)/h,f=oo(([,,g])=>g).right(a,d);if(f===a.length)return e.every(uo(c/Sl,u/Sl,h));if(f===0)return ta.every(Math.max(uo(c,u,h),1));const[p,m]=a[d/a[f-1][2]<a[f][2]/d?f-1:f];return p.every(m)}return[o,l]}const[y_,b_]=v_(dn,Cl,ea,Si,Tl,Ol);function $l(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Al(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Oi(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function x_(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=Ti(i),u=Mi(i),h=Ti(s),d=Mi(s),f=Ti(a),p=Mi(a),m=Ti(o),g=Mi(o),v=Ti(l),y=Mi(l),b={a:U,A:I,b:B,B:j,c:null,d:Vd,e:Vd,f:G_,g:J_,G:eE,H:V_,I:H_,j:F_,L:Hd,m:z_,M:j_,p:Y,q:et,Q:qd,s:Yd,S:W_,u:q_,U:Y_,V:X_,w:Z_,W:K_,x:null,X:null,y:Q_,Y:tE,Z:nE,"%":Wd},S={a:pt,A:z,b:K,B:ht,c:null,d:Gd,e:Gd,f:aE,g:mE,G:yE,H:rE,I:iE,j:sE,L:zd,m:oE,M:lE,p:it,q:Mt,Q:qd,s:Yd,S:cE,u:uE,U:hE,V:dE,w:fE,W:pE,x:null,X:null,y:gE,Y:vE,Z:bE,"%":Wd},_={a:A,A:C,b:V,B:M,c:k,d:Ud,e:Ud,f:N_,g:Pd,G:Nd,H:Bd,I:Bd,j:L_,L:I_,m:k_,M:R_,p:N,q:A_,Q:U_,s:B_,S:D_,u:O_,U:T_,V:M_,w:S_,W:C_,x:w,X:P,y:Pd,Y:Nd,Z:$_,"%":P_};b.x=E(n,b),b.X=E(r,b),b.c=E(t,b),S.x=E(n,S),S.X=E(r,S),S.c=E(t,S);function E(W,J){return function(ct){var F=[],Ut=-1,bt=0,zt=W.length,jt,nt,It;for(ct instanceof Date||(ct=new Date(+ct));++Ut<zt;)W.charCodeAt(Ut)===37&&(F.push(W.slice(bt,Ut)),(nt=Id[jt=W.charAt(++Ut)])!=null?jt=W.charAt(++Ut):nt=jt==="e"?" ":"0",(It=J[jt])&&(jt=It(ct,nt)),F.push(jt),bt=Ut+1);return F.push(W.slice(bt,Ut)),F.join("")}}function T(W,J){return function(ct){var F=Oi(1900,void 0,1),Ut=R(F,W,ct+="",0),bt,zt;if(Ut!=ct.length)return null;if("Q"in F)return new Date(F.Q);if("s"in F)return new Date(F.s*1e3+("L"in F?F.L:0));if(J&&!("Z"in F)&&(F.Z=0),"p"in F&&(F.H=F.H%12+F.p*12),F.m===void 0&&(F.m="q"in F?F.q:0),"V"in F){if(F.V<1||F.V>53)return null;"w"in F||(F.w=1),"Z"in F?(bt=Al(Oi(F.y,0,1)),zt=bt.getUTCDay(),bt=zt>4||zt===0?ra.ceil(bt):ra(bt),bt=Ml.offset(bt,(F.V-1)*7),F.y=bt.getUTCFullYear(),F.m=bt.getUTCMonth(),F.d=bt.getUTCDate()+(F.w+6)%7):(bt=$l(Oi(F.y,0,1)),zt=bt.getDay(),bt=zt>4||zt===0?na.ceil(bt):na(bt),bt=Si.offset(bt,(F.V-1)*7),F.y=bt.getFullYear(),F.m=bt.getMonth(),F.d=bt.getDate()+(F.w+6)%7)}else("W"in F||"U"in F)&&("w"in F||(F.w="u"in F?F.u%7:"W"in F?1:0),zt="Z"in F?Al(Oi(F.y,0,1)).getUTCDay():$l(Oi(F.y,0,1)).getDay(),F.m=0,F.d="W"in F?(F.w+6)%7+F.W*7-(zt+5)%7:F.w+F.U*7-(zt+6)%7);return"Z"in F?(F.H+=F.Z/100|0,F.M+=F.Z%100,Al(F)):$l(F)}}function R(W,J,ct,F){for(var Ut=0,bt=J.length,zt=ct.length,jt,nt;Ut<bt;){if(F>=zt)return-1;if(jt=J.charCodeAt(Ut++),jt===37){if(jt=J.charAt(Ut++),nt=_[jt in Id?J.charAt(Ut++):jt],!nt||(F=nt(W,ct,F))<0)return-1}else if(jt!=ct.charCodeAt(F++))return-1}return F}function N(W,J,ct){var F=c.exec(J.slice(ct));return F?(W.p=u.get(F[0].toLowerCase()),ct+F[0].length):-1}function A(W,J,ct){var F=f.exec(J.slice(ct));return F?(W.w=p.get(F[0].toLowerCase()),ct+F[0].length):-1}function C(W,J,ct){var F=h.exec(J.slice(ct));return F?(W.w=d.get(F[0].toLowerCase()),ct+F[0].length):-1}function V(W,J,ct){var F=v.exec(J.slice(ct));return F?(W.m=y.get(F[0].toLowerCase()),ct+F[0].length):-1}function M(W,J,ct){var F=m.exec(J.slice(ct));return F?(W.m=g.get(F[0].toLowerCase()),ct+F[0].length):-1}function k(W,J,ct){return R(W,t,J,ct)}function w(W,J,ct){return R(W,n,J,ct)}function P(W,J,ct){return R(W,r,J,ct)}function U(W){return a[W.getDay()]}function I(W){return s[W.getDay()]}function B(W){return l[W.getMonth()]}function j(W){return o[W.getMonth()]}function Y(W){return i[+(W.getHours()>=12)]}function et(W){return 1+~~(W.getMonth()/3)}function pt(W){return a[W.getUTCDay()]}function z(W){return s[W.getUTCDay()]}function K(W){return l[W.getUTCMonth()]}function ht(W){return o[W.getUTCMonth()]}function it(W){return i[+(W.getUTCHours()>=12)]}function Mt(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var J=E(W+="",b);return J.toString=function(){return W},J},parse:function(W){var J=T(W+="",!1);return J.toString=function(){return W},J},utcFormat:function(W){var J=E(W+="",S);return J.toString=function(){return W},J},utcParse:function(W){var J=T(W+="",!0);return J.toString=function(){return W},J}}}var Id={"-":"",_:" ",0:"0"},Qt=/^\s*\d+/,w_=/^%/,__=/[\\^$*+?|[\]().{}]/g;function vt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function E_(e){return e.replace(__,"\\$&")}function Ti(e){return new RegExp("^(?:"+e.map(E_).join("|")+")","i")}function Mi(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function S_(e,t,n){var r=Qt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function O_(e,t,n){var r=Qt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function T_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function M_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function C_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Nd(e,t,n){var r=Qt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Pd(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function $_(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function A_(e,t,n){var r=Qt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function k_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Ud(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function L_(e,t,n){var r=Qt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Bd(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function R_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function D_(e,t,n){var r=Qt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function I_(e,t,n){var r=Qt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function N_(e,t,n){var r=Qt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function P_(e,t,n){var r=w_.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function U_(e,t,n){var r=Qt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function B_(e,t,n){var r=Qt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Vd(e,t){return vt(e.getDate(),t,2)}function V_(e,t){return vt(e.getHours(),t,2)}function H_(e,t){return vt(e.getHours()%12||12,t,2)}function F_(e,t){return vt(1+Si.count(dn(e),e),t,3)}function Hd(e,t){return vt(e.getMilliseconds(),t,3)}function G_(e,t){return Hd(e,t)+"000"}function z_(e,t){return vt(e.getMonth()+1,t,2)}function j_(e,t){return vt(e.getMinutes(),t,2)}function W_(e,t){return vt(e.getSeconds(),t,2)}function q_(e){var t=e.getDay();return t===0?7:t}function Y_(e,t){return vt(ea.count(dn(e)-1,e),t,2)}function Fd(e){var t=e.getDay();return t>=4||t===0?Tr(e):Tr.ceil(e)}function X_(e,t){return e=Fd(e),vt(Tr.count(dn(e),e)+(dn(e).getDay()===4),t,2)}function Z_(e){return e.getDay()}function K_(e,t){return vt(na.count(dn(e)-1,e),t,2)}function Q_(e,t){return vt(e.getFullYear()%100,t,2)}function J_(e,t){return e=Fd(e),vt(e.getFullYear()%100,t,2)}function tE(e,t){return vt(e.getFullYear()%1e4,t,4)}function eE(e,t){var n=e.getDay();return e=n>=4||n===0?Tr(e):Tr.ceil(e),vt(e.getFullYear()%1e4,t,4)}function nE(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function Gd(e,t){return vt(e.getUTCDate(),t,2)}function rE(e,t){return vt(e.getUTCHours(),t,2)}function iE(e,t){return vt(e.getUTCHours()%12||12,t,2)}function sE(e,t){return vt(1+Ml.count(Kn(e),e),t,3)}function zd(e,t){return vt(e.getUTCMilliseconds(),t,3)}function aE(e,t){return zd(e,t)+"000"}function oE(e,t){return vt(e.getUTCMonth()+1,t,2)}function lE(e,t){return vt(e.getUTCMinutes(),t,2)}function cE(e,t){return vt(e.getUTCSeconds(),t,2)}function uE(e){var t=e.getUTCDay();return t===0?7:t}function hE(e,t){return vt(Dd.count(Kn(e)-1,e),t,2)}function jd(e){var t=e.getUTCDay();return t>=4||t===0?Mr(e):Mr.ceil(e)}function dE(e,t){return e=jd(e),vt(Mr.count(Kn(e),e)+(Kn(e).getUTCDay()===4),t,2)}function fE(e){return e.getUTCDay()}function pE(e,t){return vt(ra.count(Kn(e)-1,e),t,2)}function gE(e,t){return vt(e.getUTCFullYear()%100,t,2)}function mE(e,t){return e=jd(e),vt(e.getUTCFullYear()%100,t,2)}function vE(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function yE(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Mr(e):Mr.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function bE(){return"+0000"}function Wd(){return"%"}function qd(e){return+e}function Yd(e){return Math.floor(+e/1e3)}var Cr,Xd;xE({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function xE(e){return Cr=x_(e),Xd=Cr.format,Cr.parse,Cr.utcFormat,Cr.utcParse,Cr}function wE(e){return new Date(e)}function _E(e){return e instanceof Date?+e:+new Date(+e)}function Zd(e,t,n,r,i,s,a,o,l,c){var u=Td(),h=u.invert,d=u.domain,f=c(".%L"),p=c(":%S"),m=c("%I:%M"),g=c("%I %p"),v=c("%a %d"),y=c("%b %d"),b=c("%B"),S=c("%Y");function _(E){return(l(E)<E?f:o(E)<E?p:a(E)<E?m:s(E)<E?g:r(E)<E?i(E)<E?v:y:n(E)<E?b:S)(E)}return u.invert=function(E){return new Date(h(E))},u.domain=function(E){return arguments.length?d(Array.from(E,_E)):d().map(wE)},u.ticks=function(E){var T=d();return e(T[0],T[T.length-1],E??10)},u.tickFormat=function(E,T){return T==null?_:c(T)},u.nice=function(E){var T=d();return(!E||typeof E.range!="function")&&(E=t(T[0],T[T.length-1],E??10)),E?d(Cd(T,E)):u},u.copy=function(){return bl(u,Zd(e,t,n,r,i,s,a,o,l,c))},u}function Kd(){return Er.apply(Zd(y_,b_,dn,Cl,ea,Si,Tl,Ol,Or,Xd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ut(e){return function(){return e}}const Qd=Math.abs,ae=Math.atan2,Qn=Math.cos,EE=Math.max,kl=Math.min,Ze=Math.sin,$r=Math.sqrt,oe=1e-12,Ci=Math.PI,ia=Ci/2,sa=2*Ci;function SE(e){return e>1?0:e<-1?Ci:Math.acos(e)}function Jd(e){return e>=1?ia:e<=-1?-ia:Math.asin(e)}function aa(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Go(t)}function OE(e){return e.innerRadius}function TE(e){return e.outerRadius}function ME(e){return e.startAngle}function CE(e){return e.endAngle}function $E(e){return e&&e.padAngle}function AE(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,h=o-s,d=h*l-u*c;if(!(d*d<oe))return d=(u*(t-s)-h*(e-i))/d,[e+d*l,t+d*c]}function oa(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/$r(o*o+l*l),u=c*l,h=-c*o,d=e+u,f=t+h,p=n+u,m=r+h,g=(d+p)/2,v=(f+m)/2,y=p-d,b=m-f,S=y*y+b*b,_=i-s,E=d*m-p*f,T=(b<0?-1:1)*$r(EE(0,_*_*S-E*E)),R=(E*b-y*T)/S,N=(-E*y-b*T)/S,A=(E*b+y*T)/S,C=(-E*y+b*T)/S,V=R-g,M=N-v,k=A-g,w=C-v;return V*V+M*M>k*k+w*w&&(R=A,N=C),{cx:R,cy:N,x01:-u,y01:-h,x11:R*(i/_-1),y11:N*(i/_-1)}}function $i(){var e=OE,t=TE,n=ut(0),r=null,i=ME,s=CE,a=$E,o=null,l=aa(c);function c(){var u,h,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-ia,m=s.apply(this,arguments)-ia,g=Qd(m-p),v=m>p;if(o||(o=u=l()),f<d&&(h=f,f=d,d=h),!(f>oe))o.moveTo(0,0);else if(g>sa-oe)o.moveTo(f*Qn(p),f*Ze(p)),o.arc(0,0,f,p,m,!v),d>oe&&(o.moveTo(d*Qn(m),d*Ze(m)),o.arc(0,0,d,m,p,v));else{var y=p,b=m,S=p,_=m,E=g,T=g,R=a.apply(this,arguments)/2,N=R>oe&&(r?+r.apply(this,arguments):$r(d*d+f*f)),A=kl(Qd(f-d)/2,+n.apply(this,arguments)),C=A,V=A,M,k;if(N>oe){var w=Jd(N/d*Ze(R)),P=Jd(N/f*Ze(R));(E-=w*2)>oe?(w*=v?1:-1,S+=w,_-=w):(E=0,S=_=(p+m)/2),(T-=P*2)>oe?(P*=v?1:-1,y+=P,b-=P):(T=0,y=b=(p+m)/2)}var U=f*Qn(y),I=f*Ze(y),B=d*Qn(_),j=d*Ze(_);if(A>oe){var Y=f*Qn(b),et=f*Ze(b),pt=d*Qn(S),z=d*Ze(S),K;if(g<Ci)if(K=AE(U,I,pt,z,Y,et,B,j)){var ht=U-K[0],it=I-K[1],Mt=Y-K[0],W=et-K[1],J=1/Ze(SE((ht*Mt+it*W)/($r(ht*ht+it*it)*$r(Mt*Mt+W*W)))/2),ct=$r(K[0]*K[0]+K[1]*K[1]);C=kl(A,(d-ct)/(J-1)),V=kl(A,(f-ct)/(J+1))}else C=V=0}T>oe?V>oe?(M=oa(pt,z,U,I,f,V,v),k=oa(Y,et,B,j,f,V,v),o.moveTo(M.cx+M.x01,M.cy+M.y01),V<A?o.arc(M.cx,M.cy,V,ae(M.y01,M.x01),ae(k.y01,k.x01),!v):(o.arc(M.cx,M.cy,V,ae(M.y01,M.x01),ae(M.y11,M.x11),!v),o.arc(0,0,f,ae(M.cy+M.y11,M.cx+M.x11),ae(k.cy+k.y11,k.cx+k.x11),!v),o.arc(k.cx,k.cy,V,ae(k.y11,k.x11),ae(k.y01,k.x01),!v))):(o.moveTo(U,I),o.arc(0,0,f,y,b,!v)):o.moveTo(U,I),!(d>oe)||!(E>oe)?o.lineTo(B,j):C>oe?(M=oa(B,j,Y,et,d,-C,v),k=oa(U,I,pt,z,d,-C,v),o.lineTo(M.cx+M.x01,M.cy+M.y01),C<A?o.arc(M.cx,M.cy,C,ae(M.y01,M.x01),ae(k.y01,k.x01),!v):(o.arc(M.cx,M.cy,C,ae(M.y01,M.x01),ae(M.y11,M.x11),!v),o.arc(0,0,d,ae(M.cy+M.y11,M.cx+M.x11),ae(k.cy+k.y11,k.cx+k.x11),v),o.arc(k.cx,k.cy,C,ae(k.y11,k.x11),ae(k.y01,k.x01),!v))):o.arc(0,0,d,_,S,v)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Ci/2;return[Qn(h)*u,Ze(h)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ut(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ut(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ut(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ut(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ut(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ut(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ut(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var kE=Array.prototype.slice;function la(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function tf(e){this._context=e}tf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ca(e){return new tf(e)}function Ll(e){return e[0]}function Rl(e){return e[1]}function Ai(e,t){var n=ut(!0),r=null,i=ca,s=null,a=aa(o);e=typeof e=="function"?e:e===void 0?Ll:ut(e),t=typeof t=="function"?t:t===void 0?Rl:ut(t);function o(l){var c,u=(l=la(l)).length,h,d=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(h=l[c],c,l))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(h,c,l),+t(h,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:ut(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ut(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ut(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function Dl(e,t,n){var r=null,i=ut(!0),s=null,a=ca,o=null,l=aa(c);e=typeof e=="function"?e:e===void 0?Ll:ut(+e),t=typeof t=="function"?t:ut(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Rl:ut(+n);function c(h){var d,f,p,m=(h=la(h)).length,g,v=!1,y,b=new Array(m),S=new Array(m);for(s==null&&(o=a(y=l())),d=0;d<=m;++d){if(!(d<m&&i(g=h[d],d,h))===v)if(v=!v)f=d,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=d-1;p>=f;--p)o.point(b[p],S[p]);o.lineEnd(),o.areaEnd()}v&&(b[d]=+e(g,d,h),S[d]=+t(g,d,h),o.point(r?+r(g,d,h):b[d],n?+n(g,d,h):S[d]))}if(y)return o=null,y+""||null}function u(){return Ai().defined(i).curve(a).context(s)}return c.x=function(h){return arguments.length?(e=typeof h=="function"?h:ut(+h),r=null,c):e},c.x0=function(h){return arguments.length?(e=typeof h=="function"?h:ut(+h),c):e},c.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:ut(+h),c):r},c.y=function(h){return arguments.length?(t=typeof h=="function"?h:ut(+h),n=null,c):t},c.y0=function(h){return arguments.length?(t=typeof h=="function"?h:ut(+h),c):t},c.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:ut(+h),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(h){return arguments.length?(i=typeof h=="function"?h:ut(!!h),c):i},c.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),c):a},c.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),c):s},c}function LE(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function RE(e){return e}function DE(){var e=RE,t=LE,n=null,r=ut(0),i=ut(sa),s=ut(0);function a(o){var l,c=(o=la(o)).length,u,h,d=0,f=new Array(c),p=new Array(c),m=+r.apply(this,arguments),g=Math.min(sa,Math.max(-sa,i.apply(this,arguments)-m)),v,y=Math.min(Math.abs(g)/c,s.apply(this,arguments)),b=y*(g<0?-1:1),S;for(l=0;l<c;++l)(S=p[f[l]=l]=+e(o[l],l,o))>0&&(d+=S);for(t!=null?f.sort(function(_,E){return t(p[_],p[E])}):n!=null&&f.sort(function(_,E){return n(o[_],o[E])}),l=0,h=d?(g-c*b)/d:0;l<c;++l,m=v)u=f[l],S=p[u],v=m+(S>0?S*h:0)+b,p[u]={data:o[u],index:l,value:S,startAngle:m,endAngle:v,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ut(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:ut(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ut(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ut(+o),a):s},a}var IE=nf(ca);function ef(e){this._curve=e}ef.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function nf(e){function t(n){return new ef(e(n))}return t._curve=e,t}function NE(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(nf(n)):t()._curve},e}function PE(){return NE(Ai().curve(IE))}class UE{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function BE(e){return new UE(e,!0)}function VE(e){return e.source}function HE(e){return e.target}function FE(e){let t=VE,n=HE,r=Ll,i=Rl,s=null,a=null,o=aa(l);function l(){let c;const u=kE.call(arguments),h=t.apply(this,u),d=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=h,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),a.lineEnd(),c)return a=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:ut(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ut(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function GE(){return FE(BE)}function An(){}function ua(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function ha(e){this._context=e}ha.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ua(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ua(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zE(e){return new ha(e)}function rf(e){this._context=e}rf.prototype={areaStart:An,areaEnd:An,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ua(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jE(e){return new rf(e)}function sf(e){this._context=e}sf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ua(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function WE(e){return new sf(e)}function af(e,t){this._basis=new ha(e),this._beta=t}af.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const qE=function e(t){function n(r){return t===1?new ha(r):new af(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function da(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Il(e,t){this._context=e,this._k=(1-t)/6}Il.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:da(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:da(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const YE=function e(t){function n(r){return new Il(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Nl(e,t){this._context=e,this._k=(1-t)/6}Nl.prototype={areaStart:An,areaEnd:An,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:da(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const XE=function e(t){function n(r){return new Nl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Pl(e,t){this._context=e,this._k=(1-t)/6}Pl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:da(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ZE=function e(t){function n(r){return new Pl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Ul(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>oe){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>oe){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function of(e,t){this._context=e,this._alpha=t}of.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Ul(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const KE=function e(t){function n(r){return t?new of(r,t):new Il(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function lf(e,t){this._context=e,this._alpha=t}lf.prototype={areaStart:An,areaEnd:An,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ul(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const QE=function e(t){function n(r){return t?new lf(r,t):new Nl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function cf(e,t){this._context=e,this._alpha=t}cf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ul(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const JE=function e(t){function n(r){return t?new cf(r,t):new Pl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function uf(e){this._context=e}uf.prototype={areaStart:An,areaEnd:An,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function hf(e){return new uf(e)}function df(e){return e<0?-1:1}function ff(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(df(s)+df(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function pf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Bl(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function fa(e){this._context=e}fa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Bl(this,this._t0,pf(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Bl(this,pf(this,n=ff(this,e,t)),n);break;default:Bl(this,this._t0,n=ff(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function gf(e){this._context=new mf(e)}(gf.prototype=Object.create(fa.prototype)).point=function(e,t){fa.prototype.point.call(this,t,e)};function mf(e){this._context=e}mf.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function tS(e){return new fa(e)}function eS(e){return new gf(e)}function vf(e){this._context=e}vf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=yf(e),i=yf(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function yf(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function nS(e){return new vf(e)}function pa(e,t){this._context=e,this._t=t}pa.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function rS(e){return new pa(e,.5)}function iS(e){return new pa(e,0)}function sS(e){return new pa(e,1)}function bf(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function xf(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function aS(e,t){return e[t]}function oS(e){const t=[];return t.key=e,t}function Vl(){var e=ut([]),t=xf,n=bf,r=aS;function i(s){var a=Array.from(e.apply(this,arguments),oS),o,l=a.length,c=-1,u;for(const h of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(h,a[o].key,c,s)]).data=h;for(o=0,u=la(t(a));o<l;++o)a[u[o]].index=o;return n(a,u),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:ut(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ut(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?xf:typeof s=="function"?s:ut(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??bf,i):n},i}function lS(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}function ki(e,t,n){this.k=e,this.x=t,this.y=n}ki.prototype={constructor:ki,scale:function(e){return e===1?this:new ki(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new ki(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},ki.prototype;var wf=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(wf||{}),_f=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(_f||{}),Ef=(e=>(e.UPDATE="model-update",e))(Ef||{}),Sf=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(Sf||{}),Of=(e=>(e.UPDATE="zoom-bar-update",e.SELECTION_START="zoom-bar-selection-start",e.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",e.SELECTION_END="zoom-bar-selection-end",e))(Of||{}),Tf=(e=>(e.CHANGE="zoom-domain-change",e))(Tf||{}),Mf=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Mf||{}),Cf=(e=>(e.LABEL_MOUSEOVER="axis-label-mouseover",e.LABEL_MOUSEMOVE="axis-label-mousemove",e.LABEL_CLICK="axis-label-click",e.LABEL_MOUSEOUT="axis-label-mouseout",e.LABEL_FOCUS="axis-label-focus",e.LABEL_BLUR="axis-label-blur",e.RENDER_COMPLETE="axis-render-complete",e))(Cf||{}),$f=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))($f||{}),Af=(e=>(e.WORD_MOUSEOVER="wordcloud-word-mouseover",e.WORD_MOUSEMOVE="wordcloud-word-mousemove",e.WORD_CLICK="wordcloud-word-click",e.WORD_MOUSEOUT="wordcloud-word-mouseout",e))(Af||{}),kf=(e=>(e.SLICE_MOUSEOVER="pie-slice-mouseover",e.SLICE_MOUSEMOVE="pie-slice-mousemove",e.SLICE_CLICK="pie-slice-click",e.SLICE_MOUSEOUT="pie-slice-mouseout",e))(kf||{}),Lf=(e=>(e.ARC_MOUSEOVER="gauge-arc-mouseover",e.ARC_MOUSEMOVE="gauge-arc-mousemove",e.ARC_CLICK="gauge-arc-click",e.ARC_MOUSEOUT="gauge-arc-mouseout",e))(Lf||{}),Rf=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Rf||{}),Df=(e=>(e.BOX_MOUSEOVER="box-mouseover",e.BOX_MOUSEMOVE="box-mousemove",e.BOX_CLICK="box-click",e.BOX_MOUSEOUT="box-mouseout",e.OUTLIER_MOUSEOVER="outlier-mouseover",e.OUTLIER_MOUSEMOVE="outlier-mousemove",e.OUTLIER_CLICK="outlier-click",e.OUTLIER_MOUSEOUT="outlier-mouseout",e))(Df||{}),If=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(If||{}),Nf=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Nf||{}),Pf=(e=>(e.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",e.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",e.X_AXIS_CLICK="radar-x-axis-click",e.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",e))(Pf||{}),Uf=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Uf||{}),Bf=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(Bf||{}),Li=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Li||{}),Vf=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Vf||{}),Hf=(e=>(e.ITEM_HOVER="legend-item-onhover",e.ITEM_CLICK="legend-item-onclick",e.ITEM_MOUSEOUT="legend-item-onmouseout",e.ITEMS_UPDATE="legend-items-update",e))(Hf||{}),Ff=(e=>(e.CIRCLE_MOUSEOVER="circle-leaf-mouseover",e.CIRCLE_CLICK="circle-leaf-click",e.CIRCLE_MOUSEOUT="circle-leaf-mouseout",e.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",e))(Ff||{}),Gf=(e=>(e.NODE_MOUSEOVER="alluvial-node-mouseover",e.NODE_CLICK="alluvial-node-click",e.NODE_MOUSEOUT="alluvial-node-mouseout",e.NODE_MOUSEMOVE="alluvial-node-mousemove",e.LINE_MOUSEOVER="alluvial-line-mouseover",e.LINE_CLICK="alluvial-line-click",e.LINE_MOUSEOUT="alluvial-line-mouseout",e.LINE_MOUSEMOVE="alluvial-line-mousemove",e))(Gf||{}),zf=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(zf||{}),jf=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(jf||{}),Ar=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Ar||{});const cS=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Gf,Area:$f,Axis:Cf,Bar:Rf,Boxplot:Df,CanvasZoom:Mf,Chart:wf,Choropleth:Ar,CirclePack:Ff,Gauge:Lf,Heatmap:jf,Legend:Hf,Line:Nf,Meter:zf,Modal:_f,Model:Ef,Pie:kf,Radar:Pf,Scatter:If,Threshold:Vf,Toolbar:Sf,Tooltip:Li,Tree:Uf,Treemap:Bf,WordCloud:Af,ZoomBar:Of,ZoomDomain:Tf},Symbol.toStringTag,{value:"Module"})),O=cS;var Q=(e=>(e.HTML="html",e.SVG="svg",e))(Q||{}),Wf=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(Wf||{}),tt=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(tt||{}),H=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(H||{}),Ke=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ke||{}),Ve=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ve||{}),Jt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Jt||{}),Z=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(Z||{}),Ri=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Ri||{}),Yt=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Yt||{}),Di=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Di||{}),Hl=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(Hl||{}),$t=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))($t||{}),at=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(at||{}),kr=(e=>(e.CENTER="center",e))(kr||{}),ga=(e=>(e.LEFT="left",e.RIGHT="right",e))(ga||{}),Xt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Xt||{}),fn=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(fn||{}),pn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(pn||{}),Lr=(e=>(e.SEMI="semi",e.FULL="full",e))(Lr||{}),Fl=(e=>(e.UP="up",e.DOWN="down",e))(Fl||{}),ma=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(ma||{}),va=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(va||{}),$e=(e=>(e.SCATTER="scatter",e.LINE="line",e.SIMPLE_BAR="simple-bar",e.STACKED_BAR="stacked-bar",e.GROUPED_BAR="grouped-bar",e.AREA="area",e.STACKED_AREA="stacked-area",e))($e||{}),Bt=(e=>(e.EXPORT_CSV="Export as CSV",e.EXPORT_PNG="Export as PNG",e.EXPORT_JPG="Export as JPG",e.ZOOM_IN="Zoom in",e.ZOOM_OUT="Zoom out",e.RESET_ZOOM="Reset zoom",e.MAKE_FULLSCREEN="Make fullscreen",e.SHOW_AS_DATATABLE="Show as data-table",e.CUSTOM="Custom",e))(Bt||{}),Gl=(e=>(e.LEFT="left",e.RIGHT="right",e))(Gl||{}),Zt=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Zt||{}),ya=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(ya||{}),Ii=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(Ii||{}),ba=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(ba||{}),gn=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(gn||{});function zl(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}function Ni(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",i;if(r==="formatting"&&e.formattingValues){var s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{var o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[o]}var c=e.argumentCallback?e.argumentCallback(t):t;return i[c]}}function Pi(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;var a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?hS(o,function(h){return h.test(a)}):uS(o,function(h){return h.test(a)}),c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=t.slice(a.length);return{value:c,rest:u}}}function uS(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function hS(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function dS(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var i=r[0],s=t.match(e.parsePattern);if(!s)return null;var a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;var o=t.slice(i.length);return{value:a,rest:o}}}function xa(e){"@babel/helpers - typeof";return xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xa(e)}function Kt(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ot(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function yt(e){ot(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||xa(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wa(e,t){ot(2,arguments);var n=yt(e).getTime(),r=Kt(t);return new Date(n+r)}var fS={};function _a(){return fS}function jl(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function pS(e){return ot(1,arguments),e instanceof Date||xa(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function gS(e){if(ot(1,arguments),!pS(e)&&typeof e!="number")return!1;var t=yt(e);return!isNaN(Number(t))}function mS(e,t){ot(2,arguments);var n=Kt(t);return wa(e,-n)}var vS=864e5;function yS(e){ot(1,arguments);var t=yt(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=n-r;return Math.floor(i/vS)+1}function Ea(e){ot(1,arguments);var t=1,n=yt(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function qf(e){ot(1,arguments);var t=yt(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=Ea(r),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=Ea(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function bS(e){ot(1,arguments);var t=qf(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Ea(n);return r}var xS=6048e5;function wS(e){ot(1,arguments);var t=yt(e),n=Ea(t).getTime()-bS(t).getTime();return Math.round(n/xS)+1}function Sa(e,t){var n,r,i,s,a,o,l,c;ot(1,arguments);var u=_a(),h=Kt((n=(r=(i=(s=t==null?void 0:t.weekStartsOn)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=yt(e),f=d.getUTCDay(),p=(f<h?7:0)+f-h;return d.setUTCDate(d.getUTCDate()-p),d.setUTCHours(0,0,0,0),d}function Yf(e,t){var n,r,i,s,a,o,l,c;ot(1,arguments);var u=yt(e),h=u.getUTCFullYear(),d=_a(),f=Kt((n=(r=(i=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:d.firstWeekContainsDate)!==null&&r!==void 0?r:(l=d.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(h+1,0,f),p.setUTCHours(0,0,0,0);var m=Sa(p,t),g=new Date(0);g.setUTCFullYear(h,0,f),g.setUTCHours(0,0,0,0);var v=Sa(g,t);return u.getTime()>=m.getTime()?h+1:u.getTime()>=v.getTime()?h:h-1}function _S(e,t){var n,r,i,s,a,o,l,c;ot(1,arguments);var u=_a(),h=Kt((n=(r=(i=(s=t==null?void 0:t.firstWeekContainsDate)!==null&&s!==void 0?s:t==null||(a=t.locale)===null||a===void 0||(o=a.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=Yf(e,t),f=new Date(0);f.setUTCFullYear(d,0,h),f.setUTCHours(0,0,0,0);var p=Sa(f,t);return p}var ES=6048e5;function SS(e,t){ot(1,arguments);var n=yt(e),r=Sa(n,t).getTime()-_S(n,t).getTime();return Math.round(r/ES)+1}function St(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var OS={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return St(t==="yy"?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):St(n+1,2)},d:function(e,t){return St(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(e,t){return St(e.getUTCHours()%12||12,t.length)},H:function(e,t){return St(e.getUTCHours(),t.length)},m:function(e,t){return St(e.getUTCMinutes(),t.length)},s:function(e,t){return St(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,n-3));return St(i,t.length)}};const kn=OS;var Rr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},TS={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return kn.y(e,t)},Y:function(e,t,n,r){var i=Yf(e,r),s=i>0?i:1-i;if(t==="YY"){var a=s%100;return St(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):St(s,t.length)},R:function(e,t){var n=qf(e);return St(n,t.length)},u:function(e,t){var n=e.getUTCFullYear();return St(n,t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return St(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return St(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return kn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return St(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=SS(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):St(i,t.length)},I:function(e,t,n){var r=wS(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):St(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):kn.d(e,t)},D:function(e,t,n){var r=yS(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):St(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return St(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return St(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return St(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours(),i=r/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r=e.getUTCHours(),i;switch(r===12?i=Rr.noon:r===0?i=Rr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r=e.getUTCHours(),i;switch(r>=17?i=Rr.evening:r>=12?i=Rr.afternoon:r>=4?i=Rr.morning:i=Rr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var r=e.getUTCHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return kn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):kn.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):St(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):kn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):kn.s(e,t)},S:function(e,t){return kn.S(e,t)},X:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Zf(s);case"XXXX":case"XX":return Jn(s);case"XXXXX":case"XXX":default:return Jn(s,":")}},x:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"x":return Zf(s);case"xxxx":case"xx":return Jn(s);case"xxxxx":case"xxx":default:return Jn(s,":")}},O:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xf(s,":");case"OOOO":default:return"GMT"+Jn(s,":")}},z:function(e,t,n,r){var i=r._originalDate||e,s=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xf(s,":");case"zzzz":default:return"GMT"+Jn(s,":")}},t:function(e,t,n,r){var i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return St(s,t.length)},T:function(e,t,n,r){var i=r._originalDate||e,s=i.getTime();return St(s,t.length)}};function Xf(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;if(s===0)return n+String(i);var a=t||"";return n+String(i)+a+St(s,2)}function Zf(e,t){if(e%60===0){var n=e>0?"-":"+";return n+St(Math.abs(e)/60,2)}return Jn(e,t)}function Jn(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e),s=St(Math.floor(i/60),2),a=St(i%60,2);return r+s+n+a}const MS=TS;var Kf=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Qf=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},CS=function(e,t){var n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Kf(e,t);var s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Kf(r,t)).replace("{{time}}",Qf(i,t))},$S={p:Qf,P:CS};const AS=$S;var kS=["D","DD"],LS=["YY","YYYY"];function RS(e){return kS.indexOf(e)!==-1}function DS(e){return LS.indexOf(e)!==-1}function Jf(e,t,n){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var IS={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},NS=function(e,t,n){var r,i=IS[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};const PS=NS;var US={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},BS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},VS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},HS={date:zl({formats:US,defaultWidth:"full"}),time:zl({formats:BS,defaultWidth:"full"}),dateTime:zl({formats:VS,defaultWidth:"full"})};const FS=HS;var GS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zS=function(e,t,n,r){return GS[e]};const jS=zS;var WS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},YS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},XS={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ZS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},KS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},QS=function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},JS={ordinalNumber:QS,era:Ni({values:WS,defaultWidth:"wide"}),quarter:Ni({values:qS,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Ni({values:YS,defaultWidth:"wide"}),day:Ni({values:XS,defaultWidth:"wide"}),dayPeriod:Ni({values:ZS,defaultWidth:"wide",formattingValues:KS,defaultFormattingWidth:"wide"})};const tO=JS;var eO=/^(\d+)(th|st|nd|rd)?/i,nO=/\d+/i,rO={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},iO={any:[/^b/i,/^(a|c)/i]},sO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},aO={any:[/1/i,/2/i,/3/i,/4/i]},oO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},lO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},cO={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},uO={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},hO={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dO={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fO={ordinalNumber:dS({matchPattern:eO,parsePattern:nO,valueCallback:function(e){return parseInt(e,10)}}),era:Pi({matchPatterns:rO,defaultMatchWidth:"wide",parsePatterns:iO,defaultParseWidth:"any"}),quarter:Pi({matchPatterns:sO,defaultMatchWidth:"wide",parsePatterns:aO,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Pi({matchPatterns:oO,defaultMatchWidth:"wide",parsePatterns:lO,defaultParseWidth:"any"}),day:Pi({matchPatterns:cO,defaultMatchWidth:"wide",parsePatterns:uO,defaultParseWidth:"any"}),dayPeriod:Pi({matchPatterns:hO,defaultMatchWidth:"any",parsePatterns:dO,defaultParseWidth:"any"})},pO={code:"en-US",formatDistance:PS,formatLong:FS,formatRelative:jS,localize:tO,match:fO,options:{weekStartsOn:0,firstWeekContainsDate:1}};const tp=pO;var gO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vO=/^'([^]*?)'?$/,yO=/''/g,bO=/[a-zA-Z]/;function Dr(e,t,n){var r,i,s,a,o,l,c,u,h,d,f,p,m,g,v,y,b,S;ot(2,arguments);var _=String(t),E=_a(),T=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:E.locale)!==null&&r!==void 0?r:tp,R=Kt((s=(a=(o=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:E.firstWeekContainsDate)!==null&&a!==void 0?a:(h=E.locale)===null||h===void 0||(d=h.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=Kt((f=(p=(m=(g=n==null?void 0:n.weekStartsOn)!==null&&g!==void 0?g:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&m!==void 0?m:E.weekStartsOn)!==null&&p!==void 0?p:(b=E.locale)===null||b===void 0||(S=b.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&f!==void 0?f:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var A=yt(e);if(!gS(A))throw new RangeError("Invalid time value");var C=jl(A),V=mS(A,C),M={firstWeekContainsDate:R,weekStartsOn:N,locale:T,_originalDate:A},k=_.match(mO).map(function(w){var P=w[0];if(P==="p"||P==="P"){var U=AS[P];return U(w,T.formatLong)}return w}).join("").match(gO).map(function(w){if(w==="''")return"'";var P=w[0];if(P==="'")return xO(w);var U=MS[P];if(U)return!(n!=null&&n.useAdditionalWeekYearTokens)&&DS(w)&&Jf(w,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&RS(w)&&Jf(w,t,String(e)),U(V,w,T.localize,M);if(P.match(bO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+P+"`");return w}).join("");return k}function xO(e){var t=e.match(vO);return t?t[1].replace(yO,"'"):e}const ge="cds",mn={opacity:{unselected:.05,selected:.4}},Ln={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Ir={duration:1e3,ease:ah,zoomLevel:3},Nr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},ep={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ae={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},wO={defaultBins:10},Vt={items:{status:{ACTIVE:1,DISABLED:0},horizontalSpace:12,verticalSpace:24,textYOffset:8,spaceAfter:4},checkbox:{radius:6.5},radius:{iconData:[{cx:7,cy:7,r:6.5},{cx:7,cy:10,r:3.5}],fill:null,stroke:"#8c8c8c"},line:{yPosition:6,width:24,strokeWidth:1.4,fill:null,stroke:"#999999"},area:{width:24,height:14,fill:"#6f6f6f",stroke:null},size:{iconData:[{width:23,height:12},{width:13,height:6}],fill:null,stroke:"#8D8D8D"},quartile:{iconData:[{x:0,y:0,width:24,height:13},{x:11,y:4,width:1,height:4}]},zoom:{iconData:[{x:0,y:0,width:12,height:12}],color:"#8D8D8D"},color:{barWidth:300,barHeight:8,axisYTranslation:10}},vn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},te={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},At={radiusOffset:-15,innerRadius:2,padAngle:.007,hoverArc:{outerRadiusOffset:3},xOffset:30,yOffset:20,yOffsetCallout:10,callout:{minSliceDegree:5,offsetX:15,offsetY:12,horizontalLineLength:8,textMargin:2}},tr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},He={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},np={minCellDividerDimension:16,chartPadding:.5},rp={default:{size:24}},_O={horizontalOffset:10},ip={default:{duration:300},pie_slice_mouseover:{duration:100},pie_chart_titles:{duration:375},graph_element_mouseover_fill_update:{duration:100},graph_element_mouseout_fill_update:{duration:100}},Se={height:{[Ke.GRAPH_VIEW]:32,[Ke.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},EO=[{type:Zt.RADIUS,name:"Radius"},{type:Zt.AREA,name:"Poor area"},{type:Zt.AREA,name:"Satisfactory area"},{type:Zt.AREA,name:"Great area"},{type:Zt.QUARTILE,name:"Quartiles"}];var SO=typeof global=="object"&&global&&global.Object===Object&&global;const sp=SO;var OO=typeof self=="object"&&self&&self.Object===Object&&self,TO=sp||OO||Function("return this")();const Fe=TO;var MO=Fe.Symbol;const ke=MO;var ap=Object.prototype,CO=ap.hasOwnProperty,$O=ap.toString,Ui=ke?ke.toStringTag:void 0;function AO(e){var t=CO.call(e,Ui),n=e[Ui];try{e[Ui]=void 0;var r=!0}catch{}var i=$O.call(e);return r&&(t?e[Ui]=n:delete e[Ui]),i}var kO=Object.prototype,LO=kO.toString;function RO(e){return LO.call(e)}var DO="[object Null]",IO="[object Undefined]",op=ke?ke.toStringTag:void 0;function er(e){return e==null?e===void 0?IO:DO:op&&op in Object(e)?AO(e):RO(e)}function Qe(e){return e!=null&&typeof e=="object"}var NO="[object Symbol]";function Oa(e){return typeof e=="symbol"||Qe(e)&&er(e)==NO}function lp(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var PO=Array.isArray;const ee=PO;var UO=1/0,cp=ke?ke.prototype:void 0,up=cp?cp.toString:void 0;function hp(e){if(typeof e=="string")return e;if(ee(e))return lp(e,hp)+"";if(Oa(e))return up?up.call(e):"";var t=e+"";return t=="0"&&1/e==-UO?"-0":t}function Le(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Wl(e){return e}var BO="[object AsyncFunction]",VO="[object Function]",HO="[object GeneratorFunction]",FO="[object Proxy]";function ql(e){if(!Le(e))return!1;var t=er(e);return t==VO||t==HO||t==BO||t==FO}var GO=Fe["__core-js_shared__"];const Yl=GO;var dp=function(){var e=/[^.]+$/.exec(Yl&&Yl.keys&&Yl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function zO(e){return!!dp&&dp in e}var jO=Function.prototype,WO=jO.toString;function nr(e){if(e!=null){try{return WO.call(e)}catch{}try{return e+""}catch{}}return""}var qO=/[\\^$.*+?()[\]{}|]/g,YO=/^\[object .+?Constructor\]$/,XO=Function.prototype,ZO=Object.prototype,KO=XO.toString,QO=ZO.hasOwnProperty,JO=RegExp("^"+KO.call(QO).replace(qO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tT(e){if(!Le(e)||zO(e))return!1;var t=ql(e)?JO:YO;return t.test(nr(e))}function eT(e,t){return e==null?void 0:e[t]}function rr(e,t){var n=eT(e,t);return tT(n)?n:void 0}var nT=rr(Fe,"WeakMap");const Xl=nT;var fp=Object.create,rT=function(){function e(){}return function(t){if(!Le(t))return{};if(fp)return fp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const iT=rT;function sT(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function aT(){}function pp(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var oT=800,lT=16,cT=Date.now;function uT(e){var t=0,n=0;return function(){var r=cT(),i=lT-(r-n);if(n=r,i>0){if(++t>=oT)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function hT(e){return function(){return e}}var dT=function(){try{var e=rr(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Ta=dT;var fT=Ta?function(e,t){return Ta(e,"toString",{configurable:!0,enumerable:!1,value:hT(t),writable:!0})}:Wl,pT=uT(fT);const gT=pT;function mT(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function vT(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function yT(e){return e!==e}function bT(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function xT(e,t,n){return t===t?bT(e,t,n):vT(e,yT,n)}function wT(e,t){var n=e==null?0:e.length;return!!n&&xT(e,t,0)>-1}var _T=9007199254740991,ET=/^(?:0|[1-9]\d*)$/;function Zl(e,t){var n=typeof e;return t=t??_T,!!t&&(n=="number"||n!="symbol"&&ET.test(e))&&e>-1&&e%1==0&&e<t}function Ma(e,t,n){t=="__proto__"&&Ta?Ta(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Bi(e,t){return e===t||e!==e&&t!==t}var ST=Object.prototype,OT=ST.hasOwnProperty;function gp(e,t,n){var r=e[t];(!(OT.call(e,t)&&Bi(r,n))||n===void 0&&!(t in e))&&Ma(e,t,n)}function Vi(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),i?Ma(n,o,l):gp(n,o,l)}return n}var mp=Math.max;function TT(e,t,n){return t=mp(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=mp(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),sT(e,this,o)}}function vp(e,t){return gT(TT(e,t,Wl),e+"")}var MT=9007199254740991;function Kl(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=MT}function ir(e){return e!=null&&Kl(e.length)&&!ql(e)}function yp(e,t,n){if(!Le(n))return!1;var r=typeof t;return(r=="number"?ir(n)&&Zl(t,n.length):r=="string"&&t in n)?Bi(n[t],e):!1}function CT(e){return vp(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&yp(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var $T=Object.prototype;function Ca(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||$T;return e===n}function AT(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var kT="[object Arguments]";function bp(e){return Qe(e)&&er(e)==kT}var xp=Object.prototype,LT=xp.hasOwnProperty,RT=xp.propertyIsEnumerable,DT=bp(function(){return arguments}())?bp:function(e){return Qe(e)&&LT.call(e,"callee")&&!RT.call(e,"callee")};const Pr=DT;function IT(){return!1}var wp=typeof X=="object"&&X&&!X.nodeType&&X,_p=wp&&typeof module=="object"&&module&&!module.nodeType&&module,NT=_p&&_p.exports===wp,Ep=NT?Fe.Buffer:void 0,PT=Ep?Ep.isBuffer:void 0,UT=PT||IT;const Ur=UT;var BT="[object Arguments]",VT="[object Array]",HT="[object Boolean]",FT="[object Date]",GT="[object Error]",zT="[object Function]",jT="[object Map]",WT="[object Number]",qT="[object Object]",YT="[object RegExp]",XT="[object Set]",ZT="[object String]",KT="[object WeakMap]",QT="[object ArrayBuffer]",JT="[object DataView]",tM="[object Float32Array]",eM="[object Float64Array]",nM="[object Int8Array]",rM="[object Int16Array]",iM="[object Int32Array]",sM="[object Uint8Array]",aM="[object Uint8ClampedArray]",oM="[object Uint16Array]",lM="[object Uint32Array]",Rt={};Rt[tM]=Rt[eM]=Rt[nM]=Rt[rM]=Rt[iM]=Rt[sM]=Rt[aM]=Rt[oM]=Rt[lM]=!0,Rt[BT]=Rt[VT]=Rt[QT]=Rt[HT]=Rt[JT]=Rt[FT]=Rt[GT]=Rt[zT]=Rt[jT]=Rt[WT]=Rt[qT]=Rt[YT]=Rt[XT]=Rt[ZT]=Rt[KT]=!1;function cM(e){return Qe(e)&&Kl(e.length)&&!!Rt[er(e)]}function Ql(e){return function(t){return e(t)}}var Sp=typeof X=="object"&&X&&!X.nodeType&&X,Hi=Sp&&typeof module=="object"&&module&&!module.nodeType&&module,uM=Hi&&Hi.exports===Sp,Jl=uM&&sp.process,hM=function(){try{var e=Hi&&Hi.require&&Hi.require("util").types;return e||Jl&&Jl.binding&&Jl.binding("util")}catch{}}();const Br=hM;var Op=Br&&Br.isTypedArray,dM=Op?Ql(Op):cM;const $a=dM;var fM=Object.prototype,pM=fM.hasOwnProperty;function Tp(e,t){var n=ee(e),r=!n&&Pr(e),i=!n&&!r&&Ur(e),s=!n&&!r&&!i&&$a(e),a=n||r||i||s,o=a?AT(e.length,String):[],l=o.length;for(var c in e)(t||pM.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Zl(c,l)))&&o.push(c);return o}function Mp(e,t){return function(n){return e(t(n))}}var gM=Mp(Object.keys,Object);const mM=gM;var vM=Object.prototype,yM=vM.hasOwnProperty;function Cp(e){if(!Ca(e))return mM(e);var t=[];for(var n in Object(e))yM.call(e,n)&&n!="constructor"&&t.push(n);return t}function Fi(e){return ir(e)?Tp(e):Cp(e)}function bM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var xM=Object.prototype,wM=xM.hasOwnProperty;function _M(e){if(!Le(e))return bM(e);var t=Ca(e),n=[];for(var r in e)r=="constructor"&&(t||!wM.call(e,r))||n.push(r);return n}function Gi(e){return ir(e)?Tp(e,!0):_M(e)}var EM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,SM=/^\w*$/;function tc(e,t){if(ee(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Oa(e)?!0:SM.test(e)||!EM.test(e)||t!=null&&e in Object(t)}var OM=rr(Object,"create");const zi=OM;function TM(){this.__data__=zi?zi(null):{},this.size=0}function MM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var CM="__lodash_hash_undefined__",$M=Object.prototype,AM=$M.hasOwnProperty;function kM(e){var t=this.__data__;if(zi){var n=t[e];return n===CM?void 0:n}return AM.call(t,e)?t[e]:void 0}var LM=Object.prototype,RM=LM.hasOwnProperty;function DM(e){var t=this.__data__;return zi?t[e]!==void 0:RM.call(t,e)}var IM="__lodash_hash_undefined__";function NM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=zi&&t===void 0?IM:t,this}function sr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sr.prototype.clear=TM,sr.prototype.delete=MM,sr.prototype.get=kM,sr.prototype.has=DM,sr.prototype.set=NM;function PM(){this.__data__=[],this.size=0}function Aa(e,t){for(var n=e.length;n--;)if(Bi(e[n][0],t))return n;return-1}var UM=Array.prototype,BM=UM.splice;function VM(e){var t=this.__data__,n=Aa(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():BM.call(t,n,1),--this.size,!0}function HM(e){var t=this.__data__,n=Aa(t,e);return n<0?void 0:t[n][1]}function FM(e){return Aa(this.__data__,e)>-1}function GM(e,t){var n=this.__data__,r=Aa(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function yn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yn.prototype.clear=PM,yn.prototype.delete=VM,yn.prototype.get=HM,yn.prototype.has=FM,yn.prototype.set=GM;var zM=rr(Fe,"Map");const ji=zM;function jM(){this.size=0,this.__data__={hash:new sr,map:new(ji||yn),string:new sr}}function WM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ka(e,t){var n=e.__data__;return WM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function qM(e){var t=ka(this,e).delete(e);return this.size-=t?1:0,t}function YM(e){return ka(this,e).get(e)}function XM(e){return ka(this,e).has(e)}function ZM(e,t){var n=ka(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function bn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bn.prototype.clear=jM,bn.prototype.delete=qM,bn.prototype.get=YM,bn.prototype.has=XM,bn.prototype.set=ZM;var KM="Expected a function";function ec(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(KM);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(ec.Cache||bn),n}ec.Cache=bn;var QM=500;function JM(e){var t=ec(e,function(r){return n.size===QM&&n.clear(),r}),n=t.cache;return t}var tC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,eC=/\\(\\)?/g,nC=JM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(tC,function(n,r,i,s){t.push(i?s.replace(eC,"$1"):r||n)}),t});const rC=nC;function Wi(e){return e==null?"":hp(e)}function $p(e,t){return ee(e)?e:tc(e,t)?[e]:rC(Wi(e))}var iC=1/0;function La(e){if(typeof e=="string"||Oa(e))return e;var t=e+"";return t=="0"&&1/e==-iC?"-0":t}function Ap(e,t){t=$p(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[La(t[n++])];return n&&n==r?e:void 0}function kt(e,t,n){var r=e==null?void 0:Ap(e,t);return r===void 0?n:r}function nc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var kp=ke?ke.isConcatSpreadable:void 0;function sC(e){return ee(e)||Pr(e)||!!(kp&&e&&e[kp])}function Ra(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=sC),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Ra(o,t-1,n,r,i):nc(i,o):r||(i[i.length]=o)}return i}var aC=Mp(Object.getPrototypeOf,Object);const rc=aC;var oC="[object Object]",lC=Function.prototype,cC=Object.prototype,Lp=lC.toString,uC=cC.hasOwnProperty,hC=Lp.call(Object);function dC(e){if(!Qe(e)||er(e)!=oC)return!1;var t=rc(e);if(t===null)return!0;var n=uC.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Lp.call(n)==hC}function fC(){this.__data__=new yn,this.size=0}function pC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function gC(e){return this.__data__.get(e)}function mC(e){return this.__data__.has(e)}var vC=200;function yC(e,t){var n=this.__data__;if(n instanceof yn){var r=n.__data__;if(!ji||r.length<vC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new bn(r)}return n.set(e,t),this.size=n.size,this}function Ge(e){var t=this.__data__=new yn(e);this.size=t.size}Ge.prototype.clear=fC,Ge.prototype.delete=pC,Ge.prototype.get=gC,Ge.prototype.has=mC,Ge.prototype.set=yC;function bC(e,t){return e&&Vi(t,Fi(t),e)}function xC(e,t){return e&&Vi(t,Gi(t),e)}var Rp=typeof X=="object"&&X&&!X.nodeType&&X,Dp=Rp&&typeof module=="object"&&module&&!module.nodeType&&module,wC=Dp&&Dp.exports===Rp,Ip=wC?Fe.Buffer:void 0,Np=Ip?Ip.allocUnsafe:void 0;function Pp(e,t){if(t)return e.slice();var n=e.length,r=Np?Np(n):new e.constructor(n);return e.copy(r),r}function _C(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function Up(){return[]}var EC=Object.prototype,SC=EC.propertyIsEnumerable,Bp=Object.getOwnPropertySymbols,OC=Bp?function(e){return e==null?[]:(e=Object(e),_C(Bp(e),function(t){return SC.call(e,t)}))}:Up;const ic=OC;function TC(e,t){return Vi(e,ic(e),t)}var MC=Object.getOwnPropertySymbols,CC=MC?function(e){for(var t=[];e;)nc(t,ic(e)),e=rc(e);return t}:Up;const Vp=CC;function $C(e,t){return Vi(e,Vp(e),t)}function Hp(e,t,n){var r=t(e);return ee(e)?r:nc(r,n(e))}function sc(e){return Hp(e,Fi,ic)}function AC(e){return Hp(e,Gi,Vp)}var kC=rr(Fe,"DataView");const ac=kC;var LC=rr(Fe,"Promise");const oc=LC;var RC=rr(Fe,"Set");const Vr=RC;var Fp="[object Map]",DC="[object Object]",Gp="[object Promise]",zp="[object Set]",jp="[object WeakMap]",Wp="[object DataView]",IC=nr(ac),NC=nr(ji),PC=nr(oc),UC=nr(Vr),BC=nr(Xl),ar=er;(ac&&ar(new ac(new ArrayBuffer(1)))!=Wp||ji&&ar(new ji)!=Fp||oc&&ar(oc.resolve())!=Gp||Vr&&ar(new Vr)!=zp||Xl&&ar(new Xl)!=jp)&&(ar=function(e){var t=er(e),n=t==DC?e.constructor:void 0,r=n?nr(n):"";if(r)switch(r){case IC:return Wp;case NC:return Fp;case PC:return Gp;case UC:return zp;case BC:return jp}return t});const Hr=ar;var VC=Object.prototype,HC=VC.hasOwnProperty;function FC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&HC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var GC=Fe.Uint8Array;const Da=GC;function lc(e){var t=new e.constructor(e.byteLength);return new Da(t).set(new Da(e)),t}function zC(e,t){var n=t?lc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var jC=/\w*$/;function WC(e){var t=new e.constructor(e.source,jC.exec(e));return t.lastIndex=e.lastIndex,t}var qp=ke?ke.prototype:void 0,Yp=qp?qp.valueOf:void 0;function qC(e){return Yp?Object(Yp.call(e)):{}}function Xp(e,t){var n=t?lc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var YC="[object Boolean]",XC="[object Date]",ZC="[object Map]",KC="[object Number]",QC="[object RegExp]",JC="[object Set]",t2="[object String]",e2="[object Symbol]",n2="[object ArrayBuffer]",r2="[object DataView]",i2="[object Float32Array]",s2="[object Float64Array]",a2="[object Int8Array]",o2="[object Int16Array]",l2="[object Int32Array]",c2="[object Uint8Array]",u2="[object Uint8ClampedArray]",h2="[object Uint16Array]",d2="[object Uint32Array]";function f2(e,t,n){var r=e.constructor;switch(t){case n2:return lc(e);case YC:case XC:return new r(+e);case r2:return zC(e,n);case i2:case s2:case a2:case o2:case l2:case c2:case u2:case h2:case d2:return Xp(e,n);case ZC:return new r;case KC:case t2:return new r(e);case QC:return WC(e);case JC:return new r;case e2:return qC(e)}}function Zp(e){return typeof e.constructor=="function"&&!Ca(e)?iT(rc(e)):{}}var p2="[object Map]";function g2(e){return Qe(e)&&Hr(e)==p2}var Kp=Br&&Br.isMap,m2=Kp?Ql(Kp):g2;const v2=m2;var y2="[object Set]";function b2(e){return Qe(e)&&Hr(e)==y2}var Qp=Br&&Br.isSet,x2=Qp?Ql(Qp):b2;const w2=x2;var _2=1,E2=2,S2=4,Jp="[object Arguments]",O2="[object Array]",T2="[object Boolean]",M2="[object Date]",C2="[object Error]",tg="[object Function]",$2="[object GeneratorFunction]",A2="[object Map]",k2="[object Number]",eg="[object Object]",L2="[object RegExp]",R2="[object Set]",D2="[object String]",I2="[object Symbol]",N2="[object WeakMap]",P2="[object ArrayBuffer]",U2="[object DataView]",B2="[object Float32Array]",V2="[object Float64Array]",H2="[object Int8Array]",F2="[object Int16Array]",G2="[object Int32Array]",z2="[object Uint8Array]",j2="[object Uint8ClampedArray]",W2="[object Uint16Array]",q2="[object Uint32Array]",Lt={};Lt[Jp]=Lt[O2]=Lt[P2]=Lt[U2]=Lt[T2]=Lt[M2]=Lt[B2]=Lt[V2]=Lt[H2]=Lt[F2]=Lt[G2]=Lt[A2]=Lt[k2]=Lt[eg]=Lt[L2]=Lt[R2]=Lt[D2]=Lt[I2]=Lt[z2]=Lt[j2]=Lt[W2]=Lt[q2]=!0,Lt[C2]=Lt[tg]=Lt[N2]=!1;function Ia(e,t,n,r,i,s){var a,o=t&_2,l=t&E2,c=t&S2;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Le(e))return e;var u=ee(e);if(u){if(a=FC(e),!o)return pp(e,a)}else{var h=Hr(e),d=h==tg||h==$2;if(Ur(e))return Pp(e,o);if(h==eg||h==Jp||d&&!i){if(a=l||d?{}:Zp(e),!o)return l?$C(e,xC(a,e)):TC(e,bC(a,e))}else{if(!Lt[h])return i?e:{};a=f2(e,h,o)}}s||(s=new Ge);var f=s.get(e);if(f)return f;s.set(e,a),w2(e)?e.forEach(function(g){a.add(Ia(g,t,n,g,e,s))}):v2(e)&&e.forEach(function(g,v){a.set(v,Ia(g,t,n,v,e,s))});var p=c?l?AC:sc:l?Gi:Fi,m=u?void 0:p(e);return mT(m||e,function(g,v){m&&(v=g,g=e[v]),gp(a,v,Ia(g,t,n,v,e,s))}),a}var Y2=1,X2=4;function Z2(e){return Ia(e,Y2|X2)}var K2="__lodash_hash_undefined__";function Q2(e){return this.__data__.set(e,K2),this}function J2(e){return this.__data__.has(e)}function qi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new bn;++t<n;)this.add(e[t])}qi.prototype.add=qi.prototype.push=Q2,qi.prototype.has=J2;function ng(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function rg(e,t){return e.has(t)}var t$=1,e$=2;function ig(e,t,n,r,i,s){var a=n&t$,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=n&e$?new qi:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(r)var g=a?r(m,p,h,t,e,s):r(p,m,h,e,t,s);if(g!==void 0){if(g)continue;d=!1;break}if(f){if(!ng(t,function(v,y){if(!rg(f,y)&&(p===v||i(p,v,n,r,s)))return f.push(y)})){d=!1;break}}else if(!(p===m||i(p,m,n,r,s))){d=!1;break}}return s.delete(e),s.delete(t),d}function n$(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function cc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var r$=1,i$=2,s$="[object Boolean]",a$="[object Date]",o$="[object Error]",l$="[object Map]",c$="[object Number]",u$="[object RegExp]",h$="[object Set]",d$="[object String]",f$="[object Symbol]",p$="[object ArrayBuffer]",g$="[object DataView]",sg=ke?ke.prototype:void 0,uc=sg?sg.valueOf:void 0;function m$(e,t,n,r,i,s,a){switch(n){case g$:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case p$:return!(e.byteLength!=t.byteLength||!s(new Da(e),new Da(t)));case s$:case a$:case c$:return Bi(+e,+t);case o$:return e.name==t.name&&e.message==t.message;case u$:case d$:return e==t+"";case l$:var o=n$;case h$:var l=r&r$;if(o||(o=cc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=i$,a.set(e,t);var u=ig(o(e),o(t),r,i,s,a);return a.delete(e),u;case f$:if(uc)return uc.call(e)==uc.call(t)}return!1}var v$=1,y$=Object.prototype,b$=y$.hasOwnProperty;function x$(e,t,n,r,i,s){var a=n&v$,o=sc(e),l=o.length,c=sc(t),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var d=o[h];if(!(a?d in t:b$.call(t,d)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<l;){d=o[h];var v=e[d],y=t[d];if(r)var b=a?r(y,v,d,t,e,s):r(v,y,d,e,t,s);if(!(b===void 0?v===y||i(v,y,n,r,s):b)){m=!1;break}g||(g=d=="constructor")}if(m&&!g){var S=e.constructor,_=t.constructor;S!=_&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return s.delete(e),s.delete(t),m}var w$=1,ag="[object Arguments]",og="[object Array]",Na="[object Object]",_$=Object.prototype,lg=_$.hasOwnProperty;function E$(e,t,n,r,i,s){var a=ee(e),o=ee(t),l=a?og:Hr(e),c=o?og:Hr(t);l=l==ag?Na:l,c=c==ag?Na:c;var u=l==Na,h=c==Na,d=l==c;if(d&&Ur(e)){if(!Ur(t))return!1;a=!0,u=!1}if(d&&!u)return s||(s=new Ge),a||$a(e)?ig(e,t,n,r,i,s):m$(e,t,l,n,r,i,s);if(!(n&w$)){var f=u&&lg.call(e,"__wrapped__"),p=h&&lg.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new Ge),i(m,g,n,r,s)}}return d?(s||(s=new Ge),x$(e,t,n,r,i,s)):!1}function Pa(e,t,n,r,i){return e===t?!0:e==null||t==null||!Qe(e)&&!Qe(t)?e!==e&&t!==t:E$(e,t,n,r,Pa,i)}var S$=1,O$=2;function T$(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var l=o[0],c=e[l],u=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var h=new Ge;if(r)var d=r(c,u,l,e,t,h);if(!(d===void 0?Pa(u,c,S$|O$,r,h):d))return!1}}return!0}function cg(e){return e===e&&!Le(e)}function M$(e){for(var t=Fi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,cg(i)]}return t}function ug(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function C$(e){var t=M$(e);return t.length==1&&t[0][2]?ug(t[0][0],t[0][1]):function(n){return n===e||T$(n,e,t)}}function $$(e,t){return e!=null&&t in Object(e)}function A$(e,t,n){t=$p(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=La(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&Kl(i)&&Zl(a,i)&&(ee(e)||Pr(e)))}function k$(e,t){return e!=null&&A$(e,t,$$)}var L$=1,R$=2;function D$(e,t){return tc(e)&&cg(t)?ug(La(e),t):function(n){var r=kt(n,e);return r===void 0&&r===t?k$(n,e):Pa(t,r,L$|R$)}}function I$(e){return function(t){return t==null?void 0:t[e]}}function N$(e){return function(t){return Ap(t,e)}}function P$(e){return tc(e)?I$(La(e)):N$(e)}function Ua(e){return typeof e=="function"?e:e==null?Wl:typeof e=="object"?ee(e)?D$(e[0],e[1]):C$(e):P$(e)}function U$(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(n(s[l],l,s)===!1)break}return t}}var B$=U$();const hg=B$;function hc(e,t,n){(n!==void 0&&!Bi(e[t],n)||n===void 0&&!(t in e))&&Ma(e,t,n)}function dc(e){return Qe(e)&&ir(e)}function fc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function V$(e){return Vi(e,Gi(e))}function H$(e,t,n,r,i,s,a){var o=fc(e,n),l=fc(t,n),c=a.get(l);if(c){hc(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,h=u===void 0;if(h){var d=ee(l),f=!d&&Ur(l),p=!d&&!f&&$a(l);u=l,d||f||p?ee(o)?u=o:dc(o)?u=pp(o):f?(h=!1,u=Pp(l,!0)):p?(h=!1,u=Xp(l,!0)):u=[]:dC(l)||Pr(l)?(u=o,Pr(o)?u=V$(o):(!Le(o)||ql(o))&&(u=Zp(l))):h=!1}h&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),hc(e,n,u)}function dg(e,t,n,r,i){e!==t&&hg(t,function(s,a){if(i||(i=new Ge),Le(s))H$(e,t,a,n,dg,r,i);else{var o=r?r(fc(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),hc(e,a,o)}},Gi)}function F$(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function G$(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var z$="[object Map]",j$="[object Set]",W$=Object.prototype,q$=W$.hasOwnProperty;function ze(e){if(e==null)return!0;if(ir(e)&&(ee(e)||typeof e=="string"||typeof e.splice=="function"||Ur(e)||$a(e)||Pr(e)))return!e.length;var t=Hr(e);if(t==z$||t==j$)return!e.size;if(Ca(e))return!Cp(e).length;for(var n in e)if(q$.call(e,n))return!1;return!0}var Y$=CT(function(e,t,n){dg(e,t,n)});const rt=Y$;var X$=1/0,Z$=Vr&&1/cc(new Vr([,-0]))[1]==X$?function(e){return new Vr(e)}:aT;const K$=Z$;var Q$=200;function fg(e,t,n){var r=-1,i=wT,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=F$;else if(s>=Q$){var c=t?null:K$(e);if(c)return cc(c);a=!1,i=rg,l=new qi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],h=t?t(u):u;if(u=n||u!==0?u:0,a&&h===h){for(var d=l.length;d--;)if(l[d]===h)continue t;t&&l.push(h),o.push(u)}else i(l,h,n)||(l!==o&&l.push(h),o.push(u))}return o}var J$=vp(function(e){var t=G$(e);return dc(t)&&(t=void 0),fg(Ra(e,1,dc,!0),Ua(t))});const tA=J$;function eA(e){return e&&e.length?fg(e):[]}const xn=Z2,Yi=eA;function nA(e,t,n){let r=null;return(...i)=>{const s=this;s.mousePosition=Hn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Nt(e,t){var n;const r=xn(e),i=Object.keys(t.axes||{});(n=t==null?void 0:t.toolbar)!=null&&n.controls&&delete r.toolbar.controls,i.length===0&&delete r.axes;for(const s in r.axes)if(i.includes(s)){const a=t.axes[s];if((a.primary||a.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),a.mapsTo==null){const l=a.scaleType;l==null?a.mapsTo="value":l===Z.TIME?a.mapsTo="date":l===Z.LABELS&&(a.mapsTo="key")}}else delete r.axes[s];return pc(r,t),rt(r,t)}function wn(e){if(!e)return;const t=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=e.getAttribute("transform").match(t);if(!n)return null;if(n[0]){const r=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:r[0],ty:r[1]}}return null}function Xi(e){const t=/\(([^)]+)\)/.exec(e);if(t&&t.length>1){const n=t[1].split(",");if(n.length>1)return{x:parseFloat(n[0]),y:parseFloat(n[1])}}return{x:0,y:0}}function pg(e,t,n="value"){const r=e/t.reduce((i,s)=>i+s[n],0)*100;return r%1!==0?parseFloat(r.toFixed(1)):r}function Zi(e,t,n){if(n>e.length)return e;if(t===Ve.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ve.FRONT_LINE)return"..."+e.substr(-n);if(t===Ve.END_LINE)return e.substr(0,n)+"..."}function pc(e,t){const n=x(e,"legend","additionalItems"),r=x(t,"legend","additionalItems");if(n&&r){const i=r.map(o=>o.type),s=n.map(o=>o.type),a=EO.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=tA(a,r,"name")}}const x=(e,...t)=>{let n=e;if(n){for(const r of t)if(n[r]!==null&&n[r]!==void 0)n=n[r];else return null;return n}return null},gg=(e,t)=>t===Jt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ue=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=gg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function _n(e,t,n){return n===Jt.VERTICAL?[e,t]:[t,e]}const Fr={type:Ve.END_LINE,threshold:16,numCharacter:14},rA={enabled:!0,position:Ri.BOTTOM,clickable:!0,truncation:Fr,alignment:Yt.LEFT,order:null,additionalItems:[]},iA={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},sA={enabled:!0},mg={enabled:!0,showTotal:!0,truncation:Fr,groupLabel:"Group"},vg={top:{visible:!0,includeZero:!0,truncation:Fr},bottom:{visible:!0,includeZero:!0,truncation:Fr},left:{visible:!0,includeZero:!0,truncation:Fr},right:{visible:!0,includeZero:!0,truncation:Fr}},Ba={addSpaceOnEdges:1,showDayName:!1,localeObject:tp,timeIntervalFormats:{"15seconds":{primary:"MMM d, pp",secondary:"pp"},minute:{primary:"MMM d, p",secondary:"p"},"30minutes":{primary:"MMM d, p",secondary:"p"},hourly:{primary:"MMM d, hh a",secondary:"hh a"},daily:{primary:"MMM d",secondary:"d"},weekly:{primary:"eee, MMM d",secondary:"eee"},monthly:{primary:"MMM yyyy",secondary:"MMM"},quarterly:{primary:"QQQ ''yy",secondary:"QQQ"},yearly:{primary:"yyyy",secondary:"yyyy"}}},aA=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),le={width:null,height:null,resizable:!0,theme:Wf.WHITE,tooltip:mg,legend:rA,style:{prefix:"cc"},data:{groupMapsTo:"group",loading:!1,selectedGroups:[]},color:{scale:null,pairing:{numberOfVariants:null,option:1},gradient:{enabled:!1}},toolbar:{enabled:!0,numberOfIcons:3,controls:[{type:Bt.SHOW_AS_DATATABLE},...aA?[{type:Bt.MAKE_FULLSCREEN}]:[],{type:Bt.EXPORT_CSV},{type:Bt.EXPORT_PNG},{type:Bt.EXPORT_JPG}]}},yg=rt({},le,{thematic:{projection:gn.geoNaturalEarth1}}),Ki=rt({},le,{axes:vg,timeScale:Ba,grid:iA,ruler:sA,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ke.GRAPH_VIEW}}}),or=rt({},Ki,{bars:{maxWidth:16,spacingFactor:.25},timeScale:rt(Ba,{addSpaceOnEdges:1})}),oA=rt({},or,{}),lA=rt({},or,{}),cA=rt({},or,{bars:rt({},or.bars,{dividerSize:1.5})}),uA=rt({},or,{}),gc=rt({},Ki,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),hA=gc,bg=rt({},gc,{points:{radius:3,filled:!1,enabled:!0}}),xg=rt({},bg,{timeScale:rt(Ba,{addSpaceOnEdges:0})}),dA=xg,fA=rt({},Ki,{bubble:{radiusMapsTo:"radius",radiusLabel:"Radius",radiusRange:e=>{const t=Math.min(e.width,e.height);return[t*3/400,t*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:Zt.RADIUS,name:"Radius"}]}}),pA=rt({},Ki,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Zt.AREA,name:"Poor area"},{type:Zt.AREA,name:"Satisfactory area"},{type:Zt.AREA,name:"Great area"},{type:Zt.QUARTILE,name:"Quartiles"}]}}),gA=rt({},or,{bars:{dividerSize:1.5},timeScale:rt(Ba,{addSpaceOnEdges:0})}),mA=rt({},le,{tooltip:rt({},mg,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:e=>{const t=Math.min(e.width,e.height);return[t*20/400,t*75/400]},wordMapsTo:"word"}}),wg=rt({},le,{pie:{labels:{formatter:null,enabled:!0},alignment:Yt.LEFT,sortFunction:null,valueMapsTo:"value"}}),vA=rt({},le,{legend:{enabled:!1},gauge:{type:Lr.SEMI,arcWidth:16,deltaArrow:{size:e=>e/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:e=>e/8,valueFontSize:e=>e/2.5,numberFormatter:e=>Number(e.toFixed(2))%1!==0?e.toFixed(2).toLocaleString():e.toFixed().toLocaleString(),alignment:Yt.LEFT}}),yA=rt({},wg,{donut:{center:{numberFontSize:e=>`${Math.min(e/100*24,24)}px`,titleFontSize:e=>`${Math.min(e/100*15,15)}px`,titleYPosition:e=>Math.min(e/80*20,20),numberFormatter:e=>Math.floor(e).toLocaleString()},alignment:Yt.LEFT}}),_g=rt({},le,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),bA=rt({},_g,{legend:{enabled:!0}}),xA=rt({},le,{radar:{axes:{angle:"key",value:"value"},alignment:Yt.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),wA=rt({},or,{comboChartTypes:[]}),_A=rt({tree:{type:Hl.TREE}},le,{}),EA=rt({},le,{data:rt(le.data,{groupMapsTo:"name"})}),SA=rt({},le,Nr,{data:rt(le.data,{groupMapsTo:"name"})}),OA=rt({},le,{alluvial:{data:rt(le.data,{groupMapsTo:"source"}),nodeAlignment:Yt.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),TA=rt({},le,{axes:vg,heatmap:{divider:{state:Ii.AUTO},colorLegend:{type:"linear"}}}),MA=rt({},yg,{choropleth:{colorLegend:{type:"linear"}}}),Tt={alluvialChart:OA,areaChart:xg,axisChart:Ki,boxplotChart:uA,bubbleChart:fA,bulletChart:pA,chart:le,circlePackChart:SA,choroplethChart:MA,comboChart:wA,donutChart:yA,gaugeChart:vA,groupedBarChart:lA,heatmapChart:TA,histogramChart:gA,lineChart:bg,lollipopChart:hA,meterChart:_g,pieChart:wg,proportionalMeterChart:bA,radarChart:xA,scatterChart:gc,simpleBarChart:oA,stackedAreaChart:dA,stackedBarChart:cA,thematicChart:yg,treeChart:_A,treemapChart:EA,wordCloudChart:mA};var Eg=(e=>(e["15seconds"]="15seconds",e.minute="minute",e["30minutes"]="30minutes",e.hourly="hourly",e.daily="daily",e.weekly="weekly",e.monthly="monthly",e.quarterly="quarterly",e.yearly="yearly",e))(Eg||{});const mc=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function Sg(e,t,n,r,i){const s=t===0,a=Number(Dr(new Date(e),"c"))===2,o=Number(Dr(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ha(e)||Qi(e,l)||Rn(e);case"minute":return s||Ha(e)||Qi(e,l)||Rn(e);case"30minutes":return s||Ha(e)||Qi(e,l)||Rn(e);case"hourly":return s||Ha(e)||Qi(e,l)||Rn(e);case"daily":return i?s||a||Rn(e):s||Qi(e,l)||Rn(e);case"weekly":return s||a||Rn(e);case"monthly":return s||Rn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function vc(e,t,n,r,i){const s=i.showDayName,a=r==="daily"&&s?"weekly":r,o=new Date(e),l=x(i,"timeIntervalFormats")[a],c=x(l,"primary"),u=x(l,"secondary");let h=Sg(e,t,n,r,s)?c:u;r==="15seconds"&&o.getMilliseconds()!==0&&(h=h.replace("pp","h:mm:ss.SSS a"));const d=i.localeObject;return Dr(o,h,{locale:d})}function Va(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function CA(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function $A(e){const t=mc.reduce((n,[,r],i)=>{const s=mc[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return mc[t][0]}function yc(e,t){if(Eg[t])return t;if(e.length===1)return"15seconds";const n=CA(e),r=Mn(n);return $A(r)}function Ha(e){const{s:t,m:n,H:r}=Va(e);return r===0&&n===0&&t===0}function Qi(e,t){const n=Va(e).M,r=Va(t).M;return n!==r}function Rn(e){const{M:t,d:n,s:r,m:i,H:s}=Va(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Og(e){return e===void 0?"":e.toISOString()}function Tg(e){const t=De(e,r=>r.value),n=Be().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}function Mg(e,t){const n=x(t,"gradient","colors"),r=!ze(n);let i=x(t,"pairing","option");const s=Tg(e),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const l=a==="diverge"?17:11;for(let c=1;c<l+1;c++)o.push(`fill-${a}-${i}-${c}`)}return xl().domain(s).range(o)}var lt=(e=>(e.GRAPHICS_DOCUMENT="graphics-document",e.GRAPHICS_OBJECT="graphics-object",e.GRAPHICS_SYMBOL="graphics-symbol",e.GROUP="group",e.DOCUMENT="document",e.CHECKBOX="checkbox",e.BUTTON="button",e.MENU="menu",e.MENU_ITEM="menuitem",e.IMG="img",e))(lt||{});function AA(e,t){return e&&hg(e,t,Fi)}function kA(e,t){return function(n,r){if(n==null)return n;if(!ir(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var LA=kA(AA);const bc=LA;function RA(e,t,n,r){for(var i=-1,s=e==null?0:e.length;++i<s;){var a=e[i];t(r,a,n(a),e)}return r}function DA(e,t,n,r){return bc(e,function(i,s,a){t(r,i,n(i),a)}),r}function IA(e,t){return function(n,r){var i=ee(n)?RA:DA,s=t?t():{};return i(n,e,Ua(r),s)}}function NA(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}var PA=Object.prototype,UA=PA.hasOwnProperty,BA=IA(function(e,t,n){UA.call(e,n)?e[n].push(t):Ma(e,n,[t])});const VA=BA;class Je{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}getAllDataFromDomain(t){if(!this.getData())return null;const n=this.getOptions();let r=this.getData();const i=this.getDataGroups(),{groupMapsTo:s}=x(n,"data"),a=x(n,"axes");return t&&(r=r.filter(o=>t.includes(o[s]))),a&&Object.keys(a).forEach(o=>{const l=a[o].mapsTo,c=a[o].scaleType;if((c===Z.LINEAR||c===Z.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===Z.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,h]=a[o].domain;r=r.filter(d=>!(l in d)||d[l]>=u&&d[l]<=h)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=Vt.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(s=>r.find(a=>a.name===s[i]&&a.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(xn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),n}getDataGroups(t){return x(this.getOptions(),"data","loading")?[]:t?this.get("dataGroups").filter(n=>t.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=Vt.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(n=>n.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(n=>n.name)}aggregateBinDataByGroup(t){return VA(t,"group")}getBinConfigurations(){const t=this.getDisplayData(),n=this.getOptions(),r=this.services.cartesianScales.getMainXAxisPosition(),i=this.services.cartesianScales.getDomainIdentifier(),s=n.axes[r],{groupMapsTo:a}=n.data,{bins:o=wO.defaultBins}=s,l=Array.isArray(o),c=r0().value(f=>f[i]).thresholds(o)(t);if(l)c[c.length-1].x1=o[o.length-1];else{const f=c[0].x1-c[0].x0;c[c.length-1].x1=+c[c.length-1].x0+f}const u=l?[o[0],o[o.length-1]]:[c[0].x0,c[c.length-1].x1],h=Array.from(new Set(t.map(f=>f[a]))),d=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,m=this.aggregateBinDataByGroup(f);h.forEach(g=>{d.push({group:g,key:p,value:m[g]||0,bin:f.x0})})}),{bins:c,binsDomain:u}}getBinnedStackedData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getActiveDataGroupNames(),{bins:i}=this.getBinConfigurations(),s=this.getDataValuesGroupedByKeys({bins:i});return Vl().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}-${l.x1}`):s=Yi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Og(l[c]):l[c]&&typeof l[c].toString=="function"?l[c].toString():l[c]}));const a=this.services.cartesianScales.domainAxisPosition,o=r.axes[a].scaleType;return o===Z.TIME?s.sort((l,c)=>{const u=new Date(l),h=new Date(c);return u-h}):(o===Z.LOG||o===Z.LINEAR)&&s.sort((l,c)=>l-c),s}getDataValuesGroupedByKeys({bins:t=null,groups:n=null}){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.getDisplayData(n),a=this.getDataGroupNames(),o=this.getStackKeys({bins:t,groups:n});return t?o.map(l=>{const[c,u]=l.split("-"),h={x0:c,x1:u},d=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{h[f]=d.filter(p=>p[i]===f).length}),h}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const h=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Og(f[p])===l:f[p].toString()===l)}),d=this.services.cartesianScales.getRangeIdentifier(c);c[u]=h?h[d]:null}),c})}getStackedData({percentage:t=!1,groups:n=null,divergent:r=!1}){const i=this.getOptions(),{groupMapsTo:s}=i.data,a=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(t){const l=NA(o.map(c=>[c.sharedStackKey,0]));o.forEach(c=>{a.forEach(u=>{l[c.sharedStackKey]+=c[u]})}),o.forEach(c=>{a.forEach(u=>{const h=l[c.sharedStackKey];l[c.sharedStackKey]?c[u]=c[u]/h*100:c[u]=0})})}return(r?Vl().offset(lS):Vl()).keys(a)(o).map((l,c)=>Object.keys(l).filter(u=>!isNaN(u)).map(u=>{const h=l[u];return h[s]=a[c],h}))}getOptions(){return this.state.options}set(t,n){this.state=Object.assign({},this.state,t);const r=Object.assign({skipUpdate:!1,animate:!0},n);r.skipUpdate||this.update(r.animate)}get(t){return t?this.state[t]:this.state}setOptions(t){const n=this.getOptions();pc(n,t),this.set({options:rt(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(O.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Vt.items.status,i=this.getDataGroups(),s=i.some(c=>c.status===r),a=i.filter(c=>c.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((c,u)=>{i[u].status=n});else{const c=i.findIndex(u=>u.name===t);i[c].status=i[c].status===r?n:r}else i.forEach((c,u)=>{i[u].status=c.name===t?n:r});const o=i.filter(c=>c.status===n),l=this.getOptions();i.some(c=>c.status===r)?l.data.selectedGroups=o.map(c=>c.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(O.Legend.ITEMS_UPDATE,{dataGroups:i}),this.set({dataGroups:i})}getIsFilled(t,n,r,i){const s=this.getOptions();return s.getIsFilled?s.getIsFilled(t,n,r,i):i}getFillColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getFillColor?i.getFillColor(t,n,r,s):s}getStrokeColor(t,n,r){const i=this.getOptions(),s=x(this.colorScale,t);return i.getStrokeColor?i.getStrokeColor(t,n,r,s):s}isUserProvidedColorScaleValid(){const t=x(this.getOptions(),"color","scale"),n=this.getDataGroups();return t==null||Object.keys(t).length==0?!1:n.some(r=>Object.keys(t).includes(r.name))}getColorClassName(t){const n=this.colorClassNames(t.dataGroupName);let r=t.originalClassName;return t.classNameTypes.forEach(i=>r=t.originalClassName?`${r} ${i}-${n}`:`${i}-${n}`),r||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(t){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:r,labels:i}=t;return r.forEach(s=>{s.data.forEach((a,o)=>{let l;const c=x(s,"label");if(c===null){const h=x(i,o);h?l=h:l="Ungrouped"}else l=c;const u={group:l,key:i[o]};isNaN(a)?(u.value=a.value,u.date=a.date):u.value=a,n.push(u)})}),n}getTabularDataArray(){return[]}exportToCSV(){const t=this.getTabularDataArray().map(i=>i.map(s=>`"${s==="&ndash;"?"–":s}"`));let n="",r="";t.forEach(function(i,s){r=i.join(","),n+=s<t.length?r+`
2
+ `:r}),this.services.files.downloadCSV(n,"myChart.csv")}getTabularData(t){return Array.isArray(t)?t:this.transformToTabularData(t)}sanitize(t){return t=this.getTabularData(t),t}updateAllDataGroups(){this.allDataGroups?this.getDataGroupNames().forEach(t=>{this.allDataGroups.indexOf(t)===-1&&this.allDataGroups.push(t)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(t){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:r,DISABLED:i}=Vt.items.status,s=this.getOptions(),a=Yi(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(l=>a.includes(l))||(s.data.selectedGroups=[]));const o=l=>!s.data.selectedGroups.length||s.data.selectedGroups.includes(l)?r:i;return a.map(l=>({name:l,status:o(l)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const t=this.getOptions(),n=x(t,"color","scale");Object.keys(n).forEach(r=>{this.allDataGroups.includes(r)||console.warn(`"${r}" does not exist in data groups.`)}),this.allDataGroups.filter(r=>n[r]).forEach(r=>this.colorScale[r]=n[r])}setColorClassNames(){const t=x(this.getOptions(),"color","pairing");let n=x(t,"numberOfVariants");(!n||n<this.allDataGroups.length)&&(n=this.allDataGroups.length);let r=x(t,"option");const i=ep.pairingOptions,s=n>5?14:n,a=`${s}-color`;r=r<=i[a]?r:1;const o=this.allDataGroups.map((l,c)=>`${s}-${r}-${c%14+1}`);this.colorClassNames=Js().range(o).domain(this.allDataGroups)}}class lr extends Je{constructor(t){super(t),this.axisFlavor=ba.DEFAULT}assignRangeAndDomains(){const{cartesianScales:t}=this.services,n=this.getOptions(),r=t.isDualAxes(),i={primaryDomain:t.domainAxisPosition,primaryRange:t.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return r&&(i.secondaryDomain=t.secondaryDomainAxisPosition,i.secondaryRange=t.secondaryRangeAxisPosition),Object.keys(i).forEach(s=>{const a=i[s];t.scales[a]?i[s]={position:a,label:t.getScaleLabel(a),identifier:x(n,"axes",a,"mapsTo")}:i[s]=null}),i}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{cartesianScales:i}=this.services,{primaryDomain:s,primaryRange:a,secondaryDomain:o,secondaryRange:l}=this.assignRangeAndDomains(),c=i.getDomainAxisScaleType();let u;return c===Z.TIME&&(u=h=>Dr(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...l?[l.label]:[]],...t.map(h=>[h[r],h[s.identifier]===null?"&ndash;":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"&ndash;":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"&ndash;":h[o.identifier]]:[],...l?[h[l.identifier]===null||isNaN(h[l.identifier])?"&ndash;":h[l.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),x(this.getOptions(),"zoomBar",H.TOP,"enabled"))){const r=x(this.getOptions(),"zoomBar",H.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(xn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=Yi(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(h=>{h[s].getTime()===l&&(c+=h[a])}),u[s]=new Date(l),u[a]=c,u})}this.set({zoomBarData:r})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(t){const n=this.getOptions();if(!n.axes)return t;const r=[];return Object.keys(H).forEach(i=>{const s=H[i],a=n.axes[s];if(a&&a.scaleType===Z.TIME){const o=a.mapsTo;(o!==null||o!==void 0)&&r.push(o)}}),r.length>0&&t.forEach(i=>{r.forEach(s=>{x(i,s,"getTime")===null&&(i[s]=new Date(i[s]))})}),t}sanitize(t){return t=super.sanitize(t),t=this.sanitizeDateValues(t),t}}let HA=class extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();return t.sort((n,r)=>n.source.localeCompare(r.source)),[["Source","Target","Value"],...t.map(n=>[n.source,n.target,n.value])]}},FA=class extends lr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:ho(t,.25),q_50:ho(t,.5),q_75:ho(t,.75)}}getBoxplotData(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getGroupedData(),i=[];for(const{name:s,data:a}of r){const o=this.services.cartesianScales.getRangeIdentifier(),l=a.map(b=>b[o]).sort(xe),c={[n]:s,counts:l,quartiles:this.getBoxQuartiles(l),outliers:null,whiskers:null},u=c.quartiles.q_25,h=c.quartiles.q_75,d=(h-u)*1.5,f=u-d,p=h+d,m=[],g=[];for(const b of l)b<f||b>p?m.push(b):g.push(b);c.outliers=m;const v=Mn(g),y=Vn(g);c.whiskers={min:v||Mn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||Vn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75])},i.push(c)}return i}getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBoxplotData();return[["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],...r.map(i=>{let s=x(i,"outliers");return(s===null||s.length===0)&&(s=["&ndash;"]),[i[n],x(i,"whiskers","min")!==null?x(i,"whiskers","min").toLocaleString():"&ndash;",x(i,"quartiles","q_25")!==null?x(i,"quartiles","q_25").toLocaleString():"&ndash;",x(i,"quartiles","q_50")!==null?x(i,"quartiles","q_50").toLocaleString():"&ndash;",x(i,"quartiles","q_75")!==null?x(i,"quartiles","q_75").toLocaleString():"&ndash;",x(i,"whiskers","max")!==null?x(i,"whiskers","max").toLocaleString():"&ndash;",x(i,"quartiles","q_75")!==null&&x(i,"quartiles","q_25")!==null?(x(i,"quartiles","q_75")-x(i,"quartiles","q_25")).toLocaleString():"&ndash;",s.map(a=>a.toLocaleString()).join(",")]})]}setColorClassNames(){const t=x(this.getOptions(),"color","pairing");let n=x(t,"option");const r=ep.pairingOptions;n=n<=r["1-color"]?n:1;const i=this.allDataGroups.map(()=>`1-${n}-1`);this.colorClassNames=Js().range(i).domain(this.allDataGroups)}},GA=class extends lr{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),s=x(n,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(a=>[a.title,a[r],a.value===null?"&ndash;":a.value,x(a,"marker")===null?"&ndash;":a.marker,x(a,"marker")===null?"&ndash;":`${Math.floor(a[i]/a.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(a)]])]}},zA=class extends Je{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(ze(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!ze(n)&&!ze(t.geoData.objects.countries)&&(t.geoData.objects.countries.geometries.forEach(r=>{this._matrix[r.properties.NAME]=r}),n.forEach(r=>{this._matrix[r.name]?this._matrix[r.name].value=r.value||null:console.warn(`Data point ${r} is missing geographical data.`)}))}return this._matrix}getTabularDataArray(){const t=this.getDisplayData();return[["Country ID","Country Name","Value"],...t.map(n=>[n.id===null?"&ndash;":n.id,n.name,n.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=x(this.getOptions(),"color");this._colorScale=Mg(this.getDisplayData(),t)}},jA=class extends Je{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=rt({},t,this.getZoomOptions(t));pc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:rt(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&x(n,0,"children")?x(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),x(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:Zt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent","Value"]];return t.forEach(r=>{let i=r.value?r.value:0;r.children&&(i+=this.getChildrenDatums(r.children,r.name,n,0)),n.push(["&ndash;",r.name,i])}),n}getChildrenDatums(t,n,r=[],i=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(i+=a.value),l+=this.getChildrenDatums(a.children,o,r,l),r.push([o,s,l]),i+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,i+=a.value),r.push([a.name,s,c])}}),i}},WA=class extends Je{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(i=>[i[r],i.value===null?"&ndash;":i.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((n,r)=>r.value-n.value)}},qA=class extends Je{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data;return[["Group","Value"],...t.map(i=>[i[r],i.value===null?"&ndash;":i.value.toLocaleString()])]}},YA=class extends lr{constructor(t){super(t),this.axisFlavor=ba.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=x(this.getOptions(),"axes");if(x(n,"left","scaleType")&&x(n,"left","scaleType")!==Z.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==Z.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==Z.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==Z.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=De(this.getDisplayData(),r=>r.value),n=Be().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(ze(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(ze(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(ze(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=xn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(xn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){ze(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains();return[[n.label,r.label,"Value"],...t.map(i=>[i[n.identifier]===null?"&ndash;":i[n.identifier],i[r.identifier]===null?"&ndash;":i[r.identifier].toLocaleString(),i.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!ze(n);let i=x(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=xl().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=Mg(this.getDisplayData(),l)}},XA=class extends lr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[kt(t,"bins.rangeLabel")||"Range",...r.map(i=>kt(i,`0.${n}`))],...kt(r,0).map((i,s)=>[`${kt(i,"data.x0")} – ${kt(i,"data.x1")}`,...r.map(a=>kt(a[s],`data.${kt(a[s],n)}`))])]}},ZA=class extends Je{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((n,r)=>n+r.value,0)}getFillColor(t){const n=this.getOptions(),r=x(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=x(this.getDisplayData()),{value:r}=n?n.reduce((a,o)=>({value:a.value+o.value})):0,i=x(t,"meter","proportional")?r:r>100?100:r,s=x(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=x(n,"meter","proportional");let a=[],o;if(s===null){o=100;const l=t[0];a=[["Group","Value",...i?["Status"]:[]],[l[r],l.value,...i?[i]:[]]]}else o=x(s,"total")||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[r],c.value,(c.value/o*100).toFixed(2)+" %"])];return a}},KA=class extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),s=x(n,"0","data").map(a=>a[r]);return[["Group",...s],...n.map(a=>[a.name,...s.map((o,l)=>x(a,"data",l,i)!==null?x(a,"data",l,i).toLocaleString():"&ndash;")])]}},QA=class extends Je{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"&ndash;"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}};class JA extends Je{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Group","Value"]];return t.forEach(r=>{Array.isArray(r.children)?r.children.forEach(i=>{n.push([i.name,r.name,i.value])}):x(r.name)!==null&&x(r.value)&&n.push(["–",r.name,r.value])}),n}}let tk=class extends Je{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data;return[[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],...t.map(a=>[a[i],a[s],a[r]])]}};var ek=/\s/;function nk(e){for(var t=e.length;t--&&ek.test(e.charAt(t)););return t}var rk=/^\s+/;function ik(e){return e&&e.slice(0,nk(e)+1).replace(rk,"")}var Cg=0/0,sk=/^[-+]0x[0-9a-f]+$/i,ak=/^0b[01]+$/i,ok=/^0o[0-7]+$/i,lk=parseInt;function Ji(e){if(typeof e=="number")return e;if(Oa(e))return Cg;if(Le(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Le(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ik(e);var n=ak.test(e);return n||ok.test(e)?lk(e.slice(2),n?2:8):sk.test(e)?Cg:+e}var ck=function(){return Fe.Date.now()};const xc=ck;var uk="Expected a function",hk=Math.max,dk=Math.min;function Fa(e,t,n){var r,i,s,a,o,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(uk);t=Ji(t)||0,Le(n)&&(u=!!n.leading,h="maxWait"in n,s=h?hk(Ji(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function f(E){var T=r,R=i;return r=i=void 0,c=E,a=e.apply(R,T),a}function p(E){return c=E,o=setTimeout(v,t),u?f(E):a}function m(E){var T=E-l,R=E-c,N=t-T;return h?dk(N,s-R):N}function g(E){var T=E-l,R=E-c;return l===void 0||T>=t||T<0||h&&R>=s}function v(){var E=xc();if(g(E))return y(E);o=setTimeout(v,m(E))}function y(E){return o=void 0,d&&r?f(E):(r=i=void 0,a)}function b(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function S(){return o===void 0?a:y(xc())}function _(){var E=xc(),T=g(E);if(r=arguments,i=this,l=E,T){if(o===void 0)return p(l);if(h)return clearTimeout(o),o=setTimeout(v,t),f(l)}return o===void 0&&(o=setTimeout(v,t)),a}return _.cancel=b,_.flush=S,_}function fk(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const pk=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function En(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Ga(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function gk(e){const t=Ga(e,"border-left-width"),n=Ga(e,"border-right-width");return e.clientWidth+t+n}function mk(e){const t=Ga(e,"border-top-width"),n=Ga(e,"border-bottom-width");return e.clientHeight+t+n}function $g(e,t={}){const n=t.width||gk(e),r=t.height||mk(e);return{width:n,height:r}}function vk(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Oe=16384;function yk(e){(e.width>Oe||e.height>Oe)&&(e.width>Oe&&e.height>Oe?e.width>e.height?(e.height*=Oe/e.width,e.width=Oe):(e.width*=Oe/e.height,e.height=Oe):e.width>Oe?(e.height*=Oe/e.width,e.width=Oe):(e.width*=Oe/e.height,e.height=Oe))}function za(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function bk(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function xk(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),bk(i)}const me=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||me(n,t)};function wk(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function _k(e){return En(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function Ek(e,t,n){const r=`.${e}:${t}`,i=n.cssText?wk(n):_k(n);return document.createTextNode(`${r}{${i}}`)}function Ag(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=pk();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(Ek(s,n,r)),t.appendChild(a)}function Sk(e,t){Ag(e,t,":before"),Ag(e,t,":after")}const kg="application/font-woff",Lg="image/jpeg",Ok={woff:kg,woff2:kg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Lg,jpeg:Lg,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Tk(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function wc(e){const t=Tk(e).toLowerCase();return Ok[t]||""}function Mk(e){return e.split(/,/)[1]}function _c(e){return e.search(/^(data:)/)!==-1}function Rg(e,t){return`data:${t};base64,${e}`}async function Dg(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((s,a)=>{const o=new FileReader;o.onerror=a,o.onloadend=()=>{try{s(n({res:r,result:o.result}))}catch(l){a(l)}},o.readAsDataURL(i)})}const Ec={};function Ck(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Sc(e,t,n){const r=Ck(e,t,n.includeQueryParams);if(Ec[r]!=null)return Ec[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Dg(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),Mk(o)));i=Rg(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return Ec[r]=i,i}async function $k(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):za(t)}async function Ak(e,t){if(e.currentSrc){const s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a==null||a.drawImage(e,0,0,s.width,s.height);const o=s.toDataURL();return za(o)}const n=e.poster,r=wc(n),i=await Sc(n,r,t);return za(i)}async function kk(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await ja(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function Lk(e,t){return me(e,HTMLCanvasElement)?$k(e):me(e,HTMLVideoElement)?Ak(e,t):me(e,HTMLIFrameElement)?kk(e):e.cloneNode(!1)}const Rk=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function Dk(e,t,n){var r,i;let s=[];return Rk(e)&&e.assignedNodes?s=En(e.assignedNodes()):me(e,HTMLIFrameElement)&&!((r=e.contentDocument)===null||r===void 0)&&r.body?s=En(e.contentDocument.body.childNodes):s=En(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||me(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>ja(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function Ik(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):En(r).forEach(i=>{let s=r.getPropertyValue(i);i==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),me(e,HTMLIFrameElement)&&i==="display"&&s==="inline"&&(s="block"),i==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),n.setProperty(i,s,r.getPropertyPriority(i))})}function Nk(e,t){me(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),me(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Pk(e,t){if(me(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function Uk(e,t){return me(t,Element)&&(Ik(e,t),Sk(e,t),Nk(e,t),Pk(e,t)),t}async function Bk(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let s=0;s<n.length;s++){const a=n[s].getAttribute("xlink:href");if(a){const o=e.querySelector(a),l=document.querySelector(a);!o&&l&&!r[a]&&(r[a]=await ja(l,t,!0))}}const i=Object.values(r);if(i.length){const s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const o=document.createElementNS(s,"defs");a.appendChild(o);for(let l=0;l<i.length;l++)o.appendChild(i[l]);e.appendChild(a)}return e}async function ja(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Lk(r,t)).then(r=>Dk(e,r,t)).then(r=>Uk(e,r)).then(r=>Bk(r,t))}const Ig=/url\((['"]?)([^'"]+?)\1\)/g,Vk=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Hk=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Fk(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Gk(e){const t=[];return e.replace(Ig,(n,r,i)=>(t.push(i),n)),t.filter(n=>!_c(n))}async function zk(e,t,n,r,i){try{const s=n?fk(t,n):t,a=wc(t);let o;if(i){const l=await i(s);o=Rg(l,a)}else o=await Sc(s,a,r);return e.replace(Fk(t),`$1${o}$3`)}catch{}return e}function jk(e,{preferredFontFormat:t}){return t?e.replace(Hk,n=>{for(;;){const[r,,i]=Vk.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ng(e){return e.search(Ig)!==-1}async function Pg(e,t,n){if(!Ng(e))return e;const r=jk(e,n);return Gk(r).reduce((i,s)=>i.then(a=>zk(a,s,t,n)),Promise.resolve(r))}async function Wa(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Pg(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function Wk(e,t){await Wa("background",e,t)||await Wa("background-image",e,t),await Wa("mask",e,t)||await Wa("mask-image",e,t)}async function qk(e,t){const n=me(e,HTMLImageElement);if(!(n&&!_c(e.src))&&!(me(e,SVGImageElement)&&!_c(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Sc(r,wc(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=a;const o=e;o.decode&&(o.decode=s),o.loading==="lazy"&&(o.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function Yk(e,t){const n=En(e.childNodes).map(r=>Ug(r,t));await Promise.all(n).then(()=>e)}async function Ug(e,t){me(e,Element)&&(await Wk(e,t),await qk(e,t),await Yk(e,t))}function Xk(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const Bg={};async function Vg(e){let t=Bg[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Bg[e]=t,t}async function Hg(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),Dg(a,t.fetchRequestInit,({result:o})=>(n=n.replace(s,`url(${o})`),[s,o]))});return Promise.all(i).then(()=>n)}function Fg(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=o.exec(r),l===null)break;s.lastIndex=o.lastIndex}else o.lastIndex=s.lastIndex;t.push(l[0])}return t}async function Zk(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{En(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Vg(l).then(u=>Hg(u,t)).then(u=>Fg(u).forEach(h=>{try{i.insertRule(h,h.startsWith("@import")?o+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:h,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(s){const a=e.find(o=>o.href==null)||document.styleSheets[0];i.href!=null&&r.push(Vg(i.href).then(o=>Hg(o,t)).then(o=>Fg(o).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{En(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function Kk(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ng(t.style.getPropertyValue("src")))}async function Qk(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=En(e.ownerDocument.styleSheets),r=await Zk(n,t);return Kk(r)}async function Jk(e,t){const n=await Qk(e,t);return(await Promise.all(n.map(r=>{const i=r.parentStyleSheet?r.parentStyleSheet.href:null;return Pg(r.cssText,i,t)}))).join(`
3
+ `)}async function tL(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Jk(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function eL(e,t={}){const{width:n,height:r}=$g(e,t),i=await ja(e,t,!0);return await tL(i,t),await Ug(i,t),Xk(i,t),await xk(i,n,r)}async function Gg(e,t={}){const{width:n,height:r}=$g(e,t),i=await eL(e,t),s=await za(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||vk(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||yk(a),a.style.width=`${c}`,a.style.height=`${u}`,t.backgroundColor&&(o.fillStyle=t.backgroundColor,o.fillRect(0,0,a.width,a.height)),o.drawImage(s,0,0,a.width,a.height),a}async function nL(e,t={}){return(await Gg(e,t)).toDataURL()}async function rL(e,t={}){return(await Gg(e,t)).toDataURL("image/jpeg",t.quality||1)}class Sn{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const iL="DONT_STYLE_ME_css_styles_verifier";class L extends Sn{constructor(t,n){super(t,n),this.chartID=""}static getHTMLElementSize(t){return{width:t.clientWidth,height:t.clientHeight}}static getSVGElementSize(t,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){t.attr||(t=D(t));const r={width:0,height:0},i=d=>{d&&Object.keys(r).forEach(f=>{if(d[f]){const p=d[f],m=parseFloat(p);p&&m>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=m)}})},s={width:t.attr("width"),height:t.attr("height")},a=t.node();let o,l,c,u;try{typeof a.getBBox=="function"&&(o=a.getBBox(),l={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(d){console.error(d)}let h;if(a instanceof SVGSVGElement&&(h={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(h),r.width>0&&r.height>0))return h;if(n.useBBox&&(i(l),r.width>0&&r.height>0))return l;if(n.useBoundingRect&&(i(u),r.width>0&&r.height>0))return u}try{const d={width:x(t.node(),"width","baseVal","value"),height:x(t.node(),"height","baseVal","value")};i(d)}catch{i(h),i(l),i(s)}return r}static appendOrSelect(t,n){const r=t.select(`${n}`);if(r.empty()){let i=n.split("#"),s,a;return i.length===2?(s=i[0],i=i[1].split("."),a=i[0]):(i=n.split("."),s=i[0]),t.append(s).attr("id",a).attr("class",i.slice(1).join(" "))}return r}init(){this.styleHolderElement(),this.initializeID(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}generateElementIDString(t){return`chart-${this.chartID}-${t}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const t=this.model.getOptions(),n=x(t,"style","prefix"),r=D(this.getHolder()).append("div").classed(`${ge}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",iL),this.mainContainer=r.node()}update(){this.styleHolderElement()}styleHolderElement(){const t=this.getHolder(),{width:n,height:r,theme:i}=this.model.getOptions();n!==this.width&&(t.style.width=n,this.width=n),r!==this.height&&(t.style.height=r,this.height=r),D(this.getHolder()).classed(`${ge}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.getHolder(),r=D(n);r.classed("filled",!0),rL(this.getMainContainer(),{quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.jpg"),r.classed("filled",!1)})}exportToPNG(){const t=this,n=this.getHolder(),r=D(n);r.classed("filled",!0),nL(this.getMainContainer(),{quality:1,filter:i=>!(i.classList&&i.classList.contains("cds--cc--toolbar"))}).then(function(i){var s;(s=t.services.files)==null||s.downloadImage(i,"myChart.png"),r.classed("filled",!1)}).catch(function(i){console.error("oops, something went wrong!",i)})}toggleFullscreen(){const t=this.getHolder();D(t).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.msRequestFullscreen&&t.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const t=D(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=L.getSVGElementSize(D(this.mainContainer),{useBBox:!0}),n=D(this.mainContainer).attr("class"),r=D(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(L.getSVGElementSize(D(s),{useBBox:!0}).height)}),i<=t?D(this.mainContainer).attr("height",i):D(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&D(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(O.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Fa(()=>{var s;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(s=this.services.events)==null||s.dispatchEvent(O.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}}let Oc=class Uv extends Sn{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:Uv.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}};function zg(e){const t=sL(jg(e),360);return Dn(t,[0,10])||Dn(t,[350,0])?{textAnchor:fn.START,dominantBaseline:pn.MIDDLE}:Dn(t,[10,80])?{textAnchor:fn.START,dominantBaseline:pn.HANGING}:Dn(t,[80,100])?{textAnchor:fn.MIDDLE,dominantBaseline:pn.HANGING}:Dn(t,[100,170])?{textAnchor:fn.END,dominantBaseline:pn.HANGING}:Dn(t,[170,190])?{textAnchor:fn.END,dominantBaseline:pn.MIDDLE}:Dn(t,[190,260])?{textAnchor:fn.END,dominantBaseline:pn.BASELINE}:Dn(t,[260,280])?{textAnchor:fn.MIDDLE,dominantBaseline:pn.BASELINE}:{textAnchor:fn.START,dominantBaseline:pn.BASELINE}}function sL(e,t){return(e%t+t)%t}function Dn(e,[t,n]){return e>=t&&e<=n}function jg(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function aL(e,t){return t*Math.sin(e-Math.PI/2)}function Wg(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 oL(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 Tc(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function lL(e){return e.depth}function cL(e,t){return t-1-e.height}function qg(e,t){return e.sourceLinks.length?e.depth:t-1}function qa(e){return function(){return e}}function Yg(e,t){return Ya(e.source,t.source)||e.index-t.index}function Xg(e,t){return Ya(e.target,t.target)||e.index-t.index}function Ya(e,t){return e.y0-t.y0}function Mc(e){return e.value}function uL(e){return e.index}function hL(e){return e.nodes}function dL(e){return e.links}function Zg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Kg({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function fL(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=uL,l=qg,c,u,h=hL,d=dL,f=6;function p(){const w={nodes:h.apply(null,arguments),links:d.apply(null,arguments)};return m(w),g(w),v(w),y(w),_(w),Kg(w),w}p.update=function(w){return Kg(w),w},p.nodeId=function(w){return arguments.length?(o=typeof w=="function"?w:qa(w),p):o},p.nodeAlign=function(w){return arguments.length?(l=typeof w=="function"?w:qa(w),p):l},p.nodeSort=function(w){return arguments.length?(c=w,p):c},p.nodeWidth=function(w){return arguments.length?(i=+w,p):i},p.nodePadding=function(w){return arguments.length?(s=a=+w,p):s},p.nodes=function(w){return arguments.length?(h=typeof w=="function"?w:qa(w),p):h},p.links=function(w){return arguments.length?(d=typeof w=="function"?w:qa(w),p):d},p.linkSort=function(w){return arguments.length?(u=w,p):u},p.size=function(w){return arguments.length?(e=t=0,n=+w[0],r=+w[1],p):[n-e,r-t]},p.extent=function(w){return arguments.length?(e=+w[0][0],n=+w[1][0],t=+w[0][1],r=+w[1][1],p):[[e,t],[n,r]]},p.iterations=function(w){return arguments.length?(f=+w,p):f};function m({nodes:w,links:P}){for(const[I,B]of w.entries())B.index=I,B.sourceLinks=[],B.targetLinks=[];const U=new Map(w.map((I,B)=>[o(I,B,w),I]));for(const[I,B]of P.entries()){B.index=I;let{source:j,target:Y}=B;typeof j!="object"&&(j=B.source=Zg(U,j)),typeof Y!="object"&&(Y=B.target=Zg(U,Y)),j.sourceLinks.push(B),Y.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:I,targetLinks:B}of w)I.sort(u),B.sort(u)}function g({nodes:w}){for(const P of w)P.value=P.fixedValue===void 0?Math.max(Tc(P.sourceLinks,Mc),Tc(P.targetLinks,Mc)):P.fixedValue}function v({nodes:w}){const P=w.length;let U=new Set(w),I=new Set,B=0;for(;U.size;){for(const j of U){j.depth=B;for(const{target:Y}of j.sourceLinks)I.add(Y)}if(++B>P)throw new Error("circular link");U=I,I=new Set}}function y({nodes:w}){const P=w.length;let U=new Set(w),I=new Set,B=0;for(;U.size;){for(const j of U){j.height=B;for(const{source:Y}of j.targetLinks)I.add(Y)}if(++B>P)throw new Error("circular link");U=I,I=new Set}}function b({nodes:w}){const P=Wg(w,B=>B.depth)+1,U=(n-e-i)/(P-1),I=new Array(P);for(const B of w){const j=Math.max(0,Math.min(P-1,Math.floor(l.call(null,B,P))));B.layer=j,B.x0=e+j*U,B.x1=B.x0+i,I[j]?I[j].push(B):I[j]=[B]}if(c)for(const B of I)B.sort(c);return I}function S(w){const P=oL(w,U=>(r-t-(U.length-1)*a)/Tc(U,Mc));for(const U of w){let I=t;for(const B of U){B.y0=I,B.y1=I+B.value*P,I=B.y1+a;for(const j of B.sourceLinks)j.width=j.value*P}I=(r-I+a)/(U.length+1);for(let B=0;B<U.length;++B){const j=U[B];j.y0+=I*(B+1),j.y1+=I*(B+1)}V(U)}}function _(w){const P=b(w);a=Math.min(s,(r-t)/(Wg(P,U=>U.length)-1)),S(P);for(let U=0;U<f;++U){const I=Math.pow(.99,U),B=Math.max(1-I,(U+1)/f);T(P,I,B),E(P,I,B)}}function E(w,P,U){for(let I=1,B=w.length;I<B;++I){const j=w[I];for(const Y of j){let et=0,pt=0;for(const{source:K,value:ht}of Y.targetLinks){let it=ht*(Y.layer-K.layer);et+=M(K,Y)*it,pt+=it}if(!(pt>0))continue;let z=(et/pt-Y.y0)*P;Y.y0+=z,Y.y1+=z,C(Y)}c===void 0&&j.sort(Ya),R(j,U)}}function T(w,P,U){for(let I=w.length,B=I-2;B>=0;--B){const j=w[B];for(const Y of j){let et=0,pt=0;for(const{target:K,value:ht}of Y.sourceLinks){let it=ht*(K.layer-Y.layer);et+=k(Y,K)*it,pt+=it}if(!(pt>0))continue;let z=(et/pt-Y.y0)*P;Y.y0+=z,Y.y1+=z,C(Y)}c===void 0&&j.sort(Ya),R(j,U)}}function R(w,P){const U=w.length>>1,I=w[U];A(w,I.y0-a,U-1,P),N(w,I.y1+a,U+1,P),A(w,r,w.length-1,P),N(w,t,0,P)}function N(w,P,U,I){for(;U<w.length;++U){const B=w[U],j=(P-B.y0)*I;j>1e-6&&(B.y0+=j,B.y1+=j),P=B.y1+a}}function A(w,P,U,I){for(;U>=0;--U){const B=w[U],j=(B.y1-P)*I;j>1e-6&&(B.y0-=j,B.y1-=j),P=B.y0-a}}function C({sourceLinks:w,targetLinks:P}){if(u===void 0){for(const{source:{sourceLinks:U}}of P)U.sort(Xg);for(const{target:{targetLinks:U}}of w)U.sort(Yg)}}function V(w){if(u===void 0)for(const{sourceLinks:P,targetLinks:U}of w)P.sort(Xg),U.sort(Yg)}function M(w,P){let U=w.y0-(w.sourceLinks.length-1)*a/2;for(const{target:I,width:B}of w.sourceLinks){if(I===P)break;U+=B+a}for(const{source:I,width:B}of P.targetLinks){if(I===w)break;U-=B}return U}function k(w,P){let U=P.y0-(P.targetLinks.length-1)*a/2;for(const{source:I,width:B}of P.targetLinks){if(I===w)break;U+=B+a}for(const{target:I,width:B}of w.sourceLinks){if(I===P)break;U-=B}return U}return p}var Cc=Math.PI,$c=2*Cc,cr=1e-6,pL=$c-cr;function Ac(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Qg(){return new Ac}Ac.prototype=Qg.prototype={constructor:Ac,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,h=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>cr)if(!(Math.abs(u*o-l*c)>cr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var d=n-s,f=r-a,p=o*o+l*l,m=d*d+f*f,g=Math.sqrt(p),v=Math.sqrt(h),y=i*Math.tan((Cc-Math.acos((p+h-m)/(2*g*v)))/2),b=y/v,S=y/g;Math.abs(b-1)>cr&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+S*o)+","+(this._y1=t+S*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,h=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>cr||Math.abs(this._y1-c)>cr)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%$c+$c),h>pL?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>cr&&(this._+="A"+n+","+n+",0,"+ +(h>=Cc)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function Jg(e){return function(){return e}}function gL(e){return e[0]}function mL(e){return e[1]}var vL=Array.prototype.slice;function yL(e){return e.source}function bL(e){return e.target}function xL(e){var t=yL,n=bL,r=gL,i=mL,s=null;function a(){var o,l=vL.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Qg()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:Jg(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Jg(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function wL(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function _L(){return xL(wL)}function EL(e){return[e.source.x1,e.y0]}function SL(e){return[e.target.x0,e.y1]}function OL(){return _L().source(EL).target(SL)}function tm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function TL(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var s=Function.bind.apply(t,i);return new s}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var ML={value:function(){}};function em(){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 Xa(n)}function Xa(e){this._=e}function CL(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}})}Xa.prototype=em.prototype={constructor:Xa,on:function(e,t){var n=this._,r=CL(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=$L(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]=nm(n[i],e.name,t);else if(t==null)for(i in n)n[i]=nm(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 Xa(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 $L(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function nm(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ML,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var AL=TL(Object.freeze(Object.defineProperty({__proto__:null,dispatch:em},Symbol.toStringTag,{value:"Module"}))).dispatch,kc=Math.PI/180,ts=64,Za=2048,kL=function(){var e=[256,256],t=LL,n=RL,r=DL,i=rm,s=rm,a=IL,o=NL,l=im,c=[],u=1/0,h=AL("word","end"),d=null,f=Math.random,p={},m=GL;p.canvas=function(y){return arguments.length?(m=In(y),p):m},p.start=function(){var y=g(m()),b=FL((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,T=[],R=c.map(function(A,C){return A.text=t.call(this,A,C),A.font=n.call(this,A,C),A.style=i.call(this,A,C),A.weight=s.call(this,A,C),A.rotate=a.call(this,A,C),A.size=~~r.call(this,A,C),A.padding=o.call(this,A,C),A}).sort(function(A,C){return C.size-A.size});return d&&clearInterval(d),d=setInterval(N,0),N(),p;function N(){for(var A=Date.now();Date.now()-A<u&&++E<_&&d;){var C=R[E];C.x=e[0]*(f()+.5)>>1,C.y=e[1]*(f()+.5)>>1,PL(y,C,R,E),C.hasText&&v(b,C,S)&&(T.push(C),h.call("word",p,C),S?BL(S,C):S=[{x:C.x+C.x0,y:C.y+C.y0},{x:C.x+C.x1,y:C.y+C.y1}],C.x-=e[0]>>1,C.y-=e[1]>>1)}E>=_&&(p.stop(),h.call("end",p,T,S))}},p.stop=function(){return d&&(clearInterval(d),d=null),p};function g(y){y.width=y.height=1;var b=Math.sqrt(y.getContext("2d").getImageData(0,0,1,1).data.length>>2);y.width=(ts<<5)/b,y.height=Za/b;var S=y.getContext("2d");return S.fillStyle=S.strokeStyle="red",S.textAlign="center",{context:S,ratio:b}}function v(y,b,S){e[0],e[1];for(var _=b.x,E=b.y,T=Math.sqrt(e[0]*e[0]+e[1]*e[1]),R=l(e),N=f()<.5?1:-1,A=-N,C,V,M;(C=R(A+=N))&&(V=~~C[0],M=~~C[1],!(Math.min(Math.abs(V),Math.abs(M))>=T));)if(b.x=_+V,b.y=E+M,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!S||!UL(b,y,e[0]))&&(!S||VL(b,S))){for(var k=b.sprite,w=b.width>>5,P=e[0]>>5,U=b.x-(w<<4),I=U&127,B=32-I,j=b.y1-b.y0,Y=(b.y+b.y0)*P+(U>>5),et,pt=0;pt<j;pt++){et=0;for(var z=0;z<=w;z++)y[Y+z]|=et<<B|(z<w?(et=k[pt*w+z])>>>I:0);Y+=P}return delete b.sprite,!0}return!1}return p.timeInterval=function(y){return arguments.length?(u=y??1/0,p):u},p.words=function(y){return arguments.length?(c=y,p):c},p.size=function(y){return arguments.length?(e=[+y[0],+y[1]],p):e},p.font=function(y){return arguments.length?(n=In(y),p):n},p.fontStyle=function(y){return arguments.length?(i=In(y),p):i},p.fontWeight=function(y){return arguments.length?(s=In(y),p):s},p.rotate=function(y){return arguments.length?(a=In(y),p):a},p.text=function(y){return arguments.length?(t=In(y),p):t},p.spiral=function(y){return arguments.length?(l=zL[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=In(y),p):r},p.padding=function(y){return arguments.length?(o=In(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=h.on.apply(h,arguments);return y===h?p:y},p};function LL(e){return e.text}function RL(){return"serif"}function rm(){return"normal"}function DL(e){return Math.sqrt(e.value)}function IL(){return(~~(Math.random()*6)-3)*30}function NL(){return 1}function PL(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(ts<<5)/s,Za/s);var a=0,o=0,l=0,c=n.length;for(--r;++r<c;){t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font;var u=i.measureText(t.text+"m").width*s,h=t.size<<1;if(t.rotate){var d=Math.sin(t.rotate*kc),f=Math.cos(t.rotate*kc),p=u*f,m=u*d,g=h*f,v=h*d;u=Math.max(Math.abs(p+v),Math.abs(p-v))+31>>5<<5,h=~~Math.max(Math.abs(m+g),Math.abs(m-g))}else u=u+31>>5<<5;if(h>l&&(l=h),a+u>=ts<<5&&(a=0,o+=l,l=0),o+h>=Za)break;i.translate((a+(u>>1))/s,(o+(h>>1))/s),t.rotate&&i.rotate(t.rotate*kc),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=u,t.height=h,t.xoff=a,t.yoff=o,t.x1=u>>1,t.y1=h>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=u}for(var y=i.getImageData(0,0,(ts<<5)/s,Za/s).data,b=[];--r>=0;)if(t=n[r],!!t.hasText){for(var u=t.width,S=u>>5,h=t.y1-t.y0,_=0;_<h*S;_++)b[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,T=-1,R=0;R<h;R++){for(var _=0;_<u;_++){var N=S*R+(_>>5),A=y[(o+R)*(ts<<5)+(a+_)<<2]?1<<31-_%32:0;b[N]|=A,E|=A}E?T=R:(t.y0++,h--,R--,o++)}t.y1=t.y0+T,t.sprite=b.slice(0,(t.y1-t.y0)*S)}}}function UL(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,s=e.x-(i<<4),a=s&127,o=32-a,l=e.y1-e.y0,c=(e.y+e.y0)*n+(s>>5),u,h=0;h<l;h++){u=0;for(var d=0;d<=i;d++)if((u<<o|(d<i?(u=r[h*i+d])>>>a:0))&t[c+d])return!0;c+=n}return!1}function BL(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function VL(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function im(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function HL(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(s){var a=s<0?-1:1;switch(Math.sqrt(1+4*a*s)-a&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function FL(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function GL(){return document.createElement("canvas")}function In(e){return typeof e=="function"?e:function(){return e}}var zL={archimedean:im,rectangular:HL};const jL=tm(kL);function WL(e,t,n,r){var i=-1,s=e==null?0:e.length;for(r&&s&&(n=e[++i]);++i<s;)n=t(n,e[i],i,e);return n}function qL(e){return function(t){return e==null?void 0:e[t]}}var YL={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},XL=qL(YL);const ZL=XL;var KL=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,QL="\\u0300-\\u036f",JL="\\ufe20-\\ufe2f",tR="\\u20d0-\\u20ff",eR=QL+JL+tR,nR="["+eR+"]",rR=RegExp(nR,"g");function iR(e){return e=Wi(e),e&&e.replace(KL,ZL).replace(rR,"")}var sR=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function aR(e){return e.match(sR)||[]}var oR=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function lR(e){return oR.test(e)}var sm="\\ud800-\\udfff",cR="\\u0300-\\u036f",uR="\\ufe20-\\ufe2f",hR="\\u20d0-\\u20ff",dR=cR+uR+hR,am="\\u2700-\\u27bf",om="a-z\\xdf-\\xf6\\xf8-\\xff",fR="\\xac\\xb1\\xd7\\xf7",pR="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gR="\\u2000-\\u206f",mR=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lm="A-Z\\xc0-\\xd6\\xd8-\\xde",vR="\\ufe0e\\ufe0f",cm=fR+pR+gR+mR,um="['’]",hm="["+cm+"]",yR="["+dR+"]",dm="\\d+",bR="["+am+"]",fm="["+om+"]",pm="[^"+sm+cm+dm+am+om+lm+"]",xR="\\ud83c[\\udffb-\\udfff]",wR="(?:"+yR+"|"+xR+")",_R="[^"+sm+"]",gm="(?:\\ud83c[\\udde6-\\uddff]){2}",mm="[\\ud800-\\udbff][\\udc00-\\udfff]",Gr="["+lm+"]",ER="\\u200d",vm="(?:"+fm+"|"+pm+")",SR="(?:"+Gr+"|"+pm+")",ym="(?:"+um+"(?:d|ll|m|re|s|t|ve))?",bm="(?:"+um+"(?:D|LL|M|RE|S|T|VE))?",xm=wR+"?",wm="["+vR+"]?",OR="(?:"+ER+"(?:"+[_R,gm,mm].join("|")+")"+wm+xm+")*",TR="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MR="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",CR=wm+xm+OR,$R="(?:"+[bR,gm,mm].join("|")+")"+CR,AR=RegExp([Gr+"?"+fm+"+"+ym+"(?="+[hm,Gr,"$"].join("|")+")",SR+"+"+bm+"(?="+[hm,Gr+vm,"$"].join("|")+")",Gr+"?"+vm+"+"+ym,Gr+"+"+bm,MR,TR,dm,$R].join("|"),"g");function kR(e){return e.match(AR)||[]}function LR(e,t,n){return e=Wi(e),t=n?void 0:t,t===void 0?lR(e)?kR(e):aR(e):e.match(t)||[]}var RR="['’]",DR=RegExp(RR,"g");function _m(e){return function(t){return WL(LR(iR(t).replace(DR,"")),e,"")}}function IR(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Em(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Ji(n),n=n===n?n:0),t!==void 0&&(t=Ji(t),t=t===t?t:0),IR(Ji(e),t,n)}function NR(e,t){var n=-1,r=ir(e)?Array(e.length):[];return bc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function PR(e,t){var n=ee(e)?lp:NR;return n(e,Ua(t))}var UR=1/0;function BR(e,t){return Ra(PR(e,t),UR)}function Sm(e,t){return Pa(e,t)}var VR=_m(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const zr=VR;function HR(e,t){var n;return bc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function FR(e,t,n){var r=ee(e)?ng:HR;return n&&yp(e,t,n)&&(t=void 0),r(e,Ua(t))}class ft{constructor(t,n,r){if(this.type="",this.renderType=Q.HTML,this.id="",this.parent=void 0,this.configs={},this.model=t,this.services=n,r&&(this.configs=r,this.configs.id)){const i=x(this.model.getOptions(),"style","prefix");this.id=`${i}--${this.configs.id}`}this.parent||this.setParent(D(this.services.domUtils.getMainContainer()))}init(){}render(t=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(t){this.model=t}setServices(t){this.services=t}setParent(t){var n;const r=this.parent;if(this.parent=t,!(r&&r.node()===t.node())&&this.type){const i=x(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${ge}--${i}--${this.type}`,!0),r&&r.classed(`${ge}--${i}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(t={withinChartClip:!1}){if(this.type){const n=x(this.model.getOptions(),"style","prefix"),r=this.id?`#${this.id}`:"",i=L.appendOrSelect(this.parent,`${this.renderType===Q.SVG?"svg":"div"}${r}.${ge}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const a=D(`#${s}`).select("rect");a.size()!==0&&parseFloat(a.attr("height"))>0&&i.attr("clip-path",`url(#${s})`)}}return i.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?rt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const Om=class extends ft{constructor(){super(...arguments),this.type="toolbar",this.renderType=Q.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(O.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(O.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",t)})}render(t=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(x(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:r,overflowMenuItemList:i}=this.getControlConfigs();i&&r.push(this.getOverflowButtonConfig());const s=n.selectAll("div.toolbar-control").data(r,l=>l.id);s.exit().remove();const a=s.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;a.merge(s).classed("disabled",l=>l.shouldBeDisabled()).attr("aria-disabled",l=>l.shouldBeDisabled()).attr("aria-label",l=>l.title).html(l=>`
4
4
  <button
5
5
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
6
6
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${l.id}`)}" aria-label="${l.title}">
7
7
  <svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
8
8
  ${l.iconSVG.content}
9
9
  </svg>
10
- </button>`).each(function(l,c){N(this).select("svg").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),N(this).select("button").on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>_(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.text)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),N(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(A.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(A.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=N(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=N(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=N(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=N(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=N(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(A.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=_(this.getOptions(),"toolbar","numberOfIcons")-1,n=_(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;a.type===Bt.CUSTOM?(_(a,"id")===null&&(a.id=`toolbar-button-${im.buttonID++}`),_(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a):o=this.getControlConfigByType(a.type),o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?_(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){return{id:"toolbar-overflow-menu",title:"More options",shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
10
+ </button>`).each(function(l,c){D(this).select("svg").style("will-change","transform").style("width",l.iconSVG.width!==void 0?l.iconSVG.width:"20px").style("height",l.iconSVG.height!==void 0?l.iconSVG.height:"20px"),D(this).select("button").on("click",u=>{l.shouldBeDisabled()||o.triggerFunctionAndEvent(l,u,this)}).on("keydown",u=>{u.key&&u.key==="Enter"||u.key===" "?(u.preventDefault(),o.triggerFunctionAndEvent(l,u,this)):u.key&&u.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(c):u.key&&u.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(c)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:t}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(t,i=>x(i,"id"));n.exit().remove();const r=n.enter().append("li").attr("id",i=>this.services.domUtils.generateElementIDString(`control-${i.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);r.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),r.merge(n).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",i=>i.shouldBeDisabled()).attr("aria-disabled",i=>i.shouldBeDisabled()).selectAll("button").text(i=>i.text)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(t){this.overflowMenu&&(this.overflowMenu.classed("is-open",t),this.overflowButton&&(this.overflowButton.attr("aria-expanded",t),D(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(O.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(O.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=D(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnNextEnabledToolbarItem(t){const n=this.getToolbarButtonItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`button#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)}`).node();"focus"in i&&i.focus()}}focusOnPreviousEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=n.length;for(let i=t-1;i>=0;i--)if(!n[i].shouldBeDisabled()){r=i;break}if(r<n.length){const i=D(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}focusOnNextEnabledMenuItem(t){const n=this.getOverflowMenuItems();let r=-1;for(let i=t+1;i<n.length;i++)if(!n[i].shouldBeDisabled()){r=i;break}if(r>-1){const i=D(`#${this.services.domUtils.generateElementIDString(`control-${n[r].id}`)} button`).node();"focus"in i&&i.focus()}}toggleOverflowMenu(t){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((r,i)=>{const s=D(`#${this.services.domUtils.generateElementIDString(`control-${r.id}`)}`);s!==null&&(s.on("click",()=>{n.triggerFunctionAndEvent(r,t,s.node()),n.updateOverflowMenu(!1)}),s.on("keydown",a=>{a&&a.key==="Enter"?n.triggerFunctionAndEvent(r,t,s.node()):a&&a.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(i):a&&a.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(i):a&&a.key==="Escape"&&n.updateOverflowMenu(!1),a.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}t&&t.stopImmediatePropagation()}triggerFunctionAndEvent(t,n,r){typeof t.shouldBeDisabled=="function"&&t.shouldBeDisabled()||(typeof t.clickFunction=="function"&&t.clickFunction(n),this.services.events.dispatchEvent(O.Toolbar.BUTTON_CLICK,{control:t,event:n,element:r}))}getControlConfigs(){const t=x(this.getOptions(),"toolbar","numberOfIcons")-1,n=x(this.getOptions(),"toolbar","controls"),r=[],i=[],s=[];return n.forEach(a=>{let o=null;a.type===Bt.CUSTOM?(x(a,"id")===null&&(a.id=`toolbar-button-${Om.buttonID++}`),x(a,"shouldBeDisabled")===null&&(a.shouldBeDisabled=()=>!1),o=a):o=this.getControlConfigByType(a.type),o&&(o.text=a.text?a.text:a.type,o.id.indexOf("toolbar-export")!==-1?r.push(o):i.length<t?x(o,"iconSVG","content")===null?s.push(o):i.push(o):s.push(o))}),s.push(...r),s.length?{buttonList:i,overflowMenuItemList:s}:{buttonList:i}}getToolbarButtonItems(){const{buttonList:t,overflowMenuItemList:n}=this.getControlConfigs();return n&&t.push(this.getOverflowButtonConfig()),t||[]}getOverflowMenuItems(){const{overflowMenuItemList:t}=this.getControlConfigs();return t||[]}getOverflowButtonConfig(){return{id:"toolbar-overflow-menu",title:"More options",shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
11
11
  <circle cx="16" cy="16" r="2"></circle>
12
- <circle cx="16" cy="24" r="2"></circle>`},clickFunction:t=>this.toggleOverflowMenu(t)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData();let i;switch(t){case Bt.ZOOM_IN:n&&(i={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case Bt.ZOOM_OUT:n&&(i={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case Bt.RESET_ZOOM:n&&(i={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case Bt.MAKE_FULLSCREEN:i={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Bt.SHOW_AS_DATATABLE:i={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:"Show as table",shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(A.Modal.SHOW)};break;case Bt.EXPORT_CSV:i={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case Bt.EXPORT_PNG:i={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case Bt.EXPORT_JPG:i={id:"toolbar-export-JPG",title:"Export as JPG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return i}getControlIconByType(t){switch(t){case Bt.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
12
+ <circle cx="16" cy="24" r="2"></circle>`},clickFunction:t=>this.toggleOverflowMenu(t)}}getControlConfigByType(t){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),r=this.model.getDisplayData();let i;switch(t){case Bt.ZOOM_IN:n&&(i={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomIn()});break;case Bt.ZOOM_OUT:n&&(i={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.zoomOut()});break;case Bt.RESET_ZOOM:n&&(i={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case Bt.MAKE_FULLSCREEN:i={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(t),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Bt.SHOW_AS_DATATABLE:i={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(t)},title:"Show as table",shouldBeDisabled:()=>r.length===0,clickFunction:()=>this.services.events.dispatchEvent(O.Modal.SHOW)};break;case Bt.EXPORT_CSV:i={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case Bt.EXPORT_PNG:i={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case Bt.EXPORT_JPG:i={id:"toolbar-export-JPG",title:"Export as JPG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+t)}return i}getControlIconByType(t){switch(t){case Bt.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
13
13
  <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Bt.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
14
- <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Bt.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Bt.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case Bt.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case Bt.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Bt.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Bt.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};let Qi=im;Qi.buttonID=0;const sm=class extends gt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=sm.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(r=>{const i=_(r,"growth");return i===ut.PREFERRED||i===ut.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>_(t,"growth")===ut.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=P.getHTMLElementSize(n.node()),s=this.configs.direction===Lt.ROW||this.configs.direction===Lt.ROW_REVERSE,a=_(this.model.getOptions(),"style","prefix"),o=n.classed(`${ge}--${a}--layout-row`,this.configs.direction===Lt.ROW).classed(`${ge}--${a}--layout-row-reverse`,this.configs.direction===Lt.ROW_REVERSE).classed(`${ge}--${a}--layout-column`,this.configs.direction===Lt.COLUMN).classed(`${ge}--${a}--layout-column-reverse`,this.configs.direction===Lt.COLUMN_REVERSE).classed(`${ge}--${a}--layout-alignitems-center`,this.configs.alignItems===Cr.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",c=>`layout-child layout-child-${this._instanceID} ${c.id}`).each(function(c){c.components.forEach(u=>{const h=N(this),d=_(c,"renderType")===nt.SVG;u.setParent(d?P.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const f=_(c,"growth");(f===ut.PREFERRED||f===ut.FIXED)&&u.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(c){const u=_(c,"growth"),h=_(c,"renderType")===nt.SVG?P.getSVGElementSize(N(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):P.getHTMLElementSize(this);if(u===ut.PREFERRED){const d=s?h.width:h.height,f=s?r:i;c.size=d/f*100}}),o.exit().remove(),this.children.filter(c=>_(c,"growth")===ut.STRETCH).forEach(c=>{c.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const l=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);s?l.style("width",c=>`${c.size/100*r}px`).style("height","100%"):l.style("height",c=>`${c.size/100*i}px`).style("width","100%"),l.each(function(c){c.components.forEach(u=>{_(c,"growth")===ut.STRETCH&&u.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};let me=sm;me.instanceID=Math.floor(Math.random()*99999999999);class _n extends gt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||Yf.default.size}px`).style("height",`${this.configs.size||Yf.default.size}px`).attr("opacity",0)}}var kD={prefix:"bx",selectorTabbable:`
14
+ <path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case Bt.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Bt.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case Bt.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case Bt.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Bt.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case Bt.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+t)}}};let es=Om;es.buttonID=0;const Tm=class extends ft{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=Tm.instanceID++,this.init()}init(){this.children.forEach(t=>{t.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const t=this.parent;let n=0;return t.selectAll(`div.layout-child-${this._instanceID}`).filter(r=>{const i=x(r,"growth");return i===at.PREFERRED||i===at.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>x(t,"growth")===at.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=L.getHTMLElementSize(n.node()),s=this.configs.direction===$t.ROW||this.configs.direction===$t.ROW_REVERSE,a=x(this.model.getOptions(),"style","prefix"),o=n.classed(`${ge}--${a}--layout-row`,this.configs.direction===$t.ROW).classed(`${ge}--${a}--layout-row-reverse`,this.configs.direction===$t.ROW_REVERSE).classed(`${ge}--${a}--layout-column`,this.configs.direction===$t.COLUMN).classed(`${ge}--${a}--layout-column-reverse`,this.configs.direction===$t.COLUMN_REVERSE).classed(`${ge}--${a}--layout-alignitems-center`,this.configs.alignItems===kr.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",c=>`layout-child layout-child-${this._instanceID} ${c.id}`).each(function(c){c.components.forEach(u=>{const h=D(this),d=x(c,"renderType")===Q.SVG;u.setParent(d?L.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const f=x(c,"growth");(f===at.PREFERRED||f===at.FIXED)&&u.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(c){const u=x(c,"growth"),h=x(c,"renderType")===Q.SVG?L.getSVGElementSize(D(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):L.getHTMLElementSize(this);if(u===at.PREFERRED){const d=s?h.width:h.height,f=s?r:i;c.size=d/f*100}}),o.exit().remove(),this.children.filter(c=>x(c,"growth")===at.STRETCH).forEach(c=>{c.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const l=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,c=>c.id);s?l.style("width",c=>`${c.size/100*r}px`).style("height","100%"):l.style("height",c=>`${c.size/100*i}px`).style("width","100%"),l.each(function(c){c.components.forEach(u=>{x(c,"growth")===at.STRETCH&&u.render(t)})})}setModel(t){super.setModel(t),this.children.forEach(n=>{n.components.forEach(r=>r.setModel(t))})}setServices(t){super.setServices(t),this.children.forEach(n=>{n.components.forEach(r=>r.setServices(t))})}destroy(){this.children.forEach(t=>{t.components.forEach(n=>n.destroy())})}};let ve=Tm;ve.instanceID=Math.floor(Math.random()*99999999999);class On extends ft{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||rp.default.size}px`).style("height",`${this.configs.size||rp.default.size}px`).attr("opacity",0)}}var GR={prefix:"bx",selectorTabbable:`
15
15
  a[href], area[href], input:not([disabled]):not([tabindex='-1']),
16
16
  button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),
17
17
  textarea:not([disabled]):not([tabindex='-1']),
@@ -21,9 +21,9 @@
21
21
  button:not([disabled]),select:not([disabled]),
22
22
  textarea:not([disabled]),
23
23
  iframe, object, embed, *[tabindex], *[contenteditable=true]
24
- `},Ec=kD;function am(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function RD(e,t,n){return t&&am(e.prototype,t),n&&am(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ID(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PD(e){return VD(e)||BD(e)||UD(e)||ND()}function ND(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
25
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UD(e,t){if(e){if(typeof e=="string")return Sc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sc(e,t)}}function BD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function VD(e){if(Array.isArray(e))return Sc(e)}function Sc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function om(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,PD(om(n))):t.push(n),t},[])}function HD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return om(t).reduce(function(r,i){return i(r)},function(){function r(){ID(this,r)}return RD(r)}())}function Oc(e){"@babel/helpers - typeof";return Oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oc(e)}function FD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function GD(e,t,n){return t&&lm(e.prototype,t),n&&lm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tc(e,t)}function Tc(e,t){return Tc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Tc(e,t)}function jD(e){var t=qD();return function(){var n=Wa(e),r;if(t){var i=Wa(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return WD(this,r)}}function WD(e,t){if(t&&(Oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cm(e)}function cm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wa(e){return Wa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Wa(e)}function YD(e){var t=function(n){zD(i,n);var r=jD(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(FD(this,i),a=r.call(this,s,o),a.children=[],!s||s.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return a.element=s,a.options=Object.assign(Object.create(a.constructor.options),o),a.constructor.components.set(a.element,cm(a)),a}return GD(i,[{key:"release",value:function(){for(var s=this.children.pop();s;s=this.children.pop())s.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(s,a){return this.components.get(s)||new this(s,a)}}]),i}(e);return t}function Mc(e){"@babel/helpers - typeof";return Mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mc(e)}function XD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function um(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ZD(e,t,n){return t&&um(e.prototype,t),n&&um(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qa(){return typeof Reflect<"u"&&Reflect.get?qa=Reflect.get:qa=function(e,t,n){var r=KD(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},qa.apply(this,arguments)}function KD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Fr(e),e!==null););return e}function QD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cc(e,t)}function Cc(e,t){return Cc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Cc(e,t)}function JD(e){var t=nk();return function(){var n=Fr(e),r;if(t){var i=Fr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return tk(this,r)}}function tk(e,t){if(t&&(Mc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ek(e)}function ek(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nk(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fr(e){return Fr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Fr(e)}function rk(e){var t=function(n){QD(i,n);var r=JD(i);function i(){var s;XD(this,i);for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];return s=r.call.apply(r,[this].concat(o)),s.handles=new Set,s}return ZD(i,[{key:"manage",value:function(s){return this.handles.add(s),s}},{key:"unmanage",value:function(s){return this.handles.delete(s),s}},{key:"release",value:function(){var s=this;return this.handles.forEach(function(a){a.release(),s.handles.delete(a)}),qa(Fr(i.prototype),"release",this).call(this)}}]),i}(e);return t}function Ji(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.addEventListener.apply(e,n),{release:function(){return e.removeEventListener.apply(e,n),null}}}function Ac(e){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(e)}function ik(e){return lk(e)||ok(e)||ak(e)||sk()}function sk(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ak(e,t){if(e){if(typeof e=="string")return $c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $c(e,t)}}function ok(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lk(e){if(Array.isArray(e))return $c(e)}function $c(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function uk(e,t,n){return t&&hm(e.prototype,t),n&&hm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lc(e,t)}function Lc(e,t){return Lc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Lc(e,t)}function dk(e){var t=gk();return function(){var n=Ya(e),r;if(t){var i=Ya(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return fk(this,r)}}function fk(e,t){if(t&&(Ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pk(e)}function pk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gk(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ya(e){return Ya=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ya(e)}function mk(e){var t=function(n){hk(i,n);var r=dk(i);function i(){return ck(this,i),r.apply(this,arguments)}return uk(i,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var s=this,a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];var c=typeof o[0]=="string"?o.shift():void 0,u=Object(o[0])===o[0]&&typeof o[0]!="function"?o.shift():void 0,h=typeof o[0]=="function"?o.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(c,u)){h&&h(null,!0);return}var d={group:u&&u.group,state:c},f=[d.group,c].filter(Boolean).join("-").split("-").map(function(w){return w[0].toUpperCase()+w.substr(1)}).join(""),p=new CustomEvent(this.options["eventBefore".concat(f)],{bubbles:!0,cancelable:!0,detail:u}),m=u&&u.delegatorNode||this.element,g=!m.dispatchEvent(p);if(g){if(h){var v=new Error("Changing state (".concat(JSON.stringify(d),") has been canceled."));v.canceled=!0,h(v)}}else{var b=[c,u].filter(Boolean);this._changeState.apply(this,ik(b).concat([function(){m.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),h&&h()}]))}}}]),i}(e);return t}function Dc(e,t){var n=e.target,r=e.currentTarget;if(typeof n.matches=="function"){if(n.matches(t))return n;if(n.matches("".concat(t," *"))){var i=n.closest(t);if((r.nodeType===Node.DOCUMENT_NODE?r.documentElement:r).contains(i))return i}}}function dm(e){if(!e||typeof e=="function")return{launchingElement:null,launchingEvent:null};var t=e.delegateTarget||e.currentTarget||e,n=e.currentTarget&&e;if(t&&!t.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(n&&!n.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:t,launchingEvent:n}}function kc(e){"@babel/helpers - typeof";return kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kc(e)}function vk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yk(e,t,n){return t&&fm(e.prototype,t),n&&fm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rc(e,t)}function Rc(e,t){return Rc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Rc(e,t)}function xk(e){var t=Ek();return function(){var n=Xa(e),r;if(t){var i=Xa(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return wk(this,r)}}function wk(e,t){if(t&&(kc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _k(e)}function _k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ek(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Xa(e){return Xa=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Xa(e)}function Sk(e){var t=function(n){bk(i,n);var r=xk(i);function i(){return vk(this,i),r.apply(this,arguments)}return yk(i,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",dm(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",dm(s),a)}}]),i}(e);return t}var Ok=[mk,Sk];const Tk=Ok;var pm=function(){};process.env.NODE_ENV!=="production"&&(pm=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i<r;i++)n[i-2]=arguments[i];if(t===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var s=0,a="Warning: "+t.replace(/%s/g,function(){return n[s++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}});var Mk=pm;const Ck=vg(Mk);function Ic(e){"@babel/helpers - typeof";return Ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic(e)}function Ak(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $k(e,t,n){return t&&gm(e.prototype,t),n&&gm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pc(e,t)}function Pc(e,t){return Pc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Pc(e,t)}function Dk(e){var t=Ik();return function(){var n=Za(e),r;if(t){var i=Za(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kk(this,r)}}function kk(e,t){if(t&&(Ic(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rk(e)}function Rk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ik(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Za(e){return Za=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Za(e)}function Pk(e){var t=function(n){Lk(i,n);var r=Dk(i);function i(){return Ak(this,i),r.apply(this,arguments)}return $k(i,null,[{key:"init",value:function(){var s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=Object.assign(Object.create(this.options),o);if(!a||a.nodeType!==Node.ELEMENT_NODE&&a.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(a.nodeType===Node.ELEMENT_NODE&&a.matches(l.selectorInit))this.create(a,o);else{var c=l.initEventNames.map(function(u){return Ji(a,u,function(h){var d=Dc(h,"[".concat(l.attribInitTarget,"]"));if(d){h.delegateTarget=d;var f=d.ownerDocument.querySelectorAll(d.getAttribute(l.attribInitTarget));if(f.length>1)throw new Error("Target widget must be unique.");if(f.length===1){d.tagName==="A"&&h.preventDefault();var p=s.create(f[0],o);typeof p.createdByLauncher=="function"&&p.createdByLauncher(h)}}})});return{release:function(){for(var u=c.pop();u;u=c.pop())u.release()}}}return""}}]),i.forLazyInit=!0,i}(e);return t}function Nc(e){"@babel/helpers - typeof";return Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}function Nk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Uk(e,t,n){return t&&mm(e.prototype,t),n&&mm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bk(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uc(e,t)}function Uc(e,t){return Uc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Uc(e,t)}function Vk(e){var t=Gk();return function(){var n=Ka(e),r;if(t){var i=Ka(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Hk(this,r)}}function Hk(e,t){if(t&&(Nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fk(e)}function Fk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gk(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ka(e){return Ka=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ka(e)}var zk=function(e){Bk(n,e);var t=Vk(n);function n(r,i){var s;return Nk(this,n),s=t.call(this,r,i),s._handleFocusinListener=void 0,s._handleKeydownListener=void 0,s._handleFocusin=function(a){var o=s.element.querySelector(s.options.selectorModalContainer)||s.element;s.element.classList.contains(s.options.classVisible)&&!o.contains(a.target)&&s.options.selectorsFloatingMenus.every(function(l){return!Dc(a,l)})&&s.element.querySelector(Ec.selectorTabbable).focus()},s._hookCloseActions(),s}return Uk(n,[{key:"createdByLauncher",value:function(r){this.show(r)}},{key:"shouldStateBeChanged",value:function(r){return r==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(r,i,s){var a=this,o,l=function(){if(o&&(o=a.unmanage(o).release()),r==="shown"&&a.element.offsetWidth>0&&a.element.offsetHeight>0){a.previouslyFocusedNode=a.element.ownerDocument.activeElement;var h=a.element.querySelector(a.options.selectorPrimaryFocus)||a.element.querySelector(Ec.selectorTabbable);h.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&Ck(h,"Modals need to contain a focusable element by either using "+"`".concat(a.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}s()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),r==="shown"){var c="onfocusin"in this.element.ownerDocument.defaultView,u=c?"focusin":"focus";this._handleFocusinListener=this.manage(Ji(this.element.ownerDocument,u,this._handleFocusin,!c))}r==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):r==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(Ji(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var r=this;this.manage(Ji(this.element,"click",function(i){var s=Dc(i,r.options.selectorModalClose);s&&(i.delegateTarget=s),(s||i.target===r.element)&&r.hide(i)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Ji(this.element.ownerDocument.body,"keydown",function(i){i.which===27&&r.shouldStateBeChanged("hidden")&&(i.stopPropagation(),r.hide(i))}))}}],[{key:"options",get:function(){var r=Ec.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(r,"--overflow-menu-options"),".".concat(r,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(r,"--modal-container"),classVisible:"is-visible",classBody:"".concat(r,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(HD(YD,Pk,Tk,rk));const jk=zk;class Qa extends gt{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),jk.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(A.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(A.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.model.getOptions(),n=_(t,"style","prefix"),r=this.model.getTabularDataArray();return`
24
+ `},Lc=GR;function Mm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zR(e,t,n){return t&&Mm(e.prototype,t),n&&Mm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WR(e){return ZR(e)||XR(e)||YR(e)||qR()}function qR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YR(e,t){if(e){if(typeof e=="string")return Rc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rc(e,t)}}function XR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZR(e){if(Array.isArray(e))return Rc(e)}function Rc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cm(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,WR(Cm(n))):t.push(n),t},[])}function KR(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Cm(t).reduce(function(r,i){return i(r)},function(){function r(){jR(this,r)}return zR(r)}())}function Dc(e){"@babel/helpers - typeof";return Dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dc(e)}function QR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function JR(e,t,n){return t&&$m(e.prototype,t),n&&$m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ic(e,t)}function Ic(e,t){return Ic=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Ic(e,t)}function eD(e){var t=rD();return function(){var n=Ka(e),r;if(t){var i=Ka(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return nD(this,r)}}function nD(e,t){if(t&&(Dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Am(e)}function Am(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ka(e){return Ka=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ka(e)}function iD(e){var t=function(n){tD(i,n);var r=eD(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(QR(this,i),a=r.call(this,s,o),a.children=[],!s||s.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return a.element=s,a.options=Object.assign(Object.create(a.constructor.options),o),a.constructor.components.set(a.element,Am(a)),a}return JR(i,[{key:"release",value:function(){for(var s=this.children.pop();s;s=this.children.pop())s.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(s,a){return this.components.get(s)||new this(s,a)}}]),i}(e);return t}function Nc(e){"@babel/helpers - typeof";return Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}function sD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function km(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aD(e,t,n){return t&&km(e.prototype,t),n&&km(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qa(){return typeof Reflect<"u"&&Reflect.get?Qa=Reflect.get:Qa=function(e,t,n){var r=oD(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Qa.apply(this,arguments)}function oD(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=jr(e),e!==null););return e}function lD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pc(e,t)}function Pc(e,t){return Pc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Pc(e,t)}function cD(e){var t=dD();return function(){var n=jr(e),r;if(t){var i=jr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return uD(this,r)}}function uD(e,t){if(t&&(Nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hD(e)}function hD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jr(e){return jr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},jr(e)}function fD(e){var t=function(n){lD(i,n);var r=cD(i);function i(){var s;sD(this,i);for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];return s=r.call.apply(r,[this].concat(o)),s.handles=new Set,s}return aD(i,[{key:"manage",value:function(s){return this.handles.add(s),s}},{key:"unmanage",value:function(s){return this.handles.delete(s),s}},{key:"release",value:function(){var s=this;return this.handles.forEach(function(a){a.release(),s.handles.delete(a)}),Qa(jr(i.prototype),"release",this).call(this)}}]),i}(e);return t}function ns(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.addEventListener.apply(e,n),{release:function(){return e.removeEventListener.apply(e,n),null}}}function Uc(e){"@babel/helpers - typeof";return Uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uc(e)}function pD(e){return yD(e)||vD(e)||mD(e)||gD()}function gD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mD(e,t){if(e){if(typeof e=="string")return Bc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bc(e,t)}}function vD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yD(e){if(Array.isArray(e))return Bc(e)}function Bc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xD(e,t,n){return t&&Lm(e.prototype,t),n&&Lm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vc(e,t)}function Vc(e,t){return Vc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Vc(e,t)}function _D(e){var t=OD();return function(){var n=Ja(e),r;if(t){var i=Ja(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ED(this,r)}}function ED(e,t){if(t&&(Uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SD(e)}function SD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ja(e){return Ja=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ja(e)}function TD(e){var t=function(n){wD(i,n);var r=_D(i);function i(){return bD(this,i),r.apply(this,arguments)}return xD(i,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var s=this,a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];var c=typeof o[0]=="string"?o.shift():void 0,u=Object(o[0])===o[0]&&typeof o[0]!="function"?o.shift():void 0,h=typeof o[0]=="function"?o.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(c,u)){h&&h(null,!0);return}var d={group:u&&u.group,state:c},f=[d.group,c].filter(Boolean).join("-").split("-").map(function(b){return b[0].toUpperCase()+b.substr(1)}).join(""),p=new CustomEvent(this.options["eventBefore".concat(f)],{bubbles:!0,cancelable:!0,detail:u}),m=u&&u.delegatorNode||this.element,g=!m.dispatchEvent(p);if(g){if(h){var v=new Error("Changing state (".concat(JSON.stringify(d),") has been canceled."));v.canceled=!0,h(v)}}else{var y=[c,u].filter(Boolean);this._changeState.apply(this,pD(y).concat([function(){m.dispatchEvent(new CustomEvent(s.options["eventAfter".concat(f)],{bubbles:!0,cancelable:!0,detail:u})),h&&h()}]))}}}]),i}(e);return t}function Hc(e,t){var n=e.target,r=e.currentTarget;if(typeof n.matches=="function"){if(n.matches(t))return n;if(n.matches("".concat(t," *"))){var i=n.closest(t);if((r.nodeType===Node.DOCUMENT_NODE?r.documentElement:r).contains(i))return i}}}function Rm(e){if(!e||typeof e=="function")return{launchingElement:null,launchingEvent:null};var t=e.delegateTarget||e.currentTarget||e,n=e.currentTarget&&e;if(t&&!t.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(n&&!n.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:t,launchingEvent:n}}function Fc(e){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fc(e)}function MD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function CD(e,t,n){return t&&Dm(e.prototype,t),n&&Dm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $D(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gc(e,t)}function Gc(e,t){return Gc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Gc(e,t)}function AD(e){var t=RD();return function(){var n=to(e),r;if(t){var i=to(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kD(this,r)}}function kD(e,t){if(t&&(Fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LD(e)}function LD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function to(e){return to=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},to(e)}function DD(e){var t=function(n){$D(i,n);var r=AD(i);function i(){return MD(this,i),r.apply(this,arguments)}return CD(i,[{key:"show",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("shown",Rm(s),a)}},{key:"hide",value:function(s,a){(!s||typeof s=="function")&&(a=s),this.changeState("hidden",Rm(s),a)}}]),i}(e);return t}var ID=[TD,DD];const ND=ID;function PD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Im=function(){};process.env.NODE_ENV!=="production"&&(Im=function(e,t,n){var r=arguments.length;n=new Array(r>2?r-2:0);for(var i=2;i<r;i++)n[i-2]=arguments[i];if(t===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(t.length<10||/^[s\W]*$/.test(t))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+t);if(!e){var s=0,a="Warning: "+t.replace(/%s/g,function(){return n[s++]});typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}});var UD=Im;const BD=PD(UD);function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}function VD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function HD(e,t,n){return t&&Nm(e.prototype,t),n&&Nm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function FD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jc(e,t)}function jc(e,t){return jc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},jc(e,t)}function GD(e){var t=WD();return function(){var n=eo(e),r;if(t){var i=eo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return zD(this,r)}}function zD(e,t){if(t&&(zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jD(e)}function jD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WD(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function eo(e){return eo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},eo(e)}function qD(e){var t=function(n){FD(i,n);var r=GD(i);function i(){return VD(this,i),r.apply(this,arguments)}return HD(i,null,[{key:"init",value:function(){var s=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=Object.assign(Object.create(this.options),o);if(!a||a.nodeType!==Node.ELEMENT_NODE&&a.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(a.nodeType===Node.ELEMENT_NODE&&a.matches(l.selectorInit))this.create(a,o);else{var c=l.initEventNames.map(function(u){return ns(a,u,function(h){var d=Hc(h,"[".concat(l.attribInitTarget,"]"));if(d){h.delegateTarget=d;var f=d.ownerDocument.querySelectorAll(d.getAttribute(l.attribInitTarget));if(f.length>1)throw new Error("Target widget must be unique.");if(f.length===1){d.tagName==="A"&&h.preventDefault();var p=s.create(f[0],o);typeof p.createdByLauncher=="function"&&p.createdByLauncher(h)}}})});return{release:function(){for(var u=c.pop();u;u=c.pop())u.release()}}}return""}}]),i.forLazyInit=!0,i}(e);return t}function Wc(e){"@babel/helpers - typeof";return Wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wc(e)}function YD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function XD(e,t,n){return t&&Pm(e.prototype,t),n&&Pm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qc(e,t)}function qc(e,t){return qc=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},qc(e,t)}function KD(e){var t=tI();return function(){var n=no(e),r;if(t){var i=no(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return QD(this,r)}}function QD(e,t){if(t&&(Wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JD(e)}function JD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tI(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function no(e){return no=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},no(e)}var eI=function(e){ZD(n,e);var t=KD(n);function n(r,i){var s;return YD(this,n),s=t.call(this,r,i),s._handleFocusinListener=void 0,s._handleKeydownListener=void 0,s._handleFocusin=function(a){var o=s.element.querySelector(s.options.selectorModalContainer)||s.element;s.element.classList.contains(s.options.classVisible)&&!o.contains(a.target)&&s.options.selectorsFloatingMenus.every(function(l){return!Hc(a,l)})&&s.element.querySelector(Lc.selectorTabbable).focus()},s._hookCloseActions(),s}return XD(n,[{key:"createdByLauncher",value:function(r){this.show(r)}},{key:"shouldStateBeChanged",value:function(r){return r==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(r,i,s){var a=this,o,l=function(){if(o&&(o=a.unmanage(o).release()),r==="shown"&&a.element.offsetWidth>0&&a.element.offsetHeight>0){a.previouslyFocusedNode=a.element.ownerDocument.activeElement;var h=a.element.querySelector(a.options.selectorPrimaryFocus)||a.element.querySelector(Lc.selectorTabbable);h.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&BD(h,"Modals need to contain a focusable element by either using "+"`".concat(a.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}s()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),r==="shown"){var c="onfocusin"in this.element.ownerDocument.defaultView,u=c?"focusin":"focus";this._handleFocusinListener=this.manage(ns(this.element.ownerDocument,u,this._handleFocusin,!c))}r==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):r==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(ns(this.element,"transitionend",l))}},{key:"_hookCloseActions",value:function(){var r=this;this.manage(ns(this.element,"click",function(i){var s=Hc(i,r.options.selectorModalClose);s&&(i.delegateTarget=s),(s||i.target===r.element)&&r.hide(i)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(ns(this.element.ownerDocument.body,"keydown",function(i){i.which===27&&r.shouldStateBeChanged("hidden")&&(i.stopPropagation(),r.hide(i))}))}}],[{key:"options",get:function(){var r=Lc.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(r,"--overflow-menu-options"),".".concat(r,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(r,"--modal-container"),classVisible:"is-visible",classBody:"".concat(r,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(KR(iD,qD,ND,fD));const nI=eI;class ro extends ft{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),nI.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(O.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(O.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.model.getOptions(),n=x(t,"style","prefix"),r=this.model.getTabularDataArray();return`
27
27
  <div class="cds--modal-container cds--modal-container">
28
28
  <div class="cds--modal-header cds--modal-header">
29
29
  <p class="cds--modal-header__label cds--type-delta cds--modal-header__label cds--type-delta" id="modal-title">Tabular representation</p>
@@ -59,7 +59,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
59
59
  <div class="${ge}--${n}-modal-footer-spacer"></div>
60
60
  <button class="cds--btn cds--btn--primary cds--btn cds--btn--primary" type="button" data-modal-primary-focus>Download as CSV</button>
61
61
  </div>
62
- </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=N(this.services.domUtils.getHolder()),i=_(n,"style","prefix");this.modal=P.appendOrSelect(r,`div.${ge}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class ts extends gt{constructor(){super(...arguments),this.type="title",this.renderType=nt.HTML}render(t=!1){const n=this.getComponentContainer(),r=_(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>s),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(A.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(A.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(A.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=P.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(A.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(A.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(A.Tooltip.HIDE)})}}getMaxTitleWidth(){return P.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}class Bc extends gt{constructor(){super(...arguments),this.type="legend",this.renderType=nt.HTML}render(t=!1){const n=this.getOptions(),r=_(n,"legend"),i=_(r,"alignment"),s=_(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Vt.items.status,l=a.some(b=>b.status===o),c=_(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Yt.CENTER).classed("right-aligned",i===Yt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",dt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const h=u.selectAll("div.legend-item").data(a,b=>b.name),d=h.enter().append("div").attr("class","legend-item");d.merge(u.selectAll("div.legend-item")).classed("active",function(b){return b.status===Vt.items.status.ACTIVE});const f=_(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Vt.checkbox.radius,m=d.append("div").classed("checkbox",!0),g=m.merge(h.select("div.checkbox")).attr("role",dt.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(b,w)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${w}-title`)).attr("aria-checked",({status:b})=>b===Vt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",b=>this.model.getColorClassName({classNameTypes:[st.BACKGROUND],dataGroupName:b.name,originalClassName:"checkbox"})).style("background",b=>b.status===Vt.items.status.ACTIVE?this.model.getFillColor(b.name)||this.model.getStrokeColor(b.name):null).classed("active",function(b){return b.status===Vt.items.status.ACTIVE});m.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),d.append("p").merge(h.select("p"));const v=_(n,"legend","additionalItems");if(v&&a.length){const b=this,w=u.selectAll("div.additional-item").data(v);w.exit().remove();const O=w.enter().append("div").merge(w).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(S,$)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${g.size()+$}-title`));O.selectAll("*").remove();let E,T=1;O.append("svg").classed("icon",!0).each(function(S){const $=N(this);!E||E!=S.type?(E=S.type,T=1):T++,b.addAdditionalItem($,S,T)}),O.append("p").merge(O.select("p")),this.truncateLegendText()}h.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&d.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Vt.area;if(n.type===Zt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Zt.RADIUS){const{iconData:a,fill:o,stroke:l}=Vt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",dt.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===Zt.LINE){const a=Vt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",dt.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===Zt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",dt.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Vt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Zt.SIZE){const{iconData:a,fill:o,stroke:l}=Vt.size;t.attr("fill","none").attr("role",dt.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===Zt.QUARTILE){const{iconData:a}=Vt.quartile;t.selectAll("rect").attr("role",dt.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===Zt.ZOOM){const{iconData:a,color:o}=_(Vt,"zoom"),l=t.attr("role",dt.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=_(this.getOptions(),"legend","truncation"),r=_(n,"type"),i=_(n,"threshold"),s=_(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==Ve.NONE?a.html(function(o){return o.name.length>i?qi(o.name,r,s):o.name}):a.html(o=>o.name)}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=_(r,"legend"),s=_(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(A.Legend.ITEM_HOVER,{hoveredElement:N(this)});const o=N(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.type!==Ve.NONE&&t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){N(this).datum().name.length>s.threshold&&s.type!==Ve.NONE&&t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(A.Legend.ITEM_CLICK,{clickedElement:N(this)});const a=N(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=N(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Ve.NONE&&t.services.events.dispatchEvent(A.Tooltip.HIDE),t.services.events.dispatchEvent(A.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(A.Legend.ITEM_HOVER,{hoveredElement:N(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(A.Legend.ITEM_MOUSEOUT,{hoveredElement:N(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=N(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class vm extends gt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=nt.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=P.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=P.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class Wk extends vm{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=P.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=P.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=P.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var Gr,ne;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(ne||(ne={}));var ym=(Gr={},Gr[ne.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},Gr[ne.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},Gr[ne.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},Gr[ne.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},Gr),bm=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Ja=function(){function e(t){t===void 0&&(t={}),this.positions=ym,this.positions=Object.assign({},ym,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),h=0,d=0,f=i();u.top<f.top?h=f.top-u.top:u.bottom>f.height&&(h=u.bottom-f.height),u.left<f.left?d=f.left-u.left:u.right>f.width&&(d=u.right-f.width),h&&!d?d=1:d&&!h&&(h=1);var p=n.offsetHeight*n.offsetWidth,m=h*d,g=p-m,v=g/p;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:bm.innerHeight,width:bm.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new Ja;class Vc extends gt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=nt.HTML,this.isEventListenerAdded=!1,this.positionService=new Ja,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items;let a;const o=this.formatItems(this.getItems(i));i.detail.content?a=`<div class="title-tooltip"><p>${i.detail.content}</p></div>`:a=this.getTooltipHTML(o);const l=P.appendOrSelect(this.tooltip,"div.content-box");if(_(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const c=`<div class="title-tooltip"><p>${i.detail.content}</p></div>`;l.html(c)}else l.html(this.model.getOptions().tooltip.customHTML(s,a));else l.html(a);l.selectAll(".datapoint-tooltip").each(function(c,u){const h=o[u];o[u]&&o[u].color&&N(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(A.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(A.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(A.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(A.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(A.Tooltip.MOVE,null),this.services.events.removeEventListener(A.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(A.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(A.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=_(n,"tooltip","truncation","type"),i=_(n,"tooltip","truncation","threshold"),s=_(n,"tooltip","truncation","numCharacter");return r!==Ve.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>i&&(a.label=qi(a.label,r,s)),a.value&&a.value.length>i&&(a.value=qi(a.value,r,s)),a}):t}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
62
+ </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=D(this.services.domUtils.getHolder()),i=x(n,"style","prefix");this.modal=L.appendOrSelect(r,`div.${ge}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class rs extends ft{constructor(){super(...arguments),this.type="title",this.renderType=Q.HTML}render(t=!1){const n=this.getComponentContainer(),r=x(this.getOptions(),"title"),i=n.selectAll("p.title").data([r]);if(i.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(i).html(s=>s),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(O.Tooltip.HIDE)})}i.exit().remove()}truncateTitle(t,n){if(n<=0)return;const r=t.text();if(t.node().getComputedTextLength()>n){t.append("tspan").text("...");const i=L.appendOrSelect(t,"tspan").node().getComputedTextLength(),s=t.text(),a=this.getSubstringIndex(t.node(),0,s.length-1,n-i);t.html(s.substring(0,a-1)).append("tspan").text("...");const o=this;t.on("mouseover",function(l){o.services.events.dispatchEvent(O.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(O.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(O.Tooltip.HIDE)})}}getMaxTitleWidth(){return L.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(t,n,r,i){const s=Math.floor((r+n)/2);return t.getSubStringLength(0,s)>i?this.getSubstringIndex(t,n,s,i):t.getSubStringLength(0,s)<i?t.getSubStringLength(0,s+1)>i?s:this.getSubstringIndex(t,s,r,i):s}}class Yc extends ft{constructor(){super(...arguments),this.type="legend",this.renderType=Q.HTML}render(t=!1){const n=this.getOptions(),r=x(n,"legend"),i=x(r,"alignment"),s=x(n,"legend","orientation");let a=this.model.getDataGroups();const{DISABLED:o}=Vt.items.status,l=a.some(y=>y.status===o),c=x(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Yt.CENTER).classed("right-aligned",i===Yt.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",lt.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const h=u.selectAll("div.legend-item").data(a,y=>y.name),d=h.enter().append("div").attr("class","legend-item");d.merge(u.selectAll("div.legend-item")).classed("active",function(y){return y.status===Vt.items.status.ACTIVE});const f=x(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Vt.checkbox.radius,m=d.append("div").classed("checkbox",!0),g=m.merge(h.select("div.checkbox")).attr("role",lt.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(y,b)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${b}-title`)).attr("aria-checked",({status:y})=>y===Vt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",y=>this.model.getColorClassName({classNameTypes:[tt.BACKGROUND],dataGroupName:y.name,originalClassName:"checkbox"})).style("background",y=>y.status===Vt.items.status.ACTIVE?this.model.getFillColor(y.name)||this.model.getStrokeColor(y.name):null).classed("active",function(y){return y.status===Vt.items.status.ACTIVE});m.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),d.append("p").merge(h.select("p"));const v=x(n,"legend","additionalItems");if(v&&a.length){const y=this,b=u.selectAll("div.additional-item").data(v);b.exit().remove();const S=b.enter().append("div").merge(b).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(T,R)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${g.size()+R}-title`));S.selectAll("*").remove();let _,E=1;S.append("svg").classed("icon",!0).each(function(T){const R=D(this);!_||_!=T.type?(_=T.type,E=1):E++,y.addAdditionalItem(R,T,E)}),S.append("p").merge(S.select("p")),this.truncateLegendText()}h.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&d.size()>1&&this.addEventListeners()}sortDataGroups(t,n){if(t.sort((r,i)=>n.indexOf(r.name)-n.indexOf(i.name)),n.length<t.length){const r=t.length-n.length;return t.slice(r).concat(t.slice(0,r))}return t}addAdditionalItem(t,n,r){const{width:i,height:s}=Vt.area;if(n.type===Zt.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Zt.RADIUS){const{iconData:a,fill:o,stroke:l}=Vt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",lt.IMG).attr("aria-label","radius").attr("cx",c=>c.cx).attr("cy",c=>c.cy).attr("r",c=>c.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===Zt.LINE){const a=Vt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",lt.IMG).attr("aria-label","line").attr("x1",0).attr("y1",a.yPosition).attr("x2",i).attr("y2",a.yPosition).style("stroke",n.stroke?n.stroke:a.stroke).style("stroke-width",a.strokeWidth)}else if(n.type===Zt.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",lt.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Vt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Zt.SIZE){const{iconData:a,fill:o,stroke:l}=Vt.size;t.attr("fill","none").attr("role",lt.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",c=>c.width).attr("height",c=>c.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l).style("stroke-width",1)}else if(n.type===Zt.QUARTILE){const{iconData:a}=Vt.quartile;t.selectAll("rect").attr("role",lt.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(o,l)=>`quartile-${l===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===Zt.ZOOM){const{iconData:a,color:o}=x(Vt,"zoom"),l=t.attr("role",lt.IMG).attr("aria-label","zoom").selectAll("g.icon").data(a).enter();l.append("g").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),l.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const t=this.getComponentContainer(),n=x(this.getOptions(),"legend","truncation"),r=x(n,"type"),i=x(n,"threshold"),s=x(n,"numCharacter"),a=t.selectAll("div.legend-item p");a.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),r!==Ve.NONE?a.html(function(o){return o.name.length>i?Zi(o.name,r,s):o.name}):a.html(o=>o.name)}addEventListeners(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=x(r,"legend"),s=x(i,"truncation");n.selectAll("div.legend-item").on("mouseover",function(a){t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:D(this)});const o=D(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.type!==Ve.NONE&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){D(this).datum().name.length>s.threshold&&s.type!==Ve.NONE&&t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(O.Legend.ITEM_CLICK,{clickedElement:D(this)});const a=D(this).datum();t.model.toggleDataLabel(a.name)}).on("mouseout",function(){const a=D(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Ve.NONE&&t.services.events.dispatchEvent(O.Tooltip.HIDE),t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:a})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(a){a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_HOVER,{hoveredElement:D(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(a,o){a.key&&a.key===" "?(a.preventDefault(),t.model.toggleDataLabel(o.name)):a.key&&a.key==="Tab"&&t.services.events.dispatchEvent(O.Legend.ITEM_MOUSEOUT,{hoveredElement:D(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=D(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class Um extends ft{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=Q.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(t=!0){this.createClipPath()}createClipPath(){const t=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const r=n.getMainXScale(),i=n.getMainYScale(),[s,a]=r.range(),[o,l]=i.range();if(!t)throw new Error("svg is undefined");this.chartClipPath=L.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=L.appendOrSelect(this.chartClipPath,`rect.${this.type}`);a-s>0&&c.attr("x",s).attr("y",l).attr("width",a-s).attr("height",o-l),this.chartClipPath.merge(c).lower()}}class rI extends Um{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const t=this.parent,{width:n,height:r}=L.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=L.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=L.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i.attr("x",0).attr("y",0).attr("width",n).attr("height",r),this.chartClipPath.merge(i).lower()}}var Wr,ne;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(ne||(ne={}));var Bm=(Wr={},Wr[ne.LEFT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left-t.offsetWidth)}},Wr[ne.RIGHT]=function(e,t,n){return{top:e.top-Math.round(t.offsetHeight/2)+Math.round(n.height/2),left:Math.round(e.left+n.width)}},Wr[ne.TOP]=function(e,t,n){return{top:Math.round(e.top-t.offsetHeight),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},Wr[ne.BOTTOM]=function(e,t,n){return{top:Math.round(e.top+n.height),left:e.left-Math.round(t.offsetWidth/2)+Math.round(n.width/2)}},Wr),Vm=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},io=function(){function e(t){t===void 0&&(t={}),this.positions=Bm,this.positions=Object.assign({},Bm,t)}return e.prototype.getRelativeOffset=function(t){for(var n={left:t.offsetLeft,top:t.offsetTop};t.offsetParent&&getComputedStyle(t.offsetParent).position==="static";)n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;return n},e.prototype.getAbsoluteOffset=function(t){for(var n=t,r={top:0,left:0};n.offsetParent;){var i=getComputedStyle(n.offsetParent);i.position==="static"&&i.marginLeft&&i.marginTop&&(parseInt(i.marginTop,10)&&(r.top+=parseInt(i.marginTop,10)),parseInt(i.marginLeft,10)&&(r.left+=parseInt(i.marginLeft,10))),n=n.offsetParent}var s=t.getBoundingClientRect(),a=document.body.getBoundingClientRect();return{top:s.top-a.top+r.top,left:s.left-a.left+r.left}},e.prototype.findRelative=function(t,n,r){var i=this.getRelativeOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findAbsolute=function(t,n,r){var i=this.getAbsoluteOffset(t),s=t.getBoundingClientRect();return this.calculatePosition(i,s,n,r)},e.prototype.findPosition=function(t,n,r,i){i===void 0&&(i=this.getAbsoluteOffset.bind(this));var s=i(t),a=t.getBoundingClientRect();return this.calculatePosition(s,a,n,r)},e.prototype.findPositionAt=function(t,n,r){return this.calculatePosition(t,{top:0,left:0,height:0,width:0},n,r)},e.prototype.getPlacementBox=function(t,n){var r=t.offsetHeight+n.top,i=t.offsetWidth+n.left;return{top:n.top,bottom:r,left:n.left,right:i}},e.prototype.addOffset=function(t,n,r){return n===void 0&&(n=0),r===void 0&&(r=0),Object.assign({},t,{top:t.top+n,left:t.left+r})},e.prototype.setElement=function(t,n){t.style.top=n.top+"px",t.style.left=n.left+"px"},e.prototype.findBestPlacement=function(t,n,r,i,s){var a=this;i===void 0&&(i=this.defaultContainerFunction.bind(this)),s===void 0&&(s=this.findPosition.bind(this));var o=r.map(function(l){var c=s(t,n,l),u=a.getPlacementBox(n,c),h=0,d=0,f=i();u.top<f.top?h=f.top-u.top:u.bottom>f.height&&(h=u.bottom-f.height),u.left<f.left?d=f.left-u.left:u.right>f.width&&(d=u.right-f.width),h&&!d?d=1:d&&!h&&(h=1);var p=n.offsetHeight*n.offsetWidth,m=h*d,g=p-m,v=g/p;return{placement:l,weight:v}});return o.sort(function(l,c){return c.weight-l.weight}),o[0].placement},e.prototype.findBestPlacementAt=function(t,n,r,i){var s=this;i===void 0&&(i=this.defaultContainerFunction.bind(this));var a=function(o,l,c){return s.findPositionAt(t,l,c)};return this.findBestPlacement(null,n,r,i,a)},e.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Vm.innerHeight,width:Vm.innerWidth}},e.prototype.calculatePosition=function(t,n,r,i){return this.positions[i]?this.positions[i](t,r,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},e}();new io;class Xc extends ft{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=Q.HTML,this.isEventListenerAdded=!1,this.positionService=new io,this.handleShowTooltip=i=>{const s=i.detail.data||i.detail.items;let a;const o=this.formatItems(this.getItems(i));i.detail.content?a=`<div class="title-tooltip"><p>${i.detail.content}</p></div>`:a=this.getTooltipHTML(o);const l=L.appendOrSelect(this.tooltip,"div.content-box");if(x(this.getOptions(),"tooltip","customHTML"))if(i.detail.content){const c=`<div class="title-tooltip"><p>${i.detail.content}</p></div>`;l.html(c)}else l.html(this.model.getOptions().tooltip.customHTML(s,a));else l.html(a);l.selectAll(".datapoint-tooltip").each(function(c,u){const h=o[u];o[u]&&o[u].color&&D(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",h.color)}),this.positionTooltip(i),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(O.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(O.Tooltip.MOVE,null),this.services.events.removeEventListener(O.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(O.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(O.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(t){return t.detail.items?t.detail.items:[]}formatItems(t){const n=this.getOptions(),r=x(n,"tooltip","truncation","type"),i=x(n,"tooltip","truncation","threshold"),s=x(n,"tooltip","truncation","numCharacter");return r!==Ve.NONE?t.map(a=>{const o=a.labelIcon?12:0;return a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a.label&&a.label.length+o>i&&(a.label=Zi(a.label,r,s)),a.value&&a.value.length>i&&(a.value=Zi(a.value,r,s)),a}):t}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
63
63
  <div class="datapoint-tooltip${n.bold?" bold":""}">
64
64
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
65
65
  <div class="label">
@@ -68,19 +68,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
68
68
  </div>
69
69
  ${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
70
70
  </div>
71
- </li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=_(r,"tooltip","valueFormatter");if(i)return i(t,n);if(typeof t.getTime=="function")return Lr(t,"MMM d, yyyy");try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t))return Lr(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!1){const n=this.getOptions(),r=_(n,"tooltip","enabled");if(r){const i=N(this.services.domUtils.getHolder()),s=_(n,"style","prefix");this.tooltip=P.appendOrSelect(i,`div.${ge}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=this.tooltip.node(),i=this.getOptions(),s=_(i,"zoomBar","top","enabled");let a=_(t,"detail","mousePosition");if(!a)a=Un(_(t,"detail","event"),n);else{const d=_(i,"zoomBar","top","type"),f=Ee.height[d];s&&(a[1]+=f+Ee.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=ne.LEFT:a[0]/o<.1?c=ne.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[ne.RIGHT,ne.LEFT,ne.TOP,ne.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=eO;c===ne.LEFT&&(u*=-1);const h=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,h)}}const to=class extends gt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=nt.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const i=P.appendOrSelect(n,"svg.chart-grid-backdrop"),s=P.appendOrSelect(i,`g.${this.type}`),a=P.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=P.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),h=c.getMainXScale(),[d]=h.range();r.attr("transform",`translate(${d},0)`);const f=P.appendOrSelect(r,this.frontSelectionSelector);if(h&&u===tt.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const m=E=>{const T=E[1]-E[0];let S="0,"+T.toString();const $=Math.floor(l/to.DASH_LENGTH),k=$*to.DASH_LENGTH;for(let L=0;L<$;L++)S+=","+to.DASH_LENGTH;S+=","+(l-k),$%2===1&&(S+=",0"),S+=","+T.toString(),S+=","+l.toString(),f.attr("stroke-dasharray",S)},g=E=>{const T=E.selection;T===null||T[0]===T[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),m(T))},v=(E,T)=>{const S=Fd().range([0,o]).domain(p);let $=[S.invert(E),S.invert(T)];$[0].valueOf()===$[1].valueOf()&&($=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==$[0].valueOf()||p[1].valueOf()!==$[1].valueOf())&&this.services.zoom.handleDomainChange($)};let b;const w=E=>{const T=E.selection;T!==null&&(v(T[0],T[1]),s.call(b.move,null),f.style("display","none"))};l!=0&&o!=0&&(b=ih().extent([[0,0],[o-1,l]]).on("start brush end",g).on("end.brushed",w),s.call(b));const O=this.services.zoom.getZoomRatio();i.on("click",function(E){if(E.shiftKey){const T=this.services.domUtils.getHolder(),S=Un(s.node(),T)[0];let $=S-o*O/2;$<0&&($=0);let k=S+o*O/2;k>o&&(k=o),v($,k)}})}}};let xm=to;xm.DASH_LENGTH=4;class qk extends gt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=nt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=ih(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(A.ZoomBar.UPDATE,this.render.bind(this));const t=_(this.getOptions(),"zoomBar",H.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(H.TOP),i=this.services.zoom.isZoomBarLocked(H.TOP),s=_(this.getOptions(),"zoomBar",H.TOP,"type"),a=_(this.getOptions(),"axes",H.BOTTOM,"highlights"),o=Ee.height[s],{width:l}=P.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const h=P.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(P.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Ee.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ke.GRAPH_VIEW?P.appendOrSelect(h,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ke.SLIDER_VIEW&&P.appendOrSelect(h,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(h,c,l);return}const{cartesianScales:d}=this.services,f=d.getMainXScale(),p=d.getMainYScale(),m=d.getMainXScaleType();if(f&&m===tt.TIME){let g=this.services.zoom.getZoomBarData();if(ze(g)||g.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(g);g=this.compensateDataForDefaultDomain(g,v);const b=this.model.get("initialZoomDomain"),w=_(this.getOptions(),"zoomBar",H.TOP,"initialZoomDomain");w&&w[0]&&w[1]&&(w[0]=new Date(w[0]),w[1]=new Date(w[1])),w&&!(b&&b[0].valueOf()===w[0].valueOf()&&b[1].valueOf()===w[1].valueOf())?this.model.set({initialZoomDomain:at([],w),zoomDomain:w?at([],w):v},{skipUpdate:!0}):w===null&&b!==null&&this.model.set({initialZoomDomain:null,zoomDomain:at([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Re(g,T=>T.value));const O=this.model.get("zoomDomain");if(s===Ke.GRAPH_VIEW&&(this.renderZoomBarArea(h,"path.zoom-graph-area-unselected",g,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(h,"path.zoom-graph-area",g,this.clipId),this.renderZoomBarBaseline(h,c,l),a)){const T=a.highlightStartMapsTo,S=a.highlightEndMapsTo,$=a.color,k=a.labelMapsTo;a.data.forEach((L,M)=>{P.appendOrSelect(h,`rect.highlight-${M}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(L[T])).attr("width",this.xScale(L[S])-this.xScale(L[T])).style("fill",$&&$.scale[L[k]]?$.scale[L[k]]:null).style("fill-opacity",.1).style("stroke",$&&$.scale[L[k]]?$.scale[L[k]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(O,c,l);const E=P.appendOrSelect(n,this.brushSelector).call(this.brush);if(O!==void 0)if(O[0].valueOf()===O[1].valueOf())E.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const T=O.map(S=>this.xScale(S));T[1]-T[0]<this.MIN_SELECTION_DIFF||(E.call(this.brush.move,T),this.updateBrushHandle(this.getComponentContainer(),T))}i&&(this.brush.filter(()=>!1),E.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=_(this.getOptions(),"zoomBar",H.TOP,"type"),a=Ee.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=A.ZoomBar.SELECTION_START:t.type==="brush"?a=A.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=A.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(A.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Ee.handleWidth,s=_(this.getOptions(),"zoomBar",H.TOP,"type"),a=Ee.height[s],o=-i/2,l=Ee.handleBarWidth,c=s===Ke.GRAPH_VIEW?Ee.handleBarHeight:6,u=-l/2,h=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const d=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),d.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",h).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ke.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=_(this.getOptions(),"zoomBar",H.TOP,"type"),r=Ee.height[n],i=this.getComponentContainer().select("svg.zoom-container");P.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,b,w)=>O=>s.getValueFromScale(v,b,w,O),h=u(this.xScale,l,a),d=u(this.yScale,c,o),f=_(this.getOptions(),"zoomBar",H.TOP,"type"),p=Ee.height[f],m=Al().x(v=>h(v)).y0(p).y1(v=>p-d(v)),g=P.appendOrSelect(t,n).datum(r).attr("d",m);i&&g.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=P.appendOrSelect(t,"clipPath").attr("id",n);P.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=yn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=_(this.model.getOptions(),"zoomBar",H.TOP,"type"),a=Ee.height[s],o=Mi()([[n,a],[r,a]]);P.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),P.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),_(this.getOptions(),"zoomBar",H.TOP,"type")===Ke.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(A.ZoomBar.UPDATE,this.render.bind(this))}}class Yk extends gt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=nt.SVG,this.positionService=new Ja}render(t=!1){const n=_(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(H).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),h=l.services.cartesianScales.getScaleTypeByPosition(c);let d=null,f=null;c===H.LEFT||c===H.RIGHT?(f=u,d=l.services.cartesianScales.getMainXScale()):(d=u,f=l.services.cartesianScales.getMainYScale());const p=h===tt.LABELS,[m,g]=d.range(),[v,b]=f.range(),{cartesianScales:w}=l.services,O=w.getOrientation(),E=L=>w.getDomainValue(L),T=L=>w.getRangeValue(L),[S,$]=xn(E,T,O),k=N(this);c===H.TOP||c===H.BOTTOM?(k.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("y1",b).attr("y2",v).attr("x1",({datum:L})=>S(L)+(p?u.step()/2:0)).attr("x2",({datum:L})=>S(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),k.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:L})=>-S(L)).attr("width",Math.abs(v-b)).classed("rotate",!0)):(k.selectAll("line.threshold-line").transition().call(L=>l.services.transitions.setupTransition({transition:L,name:"threshold-line-update",animate:t})).attr("x1",m).attr("x2",g).attr("y1",({datum:L})=>$(L)+(p?u.step()/2:0)).attr("y2",({datum:L})=>$(L)+(p?u.step()/2:0)).style("stroke",({fillColor:L})=>L),k.selectAll("rect.threshold-hoverable-area").attr("x",m).attr("y",({datum:L})=>$(L)).attr("width",Math.abs(g-m)).classed("rotate",!1))}),this.services.events.addEventListener(A.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(A.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(r)===tt.TIME){const s=[H.LEFT,H.RIGHT].includes(r),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),l=s?o:a,c=_(i,"timeScale"),u=fc(l.ticks(),_(c,"timeInterval"));return dc(n,0,l.ticks(),u,c)}return n.toLocaleString("en")}appendThresholdLabel(){const t=N(this.services.domUtils.getHolder()),n=_(this.getOptions(),"style","prefix");this.label=P.appendOrSelect(t,`div.${ge}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Un(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${n.label||"Threshold"}: ${s}`).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[ne.RIGHT,ne.LEFT,ne.TOP,ne.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=_(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){N(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(A.Threshold.SHOW,{event:n,hoveredElement:N(this),datum:N(this).datum()})}).on("mouseout",function(n){N(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(A.Threshold.HIDE,{event:n,hoveredElement:N(this),datum:N(this).datum()})})}}class Xk extends gt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=nt.SVG,this.positionService=new Ja,this.highlightStrokeWidth=1}render(t=!1){const n=_(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(H).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),h=l.services.cartesianScales.getMainYScale(),[d,f]=u.range(),[p,m]=h.range(),{cartesianScales:g}=l.services,v=g.getOrientation(),b=S=>g.getDomainValue(S),w=S=>g.getRangeValue(S),[O,E]=xn(b,w,v),T=N(this);c===H.TOP||c===H.BOTTOM?T.selectAll("rect.highlight-bar").transition().call(S=>l.services.transitions.setupTransition({transition:S,name:"highlight-bar-update",animate:t})).attr("y",Math.max(m+l.highlightStrokeWidth,0)).attr("height",Math.max(p-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:S,...$})=>O($[S])).attr("width",({highlightStartMapsTo:S,highlightEndMapsTo:$,...k})=>Math.max(O(k[$])-O(k[S]),0)).style("stroke",({color:S,labelMapsTo:$,...k})=>S&&S.scale[k[$]]?S.scale[k[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:S,labelMapsTo:$,...k})=>S&&S.scale[k[$]]?S.scale[k[$]]:null):T.selectAll("rect.highlight-bar").transition().call(S=>l.services.transitions.setupTransition({transition:S,name:"highlight-bar-update",animate:t})).attr("x",d).attr("width",Math.max(f-d,0)).attr("y",({highlightEndMapsTo:S,...$})=>E($[S])).attr("height",({highlightStartMapsTo:S,highlightEndMapsTo:$,...k})=>Math.max(E(k[S])-E(k[$]),0)).style("stroke",({color:S,labelMapsTo:$,...k})=>S&&S.scale[k[$]]?S.scale[k[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:S,labelMapsTo:$,...k})=>S&&S.scale[k[$]]?S.scale[k[$]]:null)})}}class wm extends Vc{getItems(t){if(t.detail.items)return t.detail.items;const n=t.detail.data;if(!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let h;if(n.length===1){const d=n[0],f=i.getRangeIdentifier(d);if(a){const m=i.getRangeAxisPosition({datum:d,groups:[d[o]]});c=i.getScaleLabel(m)}const p=d[f];h=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:d[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(m=>h.push({label:m.label,value:m.value})),h.push({label:r.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(h=[{label:l,value:u}],h=h.concat(n.map(d=>{const f=d[i.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:d[o]})}}).sort((d,f)=>f.value-d.value)),!a&&_(r,"tooltip","showTotal")===!0)){const d=i.getRangeIdentifier();h.push({label:kt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[d],0),bold:!0})}return h}}class Zk extends gt{constructor(){super(...arguments),this.type="alluvial",this.renderType=nt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.html("");const{width:r,height:i}=P.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=_(this.getOptions(),"color","gradient","enabled");let l=He.minNodePadding;s.alluvial.nodePadding>He.minNodePadding&&(l=s.alluvial.nodePadding);const c=_(s,"alluvial","nodeAlignment");let u=Tg;c===Yt.LEFT?u=Q$:c===Yt.RIGHT&&(u=J$);const h=rL().nodeId(g=>g.name).nodeWidth(He.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=h({nodes:s.alluvial.nodes.map(g=>Object.assign({},g)),links:a.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const d={};this.graph.nodes.forEach(g=>{const v=g.x0;g.category&&(d[v]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(d)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,v)=>this.services.domUtils.generateElementIDString(`alluvial-category-${v}`)).style("font-size","14px").text(g=>d[g]?d[g]:"").attr("y",20).attr("x",(g,v)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-category-${v}`),{width:w}=P.getSVGElementSize(N(`text#${b}`),{useBBox:!0});let O=0;return g+O>=w&&(O=-w+4),O});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=_(this.getOptions(),"color","scale");g&&f.enter().append("linearGradient").attr("id",v=>`${this.gradient_id}-link-${v.index}`).attr("gradientUnits","userSpaceOnUse").call(v=>v.append("stop").attr("offset","0%").attr("stop-color",b=>g[b.source.name])).call(v=>v.append("stop").attr("offset","100%").attr("stop-color",b=>g[b.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",gL()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name)).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",He.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);p.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const m=p.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`));m.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${g.value})`).attr("aria-label",g=>`${g.name} (${g.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(g,v)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:w}=P.getSVGElementSize(N(`text#${b}`),{useBBox:!0});return w+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(g,v)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:w}=P.getSVGElementSize(N(`text#${b}`),{useBBox:!0}),O=(g.y1-g.y0)/2-9;let E=g.x1-g.x0;return g.x1>=w?E=E-(w+16):E+=4,`translate(${E}, ${O})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=Ha((i,s="mouseover")=>{const a=n.parent.selectAll("path.link").transition().call(o=>n.services.transitions.setupTransition({transition:o,name:"alluvial-links-mouse-highlight"}));s==="mouseout"?(N(i).lower(),a.style("stroke-opacity",He.opacity.default)):a.style("stroke-opacity",function(){return i===this?(N(this).raise(),He.opacity.selected):He.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(i,s){const a=N(this);r(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(A.Alluvial.LINE_MOUSEOVER,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(A.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:s.target.name,value:s.value+(t.alluvial.units?` ${t.alluvial.units}`:""),color:o,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(i,s){n.services.events.dispatchEvent(A.Alluvial.LINE_MOUSEMOVE,{event:i,element:N(this),datum:s}),n.services.events.dispatchEvent(A.Tooltip.MOVE,{event:i})}).on("click",function(i,s){n.services.events.dispatchEvent(A.Alluvial.LINE_CLICK,{event:i,element:N(this),datum:s})}).on("mouseout",function(i,s){const a=N(this);r(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(A.Alluvial.LINE_MOUSEOUT,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(A.Tooltip.HIDE,{event:i,hoveredElement:a})})}addNodeEventListener(){const t=this,n=Ha((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",He.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(N(this).classed("link-hovered",!0).raise(),He.opacity.selected):He.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=N(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=Wi(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),h=Wi(u.attr("transform"));u.attr("transform",`translate(${h.x+4},${h.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(A.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(A.Alluvial.NODE_MOUSEMOVE,{event:r,element:N(this),datum:i}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(A.Alluvial.NODE_CLICK,{event:r,element:N(this),datum:i})}).on("mouseout",function(r,i){const s=N(this),a=Wi(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",He.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Wi(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(A.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
71
+ </li>`).join("")+"</ul>"}valueFormatter(t,n){const r=this.getOptions(),i=x(r,"tooltip","valueFormatter");if(i)return i(t,n);if(typeof t.getTime=="function")return Dr(t,"MMM d, yyyy");try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t))return Dr(Date.parse(t),"MMM d, yyyy")}catch{}return t.toLocaleString()}render(t=!1){const n=this.getOptions(),r=x(n,"tooltip","enabled");if(r){const i=D(this.services.domUtils.getHolder()),s=x(n,"style","prefix");this.tooltip=L.appendOrSelect(i,`div.${ge}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=this.tooltip.node(),i=this.getOptions(),s=x(i,"zoomBar","top","enabled");let a=x(t,"detail","mousePosition");if(!a)a=Hn(x(t,"detail","event"),n);else{const d=x(i,"zoomBar","top","type"),f=Se.height[d];s&&(a[1]+=f+Se.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=ne.LEFT:a[0]/o<.1?c=ne.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[ne.RIGHT,ne.LEFT,ne.TOP,ne.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=_O;c===ne.LEFT&&(u*=-1);const h=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,h)}}const so=class extends ft{constructor(){super(...arguments),this.type="grid-brush",this.renderType=Q.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const i=L.appendOrSelect(n,"svg.chart-grid-backdrop"),s=L.appendOrSelect(i,`g.${this.type}`),a=L.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=L.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),h=c.getMainXScale(),[d]=h.range();r.attr("transform",`translate(${d},0)`);const f=L.appendOrSelect(r,this.frontSelectionSelector);if(h&&u===Z.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const m=_=>{const E=_[1]-_[0];let T="0,"+E.toString();const R=Math.floor(l/so.DASH_LENGTH),N=R*so.DASH_LENGTH;for(let A=0;A<R;A++)T+=","+so.DASH_LENGTH;T+=","+(l-N),R%2===1&&(T+=",0"),T+=","+E.toString(),T+=","+l.toString(),f.attr("stroke-dasharray",T)},g=_=>{const E=_.selection;E===null||E[0]===E[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),m(E))},v=(_,E)=>{const T=Kd().range([0,o]).domain(p);let R=[T.invert(_),T.invert(E)];R[0].valueOf()===R[1].valueOf()&&(R=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==R[0].valueOf()||p[1].valueOf()!==R[1].valueOf())&&this.services.zoom.handleDomainChange(R)};let y;const b=_=>{const E=_.selection;E!==null&&(v(E[0],E[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=fh().extent([[0,0],[o-1,l]]).on("start brush end",g).on("end.brushed",b),s.call(y));const S=this.services.zoom.getZoomRatio();i.on("click",function(_){if(_.shiftKey){const E=this.services.domUtils.getHolder(),T=Hn(s.node(),E)[0];let R=T-o*S/2;R<0&&(R=0);let N=T+o*S/2;N>o&&(N=o),v(R,N)}})}}};let Hm=so;Hm.DASH_LENGTH=4;class iI extends ft{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=Q.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=fh(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(O.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",H.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(H.TOP),i=this.services.zoom.isZoomBarLocked(H.TOP),s=x(this.getOptions(),"zoomBar",H.TOP,"type"),a=x(this.getOptions(),"axes",H.BOTTOM,"highlights"),o=Se.height[s],{width:l}=L.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const h=L.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(L.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Se.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ke.GRAPH_VIEW?L.appendOrSelect(h,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ke.SLIDER_VIEW&&L.appendOrSelect(h,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(h,c,l);return}const{cartesianScales:d}=this.services,f=d.getMainXScale(),p=d.getMainYScale(),m=d.getMainXScaleType();if(f&&m===Z.TIME){let g=this.services.zoom.getZoomBarData();if(ze(g)||g.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(g);g=this.compensateDataForDefaultDomain(g,v);const y=this.model.get("initialZoomDomain"),b=x(this.getOptions(),"zoomBar",H.TOP,"initialZoomDomain");b&&b[0]&&b[1]&&(b[0]=new Date(b[0]),b[1]=new Date(b[1])),b&&!(y&&y[0].valueOf()===b[0].valueOf()&&y[1].valueOf()===b[1].valueOf())?this.model.set({initialZoomDomain:rt([],b),zoomDomain:b?rt([],b):v},{skipUpdate:!0}):b===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:rt([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(De(g,E=>E.value));const S=this.model.get("zoomDomain");if(s===Ke.GRAPH_VIEW&&(this.renderZoomBarArea(h,"path.zoom-graph-area-unselected",g,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(h,"path.zoom-graph-area",g,this.clipId),this.renderZoomBarBaseline(h,c,l),a)){const E=a.highlightStartMapsTo,T=a.highlightEndMapsTo,R=a.color,N=a.labelMapsTo;a.data.forEach((A,C)=>{L.appendOrSelect(h,`rect.highlight-${C}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(A[E])).attr("width",this.xScale(A[T])-this.xScale(A[E])).style("fill",R&&R.scale[A[N]]?R.scale[A[N]]:null).style("fill-opacity",.1).style("stroke",R&&R.scale[A[N]]?R.scale[A[N]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(S,c,l);const _=L.appendOrSelect(n,this.brushSelector).call(this.brush);if(S!==void 0)if(S[0].valueOf()===S[1].valueOf())_.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const E=S.map(T=>this.xScale(T));E[1]-E[0]<this.MIN_SELECTION_DIFF||(_.call(this.brush.move,E),this.updateBrushHandle(this.getComponentContainer(),E))}i&&(this.brush.filter(()=>!1),_.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=x(this.getOptions(),"zoomBar",H.TOP,"type"),a=Se.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=O.ZoomBar.SELECTION_START:t.type==="brush"?a=O.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=O.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Se.handleWidth,s=x(this.getOptions(),"zoomBar",H.TOP,"type"),a=Se.height[s],o=-i/2,l=Se.handleBarWidth,c=s===Ke.GRAPH_VIEW?Se.handleBarHeight:6,u=-l/2,h=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const d=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),d.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",h).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ke.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=x(this.getOptions(),"zoomBar",H.TOP,"type"),r=Se.height[n],i=this.getComponentContainer().select("svg.zoom-container");L.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,y,b)=>S=>s.getValueFromScale(v,y,b,S),h=u(this.xScale,l,a),d=u(this.yScale,c,o),f=x(this.getOptions(),"zoomBar",H.TOP,"type"),p=Se.height[f],m=Dl().x(v=>h(v)).y0(p).y1(v=>p-d(v)),g=L.appendOrSelect(t,n).datum(r).attr("d",m);i&&g.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=L.appendOrSelect(t,"clipPath").attr("id",n);L.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=xn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=x(this.model.getOptions(),"zoomBar",H.TOP,"type"),a=Se.height[s],o=Ai()([[n,a],[r,a]]);L.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),L.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),x(this.getOptions(),"zoomBar",H.TOP,"type")===Ke.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(O.ZoomBar.UPDATE,this.render.bind(this))}}class sI extends ft{constructor(t,n){super(t,n),this.type="threshold",this.renderType=Q.SVG,this.positionService=new io}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(H).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u==null?void 0:u.correspondingDatasets,mapsTo:u==null?void 0:u.mapsTo})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),h=l.services.cartesianScales.getScaleTypeByPosition(c);let d=null,f=null;c===H.LEFT||c===H.RIGHT?(f=u,d=l.services.cartesianScales.getMainXScale()):(d=u,f=l.services.cartesianScales.getMainYScale());const p=h===Z.LABELS,[m,g]=d.range(),[v,y]=f.range(),{cartesianScales:b}=l.services,S=b.getOrientation(),_=A=>b.getDomainValue(A),E=A=>b.getRangeValue(A),[T,R]=_n(_,E,S),N=D(this);c===H.TOP||c===H.BOTTOM?(N.selectAll("line.threshold-line").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"threshold-line-update",animate:t})).attr("y1",y).attr("y2",v).attr("x1",({datum:A})=>T(A)+(p?u.step()/2:0)).attr("x2",({datum:A})=>T(A)+(p?u.step()/2:0)).style("stroke",({fillColor:A})=>A),N.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:A})=>-T(A)).attr("width",Math.abs(v-y)).classed("rotate",!0)):(N.selectAll("line.threshold-line").transition().call(A=>l.services.transitions.setupTransition({transition:A,name:"threshold-line-update",animate:t})).attr("x1",m).attr("x2",g).attr("y1",({datum:A})=>R(A)+(p?u.step()/2:0)).attr("y2",({datum:A})=>R(A)+(p?u.step()/2:0)).style("stroke",({fillColor:A})=>A),N.selectAll("rect.threshold-hoverable-area").attr("x",m).attr("y",({datum:A})=>R(A)).attr("width",Math.abs(g-m)).classed("rotate",!1))}),this.services.events.addEventListener(O.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(O.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(r)===Z.TIME){const s=[H.LEFT,H.RIGHT].includes(r),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),l=s?o:a,c=x(i,"timeScale"),u=yc(l.ticks(),x(c,"timeInterval"));return vc(n,0,l.ticks(),u,c)}return n.toLocaleString("en")}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=L.appendOrSelect(t,`div.${ge}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Hn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${n.label||"Threshold"}: ${s}`).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[ne.RIGHT,ne.LEFT,ne.TOP,ne.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=x(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){D(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(O.Threshold.SHOW,{event:n,hoveredElement:D(this),datum:D(this).datum()})}).on("mouseout",function(n){D(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(O.Threshold.HIDE,{event:n,hoveredElement:D(this),datum:D(this).datum()})})}}class aI extends ft{constructor(t,n){super(t,n),this.type="highlight",this.renderType=Q.SVG,this.positionService=new io,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(H).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),h=l.services.cartesianScales.getMainYScale(),[d,f]=u.range(),[p,m]=h.range(),{cartesianScales:g}=l.services,v=g.getOrientation(),y=T=>g.getDomainValue(T),b=T=>g.getRangeValue(T),[S,_]=_n(y,b,v),E=D(this);c===H.TOP||c===H.BOTTOM?E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("y",Math.max(m+l.highlightStrokeWidth,0)).attr("height",Math.max(p-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:T,...R})=>S(R[T])).attr("width",({highlightStartMapsTo:T,highlightEndMapsTo:R,...N})=>Math.max(S(N[R])-S(N[T]),0)).style("stroke",({color:T,labelMapsTo:R,...N})=>T&&T.scale[N[R]]?T.scale[N[R]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:R,...N})=>T&&T.scale[N[R]]?T.scale[N[R]]:null):E.selectAll("rect.highlight-bar").transition().call(T=>l.services.transitions.setupTransition({transition:T,name:"highlight-bar-update",animate:t})).attr("x",d).attr("width",Math.max(f-d,0)).attr("y",({highlightEndMapsTo:T,...R})=>_(R[T])).attr("height",({highlightStartMapsTo:T,highlightEndMapsTo:R,...N})=>Math.max(_(N[T])-_(N[R]),0)).style("stroke",({color:T,labelMapsTo:R,...N})=>T&&T.scale[N[R]]?T.scale[N[R]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:T,labelMapsTo:R,...N})=>T&&T.scale[N[R]]?T.scale[N[R]]:null)})}}class Fm extends Xc{getItems(t){if(t.detail.items)return t.detail.items;const n=t.detail.data;if(!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let h;if(n.length===1){const d=n[0],f=i.getRangeIdentifier(d);if(a){const m=i.getRangeAxisPosition({datum:d,groups:[d[o]]});c=i.getScaleLabel(m)}const p=d[f];h=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:d[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(m=>h.push({label:m.label,value:m.value})),h.push({label:r.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(h=[{label:l,value:u}],h=h.concat(n.map(d=>{const f=d[i.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:d[o]})}}).sort((d,f)=>f.value-d.value)),!a&&x(r,"tooltip","showTotal")===!0)){const d=i.getRangeIdentifier();h.push({label:kt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[d],0),bold:!0})}return h}}class oI extends ft{constructor(){super(...arguments),this.type="alluvial",this.renderType=Q.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.html("");const{width:r,height:i}=L.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(this.getOptions(),"color","gradient","enabled");let l=He.minNodePadding;s.alluvial.nodePadding>He.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=qg;c===Yt.LEFT?u=lL:c===Yt.RIGHT&&(u=cL);const h=fL().nodeId(g=>g.name).nodeWidth(He.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=h({nodes:s.alluvial.nodes.map(g=>Object.assign({},g)),links:a.map(g=>Object.assign({},g))}),this.graph.nodes=this.graph.nodes.filter(g=>g.value!==0);const d={};this.graph.nodes.forEach(g=>{const v=g.x0;g.category&&(d[v]=g==null?void 0:g.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(d)).join("g").attr("transform",g=>`translate(${g}, 0)`).append("text").attr("id",(g,v)=>this.services.domUtils.generateElementIDString(`alluvial-category-${v}`)).style("font-size","14px").text(g=>d[g]?d[g]:"").attr("y",20).attr("x",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-category-${v}`),{width:b}=L.getSVGElementSize(D(`text#${y}`),{useBBox:!0});let S=0;return g+S>=b&&(S=-b+4),S});const f=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(f.exit().remove(),o){const g=x(this.getOptions(),"color","scale");g&&f.enter().append("linearGradient").attr("id",v=>`${this.gradient_id}-link-${v.index}`).attr("gradientUnits","userSpaceOnUse").call(v=>v.append("stop").attr("offset","0%").attr("stop-color",y=>g[y.source.name])).call(v=>v.append("stop").attr("offset","100%").attr("stop-color",y=>g[y.target.name])),f.exit().remove()}f.enter().append("path").classed("link",!0).attr("d",OL()).attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-line-${g.index}`)).attr("class",g=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:g.source.index,originalClassName:"link"})).style("stroke",g=>o?`url(#${this.gradient_id}-link-${g.index})`:this.model.getFillColor(g.source.name)).attr("stroke-width",g=>Math.max(1,g.width)).style("stroke-opacity",He.opacity.default).attr("aria-label",g=>`${g.source.name} → ${g.target.name} (${g.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const p=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-${g.index}`)).classed("node-group",!0).attr("transform",g=>`translate(${g.x0}, ${g.y0})`);p.append("rect").classed("node",!0).attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill","black");const m=p.append("g").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${g.index}`));m.append("text").attr("id",g=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${g.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(g=>`${g.name} (${g.value})`).attr("aria-label",g=>`${g.name} (${g.value})`),m.append("rect").classed("node-text-bg",!0).attr("width",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:b}=L.getSVGElementSize(D(`text#${y}`),{useBBox:!0});return b+8}).attr("height",18).attr("stroke-width",2).lower(),m.attr("transform",(g,v)=>{const y=this.services.domUtils.generateElementIDString(`alluvial-node-text-${v}`),{width:b}=L.getSVGElementSize(D(`text#${y}`),{useBBox:!0}),S=(g.y1-g.y0)/2-9;let _=g.x1-g.x0;return g.x1>=b?_=_-(b+16):_+=4,`translate(${_}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=Fa((i,s="mouseover")=>{const a=n.parent.selectAll("path.link").transition().call(o=>n.services.transitions.setupTransition({transition:o,name:"alluvial-links-mouse-highlight"}));s==="mouseout"?(D(i).lower(),a.style("stroke-opacity",He.opacity.default)):a.style("stroke-opacity",function(){return i===this?(D(this).raise(),He.opacity.selected):He.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(i,s){const a=D(this);r(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOVER,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:s.target.name,value:s.value+(t.alluvial.units?` ${t.alluvial.units}`:""),color:o,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(i,s){n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEMOVE,{event:i,element:D(this),datum:s}),n.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){n.services.events.dispatchEvent(O.Alluvial.LINE_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);r(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(O.Alluvial.LINE_MOUSEOUT,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(O.Tooltip.HIDE,{event:i,hoveredElement:a})})}addNodeEventListener(){const t=this,n=Fa((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",He.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(D(this).classed("link-hovered",!0).raise(),He.opacity.selected):He.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=D(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=Xi(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),h=Xi(u.attr("transform"));u.attr("transform",`translate(${h.x+4},${h.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEMOVE,{event:r,element:D(this),datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Alluvial.NODE_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=Xi(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",He.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Xi(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(O.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
72
72
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
73
73
  <polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
74
74
  <rect width="32" height="32"/>
75
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Se extends gt{constructor(){super(...arguments),this.type="grid",this.renderType=nt.SVG}render(t=!0){const n=_(this.getOptions(),"grid","x","enabled"),r=_(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(P.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(P.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=lo(i).tickSizeInner(-r).tickSizeOuter(0);if(_(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=_(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=_(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=cu(i).tickSizeInner(-r).tickSizeOuter(0);if(_(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=_(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=_(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,h)=>Number(bn(u).tx)-Number(bn(h).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+bn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+bn(o).tx;else if(o)l=+bn(o).tx-+bn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=P.getSVGElementSize(u).width-+bn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=_(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=bn(this),s={min:Number(i.tx)-r,max:Number(i.tx)+r};return s.min<=t[0]&&t[0]<=s.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=P.appendOrSelect(r,"svg.chart-grid-backdrop");const u=P.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class _m extends gt{constructor(){super(...arguments),this.type="area",this.renderType=nt.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?pn.opacity.unselected:pn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",pn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Al().curve(this.services.curves.getD3Curve()).defined(E=>{const T=s.getRangeIdentifier();return E[T]!=null}),l=this.model.getGroupedData(this.configs.groups),c=_(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let h=0;const d=(E,T)=>{_(r,"axes",E,"includeZero")===!1&&T[0]>0&&T[1]>0&&(h=T[0])},f=E=>u?s.getBoundedScaledValues(E)[0]:s.getRangeValue(h),p=E=>u?s.getBoundedScaledValues(E)[1]:s.getRangeValue(E);a===Jt.VERTICAL?(i=s.getMainYScale().domain(),d(s.getMainYAxisPosition(),i),o.x(E=>s.getDomainValue(E)).y0(E=>f(E)).y1(E=>p(E))):(i=s.getMainXScale().domain(),d(s.getMainXAxisPosition(),i),o.x0(E=>f(E)).x1(E=>p(E)).y(E=>s.getDomainValue(E)));const m=_(r,"color","gradient","enabled"),g=l&&l.length===1&&m;l.length>1&&m&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,E=>E.name),b=N(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(g){const E=b.select(`path.${this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:l[0].name})}`).node();let T;if(E)T=getComputedStyle(E,null).getPropertyValue("stroke");else{const S=_(this.model.getOptions(),"color","scale");if(S!==null){const $=Object.keys(S);T=S[$[0]]}}mc.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:mc.getStops(i,T)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const w=this,O=v.enter().append("path");g?O.merge(v).style("fill",E=>`url(#${this.services.domUtils.generateElementIDString(`${E.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:E.name,originalClassName:"area"})).attr("d",E=>{const{data:T}=E;return o(T)}):(O.attr("opacity",0).merge(v).attr("class","area").attr("class",E=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:E.name,originalClassName:"area"})).style("fill",E=>w.model.getFillColor(E.name)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"area-update-enter",animate:t})).attr("opacity",u?1:pn.opacity.selected).attr("d",E=>{const{data:T}=E;return o(T)}),u&&O.attr("fill-opacity",pn.opacity.selected).style("stroke",E=>w.model.getStrokeColor(E.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class zr extends gt{constructor(){super(...arguments),this.type="line",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?gn.opacity.unselected:gn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",gn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=f=>r.getDomainValue(f),a=f=>r.getRangeValue(f),[o,l]=xn(s,a,r.getOrientation()),c=this.getOptions(),u=Mi().x(o).y(l).curve(i.getD3Curve()).defined(f=>{const p=r.getRangeIdentifier(f);return f[p]!=null});let h=[];if(this.configs.stacked){const f=Object.keys(c.axes).some(m=>c.axes[m].percentage),{groupMapsTo:p}=c.data;h=this.model.getStackedData({groups:this.configs.groups,percentage:f}).map(m=>{const g=this.services.cartesianScales.getDomainIdentifier(m),v=this.services.cartesianScales.getRangeIdentifier(m);return{name:_(m,0,p),data:m.map(b=>({[g]:b.data.sharedStackKey,[p]:b[p],[v]:b[1]})),hidden:!DD(m,b=>b[0]!==b[1])}})}else h=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(h,f=>f.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(h,f=>f.name).attr("class",f=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",f=>{const{data:p}=f;return p.map(m=>{const g=this.services.cartesianScales.getRangeIdentifier(m);return m[g]}).join(",")}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"line-update-enter",animate:t})).attr("opacity",f=>f.hidden?0:1).attr("d",f=>{const{data:p}=f;return u(p)})}destroy(){const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Em=5;function Kk(e,t){return e>t-Em&&e<t+Em}let kn=class extends gt{constructor(){super(...arguments),this.type="ruler",this.renderType=nt.SVG,this.isXGridEnabled=_(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=_(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=_(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Jt.HORIZONTAL?r:n,h=P.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),d=P.appendOrSelect(h,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(g=>({domainValue:this.services.cartesianScales.getDomainValue(g),originalData:g})).filter(g=>Kk(g.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(g=>g.domainValue).join()===this.pointsWithinLine.map(g=>g.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(A.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const m=this.pointsWithinLine.reduce((g,v)=>{if(g.length===0)return g.push(v),g;const b=g[0].domainValue,w=Math.abs(u-v.domainValue),O=Math.abs(u-b);return w>O||(w<O?g=[v]:g.push(v)),g},[]);if(m.length>0){const g=m.map(O=>O.originalData).filter(O=>{const E=this.services.cartesianScales.getRangeIdentifier(O);return O[E]!=null}),v=m.map(O=>O.domainValue),b=f.filter(O=>{const E=this.services.cartesianScales.getDomainValue(O);return v.includes(E)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!rm(this.elementsToHighlight,b)&&this.hideRuler(),b.dispatch("mouseover"),this.elementsToHighlight=b,this.services.events.dispatchEvent(A.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:d,data:this.formatTooltipData(g)}),h.attr("opacity",1);const w=m[0];s==="horizontal"?d.attr("x1",c).attr("x2",l).attr("y1",w.domainValue).attr("y2",w.domainValue):d.attr("y1",c).attr("y2",l).attr("x1",w.domainValue).attr("x2",w.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=P.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(A.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=Un(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=I2(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=P.appendOrSelect(t,"svg.chart-grid-backdrop")}};class tn extends gt{constructor(){super(...arguments),this.type="scatter",this.renderType=nt.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(A.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(A.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(_(this.getOptions(),"points","enabled")||_(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=xn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=xn(h=>r.getDomainValue(h),h=>r.getRangeValue(h),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,h]=xn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[st.FILL,st.STROKE]:[st.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",h).attr("r",r.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,i))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",i?s:1).attr("opacity",d?0:1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var s,a;const o=N(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(A.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(A.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=N(this);(s=t.services.events)==null||s.dispatchEvent(A.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(A.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(A.Scatter.SCATTER_CLICK,{event:r,element:N(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=N(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),h=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!h).style("fill",d=>h||c?t.model.getFillColor(d[n],d[u],d):null)}(a=t.services.events)==null||a.dispatchEvent(A.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:l})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(A.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(A.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}let Sm=class extends gt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=nt.SVG,this.truncation={[H.LEFT]:!1,[H.RIGHT]:!1,[H.TOP]:!1,[H.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=_(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=P.getSVGElementSize(s,{useAttrs:!0}),l=P.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===H.BOTTOM||n===H.TOP?(c=this.configs.axes[H.LEFT]?this.margins.left:0,u=this.configs.axes[H.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const h=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===tt.LABELS||this.scaleType===tt.LABELS_RATIO?h.rangeRound([c,u]):h.range([c,u]);let d;switch(n){case H.LEFT:d=cu;break;case H.BOTTOM:d=lo;break;case H.RIGHT:d=Wv;break;case H.TOP:d=jv;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=P.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${dt.GRAPHICS_OBJECT} ${dt.GROUP}`),p.attr("aria-label",`${n} ticks`));const m=P.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),g=_(r,"axes",n),v=this.scaleType===tt.TIME||g.scaleType===tt.TIME,b=n===H.LEFT||n===H.RIGHT,w=this.model.get("zoomDomain");if(w&&v&&!b&&h.domain(w),!i){p.attr("aria-hidden",!0);return}const O=_(g,"scaleType"),E=_(r,"data","loading"),T=_(g,"ticks","number"),S=_(g,"ticks","values"),$=_(g,"truncation","type"),k=_(g,"truncation","threshold"),L=_(g,"truncation","numCharacter"),M=T!==null,V=_(r,"timeScale"),x=P.appendOrSelect(m,"g.tick"),C=P.appendOrSelect(x,"text").text("0"),y=P.getSVGElementSize(C.node(),{useBBox:!0}).height;x.remove();const R=this.scaleType||g.scaleType||tt.LINEAR,I=d(h).tickSizeOuter(0);if(h.ticks){let q;if(M?q=T:(q=An.ticks.number,b&&(q=this.getNumberOfFittingTicks(o,y,An.ticks.verticalSpaceRatio))),h.ticks().length===1&&h.ticks()[0]===0&&(q=0),I.ticks(q),v)if(!h.ticks(q).length)I.tickValues([]);else{const Q=_(r,"timeScale","addSpaceOnEdges"),lt=_(r,"axes",n,"domain"),rt=h.copy();Q&&!lt&&rt.nice(q);const ot=rt.ticks(q);Q&&ot.length>2&&!lt&&(ot.splice(ot.length-1,1),ot.splice(0,1)),I.tickValues(ot)}}let B;const U=_(g,"ticks","formatter");if(v){const q=fc(I.tickValues(),_(r,"timeScale","timeInterval"));U===null?B=(Q,lt)=>dc(Q,lt,I.tickValues(),q,V):B=(Q,lt)=>{const rt=dc(Q,lt,I.tickValues(),q,V);return U(Q,lt,rt)}}else U===null?R===tt.LINEAR&&(B=q=>q.toLocaleString()):B=U;I.tickFormat(B);const[z,j]=this.services.cartesianScales.getScaleByPosition(n).domain();let G;if(S){if(v)S.forEach((q,Q)=>{q.getTime===void 0&&(S[Q]=new Date(q))}),G=S.filter(q=>{const Q=q.getTime();return Q>=new Date(z).getTime()&&Q<=new Date(j).getTime()});else if(O===tt.LABELS){const q=this.services.cartesianScales.getScaleByPosition(n).domain();G=S.filter(Q=>q.includes(Q))}else G=S.filter(q=>q>=z&&q<=j);I.tickValues(G)}switch(n){case H.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case H.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case H.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case H.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(g.title){const q=P.appendOrSelect(l,"text.axis-title").html(et||E?"":g.title),Q=_(g,"titleOrientation");let lt;switch(n){case H.LEFT:Q===Ul.RIGHT?q.attr("transform","rotate(90)").attr("y",0).attr("x",h.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):q.attr("transform","rotate(-90)").attr("y",0).attr("x",-(h.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case H.BOTTOM:q.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case H.RIGHT:Q===Ul.LEFT?q.attr("transform","rotate(-90)").attr("y",a).attr("x",-(h.range()[0]/2)).style("text-anchor","middle"):q.attr("transform","rotate(90)").attr("y",-a).attr("x",h.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case H.TOP:lt=P.getSVGElementSize(q,{useBBox:!0}).height,q.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${lt/2})`).style("text-anchor","middle");break}}if(v){const q=fc(I.tickValues(),_(r,"timeScale","timeInterval")),Q=V.showDayName,lt=p;t&&(p=p.transition().call(rt=>this.services.transitions.setupTransition({transition:rt,name:"axis-update",animate:t}))),p=p.call(I),lt.selectAll(".tick").data(I.tickValues(),h).order().select("text").style("font-weight",(rt,ot)=>gg(rt,ot,I.tickValues(),q,Q)?"bold":"normal")}else!t||!f?p=p.call(I):p=p.transition().call(q=>this.services.transitions.setupTransition({transition:q,name:"axis-update",animate:t})).call(I);if(m.call(I),n===H.BOTTOM||n===H.TOP){let q=!1;const Q=_(g,"ticks","rotation");if(Q===ma.ALWAYS)q=!0;else if(Q===ma.NEVER)q=!1;else if(!Q||Q===ma.AUTO)if(h.step)q=m.selectAll("g.tick text").nodes().some(lt=>P.getSVGElementSize(lt,{useBBox:!0}).width>=h.step());else{q=!1;const lt=m.append("text").text("A"),rt=P.getSVGElementSize(lt.node(),{useBBox:!0}).width;let ot;m.selectAll("g.tick").each(function(){const Y=N(this),X=parseFloat(_(bn(this),"tx"));X!==null&&ot+Y.text().length*rt*.8>=X&&(q=!0),ot=X}),lt.remove()}q?(M||(I.ticks(this.getNumberOfFittingTicks(a,y,An.ticks.horizontalSpaceRatio)),m.call(I),p.call(I)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===H.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(E?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",q=>q),m.selectAll("g.tick").attr("aria-label",q=>q),$!==Ve.NONE&&O===tt.LABELS&&!S){const q=this.services.cartesianScales.getScaleDomain(n);if(q.length>0){const Q=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(Q);const lt=this;l.selectAll("g.tick text").data(q).text(function(rt){return rt.length>k?(lt.truncation[n]=!0,qi(rt,$,L)):rt}),this.getInvisibleAxisRef().selectAll("g.tick text").data(q).text(function(rt){return rt.length>k?qi(rt,$,L):rt}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(q)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=P.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=_(i,"axes",n),a=_(s,"scaleType"),o=_(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(A.Axis.LABEL_MOUSEOVER,{event:c,element:N(this),datum:u}),a===tt.LABELS&&u.length>o&&l.services.events.dispatchEvent(A.Tooltip.SHOW,{event:c,hoveredElement:N(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(A.Axis.LABEL_MOUSEMOVE,{event:c,element:N(this),datum:u}),a===tt.LABELS&&u.length>o&&l.services.events.dispatchEvent(A.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(A.Axis.LABEL_CLICK,{event:c,element:N(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(A.Axis.LABEL_MOUSEOUT,{event:c,element:N(this),datum:u}),a===tt.LABELS&&l.services.events.dispatchEvent(A.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return nm(i,2,An.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;P.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}};class Qk extends Sm{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer(),i=P.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=N(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:h}=P.getSVGElementSize(c,{useBBox:!0}),d=P.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case H.LEFT:f=-u+Number(c.attr("x")),p=-(h/2);break;case H.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(h/2);break;case H.TOP:f=-(u/2),p=-h+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,d.attr("transform","rotate(-45)"));break;case H.BOTTOM:f=-(u/2),p=h/2-2,s.truncation[n]&&(f=-u,d.attr("transform","rotate(-45)"));break}d.attr("x",f-An.hover.rectanglePadding).attr("y",p).attr("width",u+An.hover.rectanglePadding*2).attr("height",h).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=P.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=_(i,"axes",n),a=_(s,"scaleType"),o=_(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=N(this).select("text"),h=u.datum();l.services.events.dispatchEvent(A.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:h}),a===tt.LABELS&&h.length>o&&l.services.events.dispatchEvent(A.Tooltip.SHOW,{event:c,element:u,datum:h})}).on("mousemove",function(c){const u=N(this).select("text"),h=u.datum();l.services.events.dispatchEvent(A.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:h}),l.services.events.dispatchEvent(A.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(A.Axis.LABEL_CLICK,{event:c,element:N(this).select("text"),datum:N(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(A.Axis.LABEL_MOUSEOUT,{event:c,element:N(this).select("text"),datum:N(this).select("text").datum()}),a===tt.LABELS&&l.services.events.dispatchEvent(A.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const h=c.target.getBoundingClientRect();u.clientX=h.x,u.clientY=h.y}l.services.events.dispatchEvent(A.Axis.LABEL_FOCUS,{event:{...c,...u},element:N(this),datum:N(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(A.Axis.LABEL_BLUR,{event:c,element:N(this),datum:N(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(A.Tooltip.HIDE),l.services.events.dispatchEvent(A.Axis.LABEL_BLUR,{event:c,element:N(this),datum:N(this).select("text").datum()})),n===H.LEFT||n===H.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;P.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class ve extends gt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=nt.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(H),i=_(this.getOptions(),"axes");r.forEach(a=>{i[H[a]]&&(n[H[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=H[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===ya.DEFAULT?new Sm(this.model,this.services,l):new Qk(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:h}=P.getSVGElementSize(c,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=P.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===H.LEFT||l===H.RIGHT)&&(d+=5)),l){case H.TOP:s.top=h+d;break;case H.BOTTOM:s.bottom=h+d;break;case H.LEFT:s.left=u+d;break;case H.RIGHT:s.right=u+d;break}}),this.services.events.dispatchEvent(A.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(A.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class he extends gt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=_(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Xt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Xt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Xt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Xt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Jt.VERTICAL&&this.drawYGrid(t),n===Jt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius(),r=0;this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Be().domain([0,1]).range(t),this.yScale=Be().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=P.getSVGElementSize(n,{useAttrs:!0});this.backdrop=P.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=P.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=_(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=P.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=_(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=P.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=P.getSVGElementSize(i,{useAttrs:!0}),o=P.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=_(this.getOptions(),l,"alignment");P.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ti().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),h=t+Math.abs(Dt.radiusOffset),d=t+(Math.min(s,a)-t*2)/2,f=P.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${h}, ${d})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Dt.xOffset;c===Yt.CENTER?p=s/2:c===Yt.RIGHT&&(p=s-t-Dt.xOffset);const m=t+Dt.yOffset;f.attr("transform",`translate(${p}, ${m})`)}computeOuterRadius(){const{width:t,height:n}=P.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Dt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=P.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=P.appendOrSelect(i,"defs").lower(),c=P.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
75
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Te extends ft{constructor(){super(...arguments),this.type="grid",this.renderType=Q.SVG}render(t=!0){const n=x(this.getOptions(),"grid","x","enabled"),r=x(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(L.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(L.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=po(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","x","numberOfTicks");s.ticks(o)}const a=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=yu(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),l=x(this.getOptions(),"axes",o,"ticks","values");l&&s.tickValues(l)}else{const o=x(this.getOptions(),"grid","y","numberOfTicks");s.ticks(o)}const a=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?a.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:t})).call(s):a.call(s),this.cleanGrid(a)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,h)=>Number(wn(u).tx)-Number(wn(h).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+wn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+wn(o).tx;else if(o)l=+wn(o).tx-+wn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=L.getSVGElementSize(u).width-+wn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=x(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=wn(this),s={min:Number(i.tx)-r,max:Number(i.tx)+r};return s.min<=t[0]&&t[0]<=s.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=L.appendOrSelect(r,"svg.chart-grid-backdrop");const u=L.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class Gm extends ft{constructor(){super(...arguments),this.type="area",this.renderType=Q.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?mn.opacity.unselected:mn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",mn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Dl().curve(this.services.curves.getD3Curve()).defined(_=>{const E=s.getRangeIdentifier();return _[E]!=null}),l=this.model.getGroupedData(this.configs.groups),c=x(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let h=0;const d=(_,E)=>{x(r,"axes",_,"includeZero")===!1&&E[0]>0&&E[1]>0&&(h=E[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(h),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Jt.VERTICAL?(i=s.getMainYScale().domain(),d(s.getMainYAxisPosition(),i),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(i=s.getMainXScale().domain(),d(s.getMainXAxisPosition(),i),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const m=x(r,"color","gradient","enabled"),g=l&&l.length===1&&m;l.length>1&&m&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,_=>_.name),y=D(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(g){const _=y.select(`path.${this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:l[0].name})}`).node();let E;if(_)E=getComputedStyle(_,null).getPropertyValue("stroke");else{const T=x(this.model.getOptions(),"color","scale");if(T!==null){const R=Object.keys(T);E=T[R[0]]}}Oc.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:Oc.getStops(i,E)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const b=this,S=v.enter().append("path");g?S.merge(v).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:E}=_;return o(E)}):(S.attr("opacity",0).merge(v).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:_.name,originalClassName:"area"})).style("fill",_=>b.model.getFillColor(_.name)).transition().call(_=>this.services.transitions.setupTransition({transition:_,name:"area-update-enter",animate:t})).attr("opacity",u?1:mn.opacity.selected).attr("d",_=>{const{data:E}=_;return o(E)}),u&&S.attr("fill-opacity",mn.opacity.selected).style("stroke",_=>b.model.getStrokeColor(_.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class qr extends ft{constructor(){super(...arguments),this.type="line",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",vn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=f=>r.getDomainValue(f),a=f=>r.getRangeValue(f),[o,l]=_n(s,a,r.getOrientation()),c=this.getOptions(),u=Ai().x(o).y(l).curve(i.getD3Curve()).defined(f=>{const p=r.getRangeIdentifier(f);return f[p]!=null});let h=[];if(this.configs.stacked){const f=Object.keys(c.axes).some(m=>c.axes[m].percentage),{groupMapsTo:p}=c.data;h=this.model.getStackedData({groups:this.configs.groups,percentage:f}).map(m=>{const g=this.services.cartesianScales.getDomainIdentifier(m),v=this.services.cartesianScales.getRangeIdentifier(m);return{name:x(m,0,p),data:m.map(y=>({[g]:y.data.sharedStackKey,[p]:y[p],[v]:y[1]})),hidden:!FR(m,y=>y[0]!==y[1])}})}else h=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(h,f=>f.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(h,f=>f.name).attr("class",f=>this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:f.name,originalClassName:"line"})).style("stroke",f=>this.model.getStrokeColor(f.name)).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",f=>{const{data:p}=f;return p.map(m=>{const g=this.services.cartesianScales.getRangeIdentifier(m);return m[g]}).join(",")}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"line-update-enter",animate:t})).attr("opacity",f=>f.hidden?0:1).attr("d",f=>{const{data:p}=f;return u(p)})}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const zm=5;function lI(e,t){return e>t-zm&&e<t+zm}let Nn=class extends ft{constructor(){super(...arguments),this.type="ruler",this.renderType=Q.SVG,this.isXGridEnabled=x(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=x(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=x(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Jt.HORIZONTAL?r:n,h=L.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),d=L.appendOrSelect(h,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(g=>({domainValue:this.services.cartesianScales.getDomainValue(g),originalData:g})).filter(g=>lI(g.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(g=>g.domainValue).join()===this.pointsWithinLine.map(g=>g.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(O.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const m=this.pointsWithinLine.reduce((g,v)=>{if(g.length===0)return g.push(v),g;const y=g[0].domainValue,b=Math.abs(u-v.domainValue),S=Math.abs(u-y);return b>S||(b<S?g=[v]:g.push(v)),g},[]);if(m.length>0){const g=m.map(S=>S.originalData).filter(S=>{const _=this.services.cartesianScales.getRangeIdentifier(S);return S[_]!=null}),v=m.map(S=>S.domainValue),y=f.filter(S=>{const _=this.services.cartesianScales.getDomainValue(S);return v.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sm(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:d,data:this.formatTooltipData(g)}),h.attr("opacity",1);const b=m[0];s==="horizontal"?d.attr("x1",c).attr("x2",l).attr("y1",b.domainValue).attr("y2",b.domainValue):d.attr("y1",c).attr("y2",l).attr("x1",b.domainValue).attr("x2",b.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=L.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(O.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=Hn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=nA(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=L.appendOrSelect(t,"svg.chart-grid-backdrop")}};class tn extends ft{constructor(){super(...arguments),this.type="scatter",this.renderType=Q.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(x(this.getOptions(),"points","enabled")||x(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services;if(!s)throw new Error("Services cartesianScales are undefined.");const a=s.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),c=>`${c[i]}-${c[a]}`);o.exit().attr("opacity",0).remove();const l=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(l,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=_n(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=_n(h=>r.getDomainValue(h),h=>r.getRangeValue(h),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,h]=_n(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[tt.FILL,tt.STROKE]:[tt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",h).attr("r",r.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,i))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",i?s:1).attr("opacity",d?0:1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var s,a;const o=D(this);o.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:l[n],originalClassName:o.attr("class")})).style("fill",l=>{var c;const u=(c=t.services.cartesianScales)==null?void 0:c.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[u],l)}).classed("unfilled",!1),(s=t.services.events)==null||s.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:o,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOVER,{event:r,element:o,datum:i})}).on("mousemove",function(r,i){var s,a;const o=D(this);(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_MOUSEMOVE,{event:r,element:o,datum:i}),(a=t.services.events)==null||a.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(O.Scatter.SCATTER_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){var s,a,o;const l=D(this);if(l.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(s=t.services.cartesianScales)==null?void 0:s.getDomainIdentifier(i),h=t.model.getIsFilled(i[n],i[u],i,c);l.classed("unfilled",!h).style("fill",d=>h||c?t.model.getFillColor(d[n],d[u],d):null)}(a=t.services.events)==null||a.dispatchEvent(O.Scatter.SCATTER_MOUSEOUT,{event:r,element:l,datum:i}),(o=t.services.events)==null||o.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:l})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(O.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(O.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}let jm=class extends ft{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=Q.SVG,this.truncation={[H.LEFT]:!1,[H.RIGHT]:!1,[H.TOP]:!1,[H.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=x(r,"axes",n,"visible"),s=this.getComponentContainer(),{width:a,height:o}=L.getSVGElementSize(s,{useAttrs:!0}),l=L.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===H.BOTTOM||n===H.TOP?(c=this.configs.axes[H.LEFT]?this.margins.left:0,u=this.configs.axes[H.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const h=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===Z.LABELS||this.scaleType===Z.LABELS_RATIO?h.rangeRound([c,u]):h.range([c,u]);let d;switch(n){case H.LEFT:d=yu;break;case H.BOTTOM:d=po;break;case H.RIGHT:d=f0;break;case H.TOP:d=d0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=L.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${lt.GRAPHICS_OBJECT} ${lt.GROUP}`),p.attr("aria-label",`${n} ticks`));const m=L.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),g=x(r,"axes",n),v=this.scaleType===Z.TIME||g.scaleType===Z.TIME,y=n===H.LEFT||n===H.RIGHT,b=this.model.get("zoomDomain");if(b&&v&&!y&&h.domain(b),!i){p.attr("aria-hidden",!0);return}const S=x(g,"scaleType"),_=x(r,"data","loading"),E=x(g,"ticks","number"),T=x(g,"ticks","values"),R=x(g,"truncation","type"),N=x(g,"truncation","threshold"),A=x(g,"truncation","numCharacter"),C=E!==null,V=x(r,"timeScale"),M=L.appendOrSelect(m,"g.tick"),k=L.appendOrSelect(M,"text").text("0"),w=L.getSVGElementSize(k.node(),{useBBox:!0}).height;M.remove();const P=this.scaleType||g.scaleType||Z.LINEAR,U=d(h).tickSizeOuter(0);if(h.ticks){let z;if(C?z=E:(z=Ln.ticks.number,y&&(z=this.getNumberOfFittingTicks(o,w,Ln.ticks.verticalSpaceRatio))),h.ticks().length===1&&h.ticks()[0]===0&&(z=0),U.ticks(z),v)if(!h.ticks(z).length)U.tickValues([]);else{const K=x(r,"timeScale","addSpaceOnEdges"),ht=x(r,"axes",n,"domain"),it=h.copy();K&&!ht&&it.nice(z);const Mt=it.ticks(z);K&&Mt.length>2&&!ht&&(Mt.splice(Mt.length-1,1),Mt.splice(0,1)),U.tickValues(Mt)}}let I;const B=x(g,"ticks","formatter");if(v){const z=yc(U.tickValues(),x(r,"timeScale","timeInterval"));B===null?I=(K,ht)=>vc(K,ht,U.tickValues(),z,V):I=(K,ht)=>{const it=vc(K,ht,U.tickValues(),z,V);return B(K,ht,it)}}else B===null?P===Z.LINEAR&&(I=z=>z.toLocaleString()):I=B;U.tickFormat(I);const[j,Y]=this.services.cartesianScales.getScaleByPosition(n).domain();let et;if(T){if(v)T.forEach((z,K)=>{z.getTime===void 0&&(T[K]=new Date(z))}),et=T.filter(z=>{const K=z.getTime();return K>=new Date(j).getTime()&&K<=new Date(Y).getTime()});else if(S===Z.LABELS){const z=this.services.cartesianScales.getScaleByPosition(n).domain();et=T.filter(K=>z.includes(K))}else et=T.filter(z=>z>=j&&z<=Y);U.tickValues(et)}switch(n){case H.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case H.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case H.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case H.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const pt=this.model.isDataEmpty();if(g.title){const z=L.appendOrSelect(l,"text.axis-title").html(pt||_?"":g.title),K=x(g,"titleOrientation");let ht;switch(n){case H.LEFT:K===Gl.RIGHT?z.attr("transform","rotate(90)").attr("y",0).attr("x",h.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):z.attr("transform","rotate(-90)").attr("y",0).attr("x",-(h.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case H.BOTTOM:z.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case H.RIGHT:K===Gl.LEFT?z.attr("transform","rotate(-90)").attr("y",a).attr("x",-(h.range()[0]/2)).style("text-anchor","middle"):z.attr("transform","rotate(90)").attr("y",-a).attr("x",h.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case H.TOP:ht=L.getSVGElementSize(z,{useBBox:!0}).height,z.attr("transform",`translate(${this.margins.left/2+h.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(v){const z=yc(U.tickValues(),x(r,"timeScale","timeInterval")),K=V.showDayName,ht=p;t&&(p=p.transition().call(it=>this.services.transitions.setupTransition({transition:it,name:"axis-update",animate:t}))),p=p.call(U),ht.selectAll(".tick").data(U.tickValues(),h).order().select("text").style("font-weight",(it,Mt)=>Sg(it,Mt,U.tickValues(),z,K)?"bold":"normal")}else!t||!f?p=p.call(U):p=p.transition().call(z=>this.services.transitions.setupTransition({transition:z,name:"axis-update",animate:t})).call(U);if(m.call(U),n===H.BOTTOM||n===H.TOP){let z=!1;const K=x(g,"ticks","rotation");if(K===va.ALWAYS)z=!0;else if(K===va.NEVER)z=!1;else if(!K||K===va.AUTO)if(h.step)z=m.selectAll("g.tick text").nodes().some(ht=>L.getSVGElementSize(ht,{useBBox:!0}).width>=h.step());else{z=!1;const ht=m.append("text").text("A"),it=L.getSVGElementSize(ht.node(),{useBBox:!0}).width;let Mt;m.selectAll("g.tick").each(function(){const W=D(this),J=parseFloat(x(wn(this),"tx"));J!==null&&Mt+W.text().length*it*.8>=J&&(z=!0),Mt=J}),ht.remove()}z?(C||(U.ticks(this.getNumberOfFittingTicks(a,w,Ln.ticks.horizontalSpaceRatio)),m.call(U),p.call(U)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===H.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(_?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",z=>z),m.selectAll("g.tick").attr("aria-label",z=>z),R!==Ve.NONE&&S===Z.LABELS&&!T){const z=this.services.cartesianScales.getScaleDomain(n);if(z.length>0){const K=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(K);const ht=this;l.selectAll("g.tick text").data(z).text(function(it){return it.length>N?(ht.truncation[n]=!0,Zi(it,R,A)):it}),this.getInvisibleAxisRef().selectAll("g.tick text").data(z).text(function(it){return it.length>N?Zi(it,R,A):it}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(z)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=L.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:D(this),datum:u}),a===Z.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,hoveredElement:D(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:D(this),datum:u}),a===Z.LABELS&&u.length>o&&l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:D(this),datum:u}),a===Z.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return Em(i,2,Ln.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;L.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}};class cI extends jm{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer(),i=L.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=D(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:h}=L.getSVGElementSize(c,{useBBox:!0}),d=L.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case H.LEFT:f=-u+Number(c.attr("x")),p=-(h/2);break;case H.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(h/2);break;case H.TOP:f=-(u/2),p=-h+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,d.attr("transform","rotate(-45)"));break;case H.BOTTOM:f=-(u/2),p=h/2-2,s.truncation[n]&&(f=-u,d.attr("transform","rotate(-45)"));break}d.attr("x",f-Ln.hover.rectanglePadding).attr("y",p).attr("width",u+Ln.hover.rectanglePadding*2).attr("height",h).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=L.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=x(i,"axes",n),a=x(s,"scaleType"),o=x(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=D(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:h}),a===Z.LABELS&&h.length>o&&l.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,element:u,datum:h})}).on("mousemove",function(c){const u=D(this).select("text"),h=u.datum();l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:h}),l.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_CLICK,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_MOUSEOUT,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()}),a===Z.LABELS&&l.services.events.dispatchEvent(O.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const h=c.target.getBoundingClientRect();u.clientX=h.x,u.clientY=h.y}l.services.events.dispatchEvent(O.Axis.LABEL_FOCUS,{event:{...c,...u},element:D(this),datum:D(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(O.Tooltip.HIDE),l.services.events.dispatchEvent(O.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})),n===H.LEFT||n===H.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;L.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class ye extends ft{constructor(){super(...arguments),this.type="2D-axes",this.renderType=Q.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(H),i=x(this.getOptions(),"axes");r.forEach(a=>{i[H[a]]&&(n[H[a]]=!0)}),this.configs.axes=n,r.forEach(a=>{const o=H[a];if(this.configs.axes[o]&&!this.children[o]){const l={position:o,axes:this.configs.axes,margins:this.margins},c=this.model.axisFlavor===ba.DEFAULT?new jm(this.model,this.services,l):new cI(this.model,this.services,l);c.setModel(this.model),c.setServices(this.services),c.setParent(this.parent),this.children[o]=c}}),Object.keys(this.children).forEach(a=>{this.children[a].render(t)});const s={};Object.keys(this.children).forEach(a=>{const o=this.children[a],l=o.configs.position,c=o.getInvisibleAxisRef(),{width:u,height:h}=L.getSVGElementSize(c,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=L.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(l===H.LEFT||l===H.RIGHT)&&(d+=5)),l){case H.TOP:s.top=h+d;break;case H.BOTTOM:s.bottom=h+d;break;case H.LEFT:s.left=u+d;break;case H.RIGHT:s.right=u+d;break}}),this.services.events.dispatchEvent(O.Axis.RENDER_COMPLETE),Object.keys(s).some(a=>this.margins[a]!==s[a])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(O.ZoomBar.UPDATE),Object.keys(this.children).forEach(a=>{const o=this.children[a];o.margins=this.margins}),this.render(!0))}}class he extends ft{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=x(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Xt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Xt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Xt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Xt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Jt.VERTICAL&&this.drawYGrid(t),n===Jt.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius(),r=0;this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Be().domain([0,1]).range(t),this.yScale=Be().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=L.getSVGElementSize(n,{useAttrs:!0});this.backdrop=L.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=L.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=x(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=L.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=x(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=L.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=L.getSVGElementSize(i,{useAttrs:!0}),o=L.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=x(this.getOptions(),l,"alignment");L.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=$i().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),h=t+Math.abs(At.radiusOffset),d=t+(Math.min(s,a)-t*2)/2,f=L.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${h}, ${d})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+At.xOffset;c===Yt.CENTER?p=s/2:c===Yt.RIGHT&&(p=s-t-At.xOffset);const m=t+At.yOffset;f.attr("transform",`translate(${p}, ${m})`)}computeOuterRadius(){const{width:t,height:n}=L.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+At.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const n="stop-bg-shimmer",r="stop-shimmer",i=this.parent.select(".chart-skeleton"),{width:s}=L.getSVGElementSize(this.parent,{useAttrs:!0}),a=0,o=s,l=L.appendOrSelect(i,"defs").lower(),c=L.appendOrSelect(l,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",a-3*.2*s).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),u=`
76
76
  <stop class="${n}" offset="${a}"></stop>
77
77
  <stop class="${r}" offset="${a+.2}"></stop>
78
78
  <stop class="${n}" offset="${a+2*.2}"></stop>
79
- `;c.html(u),h();function h(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(ub).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",h)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class Jk extends gt{constructor(){super(...arguments),this.type="boxplot",this.renderType=nt.SVG}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,h]=o.range(),d=c-l,f=u-h;if(d===0)return;const{cartesianScales:p}=this.services,m=p.getOrientation(),g=m===Jt.VERTICAL,[v,b]=xn(M=>this.services.cartesianScales.getDomainValue(M),M=>this.services.cartesianScales.getRangeValue(M),m),w=Math.floor((g?d:f)/s.length),O=Math.min(w/2,16),E=this.model.getBoxplotData(),T=n.selectAll(".box-group").data(E);T.exit().remove();const S=T.enter().append("g").attr("class","box-group"),$=T.merge(S);S.append("path").merge(T.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ce.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalstartline",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i]),x=V,C=p.getRangeValue(M.whiskers.min),y=p.getRangeValue(M.quartiles.q_25);return ue({x0:V,x1:x,y0:C,y1:y},m)}),S.append("path").merge(T.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ce.strokeWidth.default).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-verticalendline",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i]),x=V,C=p.getRangeValue(M.whiskers.max),y=p.getRangeValue(M.quartiles.q_75);return ue({x0:V,x1:x,y0:C,y1:y},m)}),S.append("path").merge(T.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"box"})).attr("fill-opacity",Ce.box.opacity.default).attr("stroke-width",Ce.strokeWidth.default).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",M=>M[i]).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-quartiles",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-O/2,x=V+O,C=p.getRangeValue(Math[g?"max":"min"](M.quartiles.q_75,M.quartiles.q_25)),y=C+Math.abs(p.getRangeValue(M.quartiles.q_75)-p.getRangeValue(M.quartiles.q_25));return ue({x0:V,x1:x,y0:C,y1:y},m)}),S.append("path").merge(T.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",M=>{const V=p.getDomainValue(M[i])-O/2,x=V+O,C=p.getRangeValue(M.whiskers.min),y=p.getRangeValue(M.whiskers.max);return ue({x0:V,x1:x,y0:C,y1:y},m)}),S.append("path").merge(T.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ce.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-startingwhisker",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-O/4,x=V+O/2,C=p.getRangeValue(M.whiskers.min),y=p.getRangeValue(M.whiskers.min);return ue({x0:V,x1:x,y0:C,y1:y},m)}),S.append("path").merge(T.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-median",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-O/2,x=V+O,C=p.getRangeValue(M.quartiles.q_50);return ue({x0:V,x1:x,y0:C,y1:C},m)}),S.append("path").merge(T.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ce.strokeWidth.thicker).attr("fill","none").transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-endingwhisker",animate:t})).attr("d",M=>{const V=p.getDomainValue(M[i])-O/4,x=V+O/2,C=p.getRangeValue(M.whiskers.max),y=p.getRangeValue(M.whiskers.max);return ue({x0:V,x1:x,y0:C,y1:y},m)});const k=$.selectAll("circle.outlier").data(M=>M.outliers.map(V=>({min:M.whiskers.min,max:M.whiskers.max,[i]:M[i],value:V})));k.exit().remove();const L=k.enter().append("circle");k.merge(L).attr("r",Ce.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ce.circle.opacity.default).attr("cx",v).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"boxplot-update-circles",animate:t})).attr("cy",b),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=N(this);N(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ce.box.opacity.hovered),t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(A.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=N(this);t.services.events.dispatchEvent(A.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(A.Boxplot.BOX_CLICK,{event:i,element:N(this),datum:s})}).on("mouseout",function(i,s){const a=N(this);N(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ce.box.opacity.default),t.services.events.dispatchEvent(A.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=N(this);o.classed("hovered",!0).attr("fill-opacity",Ce.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(A.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=N(this);t.services.events.dispatchEvent(A.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(A.Boxplot.OUTLIER_CLICK,{event:s,element:N(this),datum:a})}).on("mouseout",function(s,a){const o=N(this);o.classed("hovered",!1).attr("fill-opacity",Ce.circle.opacity.default),t.services.events.dispatchEvent(A.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:o})})}}class jr extends gt{constructor(){super(...arguments),this.type="zero-line",this.renderType=nt.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer();if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const h=ag({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());P.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:t})).attr("y1",h.y0).attr("y2",h.y1).attr("x1",h.x0).attr("x2",h.x1)}}class tR extends tn{constructor(){super(...arguments),this.type="bubble",this.renderType=nt.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=P.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?Re(s):[1,1];return Be().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=d=>o.getDomainValue(d),c=d=>o.getRangeValue(d),[u,h]=xn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",d=>{const f=o.getRangeIdentifier(d);return d[f]}).transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",h).attr("r",d=>s(d[i]||1)).attr("class",d=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:d[a],originalClassName:"dot"})).style("fill",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getFillColor(d[a],d[f],d)}).style("stroke",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getStrokeColor(d[a],d[f],d)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=_(this.getOptions(),"bubble");return[{label:_(n,"radiusLabel"),value:t[_(n,"radiusMapsTo")]}]}}class eR extends gt{constructor(){super(...arguments),this.type="bullet",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),h=()=>{const m=[];s.forEach(v=>{v.ranges?v.ranges.forEach((b,w)=>{b!=null&&b<u&&m.push({datum:v,value:b,order:w+1})}):m.push({datum:v,order:1})});const g=P.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(m,v=>`${v[r]}-${v.order}`);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let b,w,O,E;return v.order===1?(b=this.services.cartesianScales.getDomainValue(v.datum)-16/2,w=b+16,O=c-2,E=l+1):(b=this.services.cartesianScales.getDomainValue(v.datum)-16/2,w=b+16,O=this.services.cartesianScales.getRangeValue(v.value),E=c),ue({x0:b,x1:w,y0:O,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},d=()=>{const m=P.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("bar",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-bar-update-enter",animate:t})).attr("class",g=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:g[r],originalClassName:"bar"})).style("fill",g=>this.model.getFillColor(g[r])).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-4,b=v+8,w=this.services.cartesianScales.getRangeValue(0)+1,O=this.services.cartesianScales.getRangeValue(g);return ue({x0:v,x1:b,y0:w,y1:O},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",g=>g.value)},f=()=>{const m=P.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(g=>_(g,"marker")!==null),g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("marker",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-marker-update-enter",animate:t})).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-12,b=v+24,w=this.services.cartesianScales.getRangeValue(g.marker);return ue({x0:v,x1:b,y0:w,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let m=[];s.filter(v=>_(v,"marker")!==null).forEach(v=>{const b=v.marker,w=v[o];m=m.concat([{datum:v,value:b*.25,barValue:w},{datum:v,value:b*.5,barValue:w},{datum:v,value:b*.75,barValue:w}])});const g=P.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(m,v=>v[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:b})=>{let w=4;v.ranges&&v.ranges.indexOf(b)!==-1&&(w=8);const O=this.services.cartesianScales.getDomainValue(v)-w/2,E=O+w,T=this.services.cartesianScales.getRangeValue(b);return ue({x0:O,x1:E,y0:T,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};h(),d(),f(),p(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("path.bar").on("mouseover",function(s,a){const o=N(this);o.classed("hovered",!0),t.services.events.dispatchEvent(A.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=_(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:a[r]})},{label:"Value",value:a[i]},{label:"Target",value:a.marker},{label:"Percentage",value:`${Math.floor(a[i]/a.marker*100)}%`},{label:"Performance",value:l[c]}]})}).on("mousemove",function(s,a){t.services.events.dispatchEvent(A.Bar.BAR_MOUSEMOVE,{event:s,element:N(this),datum:a}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(A.Bar.BAR_CLICK,{event:s,element:N(this),datum:a})}).on("mouseout",function(s,a){const o=N(this);o.classed("hovered",!1),t.services.events.dispatchEvent(A.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function nR(e){return e}function rR(e){if(e==null)return nR;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,h=new Array(u);for(h[0]=(t+=o[0])*r+s,h[1]=(n+=o[1])*i+a;c<u;)h[c]=o[c],++c;return h}}function iR(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function sR(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Om(e,n)})}:Om(e,t)}function Om(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Hc(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:s}:r==null?{type:"Feature",id:n,properties:i,geometry:s}:{type:"Feature",id:n,bbox:r,properties:i,geometry:s}}function Hc(e,t){var n=rR(e.transform),r=e.arcs;function i(u,h){h.length&&h.pop();for(var d=r[u<0?~u:u],f=0,p=d.length;f<p;++f)h.push(n(d[f],f));u<0&&iR(h,p)}function s(u){return n(u)}function a(u){for(var h=[],d=0,f=u.length;d<f;++d)i(u[d],h);return h.length<2&&h.push(h[0]),h}function o(u){for(var h=a(u);h.length<4;)h.push(h[0]);return h}function l(u){return u.map(o)}function c(u){var h=u.type,d;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(c)};case"Point":d=s(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(s);break;case"LineString":d=a(u.arcs);break;case"MultiLineString":d=u.arcs.map(a);break;case"Polygon":d=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:h,coordinates:d}}return c(t)}function aR(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var h=e.arcs[c<0?~c:c],d;h.length<3&&!h[1][0]&&!h[1][1]&&(d=t[++a],t[a]=c,t[u]=d)}),t.forEach(function(c){var u=o(c),h=u[0],d=u[1],f,p;if(f=i[h])if(delete i[f.end],f.push(c),f.end=d,p=r[d]){delete r[p.start];var m=p===f?f:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[f.start]=i[f.end]=f;else if(f=r[d])if(delete r[f.start],f.unshift(c),f.start=h,p=i[h]){delete i[p.end];var g=p===f?f:p.concat(f);r[g.start=p.start]=i[g.end=f.end]=g}else r[f.start]=i[f.end]=f;else f=[c],r[f.start=h]=i[f.end=d]=f});function o(c){var u=e.arcs[c<0?~c:c],h=u[0],d;return e.transform?(d=[0,0],u.forEach(function(f){d[0]+=f[0],d[1]+=f[1]})):d=u[u.length-1],c<0?[d,h]:[h,d]}function l(c,u){for(var h in c){var d=c[h];delete u[d.start],delete d.start,delete d.end,d.forEach(function(f){n[f<0?~f:f]=1}),s.push(d)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function oR(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function lR(e){return Hc(e,cR.apply(this,arguments))}function cR(e,t){var n={},r=[],i=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return oR(Hc(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(h){h.forEach(function(d){n[d<0?~d:d].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(m){m.forEach(function(g){g.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=aR(e,c),(u=c.length)>1)for(var h=1,d=o(c[0]),f,p;h<u;++h)(f=o(c[h]))>d&&(p=c[0],c[0]=c[h],c[h]=p,d=f);return c}).filter(function(l){return l.length>0})}}class uR extends kn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=nt.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),h=a.getDomainScale(),d=h.invert(o===Jt.VERTICAL?n:r),f=P.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=P.appendOrSelect(f,"line.ruler-line"),m=i.selectAll("[role=graphics-symbol]").filter(g=>{if(parseFloat(kt(g,"data.x0"))<=d&&parseFloat(kt(g,"data.x1"))>=d)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!rm(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const g=N(m.nodes()[0]).datum(),v=parseFloat(kt(g,"data.x0")),b=parseFloat(kt(g,"data.x1")),w=this.model.getActiveDataGroupNames(),O=w.reverse().map(E=>({label:E,value:kt(g,`data.${E}`),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:E})})).filter(E=>E.value!==0);if(O.length>0){this.services.events.dispatchEvent(A.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:kt(s,"bins.rangeLabel")||"Range",value:`${v} – ${b}`},...O,..._(s,"tooltip","showTotal")===!0?[{label:kt(s,"tooltip.totalLabel")||"Total",value:w.reduce((T,S)=>T+parseFloat(kt(g,`data.${S}`)),0)}]:[]]}),f.attr("opacity",1);const E=h((v+b)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",E).attr("y2",E):p.attr("y1",u).attr("y2",c).attr("x1",E).attr("x2",E)}else this.hideRuler()}else this.hideRuler()}}class eo extends kn{formatTooltipData(t){return t.reverse()}}const hR=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=ah();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},dR={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},fR={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},pR={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},gR={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},mR={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},vR={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class Tm extends Bc{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=nt.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=P.getSVGElementSize(i,{useAttrs:!0}),a=_(this.getOptions(),"data","loading");if(s>Vt.color.barWidth&&!a){const o=_(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=P.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),h=c[0]-u-9;h>1?i.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(A.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer(),{width:i}=P.getSVGElementSize(r,{useAttrs:!0}),s=_(n,"color","gradient","colors"),a=_(n,this.chartType,"colorLegend","type");let o=_(n,"color","pairing","option");const l=_(n,"heatmap","colorLegend","title");if(_(this.getOptions(),"data","loading")){r.html("");return}const c=!ze(s),u=xg(this.model.getDisplayData()),h=!(i<=Vt.color.barWidth),d=h?Vt.color.barWidth:i,f=P.appendOrSelect(r,"g.legend"),p=P.appendOrSelect(f,"g.legend-axis");if(l){const S=P.appendOrSelect(r,"g.legend-title");P.appendOrSelect(S,"text").text(l).attr("dy","0.7em"),f.attr("transform","translate(0, 16)")}const m=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let g=[];const v=m==="diverge"?17:11;if(c)g=s;else for(let S=1;S<v+1;S++)g.push(a===va.LINEAR?`stop-color-${m}-${o}-${S}`:`fill-${m}-${o}-${S}`);const b=we(u[0],u[1]),w=n1(b,3),O=Be().domain(u).range([0,d]),E=lo(O).tickSize(0).tickValues(w);let T;switch(a){case va.LINEAR:this.drawLinear(g,f,d);break;case va.QUANTIZE:T=this.drawQuantize(g,m,c,f,d),O.range([T,d]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Vt.color.axisYTranslation})`).call(E),p.select(".domain").remove(),p.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),p.select("g.tick:first-of-type text").style("text-anchor",h&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,r){const i=100/(t.length-1);P.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),P.appendOrSelect(n,"rect").attr("width",r).attr("height",Vt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=xi().domain(t).range([0,s]);return P.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Vt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(A.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class yR extends ts{constructor(){super(...arguments),this.type="meter-title",this.renderType=nt.SVG}render(t=!1){const n=_(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data;if(_(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const l=i.selectAll("text.meter-title").data([n[s]]);l.enter().append("text").classed("meter-title",!0).merge(l).attr("x",0).attr("y","1em").text(c=>c),l.exit().remove(),this.appendPercentage()}this.displayStatus();const a=this.getMaxTitleWidth(),o=P.appendOrSelect(i,"text.meter-title");a>0&&o.node().getComputedTextLength()>a&&this.truncateTitle(o,a)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=_(n,"meter","proportional","total"),s=_(n,"meter","proportional","unit")?_(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,h=_(n,"meter","proportional","breakdownFormatter");a=h!==null?h({datasetsTotal:r,total:i}):`${r} ${s} used (${u} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=P.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=_(n,"meter","proportional","total"),i=r?_(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=_(n,"meter","proportional","unit")?_(n,"meter","proportional","unit"):"",a=_(n,"meter","proportional","totalFormatter"),o=a!==null?a(i):`${r} ${s} total`,l=P.getHTMLElementSize(this.services.domUtils.getMainContainer()),c=l.width?l.width:this.parent.node().getAttribute("width"),u=t.selectAll("text.proportional-meter-total").data([o]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof c!="string"?c-te.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(h=>h),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=P.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=r.width?r.width:0,s=this.model.getStatus(),a=te.status.indicatorSize/2,o=P.appendOrSelect(n,"g.status-indicator").attr("class",s!==null?`status-indicator status--${s}`:"").attr("transform",`translate(${i-a}, 0)`),l=s?[s]:[],c=o.selectAll("circle.status").data(l);c.enter().append("circle").merge(c).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const u=o.selectAll("path.innerFill").data(l);u.enter().append("path").merge(u).attr("d",t.getStatusIconPathString(s)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),u.exit().remove(),c.exit().remove()}appendPercentage(){const t=_(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),r=P.appendOrSelect(n,"text.meter-title"),i=_(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(i),a=te.statusBar.paddingRight;s.enter().append("text").classed("percent-value",!0).merge(s).text(o=>`${o}%`).attr("x",+r.attr("x")+r.node().getComputedTextLength()+a).attr("y",r.attr("y")),s.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=P.appendOrSelect(this.parent,"tspan"),i=te.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());P.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=P.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=_(this.getOptions(),"meter","proportional"),r=t.width?t.width:this.parent.node().getBoundingClientRect().width;if(n!==null){const i=P.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=P.getSVGElementSize(i,{useBBox:!0}).width;return r-s-te.total.paddingLeft}else{const i=P.appendOrSelect(this.parent,"text.percent-value"),s=te.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=P.appendOrSelect(this.parent,"g.status-indicator").node(),l=P.getSVGElementSize(o,{useBBox:!0}).width+te.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case ga.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case ga.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case ga.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class Fc extends gt{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=P.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=_(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class bR extends gt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:kr.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{width:r,height:i}=P.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=_(l,"canvasZoom","enabled");a&&_(s,0,"children")&&(s=_(s,0,"children"));const u=vi({children:s}).sum(p=>p.value).sort((p,m)=>m.value-p.value),h=mw().size([r,i]).padding(p=>p.depth>=1?kr.padding.children+3:kr.padding.mainGroup+3)(u).descendants().splice(1).filter(p=>p.depth<=o),d=n.selectAll("circle.node").data(h);d.exit().attr("width",0).attr("height",0).remove();const f=d.enter().append("circle").classed("node",!0);f.merge(d).attr("class",p=>{const m=c&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${m}`:`node node-leaf ${m}`})}).style("fill",p=>this.model.getFillColor(p.data.dataGroupName)).style("stroke",p=>this.model.getFillColor(p.data.dataGroupName)).attr("cx",p=>p.x).attr("cy",p=>p.y).transition("circlepack-leaf-update-enter").call(p=>this.services.transitions.setupTransition({transition:p,name:"circlepack-leaf-update-enter"})).attr("r",p=>p.r).attr("opacity",1).attr("fill-opacity",kr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,Dr),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",kr.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){N(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=N(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,Dr)})}getZoomIcon(){return`
79
+ `;c.html(u),h();function h(){c.attr("gradientTransform",`translate(${a-3*.2*s}, 0)`).transition().duration(2e3).delay(1e3).ease(kb).attr("gradientTransform",`translate(${o+3*.2*s}, 0)`).on("end",h)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class uI extends ft{constructor(){super(...arguments),this.type="boxplot",this.renderType=Q.SVG}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getDataGroupNames(),a=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[l,c]=a.range(),[u,h]=o.range(),d=c-l,f=u-h;if(d===0)return;const{cartesianScales:p}=this.services,m=p.getOrientation(),g=m===Jt.VERTICAL,[v,y]=_n(C=>this.services.cartesianScales.getDomainValue(C),C=>this.services.cartesianScales.getRangeValue(C),m),b=Math.floor((g?d:f)/s.length),S=Math.min(b/2,16),_=this.model.getBoxplotData(),E=n.selectAll(".box-group").data(_);E.exit().remove();const T=E.enter().append("g").attr("class","box-group"),R=E.merge(T);T.append("path").merge(E.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ae.strokeWidth.default).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-verticalstartline",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i]),M=V,k=p.getRangeValue(C.whiskers.min),w=p.getRangeValue(C.quartiles.q_25);return ue({x0:V,x1:M,y0:k,y1:w},m)}),T.append("path").merge(E.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ae.strokeWidth.default).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-verticalendline",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i]),M=V,k=p.getRangeValue(C.whiskers.max),w=p.getRangeValue(C.quartiles.q_75);return ue({x0:V,x1:M,y0:k,y1:w},m)}),T.append("path").merge(E.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],originalClassName:"box"})).attr("fill-opacity",Ae.box.opacity.default).attr("stroke-width",Ae.strokeWidth.default).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",C=>C[i]).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-quartiles",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/2,M=V+S,k=p.getRangeValue(Math[g?"max":"min"](C.quartiles.q_75,C.quartiles.q_25)),w=k+Math.abs(p.getRangeValue(C.quartiles.q_75)-p.getRangeValue(C.quartiles.q_25));return ue({x0:V,x1:M,y0:k,y1:w},m)}),T.append("path").merge(E.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",C=>{const V=p.getDomainValue(C[i])-S/2,M=V+S,k=p.getRangeValue(C.whiskers.min),w=p.getRangeValue(C.whiskers.max);return ue({x0:V,x1:M,y0:k,y1:w},m)}),T.append("path").merge(E.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ae.strokeWidth.thicker).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-startingwhisker",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/4,M=V+S/2,k=p.getRangeValue(C.whiskers.min),w=p.getRangeValue(C.whiskers.min);return ue({x0:V,x1:M,y0:k,y1:w},m)}),T.append("path").merge(E.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-median",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/2,M=V+S,k=p.getRangeValue(C.quartiles.q_50);return ue({x0:V,x1:M,y0:k,y1:k},m)}),T.append("path").merge(E.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ae.strokeWidth.thicker).attr("fill","none").transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-endingwhisker",animate:t})).attr("d",C=>{const V=p.getDomainValue(C[i])-S/4,M=V+S/2,k=p.getRangeValue(C.whiskers.max),w=p.getRangeValue(C.whiskers.max);return ue({x0:V,x1:M,y0:k,y1:w},m)});const N=R.selectAll("circle.outlier").data(C=>C.outliers.map(V=>({min:C.whiskers.min,max:C.whiskers.max,[i]:C[i],value:V})));N.exit().remove();const A=N.enter().append("circle");N.merge(A).attr("r",Ae.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ae.circle.opacity.default).attr("cx",v).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"boxplot-update-circles",animate:t})).attr("cy",y),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(i,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ae.box.opacity.hovered),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[r],class:t.model.getColorClassName({classNameTypes:[tt.TOOLTIP]})},{label:"Minimum",value:s.whiskers.min},{label:"Q1",value:s.quartiles.q_25},{label:"Median",value:s.quartiles.q_50},{label:"Q3",value:s.quartiles.q_75},{label:"Maximum",value:s.whiskers.max},{label:"IQR",value:s.quartiles.q_75-s.quartiles.q_25}]}),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=D(this);t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(O.Boxplot.BOX_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);D(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ae.box.opacity.default),t.services.events.dispatchEvent(O.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}addCircleEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(s,a){const o=D(this);o.classed("hovered",!0).attr("fill-opacity",Ae.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[r],class:t.model.getColorClassName({classNameTypes:[tt.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=D(this);t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Boxplot.OUTLIER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1).attr("fill-opacity",Ae.circle.opacity.default),t.services.events.dispatchEvent(O.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class Yr extends ft{constructor(){super(...arguments),this.type="zero-line",this.renderType=Q.SVG}render(t){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),r=this.services.cartesianScales.getScaleByPosition(n),[i,s]=r.domain(),a=i>0&&s<0||i<0&&s>0,o=this.getComponentContainer();if(!a){o.selectAll("line.domain").remove();return}const[l,c]=this.services.cartesianScales.getDomainScale().range();let u=+r(0)+.5;u||(u=r.range()[0]);const h=gg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());L.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:t})).attr("y1",h.y0).attr("y2",h.y1).attr("x1",h.x0).attr("x2",h.x1)}}class hI extends tn{constructor(){super(...arguments),this.type="bubble",this.renderType=Q.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?De(s):[1,1];return Be().domain(l).range(o?n.bubble.radiusRange(a,i):[4,4])}styleCircles(t,n){const r=this.getOptions(),{radiusMapsTo:i}=r.bubble,s=this.getRadiusScale(t),{groupMapsTo:a}=r.data,{cartesianScales:o}=this.services,l=d=>o.getDomainValue(d),c=d=>o.getRangeValue(d),[u,h]=_n(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-label",d=>{const f=o.getRangeIdentifier(d);return d[f]}).transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",h).attr("r",d=>s(d[i]||1)).attr("class",d=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:d[a],originalClassName:"dot"})).style("fill",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getFillColor(d[a],d[f],d)}).style("stroke",d=>{const f=this.services.cartesianScales.getDomainIdentifier(d);return this.model.getStrokeColor(d[a],d[f],d)}).attr("fill-opacity",r.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(t){const n=x(this.getOptions(),"bubble");return[{label:x(n,"radiusLabel"),value:t[x(n,"radiusMapsTo")]}]}}class dI extends ft{constructor(){super(...arguments),this.type="bullet",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[l,c]=a.range(),[,u]=a.domain(),h=()=>{const m=[];s.forEach(v=>{v.ranges?v.ranges.forEach((y,b)=>{y!=null&&y<u&&m.push({datum:v,value:y,order:b+1})}):m.push({datum:v,order:1})});const g=L.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(m,v=>`${v[r]}-${v.order}`);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`range-box order-${v.order}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-range-box-update-enter",animate:t})).attr("d",v=>{let y,b,S,_;return v.order===1?(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,b=y+16,S=c-2,_=l+1):(y=this.services.cartesianScales.getDomainValue(v.datum)-16/2,b=y+16,S=this.services.cartesianScales.getRangeValue(v.value),_=c),ue({x0:y,x1:b,y0:S,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},d=()=>{const m=L.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("bar",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-bar-update-enter",animate:t})).attr("class",g=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:g[r],originalClassName:"bar"})).style("fill",g=>this.model.getFillColor(g[r])).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-4,y=v+8,b=this.services.cartesianScales.getRangeValue(0)+1,S=this.services.cartesianScales.getRangeValue(g);return ue({x0:v,x1:y,y0:b,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",g=>g.value)},f=()=>{const m=L.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(g=>x(g,"marker")!==null),g=>g[r]);m.exit().attr("opacity",0).remove(),m.enter().append("path").attr("opacity",0).merge(m).classed("marker",!0).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"bullet-marker-update-enter",animate:t})).attr("d",g=>{const v=this.services.cartesianScales.getDomainValue(g)-12,y=v+24,b=this.services.cartesianScales.getRangeValue(g.marker);return ue({x0:v,x1:y,y0:b,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let m=[];s.filter(v=>x(v,"marker")!==null).forEach(v=>{const y=v.marker,b=v[o];m=m.concat([{datum:v,value:y*.25,barValue:b},{datum:v,value:y*.5,barValue:b},{datum:v,value:y*.75,barValue:b}])});const g=L.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(m,v=>v[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).attr("class",v=>`quartile ${v.value<=v.barValue?"over-bar":""}`).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:v,value:y})=>{let b=4;v.ranges&&v.ranges.indexOf(y)!==-1&&(b=8);const S=this.services.cartesianScales.getDomainValue(v)-b/2,_=S+b,E=this.services.cartesianScales.getRangeValue(y);return ue({x0:S,x1:_,y0:E,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};h(),d(),f(),p(),this.addEventListeners()}addEventListeners(){const t=this,n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("path.bar").on("mouseover",function(s,a){const o=D(this);o.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=x(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:a[r]})},{label:"Value",value:a[i]},{label:"Target",value:a.marker},{label:"Percentage",value:`${Math.floor(a[i]/a.marker*100)}%`},{label:"Performance",value:l[c]}]})}).on("mousemove",function(s,a){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:s,element:D(this),datum:a}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);o.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function fI(e){return e}function pI(e){if(e==null)return fI;var t,n,r=e.scale[0],i=e.scale[1],s=e.translate[0],a=e.translate[1];return function(o,l){l||(t=n=0);var c=2,u=o.length,h=new Array(u);for(h[0]=(t+=o[0])*r+s,h[1]=(n+=o[1])*i+a;c<u;)h[c]=o[c],++c;return h}}function gI(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function mI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Wm(e,n)})}:Wm(e,t)}function Wm(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Zc(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:s}:r==null?{type:"Feature",id:n,properties:i,geometry:s}:{type:"Feature",id:n,bbox:r,properties:i,geometry:s}}function Zc(e,t){var n=pI(e.transform),r=e.arcs;function i(u,h){h.length&&h.pop();for(var d=r[u<0?~u:u],f=0,p=d.length;f<p;++f)h.push(n(d[f],f));u<0&&gI(h,p)}function s(u){return n(u)}function a(u){for(var h=[],d=0,f=u.length;d<f;++d)i(u[d],h);return h.length<2&&h.push(h[0]),h}function o(u){for(var h=a(u);h.length<4;)h.push(h[0]);return h}function l(u){return u.map(o)}function c(u){var h=u.type,d;switch(h){case"GeometryCollection":return{type:h,geometries:u.geometries.map(c)};case"Point":d=s(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(s);break;case"LineString":d=a(u.arcs);break;case"MultiLineString":d=u.arcs.map(a);break;case"Polygon":d=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:h,coordinates:d}}return c(t)}function vI(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var h=e.arcs[c<0?~c:c],d;h.length<3&&!h[1][0]&&!h[1][1]&&(d=t[++a],t[a]=c,t[u]=d)}),t.forEach(function(c){var u=o(c),h=u[0],d=u[1],f,p;if(f=i[h])if(delete i[f.end],f.push(c),f.end=d,p=r[d]){delete r[p.start];var m=p===f?f:f.concat(p);r[m.start=f.start]=i[m.end=p.end]=m}else r[f.start]=i[f.end]=f;else if(f=r[d])if(delete r[f.start],f.unshift(c),f.start=h,p=i[h]){delete i[p.end];var g=p===f?f:p.concat(f);r[g.start=p.start]=i[g.end=f.end]=g}else r[f.start]=i[f.end]=f;else f=[c],r[f.start=h]=i[f.end=d]=f});function o(c){var u=e.arcs[c<0?~c:c],h=u[0],d;return e.transform?(d=[0,0],u.forEach(function(f){d[0]+=f[0],d[1]+=f[1]})):d=u[u.length-1],c<0?[d,h]:[h,d]}function l(c,u){for(var h in c){var d=c[h];delete u[d.start],delete d.start,delete d.end,d.forEach(function(f){n[f<0?~f:f]=1}),s.push(d)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function yI(e){for(var t=-1,n=e.length,r,i=e[n-1],s=0;++t<n;)r=i,i=e[t],s+=r[0]*i[1]-r[1]*i[0];return Math.abs(s)}function bI(e){return Zc(e,xI.apply(this,arguments))}function xI(e,t){var n={},r=[],i=[];t.forEach(s);function s(l){switch(l.type){case"GeometryCollection":l.geometries.forEach(s);break;case"Polygon":a(l.arcs);break;case"MultiPolygon":l.arcs.forEach(a);break}}function a(l){l.forEach(function(c){c.forEach(function(u){(n[u=u<0?~u:u]||(n[u]=[])).push(l)})}),r.push(l)}function o(l){return yI(Zc(e,{type:"Polygon",arcs:[l]}).coordinates[0])}return r.forEach(function(l){if(!l._){var c=[],u=[l];for(l._=1,i.push(c);l=u.pop();)c.push(l),l.forEach(function(h){h.forEach(function(d){n[d<0?~d:d].forEach(function(f){f._||(f._=1,u.push(f))})})})}}),r.forEach(function(l){delete l._}),{type:"MultiPolygon",arcs:i.map(function(l){var c=[],u;if(l.forEach(function(m){m.forEach(function(g){g.forEach(function(v){n[v<0?~v:v].length<2&&c.push(v)})})}),c=vI(e,c),(u=c.length)>1)for(var h=1,d=o(c[0]),f,p;h<u;++h)(f=o(c[h]))>d&&(p=c[0],c[0]=c[h],c[h]=p,d=f);return c}).filter(function(l){return l.length>0})}}class wI extends Nn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=Q.SVG}showRuler(t,[n,r]){const i=this.parent,s=this.model.getOptions(),{cartesianScales:a}=this.services,o=a.getOrientation(),l=a.getRangeScale(),[c,u]=l.range(),h=a.getDomainScale(),d=h.invert(o===Jt.VERTICAL?n:r),f=L.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=L.appendOrSelect(f,"line.ruler-line"),m=i.selectAll("[role=graphics-symbol]").filter(g=>{if(parseFloat(kt(g,"data.x0"))<=d&&parseFloat(kt(g,"data.x1"))>=d)return!0});if(m.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sm(this.elementsToHighlight,m)&&this.hideRuler(),m.dispatch("mouseover"),this.elementsToHighlight=m;const g=D(m.nodes()[0]).datum(),v=parseFloat(kt(g,"data.x0")),y=parseFloat(kt(g,"data.x1")),b=this.model.getActiveDataGroupNames(),S=b.reverse().map(_=>({label:_,value:kt(g,`data.${_}`),class:this.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:_})})).filter(_=>_.value!==0);if(S.length>0){this.services.events.dispatchEvent(O.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:kt(s,"bins.rangeLabel")||"Range",value:`${v} – ${y}`},...S,...x(s,"tooltip","showTotal")===!0?[{label:kt(s,"tooltip.totalLabel")||"Total",value:b.reduce((E,T)=>E+parseFloat(kt(g,`data.${T}`)),0)}]:[]]}),f.attr("opacity",1);const _=h((v+y)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",_).attr("y2",_):p.attr("y1",u).attr("y2",c).attr("x1",_).attr("x2",_)}else this.hideRuler()}else this.hideRuler()}}class ao extends Nn{formatTooltipData(t){return t.reverse()}}const _I=(e,t)=>{const n=e.x,r=e.y,i=t.x,s=t.y,a=gh();return a.moveTo(n,r),a.lineTo(i,s),a.toString()},EI={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},SI={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},OI={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},TI={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},MI={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},CI={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class qm extends Yc{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=Q.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=L.getSVGElementSize(i,{useAttrs:!0}),a=x(this.getOptions(),"data","loading");if(s>Vt.color.barWidth&&!a){const o=x(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,c=l.getMainXScale().range();if(c[0]>1&&(i.select("g.legend").attr("transform",`translate(${c[0]}, 0)`),o)){const{width:u}=L.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),h=c[0]-u-9;h>1?i.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(i.select("g.legend").attr("transform",`translate(${c[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${c[0]}, 0)`))}}else i.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=r.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer(),{width:i}=L.getSVGElementSize(r,{useAttrs:!0}),s=x(n,"color","gradient","colors"),a=x(n,this.chartType,"colorLegend","type");let o=x(n,"color","pairing","option");const l=x(n,"heatmap","colorLegend","title");if(x(this.getOptions(),"data","loading")){r.html("");return}const c=!ze(s),u=Tg(this.model.getDisplayData()),h=!(i<=Vt.color.barWidth),d=h?Vt.color.barWidth:i,f=L.appendOrSelect(r,"g.legend"),p=L.appendOrSelect(f,"g.legend-axis");if(l){const T=L.appendOrSelect(r,"g.legend-title");L.appendOrSelect(T,"text").text(l).attr("dy","0.7em"),f.attr("transform","translate(0, 16)")}const m=u[0]<0&&u[1]>0?"diverge":"mono";(o<1&&o>4&&m==="mono"||o<1&&o>2&&m==="diverge")&&(o=1);let g=[];const v=m==="diverge"?17:11;if(c)g=s;else for(let T=1;T<v+1;T++)g.push(a===ya.LINEAR?`stop-color-${m}-${o}-${T}`:`fill-${m}-${o}-${T}`);const y=_e(u[0],u[1]),b=E1(y,3),S=Be().domain(u).range([0,d]),_=po(S).tickSize(0).tickValues(b);let E;switch(a){case ya.LINEAR:this.drawLinear(g,f,d);break;case ya.QUANTIZE:E=this.drawQuantize(g,m,c,f,d),S.range([E,d]);break;default:throw Error("Entered color legend type is not supported.")}p.attr("transform",`translate(0,${Vt.color.axisYTranslation})`).call(_),p.select(".domain").remove(),p.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),p.select("g.tick:first-of-type text").style("text-anchor",h&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(t,n,r){const i=100/(t.length-1);L.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(s,a)=>`${a*i}%`).attr("class",(s,a)=>t[a]).attr("stop-color",s=>s),L.appendOrSelect(n,"rect").attr("width",r).attr("height",Vt.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(t,n,r,i,s){!r&&n==="diverge"&&t.splice(t.length/2,1);const a=Ei().domain(t).range([0,s]);return L.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",o=>a(o)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",Vt.color.barHeight).attr("class",o=>o).attr("fill",o=>o),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(O.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class $I extends rs{constructor(){super(...arguments),this.type="meter-title",this.renderType=Q.SVG}render(t=!1){const n=x(this.model.getDisplayData(),0),r=this.getOptions(),i=this.getComponentContainer(),{groupMapsTo:s}=r.data;if(x(r,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const l=i.selectAll("text.meter-title").data([n[s]]);l.enter().append("text").classed("meter-title",!0).merge(l).attr("x",0).attr("y","1em").text(c=>c),l.exit().remove(),this.appendPercentage()}this.displayStatus();const a=this.getMaxTitleWidth(),o=L.appendOrSelect(i,"text.meter-title");a>0&&o.node().getComputedTextLength()>a&&this.truncateTitle(o,a)}displayBreakdownTitle(){const t=this.getComponentContainer(),n=this.getOptions(),r=this.model.getMaximumDomain(this.model.getDisplayData()),i=x(n,"meter","proportional","total"),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"";let a;if(r===i)a=null;else{const u=i!==null?i-r:r,h=x(n,"meter","proportional","breakdownFormatter");a=h!==null?h({datasetsTotal:r,total:i}):`${r} ${s} used (${u} ${s} available)`}const o=t.selectAll("text.proportional-meter-title").data([a]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const l=this.getMaxTitleWidth(),c=L.appendOrSelect(t,"text.proportional-meter-title");l>0&&c.node().getComputedTextLength()>l&&this.truncateTitle(c,l)}displayTotal(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"meter","proportional","total"),i=r?x(n,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),s=x(n,"meter","proportional","unit")?x(n,"meter","proportional","unit"):"",a=x(n,"meter","proportional","totalFormatter"),o=a!==null?a(i):`${r} ${s} total`,l=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),c=l.width?l.width:this.parent.node().getAttribute("width"),u=t.selectAll("text.proportional-meter-total").data([o]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof c!="string"?c-te.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(h=>h),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=r.width?r.width:0,s=this.model.getStatus(),a=te.status.indicatorSize/2,o=L.appendOrSelect(n,"g.status-indicator").attr("class",s!==null?`status-indicator status--${s}`:"").attr("transform",`translate(${i-a}, 0)`),l=s?[s]:[],c=o.selectAll("circle.status").data(l);c.enter().append("circle").merge(c).attr("class","status").attr("r",a).attr("cx",0).attr("cy",8);const u=o.selectAll("path.innerFill").data(l);u.enter().append("path").merge(u).attr("d",t.getStatusIconPathString(s)).attr("transform",`translate(-${a}, 0)`).attr("class","innerFill"),u.exit().remove(),c.exit().remove()}appendPercentage(){const t=x(this.model.getDisplayData(),0,"value"),n=this.getComponentContainer(),r=L.appendOrSelect(n,"text.meter-title"),i=x(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(i),a=te.statusBar.paddingRight;s.enter().append("text").classed("percent-value",!0).merge(s).text(o=>`${o}%`).attr("x",+r.attr("x")+r.node().getComputedTextLength()+a).attr("y",r.attr("y")),s.exit().remove()}truncateTitle(t,n){super.truncateTitle(t,n);const r=L.appendOrSelect(this.parent,"tspan"),i=te.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());L.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=x(this.getOptions(),"meter","proportional"),r=t.width?t.width:this.parent.node().getBoundingClientRect().width;if(n!==null){const i=L.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=L.getSVGElementSize(i,{useBBox:!0}).width;return r-s-te.total.paddingLeft}else{const i=L.appendOrSelect(this.parent,"text.percent-value"),s=te.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=L.appendOrSelect(this.parent,"g.status-indicator").node(),l=L.getSVGElementSize(o,{useBBox:!0}).width+te.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case ma.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case ma.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case ma.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class Kc extends ft{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=L.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!r.step){const s=x(t,"bars","spacingFactor");return Math.min(t.bars.maxWidth,i*s/n)}return Math.min(t.bars.maxWidth,r.step()/2)}isOutsideZoomedDomain(t,n){if(this.model.getDisplayData().length<=1)return!1;const r=this.model.get("zoomDomain");if(r!==void 0){const i=this.services.cartesianScales.getDomainScale();return t<i(r[0])||n>i(r[1])}return!1}}class AI extends ft{constructor(){super(...arguments),this.type="circle-pack",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-circlepack"})).attr("opacity",r=>r.data.dataGroupName===n.datum().name?1:Nr.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{width:r,height:i}=L.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;let s=this.model.getDisplayData();const a=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),l=this.getOptions(),c=x(l,"canvasZoom","enabled");a&&x(s,0,"children")&&(s=x(s,0,"children"));const u=xi({children:s}).sum(p=>p.value).sort((p,m)=>m.value-p.value),h=Pw().size([r,i]).padding(p=>p.depth>=1?Nr.padding.children+3:Nr.padding.mainGroup+3)(u).descendants().splice(1).filter(p=>p.depth<=o),d=n.selectAll("circle.node").data(h);d.exit().attr("width",0).attr("height",0).remove();const f=d.enter().append("circle").classed("node",!0);f.merge(d).attr("class",p=>{const m=c&&o===3?this.getZoomClass(p):"";return this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:p.data.dataGroupName,originalClassName:p.children?`node ${m}`:`node node-leaf ${m}`})}).style("fill",p=>this.model.getFillColor(p.data.dataGroupName)).style("stroke",p=>this.model.getFillColor(p.data.dataGroupName)).attr("cx",p=>p.x).attr("cy",p=>p.y).transition("circlepack-leaf-update-enter").call(p=>this.services.transitions.setupTransition({transition:p,name:"circlepack-leaf-update-enter"})).attr("r",p=>p.r).attr("opacity",1).attr("fill-opacity",Nr.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,f,Ir),this.setBackgroundListeners()),a||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",r=>this.model.getFillColor(r.data.dataGroupName))}highlightChildren(t){const n=t.map(r=>r.data);this.parent.selectAll("circle.node").filter(r=>n.some(i=>i===r.data)&&r.depth>1).style("stroke",Nr.circles.hover.stroke)}getZoomClass(t){return this.model.getHierarchyLevel()===3&&this.focal&&(t.data===this.focal.data||this.focal.children.some(n=>n.data===t.data))?"focal":"non-focal"}addLegendListeners(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){D(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=D(this.services.domUtils.getMainContainer()),n=this,r=this.parent.selectAll("circle.node");t.on("click",()=>{n.focal=null,n.model.updateHierarchyLevel(2),t.classed("zoomed-in",!1),n.services.canvasZoom.zoomOut(r,Ir)})}getZoomIcon(){return`
80
80
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
81
81
  <polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
82
82
  <path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
83
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=N(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=_(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],h=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:kt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else h=r.value;const d=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:d,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:h},...c,...u]})}t.services.events.dispatchEvent(A.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(A.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=N(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(A.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=N(this),s=i.classed("non-focal"),a=_(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");N(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Dr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");N(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Dr),n.stopPropagation()}t.services.events.dispatchEvent(A.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function xR(e,t){const n=ei(this._current,e);return r=>(this._current=n(r),t(this._current))}class Mm extends gt{constructor(){super(...arguments),this.type="pie",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Dt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie,o=this.model.getDisplayData().filter(S=>S[a]>0),l=this.computeRadius();this.arc=Ti().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ti().innerRadius(this.getInnerRadius()).outerRadius(l+Dt.hoverArc.outerRadiusOffset);const c=fE().value(S=>S[a]).sort(_(i,"pie","sortFunction")).padAngle(Dt.padAngle)(o),u=P.appendOrSelect(r,"g.slices").attr("role",dt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,S=>S.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",S=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:S.data[s],originalClassName:"slice"})).style("fill",S=>n.model.getFillColor(S.data[s])).attr("d",this.arc).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",S=>`${S[a]}, ${sg(S.data[a],o,a)+"%"}`).attrTween("d",function(S){return xR.bind(this)(S,n.arc)});const h=i.pie.labels.enabled,d=h?c.filter(S=>S.data[a]>0):[],f=P.appendOrSelect(r,"g.labels").attr("role",dt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(d,S=>S.data[s]);f.exit().attr("opacity",0).remove();const p=f.enter().append("text").classed("pie-label",!0),m=[];p.merge(f).style("text-anchor","middle").text(S=>i.pie.labels.formatter?i.pie.labels.formatter(S):sg(S.data[a],o,a)+"%").datum(function(S){const $=l+7,k=(S.endAngle-S.startAngle)/2+S.startAngle,L=k/Math.PI*180,M=this.getComputedTextLength();return S.textOffsetX=M/2,S.textOffsetY=L>90&&L<270?10:0,S.xPosition=(S.textOffsetX+$)*Math.sin(k),S.yPosition=(S.textOffsetY+$)*-Math.cos(k),S}).attr("transform",function(S,$){const k=d.length,L=(S.endAngle-S.startAngle)*(180/Math.PI);if($>=k-2&&L<Dt.callout.minSliceDegree){let M,V;return S.index===k-1?(M=S.xPosition+Dt.callout.offsetX+Dt.callout.textMargin+S.textOffsetX,V=S.yPosition-Dt.callout.offsetY,S.direction=pa.RIGHT,m.push(S)):(M=S.xPosition-Dt.callout.offsetX-S.textOffsetX-Dt.callout.textMargin,V=S.yPosition-Dt.callout.offsetY,S.direction=pa.LEFT,m.push(S)),`translate(${M}, ${V})`}return`translate(${S.xPosition}, ${S.yPosition})`}),this.renderCallouts(m);const g=_(i,"donut")?"donut":"pie",v=_(i,g,"alignment"),{width:b}=P.getSVGElementSize(this.getParent(),{useAttrs:!0}),w=h?Dt.xOffset:0,O=h?Dt.yOffset:0;let E=l+w;v===Yt.CENTER?E=b/2:v===Yt.RIGHT&&(E=b-l-Dt.xOffset);let T=l+O;m.length>0&&(T+=Dt.yOffsetCallout),r.attr("x",E+7).attr("y",T),this.addEventListeners()}renderCallouts(t){const n=P.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",dt.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",dt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===pa.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+Dt.callout.offsetX,y:o-Dt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-Dt.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-Dt.callout.offsetX,y:o-Dt.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+Dt.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return N(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return N(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=N(this);i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(A.Pie.SLICE_MOUSEOVER,{event:n,element:N(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(A.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(A.Pie.SLICE_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc),t.services.events.dispatchEvent(A.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=P.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Dt.radiusOffset:i}}class wR extends Mm{constructor(){super(...arguments),this.type="donut",this.renderType=nt.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=P.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=_(i,"donut","center","label");P.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(N(this))}),a!==null&&a!==""&&P.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=_(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=Pu:s=we;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Cm="4,10 8,6 12,10",Am="12,6 8,10 4,6";class _R extends gt{constructor(){super(...arguments),this.type="gauge",this.renderType=nt.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return nm(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return _(t,"gauge","type")===Ar.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(_(n,"gauge","deltaArrow","direction")){case Nl.UP:return Cm;case Nl.DOWN:return Am;default:return t>0?Cm:Am}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,h=this.computeRadius(),d=this.getInnerRadius();this.backgroundArc=Ti().innerRadius(d).outerRadius(h).startAngle(c).endAngle(u),this.arc=Ti().innerRadius(d).outerRadius(h).startAngle(o).endAngle(c),P.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>_(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=_(r,"gauge","alignment"),{width:m}=P.getSVGElementSize(this.getParent(),{useAttrs:!0});let g=h;p===Yt.CENTER?g=m/2:p===Yt.RIGHT&&(g=m-h),n.attr("x",g).attr("y",h),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=_(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=_(n,"gauge","valueFontSize"),l=_(n,"gauge","deltaFontSize"),c=_(n,"gauge","numberSpacing"),u=_(n,"gauge","showPercentageSymbol");let h=0;r===Ar.FULL&&!s?h=l(a):r===Ar.SEMI&&s&&(h=-(l(a)+c));const d=P.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${h})`),f=o(a),p=P.appendOrSelect(d,"g.gauge-value-number"),m=_(n,"gauge","numberFormatter"),g=p.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${f}px`).attr("text-anchor","middle").text(S=>m(S));const{width:v}=P.getSVGElementSize(P.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,w=u?"%":"",O=P.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",v/2).text(w),{width:E,height:T}=P.getSVGElementSize(O,{useBBox:!0});O.attr("y",`-${T/2}px`),p.attr("transform",`translate(-${E/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?_(r,"gauge","deltaFontSize"):()=>0,o=i?_(r,"gauge","numberFormatter"):()=>null,l=_(r,"gauge","deltaArrow","size"),c=_(r,"gauge","numberSpacing"),u=_(r,"gauge","showPercentageSymbol"),h=P.appendOrSelect(n,"g.gauge-numbers"),d=P.appendOrSelect(h,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=P.appendOrSelect(d,"text.gauge-delta-number"),p=u?"%":"";f.data(i===null?[]:[i]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(b=>`${o(b)}${p}`);const{width:m}=P.getSVGElementSize(P.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=_(r,"gauge","deltaArrow","enabled"),v=d.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);v.enter().append("svg").merge(v).attr("class","gauge-delta-arrow").attr("x",-l(s)-m/2).attr("y",-l(s)/2-a(s)*.35).attr("width",l(s)).attr("height",l(s)).attr("viewBox","0 0 16 16").each(function(){const b=N(this);P.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const w=_(r,"gauge","status");P.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",w!==null?`gauge-delta-arrow status--${w}`:"").attr("points",t.getArrow(i))}),v.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=_(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(A.Gauge.ARC_MOUSEOVER,{event:n,element:N(this),datum:r})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(A.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(A.Gauge.ARC_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);t.services.events.dispatchEvent(A.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=_(t,"gauge","type"),{width:r,height:i}=P.getSVGElementSize(this.parent,{useAttrs:!0});return n===Ar.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class $m extends Fc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=nt.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=ji(n.map(u=>{const h=this.services.cartesianScales.getDomainIdentifier(u);return u[h]&&typeof u[h].toString=="function"?u[h].toString():u[h]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",dt.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const h=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Jt.VERTICAL?`translate(${h}, 0)`:`translate(0, ${h})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[i])).attr("d",u=>{const h=this.groupScale(u[i]),d=this.getBarWidth(),f=h,p=h+d,m=this.services.cartesianScales.getRangeAxisPosition({datum:u}),g=this.services.cartesianScales.getValueThroughAxisPosition(m,0),v=this.services.cartesianScales.getRangeValue(u),b=this.services.cartesianScales.getDomainValue(u)-d/2,w=b+d;if(!this.isOutsideZoomedDomain(b,w))return ue({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=N(this);i.classed("hovered",!0),t.services.events.dispatchEvent(A.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(A.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(A.Bar.BAR_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);i.classed("hovered",!1),t.services.events.dispatchEvent(A.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=_(t,"bars","width"),r=_(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=xi().domain(t).rangeRound([0,this.getGroupWidth()])}}class ER extends gt{constructor(){super(...arguments),this.type="heatmap",this.renderType=nt.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",h=null,d=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const m=this.matrix[r][p].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const m=this.matrix[p][r].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Sn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Sn(l.range())},${c(r)})`),this.services.events.dispatchEvent(A.Tooltip.SHOW,{event:n.event,hoveredElement:N(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:d!==null?d:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:h!==null?h/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(A.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(A.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(A.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(A.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(A.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),_(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),h=i.range(),d=s.range();this.xBandwidth=Math.abs((h[1]-h[0])/l.length),this.yBandwidth=Math.abs((d[1]-d[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",m=>`heat-${m.index}`).classed("cell",!0).attr("transform",m=>`translate(${i(m[a])}, ${s(m[o])})`).append("rect").attr("class",m=>this.model.getColorClassName({value:m.value,originalClassName:`heat-${m.index}`})).classed("heat",!0).classed("null-state",m=>m.index===-1||m.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",m=>m.index===-1||m.value===null?`url(#${f})`:this.model.getFillColor(Number(m.value))).attr("aria-label",m=>m.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(d[1]-d[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(h[1]-h[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=P.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);P.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),P.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),P.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),P.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=_(this.getOptions(),"heatmap","divider","state");return t!==Di.OFF&&(t===Di.AUTO&&qf.minCellDividerDimension<=this.xBandwidth&&qf.minCellDividerDimension<=this.yBandwidth||t===Di.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=kt(r,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const h=N(this),d=h.select("rect.heat");if(!d.classed("null-state")){const f=Wi(h.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${f.x+t.translationUnits.x}, ${f.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(A.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i||"Total",value:u.value,color:d.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(A.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:N(this),datum:u}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(A.Heatmap.HEATMAP_CLICK,{event:c,element:N(this),datum:u})}).on("mouseout",function(c,u){const h=N(this).select("rect.heat"),d=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),d||(t.services.events.dispatchEvent(A.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class SR extends gt{constructor(){super(...arguments),this.type="histogram",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>kt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",dt.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,h)=>h).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const h=kt(u,"data");if(!h)return;const d=o(h.x1)-o(h.x0)-1,f=this.services.cartesianScales.getDomainValue(h.x0),p=f+d,m=this.services.cartesianScales.getRangeValue(u[0]);let g=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(g-m)>0&&Math.abs(g-m)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Jt.VERTICAL?g+=1:g-=1),ue({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>_(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=N(this);a.classed("hovered",!0);const o=parseFloat(kt(s,"data.x0")),l=parseFloat(kt(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(A.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:kt(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:s[n]})},{label:u,value:kt(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(A.Tooltip.MOVE,{event:i})}).on("mouseout",function(){N(this).classed("hovered",!1),r.services.events.dispatchEvent(A.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class OR extends tn{constructor(){super(...arguments),this.type="lollipop",this.renderType=nt.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?gn.weight.unselected:gn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",gn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?gn.opacity.unselected:gn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",gn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=g=>s.getDomainValue(g),u=g=>s.getRangeValue(g),h=s.getOrientation(),[d,f]=xn(c,u,h),p=n.selectAll("line.line").data(this.getScatterData(),g=>`${g[i]}-${g[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",g=>this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:g[i],originalClassName:"line"})).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"lollipop-line-update-enter",animate:t})).style("stroke",g=>this.model.getFillColor(g[i],g[l],g)).attr("opacity",1);h===Jt.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",g=>d(g)-r.points.radius):m.attr("x1",d).attr("x2",d).attr("y1",o.range()[0]).attr("y2",g=>f(g)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(A.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(A.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(A.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(A.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class TR extends gt{constructor(){super(...arguments),this.type="meter",this.renderType=nt.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-te.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-te.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=_(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=P.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;_(i,"meter","proportional")===null?u=100:u=_(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const h=Be().domain([0,u]).range([0,l]),d=this.getStackedBounds(a,h),f=_(i,"meter","height");P.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?te.height.proportional:te.height.default)),P.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?te.height.proportional:te.height.default));const p=r.selectAll("rect.value").data(d),m=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",w=>w.x).attr("y",0).attr("height",()=>f||(s?te.height.proportional:te.height.default)).attr("class",w=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:w[c],originalClassName:m})).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"meter-bar-update",animate:t})).attr("width",w=>w.value>u?h(u):w.width).style("fill",w=>n.model.getFillColor(w[c])).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",w=>w.value),p.exit().remove();const g=_(i,"meter","peak");let v=g;g!==null&&(g>u?v=u:g<a[0].value&&(v=a[0].value>u?u:a[0].value));const b=r.selectAll("line.peak").data(v==null?[]:[v]);b.enter().append("line").classed("peak",!0).merge(b).attr("y1",0).attr("y2",()=>f||(s?te.height.proportional:te.height.default)).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"peak-line-update",animate:t})).attr("x1",w=>h(w)).attr("x2",w=>h(w)).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",w=>w),b.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=_(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=N(this);r.services.events.dispatchEvent(A.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(A.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=N(this);r.services.events.dispatchEvent(A.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(A.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(A.Meter.METER_CLICK,{event:s,element:N(this),datum:a})}).on("mouseout",function(s,a){const o=N(this);r.services.events.dispatchEvent(A.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class MR extends gt{constructor(){super(...arguments),this.type="radar",this.renderType=nt.SVG,this.getLabelDimensions=t=>{const n=P.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=P.appendOrSelect(n,"text").text(t),{width:i,height:s}=P.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=_(n,"radar","axes"),s=_(n,"data","groupMapsTo"),a=AD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return at(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=_(n,"radar","axes"),s=_(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:at(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?Kn.opacity.unselected:Kn.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?Kn.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",Kn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=P.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=_(o,"data","groupMapsTo"),c=_(o,"radar","axes","value"),{angle:u,value:h}=_(o,"radar","axes"),{xLabelPadding:d,yLabelPadding:f,yTicksNumber:p,minRange:m,xAxisRectHeight:g}=Kn;this.uniqueKeys=Array.from(new Set(s.map(x=>x[u]))),this.uniqueGroups=Array.from(new Set(s.map(x=>x[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),b=(Math.min(r,i)-v)/2;if(b<=0)return;const w=xi().domain(this.fullDataNormalized.map(x=>x[u])).range([0,2*Math.PI].map(x=>x-Math.PI/2)),O=Sn(this.fullDataNormalized.map(x=>x[h])),E=Be().domain([O>=0?0:O,Nn(this.fullDataNormalized.map(x=>x[h]))]).range([m,b]).nice(p),T=E.ticks(p),S=x=>this.model.getFillColor(x),$=mE().angle(x=>w(x[u])+Math.PI/2).radius(x=>E(x[h])).curve(ef),k=this.uniqueKeys.map(x=>{const C=this.getLabelDimensions(x).width,y=Z$(w(x),b);return C+y}),L={x:Nn(k)+d,y:i/2},M=P.appendOrSelect(n,"g.y-axes").attr("role",dt.GROUP).selectAll("path").data(T,x=>x),V=x=>this.uniqueKeys.map(C=>({[u]:C,[h]:x}));M.join(x=>x.append("path").attr("opacity",0).attr("transform",`translate(${L.x}, ${L.y})`).attr("fill","none").call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",y=>$(V(y)))),x=>x.call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",y=>$(V(y)))),x=>x.call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_axes_exit",animate:t})).attr("d",y=>$(V(y))).attr("opacity",0).remove())),P.appendOrSelect(n,"g.x-axes").attr("role",dt.GROUP).selectAll("line").data(this.uniqueKeys,x=>x).join(x=>x.append("line").attr("opacity",0).attr("class",C=>`x-axis-${Hr(C)}`).attr("stroke-dasharray","0").attr("x1",C=>Gt(w(C),0,L).x).attr("y1",C=>Gt(w(C),0,L).y).attr("x2",C=>Gt(w(C),0,L).x).attr("y2",C=>Gt(w(C),0,L).y).call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",y=>Gt(w(y),E.range()[0],L).x).attr("y1",y=>Gt(w(y),E.range()[0],L).y).attr("x2",y=>Gt(w(y),E.range()[1],L).x).attr("y2",y=>Gt(w(y),E.range()[1],L).y)),x=>x.call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",y=>Gt(w(y),E.range()[0],L).x).attr("y1",y=>Gt(w(y),E.range()[0],L).y).attr("x2",y=>Gt(w(y),E.range()[1],L).x).attr("y2",y=>Gt(w(y),E.range()[1],L).y)),x=>x.call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),P.appendOrSelect(n,"g.x-labels").attr("role",dt.GROUP).selectAll("text").data(this.uniqueKeys).join(x=>x.append("text").text(C=>C).attr("opacity",0).attr("x",C=>Gt(w(C),E.range()[1]+d,L).x).attr("y",C=>Gt(w(C),E.range()[1]+d,L).y).style("text-anchor",C=>Eg(w(C)).textAnchor).style("dominant-baseline",C=>Eg(w(C)).dominantBaseline).call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),x=>x.call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",y=>Gt(w(y),E.range()[1]+d,L).x).attr("y",y=>Gt(w(y),E.range()[1]+d,L).y).end().finally(()=>{const y=_(o,"radar","alignment"),R=this.getAlignmentXOffset(y,n,this.getParent());n.attr("x",R)})),x=>x.call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),P.appendOrSelect(n,"g.blobs").attr("role",dt.GROUP).selectAll("path").data(this.groupedDataNormalized,x=>x.name).join(x=>x.append("path").attr("class",C=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:C.name,originalClassName:"blob"})).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",C=>C.name).attr("opacity",0).attr("transform",t?()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`:`translate(${L.x}, ${L.y})`).style("fill",C=>S(C.name)).style("fill-opacity",Kn.opacity.selected).style("stroke",C=>S(C.name)).call(C=>{const y=C.transition().call(R=>this.services.transitions.setupTransition({transition:R,name:"radar_blobs_enter",animate:t}));t&&y.delay(()=>Math.random()*30).attr("transform",`translate(${L.x}, ${L.y})`),y.attr("opacity",1).attr("d",R=>$(R.data))}),x=>(x.attr("class",C=>this.model.getColorClassName({classNameTypes:[st.FILL,st.STROKE],dataGroupName:C.name,originalClassName:"blob"})).style("fill",C=>S(C.name)).style("stroke",C=>S(C.name)),x.call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${L.x}, ${L.y})`).attr("d",y=>$(y.data))),x),x=>x.call(C=>{const y=C.transition().call(R=>this.services.transitions.setupTransition({transition:R,name:"radar_blobs_exit",animate:t}));t&&y.delay(()=>Math.random()*30).attr("transform",()=>`translate(${L.x}, ${L.y}) scale(${1+Math.random()*.35})`),y.attr("opacity",0).remove()})),P.appendOrSelect(n,"g.dots").attr("role",dt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(x=>_(x,h)!==null)).join(x=>x.append("circle").attr("role",dt.GRAPHICS_SYMBOL).attr("aria-label",C=>C[c]),x=>x,x=>x.remove()).attr("class",x=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:x[l],originalClassName:Hr(x[u])})).attr("cx",x=>Gt(w(x[u]),E(x[h]),L).x).attr("cy",x=>Gt(w(x[u]),E(x[h]),L).y).attr("r",0).attr("opacity",0).style("fill",x=>S(x[l])),P.appendOrSelect(n,"g.x-axes-rect").attr("role",dt.GROUP).selectAll("rect").data(this.uniqueKeys).join(x=>x.append("rect"),x=>x,x=>x.remove()).attr("x",L.x).attr("y",L.y-g/2).attr("width",E.range()[1]).attr("height",g).style("fill","red").style("fill-opacity",0).attr("transform",x=>`rotate(${Sg(w(x))}, ${L.x}, ${L.y})`),P.appendOrSelect(n,"g.y-labels").attr("role",dt.GROUP).selectAll("text").data(Re(T)).join(x=>x.append("text").attr("opacity",0).text(C=>C).attr("x",C=>Gt(-Math.PI/2,E(C),L).x+f).attr("y",C=>Gt(-Math.PI/2,E(C),L).y).style("text-anchor","start").style("dominant-baseline","middle").call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),x=>x.call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_labels_update",animate:t})).text(y=>y).attr("opacity",1).attr("x",y=>Gt(-Math.PI/2,E(y),L).x+f).attr("y",y=>Gt(-Math.PI/2,E(y),L).y)),x=>x.call(C=>C.transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=P.getSVGElementSize(n,{useBBox:!0}),{width:s}=P.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Yt.CENTER?a=Math.floor((s-i.width)/2):t===Yt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=_(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=N(this);t.services.events.dispatchEvent(A.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Hr(i)}`),o=t.parent.selectAll(`.dots circle.${Hr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,h=_(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",Kn.dotsRadius);const d=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:r,hoveredElement:s,items:d.filter(f=>typeof f[h]=="number").map(f=>({label:f[u],value:f[h],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=N(this);t.services.events.dispatchEvent(A.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(A.Radar.X_AXIS_CLICK,{event:r,element:N(this),datum:i})}).on("mouseout",function(r,i){const s=N(this),a=t.parent.select(`.x-axes .x-axis-${Hr(i)}`),o=t.parent.selectAll(`.dots circle.${Hr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(A.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(A.Tooltip.HIDE)})}}class Lm extends Fc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>this.model.getFillColor(l[r])).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),h=l[c],d=this.services.cartesianScales.getDomainValue(l)-u/2,f=d+u;let p,m;if(Array.isArray(h)&&h.length===2)p=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,v)),m=this.services.cartesianScales.getRangeValue(l)}const g=Math.abs(m-p);if(g!==0&&g<2&&(h>0&&a===Jt.VERTICAL||h<0&&a===Jt.HORIZONTAL?m=p-2:m=p+2),!this.isOutsideZoomedDomain(d,f))return ue({x0:d,x1:f,y0:p,y1:m},a)}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=N(this);i.classed("hovered",!0),t.services.events.dispatchEvent(A.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(A.Bar.BAR_MOUSEMOVE,{event:n,element:N(this),datum:r}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(A.Bar.BAR_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);i.classed("hovered",!1),t.services.events.dispatchEvent(A.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class CR extends he{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=_(this.getOptions(),"data","loading"),r=!_(this.getOptions(),"grid","x","enabled")&&!_(this.getOptions(),"grid","y","enabled")&&!_(this.getOptions(),"axes","bottom","visible")&&!_(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=P.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=P.appendOrSelect(t,"svg.chart-skeleton.DAII"),P.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Dm extends gt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>_(s,0,i)!==n.datum().name?pn.opacity.unselected:pn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",pn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=_(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),h=this.services.cartesianScales.getScaleByPosition(u),d=n.selectAll("path.area").data(o,f=>_(f,0,s));this.areaGenerator=Al().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(c,f.data.sharedStackKey)).y0(f=>h(f[0])).y1(f=>h(f[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,f=>_(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:_(f,0,s),originalClassName:"area"})).style("fill",f=>r.model.getFillColor(_(f,0,s))).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>_(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",pn.opacity.selected).attr("d",this.areaGenerator)}}class km extends Fc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>_(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",dt.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,h=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(u)-h/2,f=d+h,p=this.services.cartesianScales.getRangeValue(c[0]);let m=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(d,f)){if(Math.abs(m-p)>0&&Math.abs(m-p)>r.bars.dividerSize){const g=c[0]<0&&c[1]<=0;g&&a.length>1?this.services.cartesianScales.getOrientation()===Jt.VERTICAL?m+=c[1]===0?2:1:m-=1:g||(this.services.cartesianScales.getOrientation()===Jt.VERTICAL?m+=1:m-=1)}return ue({x0:d,x1:f,y0:p,y1:m},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",dt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=N(this);a.classed("hovered",!0),r.services.events.dispatchEvent(A.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(A.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=N(this);r.services.events.dispatchEvent(A.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(A.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(A.Bar.BAR_CLICK,{event:i,element:N(this),datum:s})}).on("mouseout",function(i,s){const a=N(this);a.classed("hovered",!1),r.services.events.dispatchEvent(A.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(_(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=P.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=_(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Rm extends tn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=nt.SVG}render(t){if(!_(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>_(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",dt.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const h=u[i],d=this.services.cartesianScales.getDomainIdentifier(u),f=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:h,[d]:u.data.sharedStackKey,[f]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,h)=>{const d=u[i],f=u.data.sharedStackKey;let p=u.data[d];const m=u[1],g=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(m)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][h].data[d]),p!==null&&o.push({[i]:d,[g]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(h=>h[i]==l[i]&&h[c]==l[c]&&h[u]==l[u])!==void 0})}}const Wr=6;class AR extends gt{constructor(){super(...arguments),this.type="tree",this.renderType=nt.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=P.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=P.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=_(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),h={top:0,right:0,bottom:0,left:l>0?l+Wr:30-Wr},d=vi({name:o,children:a}),f=10,p=r/6,m=T=>{const S=d.descendants().reverse(),$=d.links();let k=d,L=d;d.eachBefore(B=>{B.x<k.x&&(k=B),B.x>L.x&&(L=B)});const M=L.x-k.x,V=n.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-h.left,k.x,r,M].join(" ")),x=E.selectAll("g").data(S,B=>B.id),C=this,y=x.enter().append("g").attr("transform",()=>`translate(${T.y0},${T.x0})`).attr("class",B=>B.depth!==0&&B.children&&B.children.length>0?"clickable":null).on("mouseover",function(B,U){C.services.events.dispatchEvent(A.Tree.NODE_MOUSEOVER,{event:B,element:N(this),datum:U})}).on("click",function(B,U){U.depth!==0&&(U.children=U.children?null:U._children,m(U)),C.services.events.dispatchEvent(A.Tree.NODE_CLICK,{event:B,element:N(this),datum:U})}).on("mouseout",function(B,U){C.services.events.dispatchEvent(A.Tree.NODE_MOUSEOUT,{event:B,element:N(this),datum:U})});y.append("circle").attr("r",2.5).attr("class",B=>B._children?"parent":"child").attr("stroke-width",10),y.append("text").attr("dy","0.31em").attr("x",B=>B._children?-Wr:Wr).attr("text-anchor",B=>B._children?"end":"start").text(B=>B.data.name).clone(!0).attr("class","text-stroke").lower(),x.merge(y).transition(V).attr("transform",B=>`translate(${B.y},${B.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),x.exit().transition(V).remove().attr("transform",()=>`translate(${T.y},${T.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const R=O.selectAll("path").data($,B=>B.target.id),I=R.enter().append("path").attr("d",()=>{const B={x:T.x0,y:T.y0};return w({source:B,target:B})});R.merge(I).transition(V).attr("d",w),R.exit().transition(V).remove().attr("d",()=>{const B={x:T.x,y:T.y};return w({source:B,target:B})}),d.eachBefore(B=>{B.x0=B.x,B.y0=B.y})},g=d.descendants(),v=g[g.length-1].depth,b=_(s,"tree","type")===Pl.DENDROGRAM?Nx().size([i,r-u-v*Wr-l]):Sw().nodeSize([f,p]).size([i,r-u-v*Wr-l]),w=_E().x(T=>T.y).y(T=>T.x);d.x0=p/2,d.y0=0,d.descendants().forEach((T,S)=>{T.id=S,T._children=T.children}),b(d),n.attr("viewBox",[-h.left,-h.top,r,f]).style("user-select","none");const O=n.append("g").attr("class","links"),E=n.append("g").attr("class","nodes");m(d)}}var $R="#000000",LR="#ffffff",DR="#fcf4d6",kR="#fddc69",RR="#f1c21b",IR="#d2a106",PR="#b28600",NR="#8e6a00",UR="#684e00",BR="#483700",VR="#302400",HR="#1c1500",FR={10:DR,20:kR,30:RR,40:IR,50:PR,60:NR,70:UR,80:BR,90:VR,100:HR},GR="#fff2e8",zR="#ffd9be",jR="#ffb784",WR="#ff832b",qR="#eb6200",YR="#ba4e00",XR="#8a3800",ZR="#5e2900",KR="#3e1a00",QR="#231000",JR={10:GR,20:zR,30:jR,40:WR,50:qR,60:YR,70:XR,80:ZR,90:KR,100:QR},tI="#fff1f1",eI="#ffd7d9",nI="#ffb3b8",rI="#ff8389",iI="#fa4d56",sI="#da1e28",aI="#a2191f",oI="#750e13",lI="#520408",cI="#2d0709",uI={10:tI,20:eI,30:nI,40:rI,50:iI,60:sI,70:aI,80:oI,90:lI,100:cI},hI="#fff0f7",dI="#ffd6e8",fI="#ffafd2",pI="#ff7eb6",gI="#ee5396",mI="#d02670",vI="#9f1853",yI="#740937",bI="#510224",xI="#2a0a18",wI={10:hI,20:dI,30:fI,40:pI,50:gI,60:mI,70:vI,80:yI,90:bI,100:xI},_I="#f6f2ff",EI="#e8daff",SI="#d4bbff",OI="#be95ff",TI="#a56eff",MI="#8a3ffc",CI="#6929c4",AI="#491d8b",$I="#31135e",LI="#1c0f30",DI={10:_I,20:EI,30:SI,40:OI,50:TI,60:MI,70:CI,80:AI,90:$I,100:LI},kI="#edf5ff",RI="#d0e2ff",II="#a6c8ff",PI="#78a9ff",NI="#4589ff",UI="#0f62fe",BI="#0043ce",VI="#002d9c",HI="#001d6c",FI="#001141",GI={10:kI,20:RI,30:II,40:PI,50:NI,60:UI,70:BI,80:VI,90:HI,100:FI},zI="#e5f6ff",jI="#bae6ff",WI="#82cfff",qI="#33b1ff",YI="#1192e8",XI="#0072c3",ZI="#00539a",KI="#003a6d",QI="#012749",JI="#061727",tP={10:zI,20:jI,30:WI,40:qI,50:YI,60:XI,70:ZI,80:KI,90:QI,100:JI},eP="#d9fbfb",nP="#9ef0f0",rP="#3ddbd9",iP="#08bdba",sP="#009d9a",aP="#007d79",oP="#005d5d",lP="#004144",cP="#022b30",uP="#081a1c",hP={10:eP,20:nP,30:rP,40:iP,50:sP,60:aP,70:oP,80:lP,90:cP,100:uP},dP="#defbe6",fP="#a7f0ba",pP="#6fdc8c",gP="#42be65",mP="#24a148",vP="#198038",yP="#0e6027",bP="#044317",xP="#022d0d",wP="#071908",_P={10:dP,20:fP,30:pP,40:gP,50:mP,60:vP,70:yP,80:bP,90:xP,100:wP},EP="#f2f4f8",SP="#dde1e6",OP="#c1c7cd",TP="#a2a9b0",MP="#878d96",CP="#697077",AP="#4d5358",$P="#343a3f",LP="#21272a",DP="#121619",kP={10:EP,20:SP,30:OP,40:TP,50:MP,60:CP,70:AP,80:$P,90:LP,100:DP},RP="#f4f4f4",IP="#e0e0e0",PP="#c6c6c6",NP="#a8a8a8",UP="#8d8d8d",BP="#6f6f6f",VP="#525252",HP="#393939",FP="#262626",GP="#161616",zP={10:RP,20:IP,30:PP,40:NP,50:UP,60:BP,70:VP,80:HP,90:FP,100:GP},jP="#f7f3f2",WP="#e5e0df",qP="#cac5c4",YP="#ada8a8",XP="#8f8b8b",ZP="#726e6e",KP="#565151",QP="#3c3838",JP="#272525",tN="#171414",eN={10:jP,20:WP,30:qP,40:YP,50:XP,60:ZP,70:KP,80:QP,90:JP,100:tN},Im={black:{100:$R},blue:GI,coolGray:kP,cyan:tP,gray:zP,green:_P,magenta:wI,orange:JR,purple:DI,red:uI,teal:hP,warmGray:eN,white:{0:LR},yellow:FR};const nN=e=>{if(!e)return null;for(const t of Object.keys(Im)){const n=Im[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Pm=function(){const e=N(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=en(t);let r;if(n&&(r=nN(n?n.hex():null)),r==null){const i=yo(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let rN=0;class iN extends gt{constructor(){super(...arguments),this.type="treemap",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=_(window,"location"),{width:a,height:o}=P.getSVGElementSize(n,{useAttrs:!0}),l=vi({name:i.title||"Treemap",children:r}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=Aw().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>rN++).merge(u);h.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:t})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const d=h.selectAll("rect.leaf").data(f=>[f]);d.exit().attr("width",0).attr("height",0).remove(),d.enter().append("rect").classed("leaf",!0).merge(d).attr("width",0).attr("height",0).attr("id",function(){const f=N(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:t})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name)}),h.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const p=N(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=N(this.parentNode.parentNode).attr("data-uid"),m=`${i.style.prefix}-leaf-${p}`;return new URL(`#${m}`,s)+""}),f=>null,f=>f.remove()),h.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let p=f;for(;p.depth>1;)p=p.parent;const m=yo(this.model.getFillColor(p.data.name));return[{text:f.data.name,color:m.l<.5?"white":"black"}]},f=>f).join(f=>{const p=f.append("text").text(m=>m.text).style("fill",Pm).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const m=N(this.parentNode).attr("data-uid"),g=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${g}`,s)+""})`}),p},f=>f.text(p=>p.text).style("fill",Pm),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=N(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name);return l&&(s=l),en(s).darker(.7).toString()}),t.services.events.dispatchEvent(A.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(A.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=N(this);t.services.events.dispatchEvent(A.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(A.Treemap.LEAF_CLICK,{event:n,element:N(this),datum:r})}).on("mouseout",function(n,r){const i=N(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name)),t.services.events.dispatchEvent(A.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:i})})}}class sN extends gt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=nt.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(A.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(A.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:h}=P.getSVGElementSize(r,{useAttrs:!0});if(u===0||h===0)return;const d=IL().size([u,h]).words(i.map(function(p){const m=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:m,value:m}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);d.start();function f(p){const m=P.appendOrSelect(r,"g.words");m.attr("transform",`translate(${d.size()[0]/2}, ${d.size()[1]/2})`);const g=m.selectAll("text").data(p,v=>`${v[c]}-${v.text}`);g.exit().attr("opacity",0).remove(),g.enter().append("text").attr("opacity",0).merge(g).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[st.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=P.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Re(i):[1,1];return Be().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Ha(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(A.WordCloud.WORD_MOUSEOVER,{event:s,element:N(this),datum:a}),r.services.events.dispatchEvent(A.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:t.tooltip.groupLabel,value:a[n],class:r.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=N(this);r.services.events.dispatchEvent(A.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(A.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(A.WordCloud.WORD_CLICK,{event:s,element:N(this),datum:a})}).on("mouseout",function(s,a){const o=N(this);i(null),r.services.events.dispatchEvent(A.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(A.Tooltip.HIDE,{hoveredElement:o})})}}class aN extends gt{constructor(){super(...arguments),this.type="geo",this.renderType=nt.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=P.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=_(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(g=>{typeof a[g].value=="number"?o[g]=a[g]:l[g]=a[g]});const c=lR(s,Object.values(l)),u=sR(s,{type:"GeometryCollection",geometries:Object.values(o)}),h=i.fitSize([n,r],u),d=cx().projection(h);P.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",d);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=P.appendOrSelect(t,"defs");P.appendOrSelect(p,"pattern").attr("id",f).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Mi()([[0,0],[0,10]]));const m=P.appendOrSelect(t,"g.missing-data");P.appendOrSelect(m,"path").datum(c).attr("d",d).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(_(this.getOptions(),"thematic","projection")){case fn.geoEqualEarth:t=Cx();break;case fn.geoAlbers:t=wx();break;case fn.geoConicEqualArea:t=nd();break;case fn.geoConicEquidistant:t=Tx();break;case fn.geoEquirectangular:t=Sx();break;case fn.geoMercator:t=_x();break;case fn.geoNaturalEarth1:t=Ax();break;default:throw new Error("Projection is not supported.")}return t}}class oN extends aN{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=N(this);t.services.events.dispatchEvent(Mr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Ai.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Mr.CHOROPLETH_MOUSEMOVE,{event:r,element:N(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Ai.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Mr.CHOROPLETH_CLICK,{event:r,element:N(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=N(this);t.services.events.dispatchEvent(Mr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Ai.HIDE,{event:r,hoveredElement:s})})}}function Nm(e,t){ht(2,arguments);var n=xt(e),r=Kt(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function Gc(e,t){ht(2,arguments);var n=xt(e),r=Kt(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),s=new Date(n.getTime());s.setMonth(n.getMonth()+r+1,0);var a=s.getDate();return i>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}var lN=36e5;function Um(e,t){ht(2,arguments);var n=Kt(t);return xa(e,n*lN)}function Bm(e){ht(1,arguments);var t=xt(e);return t.setHours(0,0,0,0),t}var cN=864e5;function uN(e,t){ht(2,arguments);var n=Bm(e),r=Bm(t),i=n.getTime()-Vl(n),s=r.getTime()-Vl(r);return Math.round((i-s)/cN)}var hN=6e4;function zc(e,t){ht(2,arguments);var n=Kt(t);return xa(e,n*hN)}function jc(e,t){ht(2,arguments);var n=Kt(t);return xa(e,n*1e3)}function Vm(e,t){ht(2,arguments);var n=Kt(t);return Gc(e,n*12)}function es(e,t){ht(2,arguments);var n=xt(e),r=xt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}var dN=6e4,fN=36e5;function pN(e,t){ht(2,arguments);var n=xt(e),r=xt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function gN(e,t){ht(2,arguments);var n=xt(e),r=xt(t);return n.getFullYear()-r.getFullYear()}function Hm(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function mN(e,t){ht(2,arguments);var n=xt(e),r=xt(t),i=Hm(n,r),s=Math.abs(uN(n,r));n.setDate(n.getDate()-i*s);var a=+(Hm(n,r)===-i),o=i*(s-a);return o===0?0:o}function Wc(e,t){return ht(2,arguments),xt(e).getTime()-xt(t).getTime()}var Fm={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},vN="trunc";function qc(e){return e?Fm[e]:Fm[vN]}function yN(e,t,n){ht(2,arguments);var r=Wc(e,t)/fN;return qc(n==null?void 0:n.roundingMethod)(r)}function Gm(e,t,n){ht(2,arguments);var r=Wc(e,t)/dN;return qc(n==null?void 0:n.roundingMethod)(r)}function bN(e){ht(1,arguments);var t=xt(e);return t.setHours(23,59,59,999),t}function xN(e){ht(1,arguments);var t=xt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function wN(e){ht(1,arguments);var t=xt(e);return bN(t).getTime()===xN(t).getTime()}function _N(e,t){ht(2,arguments);var n=xt(e),r=xt(t),i=es(n,r),s=Math.abs(pN(n,r)),a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);var o=es(n,r)===-i;wN(xt(e))&&s===1&&es(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function zm(e,t,n){ht(2,arguments);var r=Wc(e,t)/1e3;return qc(n==null?void 0:n.roundingMethod)(r)}function EN(e,t){ht(2,arguments);var n=xt(e),r=xt(t),i=es(n,r),s=Math.abs(gN(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=es(n,r)===-i,o=i*(s-Number(a));return o===0?0:o}function SN(e,t){ht(2,arguments);var n=Kt(t);return Nm(e,-n)}function ON(e,t){ht(2,arguments);var n=Kt(t);return Gc(e,-n)}function TN(e,t){ht(2,arguments);var n=Kt(t);return Um(e,-n)}function jm(e,t){ht(2,arguments);var n=Kt(t);return zc(e,-n)}function Wm(e,t){ht(2,arguments);var n=Kt(t);return jc(e,-n)}function MN(e,t){ht(2,arguments);var n=Kt(t);return Vm(e,-n)}function qm(e){var t=e==null?0:e.length;return t?Da(e,1):[]}class CN extends wn{zoomIn(t,n,r){let i,s,a;const o=r||Dr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=P.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(A.CanvasZoom.CANVAS_ZOOM_IN,{element:N(t)})}zoomOut(t,n){const r=n||Dr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(A.CanvasZoom.CANVAS_ZOOM_OUT)}}class AN extends wn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class $N extends wn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class LN extends wn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(A.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(_(Xf,n,"duration")||Xf.default.duration)}getPendingTransitions(){return this.pendingTransitions}}let DN=class extends wn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=_(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=_(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return _(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===H.BOTTOM||t===H.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(H).map(t=>H[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===H.LEFT||this.rangeAxisPosition===H.RIGHT)&&(this.domainAxisPosition===H.BOTTOM||this.domainAxisPosition===H.TOP)?this.orientation=Jt.VERTICAL:this.orientation=Jt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=_(s,"axes");((t=a[H.LEFT])!=null&&t.correspondingDatasets&&a[H.RIGHT]||(n=a[H.RIGHT])!=null&&n.correspondingDatasets&&a[H.LEFT]||(r=a[H.TOP])!=null&&r.correspondingDatasets&&a[H.BOTTOM]||(i=a[H.BOTTOM])!=null&&i.correspondingDatasets&&a[H.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=_(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===tt.LINEAR||this.scaleTypes[t]===tt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[H.BOTTOM,H.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[H.LEFT,H.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=_(s,"axes")[r],{mapsTo:o}=a,l=_(i,o)!==null?i[o]:i;let c;switch(n){case tt.LABELS:c=t(l)+t.step()/2;break;case tt.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=_(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(_(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(_(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return _(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return _(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=_(r,"axes",t);if(i.scaleType===tt.TIME){const s=_(r,"timeScale","addSpaceOnEdges");return kN(n,s)}else return RN(n,An.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=_(t,"axes"),r=this.isDualAxes();return _(n,H.LEFT)===null&&_(n,H.RIGHT)!==null||_(n,H.RIGHT,"main")===!0||r&&_(n,H.LEFT,"correspondingDatasets")?{primary:H.RIGHT,secondary:H.LEFT}:{primary:H.LEFT,secondary:H.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=_(t,"axes"),r=this.isDualAxes();return _(n,H.BOTTOM)===null&&_(n,H.TOP)!==null||_(n,H.TOP,"main")===!0||r&&_(n,H.BOTTOM,"correspondingDatasets")?{primary:H.TOP,secondary:H.BOTTOM}:{primary:H.BOTTOM,secondary:H.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=_(r,"axes",t.primary),s=_(r,"axes",n.primary),a=i.scaleType||tt.LINEAR,o=s.scaleType||tt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===tt.LABELS||o===tt.TIME)&&a===tt.LABELS||a===tt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=_(n,"axes",t),i=_(n,"bounds"),{includeZero:s}=r,a=_(r,"scaleType")||tt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Nn(v,b=>b.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),b=this.model.getStackKeys({bins:v});return[b[0].split("-")[0],b[b.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:h}=r,{reference:d,compareTo:f}=An.ratio;if(r.domain)return a===tt.LABELS?r.domain:(a===tt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===tt.LABELS)return ji(o.map(v=>v[c]));let p,m;const g=this.model.getDataGroupNames();if(a===tt.LABELS_RATIO)return o.map(v=>`${v[d]}/${v[f]}`);if(a===tt.TIME)m=o.map(v=>+new Date(v[c]));else if(i&&n.axes)m=[],o.forEach(v=>{m.push(v[c]),v[i.upperBoundMapsTo]&&m.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&m.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&g&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,b=this.model.getDataValuesGroupedByKeys({groups:g}),w=o.filter(E=>!g.includes(E[v])),O=[];b.forEach(E=>{const{...T}=E;let S=0,$=0;Object.values(T).forEach(k=>{isNaN(k)||(k<0?$+=k:S+=k)}),O.push([$,S])}),m=[...qm(O),...w.map(E=>E[c])]}else m=[],o.forEach(v=>{const b=v[c];Array.isArray(b)&&b.length===2?(m.push(b[0]),m.push(b[1])):(l&&m.push(Math.max(v[c],v[l])),m.push(b))});return a!==tt.TIME&&a!==tt.LOG&&s&&m.push(0),h&&h.length>0&&h.forEach(v=>{const b=_(v,"value");b!==null&&m.push(b)}),p=Re(m),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=_(n,"axes",t);if(!r)return null;const i=_(r,"scaleType")||tt.LINEAR;this.scaleTypes[t]=i;let s;return i===tt.TIME?s=Fd():i===tt.LOG?s=Ed().base(r.base||10):i===tt.LABELS||i===tt.LABELS_RATIO?s=xi():s=Be(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=_(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===tt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=_(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}};function kN(e,t){const n=new Date(e[0]),r=new Date(e[1]);return EN(r,n)>1?[MN(n,t),Vm(r,t)]:_N(r,n)>1?[ON(n,t),Gc(r,t)]:mN(r,n)>1?[SN(n,t),Nm(r,t)]:yN(r,n)>1?[TN(n,t),Um(r,t)]:Gm(r,n)>30?[jm(n,t*30),zc(r,t*30)]:Gm(r,n)>1?[jm(n,t),zc(r,t)]:zm(r,n)>15?[Wm(n,t*15),jc(r,t*15)]:zm(r,n)>1?[Wm(n,t),jc(r,t)]:[n,r]}function RN([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===tt.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}let IN=class extends wn{constructor(){super(...arguments),this.curveTypes={curveLinear:la,curveLinearClosed:ef,curveBasis:EE,curveBasisClosed:SE,curveBasisOpen:OE,curveBundle:TE,curveCardinal:ME,curveCardinalClosed:CE,curveCardinalOpen:AE,curveCatmullRom:$E,curveCatmullRomClosed:LE,curveCatmullRomOpen:DE,curveMonotoneX:kE,curveMonotoneY:RE,curveNatural:IE,curveStep:PE,curveStepAfter:UE,curveStepBefore:NE}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}};class PN extends wn{isZoomBarEnabled(){if(!this.services.cartesianScales||!_(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=_(this.model.getOptions(),"axes",t,"scaleType");return t===H.BOTTOM&&n===tt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=_(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Re(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(A.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return _(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=_(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=Ee.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let h=a+u,d=o-u;h>=d&&(h=a+c/2-i/2,d=o-c/2+i/2);const f=[s.invert(h),s.invert(d)];(r[0].valueOf()!==f[0].valueOf()||r[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=_(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return _(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return _(this.model.getOptions(),"zoomBar",t,"locked")}}function NN(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function UN(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:NN(e,t,n)}var BN="\\ud800-\\udfff",VN="\\u0300-\\u036f",HN="\\ufe20-\\ufe2f",FN="\\u20d0-\\u20ff",GN=VN+HN+FN,zN="\\ufe0e\\ufe0f",jN="\\u200d",WN=RegExp("["+jN+BN+GN+zN+"]");function Ym(e){return WN.test(e)}function qN(e){return e.split("")}var Xm="\\ud800-\\udfff",YN="\\u0300-\\u036f",XN="\\ufe20-\\ufe2f",ZN="\\u20d0-\\u20ff",KN=YN+XN+ZN,QN="\\ufe0e\\ufe0f",JN="["+Xm+"]",Yc="["+KN+"]",Xc="\\ud83c[\\udffb-\\udfff]",tU="(?:"+Yc+"|"+Xc+")",Zm="[^"+Xm+"]",Km="(?:\\ud83c[\\udde6-\\uddff]){2}",Qm="[\\ud800-\\udbff][\\udc00-\\udfff]",eU="\\u200d",Jm=tU+"?",tv="["+QN+"]?",nU="(?:"+eU+"(?:"+[Zm,Km,Qm].join("|")+")"+tv+Jm+")*",rU=tv+Jm+nU,iU="(?:"+[Zm+Yc+"?",Yc,Km,Qm,JN].join("|")+")",sU=RegExp(Xc+"(?="+Xc+")|"+iU+rU,"g");function aU(e){return e.match(sU)||[]}function oU(e){return Ym(e)?aU(e):qN(e)}function lU(e){return function(t){t=Gi(t);var n=Ym(t)?oU(t):void 0,r=n?n[0]:t.charAt(0),i=n?UN(n,1).join(""):t.slice(1);return r[e]()+i}}var cU=lU("toUpperCase");const uU=cU;function hU(e){return uU(Gi(e).toLowerCase())}var dU=em(function(e,t,n){return t=t.toLowerCase(),e+(n?hU(t):t)});const fU=dU;class je{constructor(t,n){this.components=[],this.services={canvasZoom:CN,domUtils:P,events:AN,files:$N,gradientUtils:mc,transitions:LN},this.model=new Je(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(A.Model.UPDATE,r=>{const i=!!_(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(A.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(A.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=_(r,"toolbar","enabled"),s={id:"legend",components:[new Bc(this.model,this.services)],growth:ut.PREFERRED},a=_(r,"canvasZoom","enabled");a&&a===!0&&t.push(new Wk(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new ts(this.model,this.services)],growth:ut.STRETCH},c={id:"toolbar",components:[new Qi(this.model,this.services)],growth:ut.PREFERRED},u={id:"header",components:[new me(this.model,this.services,[l,...i?[c]:[]],{direction:Lt.ROW,alignItems:Cr.CENTER})],growth:ut.PREFERRED},h={id:"graph-frame",components:t,growth:ut.STRETCH,renderType:_(n,"graphFrameRenderType")||nt.SVG},d=_(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=Lt.COLUMN;if(d){const v=_(r,"legend","position");v==="left"?(f=Lt.ROW,r.legend.orientation||(r.legend.orientation=Li.VERTICAL)):v==="right"?(f=Lt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Li.VERTICAL)):v==="bottom"&&(f=Lt.COLUMN_REVERSE)}const p={id:"spacer",components:[new _n(this.model,this.services)],growth:ut.PREFERRED},m={id:"full-frame",components:[new me(this.model,this.services,[...d?[s]:[],...d?[p]:[],h],{direction:f})],growth:ut.STRETCH},g=[];if(o||i){g.push(u);const v={id:"spacer",components:[new _n(this.model,this.services,i?{size:15}:void 0)],growth:ut.PREFERRED};g.push(v)}return g.push(m),[new Vc(this.model,this.services),new Qa(this.model,this.services),new me(this.model,this.services,g,{direction:Lt.COLUMN})]}}class ye extends je{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:DN,curves:IN,zoom:PN}),this.model=new sr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=_(r,"zoomBar",H.TOP,"enabled"),s=_(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=_(r,"axes",a,"scaleType"),l=i&&a===H.BOTTOM&&o===tt.TIME,c=this.services.zoom.isZoomBarLocked(H.TOP),u=!!this.model.getOptions().title,h={id:"title",components:[new ts(this.model,this.services)],growth:ut.STRETCH},d={id:"toolbar",components:[new Qi(this.model,this.services)],growth:ut.PREFERRED},f={id:"header",components:[new me(this.model,this.services,[h,...s?[d]:[]],{direction:Lt.ROW,alignItems:Cr.CENTER})],growth:ut.PREFERRED},p={id:"legend",components:[new Bc(this.model,this.services)],growth:ut.PREFERRED};l&&!c&&t.push(new vm(this.model,this.services),new xm(this.model,this.services)),t.push(new Yk(this.model,this.services)),t.push(new Xk(this.model,this.services));const m={id:"graph-frame",components:t,growth:ut.STRETCH,renderType:nt.SVG},g=_(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Lt.COLUMN;if(g){const T=_(this.model.getOptions(),"legend","position");T===$i.LEFT?(v=Lt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Li.VERTICAL)):T===$i.RIGHT?(v=Lt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Li.VERTICAL)):T===$i.BOTTOM&&(v=Lt.COLUMN_REVERSE)}const b={id:"spacer",components:[new _n(this.model,this.services)],growth:ut.PREFERRED},w={id:"full-frame",components:[new me(this.model,this.services,[...g?[p]:[],...g?[b]:[],m],{direction:v})],growth:ut.STRETCH},O={id:"zoom-bar",components:[new qk(this.model,this.services)],growth:ut.PREFERRED,renderType:nt.SVG},E=[];if(u||s){E.push(f);const T={id:"spacer",components:[new _n(this.model,this.services,s?{size:15}:void 0)],growth:ut.PREFERRED};E.push(T)}return l&&E.push(O),E.push(w),[new wm(this.model,this.services),new Qa(this.model,this.services),new me(this.model,this.services,E,{direction:Lt.COLUMN})]}}class pU extends je{constructor(t,n){super(t,n),this.model=new _$(this.services),this.model.setOptions(Nt(Ct.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Zk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class gU extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(yn(Ct.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new zr(this.model,this.services),new _m(this.model,this.services),new tn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class mU extends ye{constructor(t,n){super(t,n),this.model=new E$(this.services),this.model.setOptions(Nt(Ct.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new Jk(this.model,this.services),new jr(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class vU extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Ct.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new tR(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class yU extends ye{constructor(t,n){super(t,n),this.model=new S$(this.services),this.model.setOptions(Nt(Ct.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new eR(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class bU extends je{constructor(t,n){super(t,n),this.model=new O$(this.services),this.model.setOptions(Nt(Ct.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=_(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new ts(this.model,this.services)],growth:ut.STRETCH},o={id:"toolbar",components:[new Qi(this.model,this.services)],growth:ut.PREFERRED},l={id:"header",components:[new me(this.model,this.services,[a,...i?[o]:[]],{direction:Lt.ROW,alignItems:Cr.CENTER})],growth:ut.PREFERRED},c={id:"legend",components:[new Tm(this.model,this.services,{chartType:"choropleth"})],growth:ut.PREFERRED,renderType:nt.SVG},u={id:"graph-frame",components:t,growth:ut.STRETCH,renderType:nt.SVG},h=_(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=Lt.COLUMN_REVERSE,f={id:"spacer",components:[new _n(this.model,this.services,{size:15})],growth:ut.PREFERRED},p={id:"full-frame",components:[new me(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:ut.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new _n(this.model,this.services,i?{size:15}:void 0)],growth:ut.PREFERRED};m.push(g)}return m.push(p),[new Vc(this.model,this.services),new Qa(this.model,this.services),new me(this.model,this.services,m,{direction:Lt.COLUMN})]}getComponents(){const t=[new oN(this.model,this.services)];return this.getChartComponents(t)}}class xU extends je{constructor(t,n){super(t,n),this.model=new T$(this.services),this.model.setOptions(Nt(Ct.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new bR(this.model,this.services)];return this.getChartComponents(t)}}const ev={[Me.LINE]:[zr,tn],[Me.SCATTER]:[tn],[Me.AREA]:[_m,zr,tn],[Me.STACKED_AREA]:[Dm,zr,Rm,eo],[Me.SIMPLE_BAR]:[Lm],[Me.GROUPED_BAR]:[$m,jr],[Me.STACKED_BAR]:[km,eo]};class wU extends ye{constructor(t,n){super(t,n);const r=Nt(Ct.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Me.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(ev).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${fU(i.type)}Chart`;return a=at({},Ct[l],this.model.getOptions(),i.options),i.type===Me.STACKED_AREA&&(o=!0),ev[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=at({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return qm(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===Me.STACKED_BAR||i.type===Me.STACKED_AREA),r=[new ve(this.model,this.services),new Se(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID}),...n?[]:[new kn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class nv extends je{constructor(t,n,r=!1){super(t,n),this.model=new M$(this.services),!r&&(this.model.setOptions(Nt(Ct.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Mm(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.PIE})];return this.getChartComponents(t)}}class _U extends nv{constructor(t,n){super(t,n,!0),this.model.setOptions(Nt(Ct.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new wR(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.DONUT})];return this.getChartComponents(t)}}class EU extends je{constructor(t,n){super(t,n),this.model=new C$(this.services),this.model.setOptions(Nt(Ct.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new _R(this.model,this.services)];return this.getChartComponents(t)}}class SU extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Ct.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new $m(this.model,this.services),new jr(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class OU extends ye{constructor(t,n){super(t,n),this.model=new A$(this.services),this.model.setOptions(Nt(Ct.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=_(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new ts(this.model,this.services)],growth:ut.STRETCH},o={id:"toolbar",components:[new Qi(this.model,this.services)],growth:ut.PREFERRED},l={id:"header",components:[new me(this.model,this.services,[a,...i?[o]:[]],{direction:Lt.ROW,alignItems:Cr.CENTER})],growth:ut.PREFERRED},c={id:"legend",components:[new Tm(this.model,this.services,{chartType:"heatmap"})],growth:ut.PREFERRED,renderType:nt.SVG},u={id:"graph-frame",components:t,growth:ut.STRETCH,renderType:nt.SVG},h=_(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=Lt.COLUMN_REVERSE,f={id:"spacer",components:[new _n(this.model,this.services,{size:15})],growth:ut.PREFERRED},p={id:"full-frame",components:[new me(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:ut.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new _n(this.model,this.services,i?{size:15}:void 0)],growth:ut.PREFERRED};m.push(g)}return m.push(p),[new wm(this.model,this.services),new Qa(this.model,this.services),new me(this.model,this.services,m,{direction:Lt.COLUMN})]}getComponents(){const t=[new ve(this.model,this.services),new ER(this.model,this.services)];return this.getAxisChartComponents(t)}}class TU extends ye{constructor(t,n){super(t,n),this.model=new $$(this.services),this.model.setOptions(Nt(Ct.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new uR(this.model,this.services),new SR(this.model,this.services)];return this.getAxisChartComponents(t)}}class MU extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Ct.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new zr(this.model,this.services),new tn(this.model,this.services,{handleThresholds:!0}),new CR(this.model,this.services),new jr(this.model,this.services)];return this.getAxisChartComponents(t)}}class CU extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Ct.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new OR(this.model,this.services),new tn(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class AU extends je{constructor(t,n){var r;super(t,n),this.model=new L$(this.services);const i=(r=n.options.meter)!=null&&r.proportional?at(yn(Ct.proportionalMeterChart),n.options):at(yn(Ct.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[..._(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new yR(this.model,this.services)],growth:ut.STRETCH,renderType:nt.SVG},{id:"spacer",components:[new _n(this.model,this.services,{size:8})],growth:ut.STRETCH}]:[],{id:"meter-graph",components:[new TR(this.model,this.services)],growth:ut.STRETCH,renderType:nt.SVG}],n=[new me(this.model,this.services,t,{direction:Lt.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:nt.HTML})}}class $U extends je{constructor(t,n){super(t,n),this.model=new D$(this.services),this.model.setOptions(Nt(Ct.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new MR(this.model,this.services)];return this.getChartComponents(t)}}class LU extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Ct.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new tn(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class DU extends je{constructor(t,n){super(t,n),this.model=new k$(this.services),this.model.setOptions(Nt(Ct.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new AR(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class kU extends je{constructor(t,n){super(t,n),this.model=new R$(this.services),this.model.setOptions(Nt(Ct.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new iN(this.model,this.services)];return this.getChartComponents(t)}}class RU extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Ct.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new Lm(this.model,this.services),new jr(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class IU extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Ct.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new eo(this.model,this.services),new Dm(this.model,this.services),new zr(this.model,this.services,{stacked:!0}),new Rm(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class PU extends ye{constructor(t,n){super(t,n),this.model.setOptions(Nt(Ct.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ve(this.model,this.services),new Se(this.model,this.services),new eo(this.model,this.services),new km(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.VERT_OR_HORIZ}),new jr(this.model,this.services)];return this.getAxisChartComponents(t)}}class NU extends je{constructor(t,n){super(t,n),this.model=new I$(this.services),this.model.setOptions(Nt(Ct.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new sN(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.PIE})];return this.getChartComponents(t)}}var Zc={exports:{}},ns={};/**
83
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=x(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],h=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:kt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else h=r.value;const d=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:d,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:h},...c,...u]})}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(O.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=D(this),s=i.classed("non-focal"),a=x(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Ir)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");D(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Ir),n.stopPropagation()}t.services.events.dispatchEvent(O.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function kI(e,t){const n=ii(this._current,e);return r=>(this._current=n(r),t(this._current))}class Ym extends ft{constructor(){super(...arguments),this.type="pie",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return At.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie,o=this.model.getDisplayData().filter(T=>T[a]>0),l=this.computeRadius();this.arc=$i().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=$i().innerRadius(this.getInnerRadius()).outerRadius(l+At.hoverArc.outerRadiusOffset);const c=DE().value(T=>T[a]).sort(x(i,"pie","sortFunction")).padAngle(At.padAngle)(o),u=L.appendOrSelect(r,"g.slices").attr("role",lt.GROUP).attr("data-name","slices").selectAll("path.slice").data(c,T=>T.data[s]);u.exit().attr("opacity",0).remove(),u.enter().append("path").classed("slice",!0).attr("opacity",0).merge(u).attr("class",T=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:T.data[s],originalClassName:"slice"})).style("fill",T=>n.model.getFillColor(T.data[s])).attr("d",this.arc).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",T=>`${T[a]}, ${pg(T.data[a],o,a)+"%"}`).attrTween("d",function(T){return kI.bind(this)(T,n.arc)});const h=i.pie.labels.enabled,d=h?c.filter(T=>T.data[a]>0):[],f=L.appendOrSelect(r,"g.labels").attr("role",lt.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(d,T=>T.data[s]);f.exit().attr("opacity",0).remove();const p=f.enter().append("text").classed("pie-label",!0),m=[];p.merge(f).style("text-anchor","middle").text(T=>i.pie.labels.formatter?i.pie.labels.formatter(T):pg(T.data[a],o,a)+"%").datum(function(T){const R=l+7,N=(T.endAngle-T.startAngle)/2+T.startAngle,A=N/Math.PI*180,C=this.getComputedTextLength();return T.textOffsetX=C/2,T.textOffsetY=A>90&&A<270?10:0,T.xPosition=(T.textOffsetX+R)*Math.sin(N),T.yPosition=(T.textOffsetY+R)*-Math.cos(N),T}).attr("transform",function(T,R){const N=d.length,A=(T.endAngle-T.startAngle)*(180/Math.PI);if(R>=N-2&&A<At.callout.minSliceDegree){let C,V;return T.index===N-1?(C=T.xPosition+At.callout.offsetX+At.callout.textMargin+T.textOffsetX,V=T.yPosition-At.callout.offsetY,T.direction=ga.RIGHT,m.push(T)):(C=T.xPosition-At.callout.offsetX-T.textOffsetX-At.callout.textMargin,V=T.yPosition-At.callout.offsetY,T.direction=ga.LEFT,m.push(T)),`translate(${C}, ${V})`}return`translate(${T.xPosition}, ${T.yPosition})`}),this.renderCallouts(m);const g=x(i,"donut")?"donut":"pie",v=x(i,g,"alignment"),{width:y}=L.getSVGElementSize(this.getParent(),{useAttrs:!0}),b=h?At.xOffset:0,S=h?At.yOffset:0;let _=l+b;v===Yt.CENTER?_=y/2:v===Yt.RIGHT&&(_=y-l-At.xOffset);let E=l+S;m.length>0&&(E+=At.yOffsetCallout),r.attr("x",_+7).attr("y",E),this.addEventListeners()}renderCallouts(t){const n=L.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",lt.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",lt.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(s){const{xPosition:a,yPosition:o,direction:l}=s;return l===ga.RIGHT?(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a+At.callout.offsetX,y:o-At.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x-At.callout.horizontalLineLength):(s.startPos={x:a,y:o+s.textOffsetY},s.endPos={x:a-At.callout.offsetX,y:o-At.callout.offsetY+s.textOffsetY},s.intersectPointX=s.endPos.x+At.callout.horizontalLineLength),s}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.startPos.x).attr("y1",s=>s.startPos.y).attr("x2",s=>s.intersectPointX).attr("y2",s=>s.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return D(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",s=>s.intersectPointX).attr("y1",s=>s.endPos.y).attr("x2",s=>s.endPos.x).attr("y2",s=>s.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOVER,{event:n,element:D(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Pie.SLICE_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc),t.services.events.dispatchEvent(O.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=L.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+At.radiusOffset:i}}class LI extends Ym{constructor(){super(...arguments),this.type="donut",this.renderType=Q.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=L.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");L.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(D(this))}),a!==null&&a!==""&&L.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=x(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=ju:s=_e;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Xm="4,10 8,6 12,10",Zm="12,6 8,10 4,6";class RI extends ft{constructor(){super(...arguments),this.type="gauge",this.renderType=Q.SVG}getValue(){var t;return((t=this.model.getData().find(n=>n.group==="value"))==null?void 0:t.value)??null}getValueRatio(){return Em(this.getValue(),0,100)/100}getDelta(){var t;return((t=this.model.getData().find(n=>n.group==="delta"))==null?void 0:t.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===Lr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(x(n,"gauge","deltaArrow","direction")){case Fl.UP:return Xm;case Fl.DOWN:return Zm;default:return t>0?Xm:Zm}}render(t=!0){const n=this.getComponentContainer().attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,h=this.computeRadius(),d=this.getInnerRadius();this.backgroundArc=$i().innerRadius(d).outerRadius(h).startAngle(c).endAngle(u),this.arc=$i().innerRadius(d).outerRadius(h).startAngle(o).endAngle(c),L.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",v=>v),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const p=x(r,"gauge","alignment"),{width:m}=L.getSVGElementSize(this.getParent(),{useAttrs:!0});let g=h;p===Yt.CENTER?g=m/2:p===Yt.RIGHT&&(g=m-h),n.attr("x",g).attr("y",h),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=x(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=x(n,"gauge","valueFontSize"),l=x(n,"gauge","deltaFontSize"),c=x(n,"gauge","numberSpacing"),u=x(n,"gauge","showPercentageSymbol");let h=0;r===Lr.FULL&&!s?h=l(a):r===Lr.SEMI&&s&&(h=-(l(a)+c));const d=L.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${h})`),f=o(a),p=L.appendOrSelect(d,"g.gauge-value-number"),m=x(n,"gauge","numberFormatter"),g=p.selectAll("text.gauge-value-number").data([i]);g.enter().append("text").attr("class","gauge-value-number").merge(g).style("font-size",`${f}px`).attr("text-anchor","middle").text(T=>m(T));const{width:v}=L.getSVGElementSize(L.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,b=u?"%":"",S=L.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",v/2).text(b),{width:_,height:E}=L.getSVGElementSize(S,{useBBox:!0});S.attr("y",`-${E/2}px`),p.attr("transform",`translate(-${_/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta();if(i){const s=this.computeRadius(),a=i?x(r,"gauge","deltaFontSize"):()=>0,o=i?x(r,"gauge","numberFormatter"):()=>null,l=x(r,"gauge","deltaArrow","size"),c=x(r,"gauge","numberSpacing"),u=x(r,"gauge","showPercentageSymbol"),h=L.appendOrSelect(n,"g.gauge-numbers"),d=L.appendOrSelect(h,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=L.appendOrSelect(d,"text.gauge-delta-number"),p=u?"%":"";f.data(i===null?[]:[i]),f.enter().append("text").classed("gauge-delta-number",!0).merge(f).attr("text-anchor","middle").style("font-size",`${a(s)}px`).text(y=>`${o(y)}${p}`);const{width:m}=L.getSVGElementSize(L.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),g=x(r,"gauge","deltaArrow","enabled"),v=d.selectAll("svg.gauge-delta-arrow").data(i!==null&&g?[i]:[]);v.enter().append("svg").merge(v).attr("class","gauge-delta-arrow").attr("x",-l(s)-m/2).attr("y",-l(s)/2-a(s)*.35).attr("width",l(s)).attr("height",l(s)).attr("viewBox","0 0 16 16").each(function(){const y=D(this);L.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=x(r,"gauge","status");L.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),v.exit().remove(),f.exit().remove()}else{const s=n.select("g.gauge-delta");s.empty()||s.remove()}}getInnerRadius(){const t=this.computeRadius(),n=x(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=L.getSVGElementSize(this.parent,{useAttrs:!0});return n===Lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Km extends Kc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=Q.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Yi(n.map(u=>{const h=this.services.cartesianScales.getDomainIdentifier(u);return u[h]&&typeof u[h].toString=="function"?u[h].toString():u[h]})),o=s.selectAll("g.bars").data(a,u=>u);o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("bars",!0).attr("role",lt.GROUP).attr("data-name","bars").merge(o);l.transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-group-update-enter",animate:t})).attr("transform",u=>{const h=this.services.cartesianScales.getDomainValue(u)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Jt.VERTICAL?`translate(${h}, 0)`:`translate(0, ${h})`});const c=l.selectAll("path.bar").data(u=>this.getDataCorrespondingToLabel(u),u=>u[i]);c.exit().attr("opacity",0).remove(),c.enter().append("path").attr("opacity",0).merge(c).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:u[i],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[i])).attr("d",u=>{const h=this.groupScale(u[i]),d=this.getBarWidth(),f=h,p=h+d,m=this.services.cartesianScales.getRangeAxisPosition({datum:u}),g=this.services.cartesianScales.getValueThroughAxisPosition(m,0),v=this.services.cartesianScales.getRangeValue(u),y=this.services.cartesianScales.getDomainValue(u)-d/2,b=y+d;if(!this.isOutsideZoomedDomain(y,b))return ue({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(n=>{const r=this.services.cartesianScales.getDomainIdentifier(n);return n[r].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=x(t,"bars","width"),r=x(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const i=this.model.getGroupedData(this.configs.groups).length,s=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-s)/i)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Ei().domain(t).rangeRound([0,this.getGroupWidth()])}}class DI extends ft{constructor(){super(...arguments),this.type="heatmap",this.renderType=Q.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",h=null,d=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const m=this.matrix[r][p].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const m=this.matrix[p][r].value;if(h===null){h=m,d=m,f=m;return}h+=m,d=m<d?m:d,f=m>f?m:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${Mn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Mn(l.range())},${c(r)})`),this.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n.event,hoveredElement:D(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:d!==null?d:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:h!==null?h/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(O.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(O.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(O.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(O.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),x(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),h=i.range(),d=s.range();this.xBandwidth=Math.abs((h[1]-h[0])/l.length),this.yBandwidth=Math.abs((d[1]-d[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",m=>`heat-${m.index}`).classed("cell",!0).attr("transform",m=>`translate(${i(m[a])}, ${s(m[o])})`).append("rect").attr("class",m=>this.model.getColorClassName({value:m.value,originalClassName:`heat-${m.index}`})).classed("heat",!0).classed("null-state",m=>m.index===-1||m.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",m=>m.index===-1||m.value===null?`url(#${f})`:this.model.getFillColor(Number(m.value))).attr("aria-label",m=>m.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(d[1]-d[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(h[1]-h[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=L.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);L.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),L.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),L.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),L.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=x(this.getOptions(),"heatmap","divider","state");return t!==Ii.OFF&&(t===Ii.AUTO&&np.minCellDividerDimension<=this.xBandwidth&&np.minCellDividerDimension<=this.yBandwidth||t===Ii.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=kt(r,"tooltip.totalLabel"),s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const h=D(this),d=h.select("rect.heat");if(!d.classed("null-state")){const f=Xi(h.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${f.x+t.translationUnits.x}, ${f.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:d,datum:u}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i||"Total",value:u.value,color:d.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(O.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const h=D(this).select("rect.heat"),d=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),d||(t.services.events.dispatchEvent(O.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class II extends ft{constructor(){super(...arguments),this.type="histogram",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer(),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>kt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",lt.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,h)=>h).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const h=kt(u,"data");if(!h)return;const d=o(h.x1)-o(h.x0)-1,f=this.services.cartesianScales.getDomainValue(h.x0),p=f+d,m=this.services.cartesianScales.getRangeValue(u[0]);let g=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(g-m)>0&&Math.abs(g-m)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Jt.VERTICAL?g+=1:g-=1),ue({x0:f,x1:p,y0:m,y1:g},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>x(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0);const o=parseFloat(kt(s,"data.x0")),l=parseFloat(kt(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:kt(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:s[n]})},{label:u,value:kt(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("mouseout",function(){D(this).classed("hovered",!1),r.services.events.dispatchEvent(O.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class NI extends tn{constructor(){super(...arguments),this.type="lollipop",this.renderType=Q.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?vn.weight.unselected:vn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",vn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?vn.opacity.unselected:vn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",vn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=g=>s.getDomainValue(g),u=g=>s.getRangeValue(g),h=s.getOrientation(),[d,f]=_n(c,u,h),p=n.selectAll("line.line").data(this.getScatterData(),g=>`${g[i]}-${g[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",g=>this.model.getColorClassName({classNameTypes:[tt.STROKE],dataGroupName:g[i],originalClassName:"line"})).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"lollipop-line-update-enter",animate:t})).style("stroke",g=>this.model.getFillColor(g[i],g[l],g)).attr("opacity",1);h===Jt.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",g=>d(g)-r.points.radius):m.attr("x1",d).attr("x2",d).attr("y1",o.range()[0]).attr("y2",g=>f(g)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(O.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(O.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class PI extends ft{constructor(){super(...arguments),this.type="meter",this.renderType=Q.SVG}getStackedBounds(t,n){let r=0;return t.map((i,s)=>s!==0?(r+=n(i.value),{...i,width:Math.abs(n(i.value)-te.dividerWidth),x:r-n(i.value)}):(r=n(i.value),{...i,width:Math.abs(n(i.value)-te.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer(),i=this.getOptions(),s=x(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=L.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;x(i,"meter","proportional")===null?u=100:u=x(i,"meter","proportional","total")||this.model.getMaximumDomain(this.model.getDisplayData());const h=Be().domain([0,u]).range([0,l]),d=this.getStackedBounds(a,h),f=x(i,"meter","height");L.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?te.height.proportional:te.height.default)),L.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?te.height.proportional:te.height.default));const p=r.selectAll("rect.value").data(d),m=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",b=>b.x).attr("y",0).attr("height",()=>f||(s?te.height.proportional:te.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:b[c],originalClassName:m})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?h(u):b.width).style("fill",b=>n.model.getFillColor(b[c])).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const g=x(i,"meter","peak");let v=g;g!==null&&(g>u?v=u:g<a[0].value&&(v=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(v==null?[]:[v]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?te.height.proportional:te.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>h(b)).attr("x2",b=>h(b)).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",b=>b),y.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=x(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class UI extends ft{constructor(){super(...arguments),this.type="radar",this.renderType=Q.SVG,this.getLabelDimensions=t=>{const n=L.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=L.appendOrSelect(n,"text").text(t),{width:i,height:s}=L.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo"),a=BR(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return rt(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=x(n,"radar","axes"),s=x(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:rt(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?tr.opacity.unselected:tr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?tr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",tr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=L.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=x(o,"data","groupMapsTo"),c=x(o,"radar","axes","value"),{angle:u,value:h}=x(o,"radar","axes"),{xLabelPadding:d,yLabelPadding:f,yTicksNumber:p,minRange:m,xAxisRectHeight:g}=tr;this.uniqueKeys=Array.from(new Set(s.map(M=>M[u]))),this.uniqueGroups=Array.from(new Set(s.map(M=>M[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const v=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),y=(Math.min(r,i)-v)/2;if(y<=0)return;const b=Ei().domain(this.fullDataNormalized.map(M=>M[u])).range([0,2*Math.PI].map(M=>M-Math.PI/2)),S=Mn(this.fullDataNormalized.map(M=>M[h])),_=Be().domain([S>=0?0:S,Vn(this.fullDataNormalized.map(M=>M[h]))]).range([m,y]).nice(p),E=_.ticks(p),T=M=>this.model.getFillColor(M),R=PE().angle(M=>b(M[u])+Math.PI/2).radius(M=>_(M[h])).curve(hf),N=this.uniqueKeys.map(M=>{const k=this.getLabelDimensions(M).width,w=aL(b(M),y);return k+w}),A={x:Vn(N)+d,y:i/2},C=L.appendOrSelect(n,"g.y-axes").attr("role",lt.GROUP).selectAll("path").data(E,M=>M),V=M=>this.uniqueKeys.map(k=>({[u]:k,[h]:M}));C.join(M=>M.append("path").attr("opacity",0).attr("transform",`translate(${A.x}, ${A.y})`).attr("fill","none").call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",w=>R(V(w)))),M=>M.call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${A.x}, ${A.y})`).attr("d",w=>R(V(w)))),M=>M.call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_axes_exit",animate:t})).attr("d",w=>R(V(w))).attr("opacity",0).remove())),L.appendOrSelect(n,"g.x-axes").attr("role",lt.GROUP).selectAll("line").data(this.uniqueKeys,M=>M).join(M=>M.append("line").attr("opacity",0).attr("class",k=>`x-axis-${zr(k)}`).attr("stroke-dasharray","0").attr("x1",k=>Ft(b(k),0,A).x).attr("y1",k=>Ft(b(k),0,A).y).attr("x2",k=>Ft(b(k),0,A).x).attr("y2",k=>Ft(b(k),0,A).y).call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",w=>Ft(b(w),_.range()[0],A).x).attr("y1",w=>Ft(b(w),_.range()[0],A).y).attr("x2",w=>Ft(b(w),_.range()[1],A).x).attr("y2",w=>Ft(b(w),_.range()[1],A).y)),M=>M.call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",w=>Ft(b(w),_.range()[0],A).x).attr("y1",w=>Ft(b(w),_.range()[0],A).y).attr("x2",w=>Ft(b(w),_.range()[1],A).x).attr("y2",w=>Ft(b(w),_.range()[1],A).y)),M=>M.call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),L.appendOrSelect(n,"g.x-labels").attr("role",lt.GROUP).selectAll("text").data(this.uniqueKeys).join(M=>M.append("text").text(k=>k).attr("opacity",0).attr("x",k=>Ft(b(k),_.range()[1]+d,A).x).attr("y",k=>Ft(b(k),_.range()[1]+d,A).y).style("text-anchor",k=>zg(b(k)).textAnchor).style("dominant-baseline",k=>zg(b(k)).dominantBaseline).call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",w=>Ft(b(w),_.range()[1]+d,A).x).attr("y",w=>Ft(b(w),_.range()[1]+d,A).y).end().finally(()=>{const w=x(o,"radar","alignment"),P=this.getAlignmentXOffset(w,n,this.getParent());n.attr("x",P)})),M=>M.call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),L.appendOrSelect(n,"g.blobs").attr("role",lt.GROUP).selectAll("path").data(this.groupedDataNormalized,M=>M.name).join(M=>M.append("path").attr("class",k=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:k.name,originalClassName:"blob"})).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-label",k=>k.name).attr("opacity",0).attr("transform",t?()=>`translate(${A.x}, ${A.y}) scale(${1+Math.random()*.35})`:`translate(${A.x}, ${A.y})`).style("fill",k=>T(k.name)).style("fill-opacity",tr.opacity.selected).style("stroke",k=>T(k.name)).call(k=>{const w=k.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_blobs_enter",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",`translate(${A.x}, ${A.y})`),w.attr("opacity",1).attr("d",P=>R(P.data))}),M=>(M.attr("class",k=>this.model.getColorClassName({classNameTypes:[tt.FILL,tt.STROKE],dataGroupName:k.name,originalClassName:"blob"})).style("fill",k=>T(k.name)).style("stroke",k=>T(k.name)),M.call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${A.x}, ${A.y})`).attr("d",w=>R(w.data))),M),M=>M.call(k=>{const w=k.transition().call(P=>this.services.transitions.setupTransition({transition:P,name:"radar_blobs_exit",animate:t}));t&&w.delay(()=>Math.random()*30).attr("transform",()=>`translate(${A.x}, ${A.y}) scale(${1+Math.random()*.35})`),w.attr("opacity",0).remove()})),L.appendOrSelect(n,"g.dots").attr("role",lt.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(M=>x(M,h)!==null)).join(M=>M.append("circle").attr("role",lt.GRAPHICS_SYMBOL).attr("aria-label",k=>k[c]),M=>M,M=>M.remove()).attr("class",M=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:M[l],originalClassName:zr(M[u])})).attr("cx",M=>Ft(b(M[u]),_(M[h]),A).x).attr("cy",M=>Ft(b(M[u]),_(M[h]),A).y).attr("r",0).attr("opacity",0).style("fill",M=>T(M[l])),L.appendOrSelect(n,"g.x-axes-rect").attr("role",lt.GROUP).selectAll("rect").data(this.uniqueKeys).join(M=>M.append("rect"),M=>M,M=>M.remove()).attr("x",A.x).attr("y",A.y-g/2).attr("width",_.range()[1]).attr("height",g).style("fill","red").style("fill-opacity",0).attr("transform",M=>`rotate(${jg(b(M))}, ${A.x}, ${A.y})`),L.appendOrSelect(n,"g.y-labels").attr("role",lt.GROUP).selectAll("text").data(De(E)).join(M=>M.append("text").attr("opacity",0).text(k=>k).attr("x",k=>Ft(-Math.PI/2,_(k),A).x+f).attr("y",k=>Ft(-Math.PI/2,_(k),A).y).style("text-anchor","start").style("dominant-baseline","middle").call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),M=>M.call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_update",animate:t})).text(w=>w).attr("opacity",1).attr("x",w=>Ft(-Math.PI/2,_(w),A).x+f).attr("y",w=>Ft(-Math.PI/2,_(w),A).y)),M=>M.call(k=>k.transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=L.getSVGElementSize(n,{useBBox:!0}),{width:s}=L.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Yt.CENTER?a=Math.floor((s-i.width)/2):t===Yt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=x(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${zr(i)}`),o=t.parent.selectAll(`.dots circle.${zr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,h=x(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",tr.dotsRadius);const d=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:r,hoveredElement:s,items:d.filter(f=>typeof f[h]=="number").map(f=>({label:f[u],value:f[h],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=D(this);t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(O.Radar.X_AXIS_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=t.parent.select(`.x-axes .x-axis-${zr(i)}`),o=t.parent.selectAll(`.dots circle.${zr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(O.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(O.Tooltip.HIDE)})}}class Qm extends Kc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,l=>l[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"bar-update-enter",animate:t})).attr("class",l=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:l[r],originalClassName:"bar"})).style("fill",l=>this.model.getFillColor(l[r])).attr("d",l=>{const c=this.services.cartesianScales.getRangeIdentifier(),u=this.getBarWidth(),h=l[c],d=this.services.cartesianScales.getDomainValue(l)-u/2,f=d+u;let p,m;if(Array.isArray(h)&&h.length===2)p=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const v=this.services.cartesianScales.getRangeScale().domain()[0];p=this.services.cartesianScales.getRangeValue(Math.max(0,v)),m=this.services.cartesianScales.getRangeValue(l)}const g=Math.abs(m-p);if(g!==0&&g<2&&(h>0&&a===Jt.VERTICAL||h<0&&a===Jt.HORIZONTAL?m=p-2:m=p+2),!this.isOutsideZoomedDomain(d,f))return ue({x0:d,x1:f,y0:p,y1:m},a)}).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",l=>l.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=D(this);i.classed("hovered",!0),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1),t.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class BI extends he{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=x(this.getOptions(),"data","loading"),r=!x(this.getOptions(),"grid","x","enabled")&&!x(this.getOptions(),"grid","y","enabled")&&!x(this.getOptions(),"axes","bottom","visible")&&!x(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=L.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=L.appendOrSelect(t,"svg.chart-skeleton.DAII"),L.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Jm extends ft{constructor(){super(...arguments),this.type="area-stacked",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>x(s,0,i)!==n.datum().name?mn.opacity.unselected:mn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",mn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=x(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),h=this.services.cartesianScales.getScaleByPosition(u),d=n.selectAll("path.area").data(o,f=>x(f,0,s));this.areaGenerator=Dl().x(f=>this.services.cartesianScales.getValueThroughAxisPosition(c,f.data.sharedStackKey)).y0(f=>h(f[0])).y1(f=>h(f[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,f=>x(f,0,s)).attr("class","area").attr("class",f=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:x(f,0,s),originalClassName:"area"})).style("fill",f=>r.model.getFillColor(x(f,0,s))).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",f=>x(f,0,s)).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"area-update-enter",animate:t})).attr("opacity",mn.opacity.selected).attr("d",this.areaGenerator)}}class tv extends Kc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>x(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",lt.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,h=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(u)-h/2,f=d+h,p=this.services.cartesianScales.getRangeValue(c[0]);let m=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(d,f)){if(Math.abs(m-p)>0&&Math.abs(m-p)>r.bars.dividerSize){const g=c[0]<0&&c[1]<=0;g&&a.length>1?this.services.cartesianScales.getOrientation()===Jt.VERTICAL?m+=c[1]===0?2:1:m-=1:g||(this.services.cartesianScales.getOrientation()===Jt.VERTICAL?m+=1:m-=1)}return ue({x0:d,x1:f,y0:p,y1:m},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",lt.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=D(this);a.classed("hovered",!0),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let o=r.model.getDisplayData(r.configs.groups).find(l=>{const c=r.services.cartesianScales.getDomainIdentifier(l),u=r.services.cartesianScales.getRangeIdentifier(l);return l[u]===s.data[s[n]]&&l[c].toString()===s.data.sharedStackKey&&l[n]===s[n]});if(o===void 0){const l=r.services.cartesianScales.getDomainIdentifier(),c=r.services.cartesianScales.getRangeIdentifier();o={[l]:s.data.sharedStackKey,[c]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:i,hoveredElement:a,data:[o]})}).on("mousemove",function(i,s){const a=D(this);r.services.events.dispatchEvent(O.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(O.Bar.BAR_CLICK,{event:i,element:D(this),datum:s})}).on("mouseout",function(i,s){const a=D(this);a.classed("hovered",!1),r.services.events.dispatchEvent(O.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(x(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=L.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=x(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ev extends tn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=Q.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(u=>r.axes[u].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=n.selectAll("g.dots").data(a,u=>x(u,0,i));o.exit().attr("opacity",0).remove();const l=o.enter().append("g").classed("dots",!0).attr("role",lt.GROUP).merge(o).selectAll("circle.dot").data(u=>u);l.exit().attr("opacity",0).remove();const c=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l).datum(u=>{const h=u[i],d=this.services.cartesianScales.getDomainIdentifier(u),f=this.services.cartesianScales.getRangeIdentifier(u);return{[i]:h,[d]:u.data.sharedStackKey,[f]:u[1]}});this.styleCircles(c,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,h)=>{const d=u[i],f=u.data.sharedStackKey;let p=u.data[d];const m=u[1],g=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(m)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][h].data[d]),p!==null&&o.push({[i]:d,[g]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(h=>h[i]==l[i]&&h[c]==l[c]&&h[u]==l[u])!==void 0})}}const Xr=6;class VI extends ft{constructor(){super(...arguments),this.type="tree",this.renderType=Q.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=L.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=L.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=x(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),h={top:0,right:0,bottom:0,left:l>0?l+Xr:30-Xr},d=xi({name:o,children:a}),f=10,p=r/6,m=E=>{const T=d.descendants().reverse(),R=d.links();let N=d,A=d;d.eachBefore(I=>{I.x<N.x&&(N=I),I.x>A.x&&(A=I)});const C=A.x-N.x,V=n.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-h.left,N.x,r,C].join(" ")),M=_.selectAll("g").data(T,I=>I.id),k=this,w=M.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",I=>I.depth!==0&&I.children&&I.children.length>0?"clickable":null).on("mouseover",function(I,B){k.services.events.dispatchEvent(O.Tree.NODE_MOUSEOVER,{event:I,element:D(this),datum:B})}).on("click",function(I,B){B.depth!==0&&(B.children=B.children?null:B._children,m(B)),k.services.events.dispatchEvent(O.Tree.NODE_CLICK,{event:I,element:D(this),datum:B})}).on("mouseout",function(I,B){k.services.events.dispatchEvent(O.Tree.NODE_MOUSEOUT,{event:I,element:D(this),datum:B})});w.append("circle").attr("r",2.5).attr("class",I=>I._children?"parent":"child").attr("stroke-width",10),w.append("text").attr("dy","0.31em").attr("x",I=>I._children?-Xr:Xr).attr("text-anchor",I=>I._children?"end":"start").text(I=>I.data.name).clone(!0).attr("class","text-stroke").lower(),M.merge(w).transition(V).attr("transform",I=>`translate(${I.y},${I.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),M.exit().transition(V).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const P=S.selectAll("path").data(R,I=>I.target.id),U=P.enter().append("path").attr("d",()=>{const I={x:E.x0,y:E.y0};return b({source:I,target:I})});P.merge(U).transition(V).attr("d",b),P.exit().transition(V).remove().attr("d",()=>{const I={x:E.x,y:E.y};return b({source:I,target:I})}),d.eachBefore(I=>{I.x0=I.x,I.y0=I.y})},g=d.descendants(),v=g[g.length-1].depth,y=x(s,"tree","type")===Hl.DENDROGRAM?iw().size([i,r-u-v*Xr-l]):jw().nodeSize([f,p]).size([i,r-u-v*Xr-l]),b=GE().x(E=>E.y).y(E=>E.x);d.x0=p/2,d.y0=0,d.descendants().forEach((E,T)=>{E.id=T,E._children=E.children}),y(d),n.attr("viewBox",[-h.left,-h.top,r,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");m(d)}}var HI="#000000",FI="#ffffff",GI="#fcf4d6",zI="#fddc69",jI="#f1c21b",WI="#d2a106",qI="#b28600",YI="#8e6a00",XI="#684e00",ZI="#483700",KI="#302400",QI="#1c1500",JI={10:GI,20:zI,30:jI,40:WI,50:qI,60:YI,70:XI,80:ZI,90:KI,100:QI},tN="#fff2e8",eN="#ffd9be",nN="#ffb784",rN="#ff832b",iN="#eb6200",sN="#ba4e00",aN="#8a3800",oN="#5e2900",lN="#3e1a00",cN="#231000",uN={10:tN,20:eN,30:nN,40:rN,50:iN,60:sN,70:aN,80:oN,90:lN,100:cN},hN="#fff1f1",dN="#ffd7d9",fN="#ffb3b8",pN="#ff8389",gN="#fa4d56",mN="#da1e28",vN="#a2191f",yN="#750e13",bN="#520408",xN="#2d0709",wN={10:hN,20:dN,30:fN,40:pN,50:gN,60:mN,70:vN,80:yN,90:bN,100:xN},_N="#fff0f7",EN="#ffd6e8",SN="#ffafd2",ON="#ff7eb6",TN="#ee5396",MN="#d02670",CN="#9f1853",$N="#740937",AN="#510224",kN="#2a0a18",LN={10:_N,20:EN,30:SN,40:ON,50:TN,60:MN,70:CN,80:$N,90:AN,100:kN},RN="#f6f2ff",DN="#e8daff",IN="#d4bbff",NN="#be95ff",PN="#a56eff",UN="#8a3ffc",BN="#6929c4",VN="#491d8b",HN="#31135e",FN="#1c0f30",GN={10:RN,20:DN,30:IN,40:NN,50:PN,60:UN,70:BN,80:VN,90:HN,100:FN},zN="#edf5ff",jN="#d0e2ff",WN="#a6c8ff",qN="#78a9ff",YN="#4589ff",XN="#0f62fe",ZN="#0043ce",KN="#002d9c",QN="#001d6c",JN="#001141",tP={10:zN,20:jN,30:WN,40:qN,50:YN,60:XN,70:ZN,80:KN,90:QN,100:JN},eP="#e5f6ff",nP="#bae6ff",rP="#82cfff",iP="#33b1ff",sP="#1192e8",aP="#0072c3",oP="#00539a",lP="#003a6d",cP="#012749",uP="#061727",hP={10:eP,20:nP,30:rP,40:iP,50:sP,60:aP,70:oP,80:lP,90:cP,100:uP},dP="#d9fbfb",fP="#9ef0f0",pP="#3ddbd9",gP="#08bdba",mP="#009d9a",vP="#007d79",yP="#005d5d",bP="#004144",xP="#022b30",wP="#081a1c",_P={10:dP,20:fP,30:pP,40:gP,50:mP,60:vP,70:yP,80:bP,90:xP,100:wP},EP="#defbe6",SP="#a7f0ba",OP="#6fdc8c",TP="#42be65",MP="#24a148",CP="#198038",$P="#0e6027",AP="#044317",kP="#022d0d",LP="#071908",RP={10:EP,20:SP,30:OP,40:TP,50:MP,60:CP,70:$P,80:AP,90:kP,100:LP},DP="#f2f4f8",IP="#dde1e6",NP="#c1c7cd",PP="#a2a9b0",UP="#878d96",BP="#697077",VP="#4d5358",HP="#343a3f",FP="#21272a",GP="#121619",zP={10:DP,20:IP,30:NP,40:PP,50:UP,60:BP,70:VP,80:HP,90:FP,100:GP},jP="#f4f4f4",WP="#e0e0e0",qP="#c6c6c6",YP="#a8a8a8",XP="#8d8d8d",ZP="#6f6f6f",KP="#525252",QP="#393939",JP="#262626",tU="#161616",eU={10:jP,20:WP,30:qP,40:YP,50:XP,60:ZP,70:KP,80:QP,90:JP,100:tU},nU="#f7f3f2",rU="#e5e0df",iU="#cac5c4",sU="#ada8a8",aU="#8f8b8b",oU="#726e6e",lU="#565151",cU="#3c3838",uU="#272525",hU="#171414",dU={10:nU,20:rU,30:iU,40:sU,50:aU,60:oU,70:lU,80:cU,90:uU,100:hU},nv={black:{100:HI},blue:tP,coolGray:zP,cyan:hP,gray:eU,green:RP,magenta:LN,orange:uN,purple:GN,red:wN,teal:_P,warmGray:dU,white:{0:FI},yellow:JI};const fU=e=>{if(!e)return null;for(const t of Object.keys(nv)){const n=nv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},rv=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=rn(t);let r;if(n&&(r=fU(n?n.hex():null)),r==null){const i=Eo(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let pU=0;class gU extends ft{constructor(){super(...arguments),this.type="treemap",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer();this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=x(window,"location"),{width:a,height:o}=L.getSVGElementSize(n,{useAttrs:!0}),l=xi({name:i.title||"Treemap",children:r}).sum(f=>f.value).sort((f,p)=>p.value-f.value),c=Zw().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>pU++).merge(u);h.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:t})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const d=h.selectAll("rect.leaf").data(f=>[f]);d.exit().attr("width",0).attr("height",0).remove(),d.enter().append("rect").classed("leaf",!0).merge(d).attr("width",0).attr("height",0).attr("id",function(){const f=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:t})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name)}),h.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const p=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${p}`}).append("use").attr("xlink:href",function(){const p=D(this.parentNode.parentNode).attr("data-uid"),m=`${i.style.prefix}-leaf-${p}`;return new URL(`#${m}`,s)+""}),f=>null,f=>f.remove()),h.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let p=f;for(;p.depth>1;)p=p.parent;const m=Eo(this.model.getFillColor(p.data.name));return[{text:f.data.name,color:m.l<.5?"white":"black"}]},f=>f).join(f=>{const p=f.append("text").text(m=>m.text).style("fill",rv).attr("x",7).attr("y",18);return s&&p.attr("clip-path",function(){const m=D(this.parentNode).attr("data-uid"),g=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${g}`,s)+""})`}),p},f=>f.text(p=>p.text).style("fill",rv),f=>f.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=D(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name);return l&&(s=l),rn(s).darker(.7).toString()}),t.services.events.dispatchEvent(O.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(O.Treemap.LEAF_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name)),t.services.events.dispatchEvent(O.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:i})})}}class mU extends ft{constructor(){super(...arguments),this.type="wordcloud",this.renderType=Q.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(O.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(O.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer().attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:h}=L.getSVGElementSize(r,{useAttrs:!0});if(u===0||h===0)return;const d=jL().size([u,h]).words(i.map(function(p){const m=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:m,value:m}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);d.start();function f(p){const m=L.appendOrSelect(r,"g.words");m.attr("transform",`translate(${d.size()[0]/2}, ${d.size()[1]/2})`);const g=m.selectAll("text").data(p,v=>`${v[c]}-${v.text}`);g.exit().attr("opacity",0).remove(),g.enter().append("text").attr("opacity",0).merge(g).style("font-size",v=>`${v.size}px`).text(function(v){return v.text}).attr("class",v=>n.model.getColorClassName({classNameTypes:[tt.FILL],dataGroupName:v[c],originalClassName:`word ${v.size>32?"light":""}`})).style("fill",v=>n.model.getFillColor(v[c],v.text,v)).attr("text-anchor","middle").transition().call(v=>n.services.transitions.setupTransition({transition:v,name:"wordcloud-text-update-enter",animate:t})).attr("transform",v=>`translate(${v.x}, ${v.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=L.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?De(i):[1,1];return Be().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Fa(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),r.services.events.dispatchEvent(O.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:t.tooltip.groupLabel,value:a[n],class:r.model.getColorClassName({classNameTypes:[tt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(O.WordCloud.WORD_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);i(null),r.services.events.dispatchEvent(O.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(O.Tooltip.HIDE,{hoveredElement:o})})}}class vU extends ft{constructor(){super(...arguments),this.type="geo",this.renderType=Q.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=L.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=x(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(g=>{typeof a[g].value=="number"?o[g]=a[g]:l[g]=a[g]});const c=bI(s,Object.values(l)),u=mI(s,{type:"GeometryCollection",geometries:Object.values(o)}),h=i.fitSize([n,r],u),d=Ax().projection(h);L.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",d);const f=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),p=L.appendOrSelect(t,"defs");L.appendOrSelect(p,"pattern").attr("id",f).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Ai()([[0,0],[0,10]]));const m=L.appendOrSelect(t,"g.missing-data");L.appendOrSelect(m,"path").datum(c).attr("d",d).style("fill",`url(#${f})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case gn.geoEqualEarth:t=Xx();break;case gn.geoAlbers:t=Fx();break;case gn.geoConicEqualArea:t=hd();break;case gn.geoConicEquidistant:t=qx();break;case gn.geoEquirectangular:t=jx();break;case gn.geoMercator:t=Gx();break;case gn.geoNaturalEarth1:t=Zx();break;default:throw new Error("Projection is not supported.")}return t}}class yU extends vU{constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",r=>this.model.getColorClassName({value:n[r.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=D(this);t.services.events.dispatchEvent(Ar.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Li.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Ar.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Li.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Ar.CHOROPLETH_CLICK,{event:r,element:D(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=D(this);t.services.events.dispatchEvent(Ar.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Li.HIDE,{event:r,hoveredElement:s})})}}function iv(e,t){ot(2,arguments);var n=yt(e),r=Kt(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function Qc(e,t){ot(2,arguments);var n=yt(e),r=Kt(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),s=new Date(n.getTime());s.setMonth(n.getMonth()+r+1,0);var a=s.getDate();return i>=a?s:(n.setFullYear(s.getFullYear(),s.getMonth(),i),n)}var bU=36e5;function sv(e,t){ot(2,arguments);var n=Kt(t);return wa(e,n*bU)}function av(e){ot(1,arguments);var t=yt(e);return t.setHours(0,0,0,0),t}var xU=864e5;function wU(e,t){ot(2,arguments);var n=av(e),r=av(t),i=n.getTime()-jl(n),s=r.getTime()-jl(r);return Math.round((i-s)/xU)}var _U=6e4;function Jc(e,t){ot(2,arguments);var n=Kt(t);return wa(e,n*_U)}function tu(e,t){ot(2,arguments);var n=Kt(t);return wa(e,n*1e3)}function ov(e,t){ot(2,arguments);var n=Kt(t);return Qc(e,n*12)}function is(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}var EU=6e4,SU=36e5;function OU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function TU(e,t){ot(2,arguments);var n=yt(e),r=yt(t);return n.getFullYear()-r.getFullYear()}function lv(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function MU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=lv(n,r),s=Math.abs(wU(n,r));n.setDate(n.getDate()-i*s);var a=+(lv(n,r)===-i),o=i*(s-a);return o===0?0:o}function eu(e,t){return ot(2,arguments),yt(e).getTime()-yt(t).getTime()}var cv={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},CU="trunc";function nu(e){return e?cv[e]:cv[CU]}function $U(e,t,n){ot(2,arguments);var r=eu(e,t)/SU;return nu(n==null?void 0:n.roundingMethod)(r)}function uv(e,t,n){ot(2,arguments);var r=eu(e,t)/EU;return nu(n==null?void 0:n.roundingMethod)(r)}function AU(e){ot(1,arguments);var t=yt(e);return t.setHours(23,59,59,999),t}function kU(e){ot(1,arguments);var t=yt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function LU(e){ot(1,arguments);var t=yt(e);return AU(t).getTime()===kU(t).getTime()}function RU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=is(n,r),s=Math.abs(OU(n,r)),a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);var o=is(n,r)===-i;LU(yt(e))&&s===1&&is(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function hv(e,t,n){ot(2,arguments);var r=eu(e,t)/1e3;return nu(n==null?void 0:n.roundingMethod)(r)}function DU(e,t){ot(2,arguments);var n=yt(e),r=yt(t),i=is(n,r),s=Math.abs(TU(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=is(n,r)===-i,o=i*(s-Number(a));return o===0?0:o}function IU(e,t){ot(2,arguments);var n=Kt(t);return iv(e,-n)}function NU(e,t){ot(2,arguments);var n=Kt(t);return Qc(e,-n)}function PU(e,t){ot(2,arguments);var n=Kt(t);return sv(e,-n)}function dv(e,t){ot(2,arguments);var n=Kt(t);return Jc(e,-n)}function fv(e,t){ot(2,arguments);var n=Kt(t);return tu(e,-n)}function UU(e,t){ot(2,arguments);var n=Kt(t);return ov(e,-n)}function pv(e){var t=e==null?0:e.length;return t?Ra(e,1):[]}class BU extends Sn{zoomIn(t,n,r){let i,s,a;const o=r||Ir;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=L.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${l/2}, ${c/2}) scale(${a}) translate(${-i},${-s})`),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||Ir;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(O.CanvasZoom.CANVAS_ZOOM_OUT)}}class VU extends Sn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class HU extends Sn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class FU extends Sn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(O.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:t,name:n,animate:r}){return this.pendingTransitions[t._id]=t,t.on("end interrupt cancel",()=>{delete this.pendingTransitions[t._id]}),this.model.getOptions().animations===!1||r===!1?t.duration(0):t.duration(x(ip,n,"duration")||ip.default.duration)}getPendingTransitions(){return this.pendingTransitions}}let GU=class extends Sn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=x(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=x(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return x(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){return this.getAxisOptions(t).title||(t===H.BOTTOM||t===H.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(H).map(t=>H[t]).forEach(t=>{this.scales[t]=this.createScale(t)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===H.LEFT||this.rangeAxisPosition===H.RIGHT)&&(this.domainAxisPosition===H.BOTTOM||this.domainAxisPosition===H.TOP)?this.orientation=Jt.VERTICAL:this.orientation=Jt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var t,n,r,i;const s=this.model.getOptions(),a=x(s,"axes");((t=a[H.LEFT])!=null&&t.correspondingDatasets&&a[H.RIGHT]||(n=a[H.RIGHT])!=null&&n.correspondingDatasets&&a[H.LEFT]||(r=a[H.TOP])!=null&&r.correspondingDatasets&&a[H.BOTTOM]||(i=a[H.BOTTOM])!=null&&i.correspondingDatasets&&a[H.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=x(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===Z.LINEAR||this.scaleTypes[t]===Z.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[H.BOTTOM,H.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[H.LEFT,H.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=x(i,o)!==null?i[o]:i;let c;switch(n){case Z.LABELS:c=t(l)+t.step()/2;break;case Z.TIME:c=t(new Date(l));break;default:c=t(l)}return c}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),a=x(s,"axes")[r],{mapsTo:o}=a,l=t[o]!==void 0?t[o]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:l),i(x(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:l)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return x(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=x(r,"axes",t);if(i.scaleType===Z.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return zU(n,s)}else return jU(n,Ln.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,H.LEFT)===null&&x(n,H.RIGHT)!==null||x(n,H.RIGHT,"main")===!0||r&&x(n,H.LEFT,"correspondingDatasets")?{primary:H.RIGHT,secondary:H.LEFT}:{primary:H.LEFT,secondary:H.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,H.BOTTOM)===null&&x(n,H.TOP)!==null||x(n,H.TOP,"main")===!0||r&&x(n,H.BOTTOM,"correspondingDatasets")?{primary:H.TOP,secondary:H.BOTTOM}:{primary:H.BOTTOM,secondary:H.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||Z.LINEAR,o=s.scaleType||Z.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===Z.LABELS||o===Z.TIME)&&a===Z.LABELS||a===Z.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=x(n,"axes",t),i=x(n,"bounds"),{includeZero:s}=r,a=x(r,"scaleType")||Z.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Vn(v,y=>y.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),y=this.model.getStackKeys({bins:v});return[y[0].split("-")[0],y[y.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:h}=r,{reference:d,compareTo:f}=Ln.ratio;if(r.domain)return a===Z.LABELS?r.domain:(a===Z.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===Z.LABELS)return Yi(o.map(v=>v[c]));let p,m;const g=this.model.getDataGroupNames();if(a===Z.LABELS_RATIO)return o.map(v=>`${v[d]}/${v[f]}`);if(a===Z.TIME)m=o.map(v=>+new Date(v[c]));else if(i&&n.axes)m=[],o.forEach(v=>{m.push(v[c]),v[i.upperBoundMapsTo]&&m.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&m.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&g&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,y=this.model.getDataValuesGroupedByKeys({groups:g}),b=o.filter(_=>!g.includes(_[v])),S=[];y.forEach(_=>{const{...E}=_;let T=0,R=0;Object.values(E).forEach(N=>{isNaN(N)||(N<0?R+=N:T+=N)}),S.push([R,T])}),m=[...pv(S),...b.map(_=>_[c])]}else m=[],o.forEach(v=>{const y=v[c];Array.isArray(y)&&y.length===2?(m.push(y[0]),m.push(y[1])):(l&&m.push(Math.max(v[c],v[l])),m.push(y))});return a!==Z.TIME&&a!==Z.LOG&&s&&m.push(0),h&&h.length>0&&h.forEach(v=>{const y=x(v,"value");y!==null&&m.push(y)}),p=De(m),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=x(n,"axes",t);if(!r)return null;const i=x(r,"scaleType")||Z.LINEAR;this.scaleTypes[t]=i;let s;return i===Z.TIME?s=Kd():i===Z.LOG?s=Ld().base(r.base||10):i===Z.LABELS||i===Z.LABELS_RATIO?s=Ei():s=Be(),s.domain(this.getScaleDomain(t)),s}getHighestDomainThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((a,o)=>o.value-a.value)[0];return this.getScaleTypeByPosition(n)===Z.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=x(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}};function zU(e,t){const n=new Date(e[0]),r=new Date(e[1]);return DU(r,n)>1?[UU(n,t),ov(r,t)]:RU(r,n)>1?[NU(n,t),Qc(r,t)]:MU(r,n)>1?[IU(n,t),iv(r,t)]:$U(r,n)>1?[PU(n,t),sv(r,t)]:uv(r,n)>30?[dv(n,t*30),Jc(r,t*30)]:uv(r,n)>1?[dv(n,t),Jc(r,t)]:hv(r,n)>15?[fv(n,t*15),tu(r,t*15)]:hv(r,n)>1?[fv(n,t),tu(r,t)]:[n,r]}function jU([e,t],n,r){const i=(t-e)*n,s=t<=0&&t+i>0?0:t+i;let a=e>=0&&e-i<0?0:e-i;if(r===Z.LOG&&a<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");a=e}return[a,s]}let WU=class extends Sn{constructor(){super(...arguments),this.curveTypes={curveLinear:ca,curveLinearClosed:hf,curveBasis:zE,curveBasisClosed:jE,curveBasisOpen:WE,curveBundle:qE,curveCardinal:YE,curveCardinalClosed:XE,curveCardinalOpen:ZE,curveCatmullRom:KE,curveCatmullRomClosed:QE,curveCatmullRomOpen:JE,curveMonotoneX:tS,curveMonotoneY:eS,curveNatural:nS,curveStep:rS,curveStepAfter:sS,curveStepBefore:iS}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}};class qU extends Sn{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===H.BOTTOM&&n===Z.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=x(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,De(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(O.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var r;const i=this.model.get("zoomDomain"),s=Object.assign({stacked:!1},n),a=x(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&a&&i){const o=s.stacked?"sharedStackKey":(r=this.services.cartesianScales)==null?void 0:r.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=i[0]&&new Date(c[o])<=i[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var n;const r=this.model.get("zoomDomain"),i=Se.handleWidth,s=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();s.domain(this.getDefaultZoomBarDomain());const a=s(r[0]),o=s(r[1]);if(o-a<i+1)return;const l=s.range(),c=o-a,u=Math.min((l[1]-l[0])/2*(t/2),c/2);let h=a+u,d=o-u;h>=d&&(h=a+c/2-i/2,d=o-c/2+i/2);const f=[s.invert(h),s.invert(d)];(r[0].valueOf()!==f[0].valueOf()||r[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=x(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return x(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return x(this.model.getOptions(),"zoomBar",t,"locked")}}function YU(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}function XU(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:YU(e,t,n)}var ZU="\\ud800-\\udfff",KU="\\u0300-\\u036f",QU="\\ufe20-\\ufe2f",JU="\\u20d0-\\u20ff",tB=KU+QU+JU,eB="\\ufe0e\\ufe0f",nB="\\u200d",rB=RegExp("["+nB+ZU+tB+eB+"]");function gv(e){return rB.test(e)}function iB(e){return e.split("")}var mv="\\ud800-\\udfff",sB="\\u0300-\\u036f",aB="\\ufe20-\\ufe2f",oB="\\u20d0-\\u20ff",lB=sB+aB+oB,cB="\\ufe0e\\ufe0f",uB="["+mv+"]",ru="["+lB+"]",iu="\\ud83c[\\udffb-\\udfff]",hB="(?:"+ru+"|"+iu+")",vv="[^"+mv+"]",yv="(?:\\ud83c[\\udde6-\\uddff]){2}",bv="[\\ud800-\\udbff][\\udc00-\\udfff]",dB="\\u200d",xv=hB+"?",wv="["+cB+"]?",fB="(?:"+dB+"(?:"+[vv,yv,bv].join("|")+")"+wv+xv+")*",pB=wv+xv+fB,gB="(?:"+[vv+ru+"?",ru,yv,bv,uB].join("|")+")",mB=RegExp(iu+"(?="+iu+")|"+gB+pB,"g");function vB(e){return e.match(mB)||[]}function yB(e){return gv(e)?vB(e):iB(e)}function bB(e){return function(t){t=Wi(t);var n=gv(t)?yB(t):void 0,r=n?n[0]:t.charAt(0),i=n?XU(n,1).join(""):t.slice(1);return r[e]()+i}}var xB=bB("toUpperCase");const wB=xB;function _B(e){return wB(Wi(e).toLowerCase())}var EB=_m(function(e,t,n){return t=t.toLowerCase(),e+(n?_B(t):t)});const SB=EB;class je{constructor(t,n){this.components=[],this.services={canvasZoom:BU,domUtils:L,events:VU,files:HU,gradientUtils:Oc,transitions:FU},this.model=new Je(this.services)}init(t,n){this.model.set({holder:t},{skipUpdate:!0}),Object.keys(this.services).forEach(r=>{const i=this.services[r];this.services[r]=new i(this.model,this.services)}),this.services.events.addEventListener(O.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(O.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(t=!0){if(!this.components)return;Object.keys(this.services).forEach(i=>{this.services[i].update()}),this.components.forEach(i=>i.render(t));const n=this.services.transitions.getPendingTransitions(),r=Object.keys(n).map(i=>n[i].end().catch(s=>s));Promise.all(r).then(()=>this.services.events.dispatchEvent(O.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(t=>t.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s={id:"legend",components:[new Yc(this.model,this.services)],growth:at.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new rI(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},c={id:"toolbar",components:[new es(this.model,this.services)],growth:at.PREFERRED},u={id:"header",components:[new ve(this.model,this.services,[l,...i?[c]:[]],{direction:$t.ROW,alignItems:kr.CENTER})],growth:at.PREFERRED},h={id:"graph-frame",components:t,growth:at.STRETCH,renderType:x(n,"graphFrameRenderType")||Q.SVG},d=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=$t.COLUMN;if(d){const v=x(r,"legend","position");v==="left"?(f=$t.ROW,r.legend.orientation||(r.legend.orientation=Di.VERTICAL)):v==="right"?(f=$t.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Di.VERTICAL)):v==="bottom"&&(f=$t.COLUMN_REVERSE)}const p={id:"spacer",components:[new On(this.model,this.services)],growth:at.PREFERRED},m={id:"full-frame",components:[new ve(this.model,this.services,[...d?[s]:[],...d?[p]:[],h],{direction:f})],growth:at.STRETCH},g=[];if(o||i){g.push(u);const v={id:"spacer",components:[new On(this.model,this.services,i?{size:15}:void 0)],growth:at.PREFERRED};g.push(v)}return g.push(m),[new Xc(this.model,this.services),new ro(this.model,this.services),new ve(this.model,this.services,g,{direction:$t.COLUMN})]}}class be extends je{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:GU,curves:WU,zoom:qU}),this.model=new lr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",H.TOP,"enabled"),s=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=x(r,"axes",a,"scaleType"),l=i&&a===H.BOTTOM&&o===Z.TIME,c=this.services.zoom.isZoomBarLocked(H.TOP),u=!!this.model.getOptions().title,h={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},d={id:"toolbar",components:[new es(this.model,this.services)],growth:at.PREFERRED},f={id:"header",components:[new ve(this.model,this.services,[h,...s?[d]:[]],{direction:$t.ROW,alignItems:kr.CENTER})],growth:at.PREFERRED},p={id:"legend",components:[new Yc(this.model,this.services)],growth:at.PREFERRED};l&&!c&&t.push(new Um(this.model,this.services),new Hm(this.model,this.services)),t.push(new sI(this.model,this.services)),t.push(new aI(this.model,this.services));const m={id:"graph-frame",components:t,growth:at.STRETCH,renderType:Q.SVG},g=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=$t.COLUMN;if(g){const E=x(this.model.getOptions(),"legend","position");E===Ri.LEFT?(v=$t.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Di.VERTICAL)):E===Ri.RIGHT?(v=$t.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Di.VERTICAL)):E===Ri.BOTTOM&&(v=$t.COLUMN_REVERSE)}const y={id:"spacer",components:[new On(this.model,this.services)],growth:at.PREFERRED},b={id:"full-frame",components:[new ve(this.model,this.services,[...g?[p]:[],...g?[y]:[],m],{direction:v})],growth:at.STRETCH},S={id:"zoom-bar",components:[new iI(this.model,this.services)],growth:at.PREFERRED,renderType:Q.SVG},_=[];if(u||s){_.push(f);const E={id:"spacer",components:[new On(this.model,this.services,s?{size:15}:void 0)],growth:at.PREFERRED};_.push(E)}return l&&_.push(S),_.push(b),[new Fm(this.model,this.services),new ro(this.model,this.services),new ve(this.model,this.services,_,{direction:$t.COLUMN})]}}class OB extends je{constructor(t,n){super(t,n),this.model=new HA(this.services),this.model.setOptions(Nt(Tt.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new oI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class TB extends be{constructor(t,n){super(t,n),this.model.setOptions(Nt(xn(Tt.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new Nn(this.model,this.services),new qr(this.model,this.services),new Gm(this.model,this.services),new tn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class MB extends be{constructor(t,n){super(t,n),this.model=new FA(this.services),this.model.setOptions(Nt(Tt.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new uI(this.model,this.services),new Yr(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class CB extends be{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new Nn(this.model,this.services),new hI(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class $B extends be{constructor(t,n){super(t,n),this.model=new GA(this.services),this.model.setOptions(Nt(Tt.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new dI(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class AB extends je{constructor(t,n){super(t,n),this.model=new zA(this.services),this.model.setOptions(Nt(Tt.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},o={id:"toolbar",components:[new es(this.model,this.services)],growth:at.PREFERRED},l={id:"header",components:[new ve(this.model,this.services,[a,...i?[o]:[]],{direction:$t.ROW,alignItems:kr.CENTER})],growth:at.PREFERRED},c={id:"legend",components:[new qm(this.model,this.services,{chartType:"choropleth"})],growth:at.PREFERRED,renderType:Q.SVG},u={id:"graph-frame",components:t,growth:at.STRETCH,renderType:Q.SVG},h=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=$t.COLUMN_REVERSE,f={id:"spacer",components:[new On(this.model,this.services,{size:15})],growth:at.PREFERRED},p={id:"full-frame",components:[new ve(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:at.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new On(this.model,this.services,i?{size:15}:void 0)],growth:at.PREFERRED};m.push(g)}return m.push(p),[new Xc(this.model,this.services),new ro(this.model,this.services),new ve(this.model,this.services,m,{direction:$t.COLUMN})]}getComponents(){const t=[new yU(this.model,this.services)];return this.getChartComponents(t)}}class kB extends je{constructor(t,n){super(t,n),this.model=new jA(this.services),this.model.setOptions(Nt(Tt.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new AI(this.model,this.services)];return this.getChartComponents(t)}}const _v={[$e.LINE]:[qr,tn],[$e.SCATTER]:[tn],[$e.AREA]:[Gm,qr,tn],[$e.STACKED_AREA]:[Jm,qr,ev,ao],[$e.SIMPLE_BAR]:[Qm],[$e.GROUPED_BAR]:[Km,Yr],[$e.STACKED_BAR]:[tv,ao]};class LB extends be{constructor(t,n){super(t,n);const r=Nt(Tt.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:$e.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(_v).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${SB(i.type)}Chart`;return a=rt({},Tt[l],this.model.getOptions(),i.options),i.type===$e.STACKED_AREA&&(o=!0),_v[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=rt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return pv(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(i=>i.type===$e.STACKED_BAR||i.type===$e.STACKED_AREA),r=[new ye(this.model,this.services),new Te(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID}),...n?[]:[new Nn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class Ev extends je{constructor(t,n,r=!1){super(t,n),this.model=new WA(this.services),!r&&(this.model.setOptions(Nt(Tt.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Ym(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.PIE})];return this.getChartComponents(t)}}class RB extends Ev{constructor(t,n){super(t,n,!0),this.model.setOptions(Nt(Tt.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new LI(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.DONUT})];return this.getChartComponents(t)}}class DB extends je{constructor(t,n){super(t,n),this.model=new qA(this.services),this.model.setOptions(Nt(Tt.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new RI(this.model,this.services)];return this.getChartComponents(t)}}class IB extends be{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new Km(this.model,this.services),new Yr(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class NB extends be{constructor(t,n){super(t,n),this.model=new YA(this.services),this.model.setOptions(Nt(Tt.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new rs(this.model,this.services)],growth:at.STRETCH},o={id:"toolbar",components:[new es(this.model,this.services)],growth:at.PREFERRED},l={id:"header",components:[new ve(this.model,this.services,[a,...i?[o]:[]],{direction:$t.ROW,alignItems:kr.CENTER})],growth:at.PREFERRED},c={id:"legend",components:[new qm(this.model,this.services,{chartType:"heatmap"})],growth:at.PREFERRED,renderType:Q.SVG},u={id:"graph-frame",components:t,growth:at.STRETCH,renderType:Q.SVG},h=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,d=$t.COLUMN_REVERSE,f={id:"spacer",components:[new On(this.model,this.services,{size:15})],growth:at.PREFERRED},p={id:"full-frame",components:[new ve(this.model,this.services,[...h?[c]:[],...h?[f]:[],u],{direction:d})],growth:at.STRETCH},m=[];if(s||i){m.push(l);const g={id:"spacer",components:[new On(this.model,this.services,i?{size:15}:void 0)],growth:at.PREFERRED};m.push(g)}return m.push(p),[new Fm(this.model,this.services),new ro(this.model,this.services),new ve(this.model,this.services,m,{direction:$t.COLUMN})]}getComponents(){const t=[new ye(this.model,this.services),new DI(this.model,this.services)];return this.getAxisChartComponents(t)}}class PB extends be{constructor(t,n){super(t,n),this.model=new XA(this.services),this.model.setOptions(Nt(Tt.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new wI(this.model,this.services),new II(this.model,this.services)];return this.getAxisChartComponents(t)}}class UB extends be{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new Nn(this.model,this.services),new qr(this.model,this.services),new tn(this.model,this.services,{handleThresholds:!0}),new BI(this.model,this.services),new Yr(this.model,this.services)];return this.getAxisChartComponents(t)}}class BB extends be{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new Nn(this.model,this.services),new NI(this.model,this.services),new tn(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class VB extends je{constructor(t,n){var r;super(t,n),this.model=new ZA(this.services);const i=(r=n.options.meter)!=null&&r.proportional?rt(xn(Tt.proportionalMeterChart),n.options):rt(xn(Tt.meterChart),n.options);this.model.setOptions(i),this.init(t,n)}getComponents(){const t=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new $I(this.model,this.services)],growth:at.STRETCH,renderType:Q.SVG},{id:"spacer",components:[new On(this.model,this.services,{size:8})],growth:at.STRETCH}]:[],{id:"meter-graph",components:[new PI(this.model,this.services)],growth:at.STRETCH,renderType:Q.SVG}],n=[new ve(this.model,this.services,t,{direction:$t.COLUMN})];return this.getChartComponents(n,{graphFrameRenderType:Q.HTML})}}class HB extends je{constructor(t,n){super(t,n),this.model=new KA(this.services),this.model.setOptions(Nt(Tt.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new UI(this.model,this.services)];return this.getChartComponents(t)}}class FB extends be{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new Nn(this.model,this.services),new tn(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class GB extends je{constructor(t,n){super(t,n),this.model=new QA(this.services),this.model.setOptions(Nt(Tt.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new VI(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class zB extends je{constructor(t,n){super(t,n),this.model=new JA(this.services),this.model.setOptions(Nt(Tt.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new gU(this.model,this.services)];return this.getChartComponents(t)}}class jB extends be{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new Qm(this.model,this.services),new Yr(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class WB extends be{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new ao(this.model,this.services),new Jm(this.model,this.services),new qr(this.model,this.services,{stacked:!0}),new ev(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new he(this.model,this.services,{skeleton:Xt.GRID})];return this.getAxisChartComponents(t)}}class qB extends be{constructor(t,n){super(t,n),this.model.setOptions(Nt(Tt.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ye(this.model,this.services),new Te(this.model,this.services),new ao(this.model,this.services),new tv(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.VERT_OR_HORIZ}),new Yr(this.model,this.services)];return this.getAxisChartComponents(t)}}class YB extends je{constructor(t,n){super(t,n),this.model=new tk(this.services),this.model.setOptions(Nt(Tt.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new mU(this.model,this.services),new he(this.model,this.services,{skeleton:Xt.PIE})];return this.getChartComponents(t)}}var su={exports:{}},ss={};/**
84
84
  * @license React
85
85
  * react-jsx-runtime.production.min.js
86
86
  *
@@ -88,7 +88,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
88
88
  *
89
89
  * This source code is licensed under the MIT license found in the
90
90
  * LICENSE file in the root directory of this source tree.
91
- */var rv;function UU(){if(rv)return ns;rv=1;var e=re,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(o,l,c){var u,h={},d=null,f=null;c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(f=l.ref);for(u in l)r.call(l,u)&&!s.hasOwnProperty(u)&&(h[u]=l[u]);if(o&&o.defaultProps)for(u in l=o.defaultProps,l)h[u]===void 0&&(h[u]=l[u]);return{$$typeof:t,type:o,key:d,ref:f,props:h,_owner:i.current}}return ns.Fragment=n,ns.jsx=a,ns.jsxs=a,ns}var rs={};/**
91
+ */var Sv;function XB(){if(Sv)return ss;Sv=1;var e=re,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(o,l,c){var u,h={},d=null,f=null;c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(f=l.ref);for(u in l)r.call(l,u)&&!s.hasOwnProperty(u)&&(h[u]=l[u]);if(o&&o.defaultProps)for(u in l=o.defaultProps,l)h[u]===void 0&&(h[u]=l[u]);return{$$typeof:t,type:o,key:d,ref:f,props:h,_owner:i.current}}return ss.Fragment=n,ss.jsx=a,ss.jsxs=a,ss}var as={};/**
92
92
  * @license React
93
93
  * react-jsx-runtime.development.js
94
94
  *
@@ -96,19 +96,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
96
96
  *
97
97
  * This source code is licensed under the MIT license found in the
98
98
  * LICENSE file in the root directory of this source tree.
99
- */var iv;function BU(){return iv||(iv=1,process.env.NODE_ENV!=="production"&&function(){var e=re,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function g(D){if(D===null||typeof D!="object")return null;var W=p&&D[p]||D[m];return typeof W=="function"?W:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(D){{for(var W=arguments.length,Z=new Array(W>1?W-1:0),ct=1;ct<W;ct++)Z[ct-1]=arguments[ct];w("error",D,Z)}}function w(D,W,Z){{var ct=v.ReactDebugCurrentFrame,_t=ct.getStackAddendum();_t!==""&&(W+="%s",Z=Z.concat([_t]));var $t=Z.map(function(vt){return String(vt)});$t.unshift("Warning: "+W),Function.prototype.apply.call(console[D],console,$t)}}var O=!1,E=!1,T=!1,S=!1,$=!1,k;k=Symbol.for("react.module.reference");function L(D){return!!(typeof D=="string"||typeof D=="function"||D===r||D===s||$||D===i||D===c||D===u||S||D===f||O||E||T||typeof D=="object"&&D!==null&&(D.$$typeof===d||D.$$typeof===h||D.$$typeof===a||D.$$typeof===o||D.$$typeof===l||D.$$typeof===k||D.getModuleId!==void 0))}function M(D,W,Z){var ct=D.displayName;if(ct)return ct;var _t=W.displayName||W.name||"";return _t!==""?Z+"("+_t+")":Z}function V(D){return D.displayName||"Context"}function x(D){if(D==null)return null;if(typeof D.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case o:var W=D;return V(W)+".Consumer";case a:var Z=D;return V(Z._context)+".Provider";case l:return M(D,D.render,"ForwardRef");case h:var ct=D.displayName||null;return ct!==null?ct:x(D.type)||"Memo";case d:{var _t=D,$t=_t._payload,vt=_t._init;try{return x(vt($t))}catch{return null}}}return null}var C=Object.assign,y=0,R,I,B,U,z,j,G;function et(){}et.__reactDisabledLog=!0;function q(){{if(y===0){R=console.log,I=console.info,B=console.warn,U=console.error,z=console.group,j=console.groupCollapsed,G=console.groupEnd;var D={configurable:!0,enumerable:!0,value:et,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}y++}}function Q(){{if(y--,y===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},D,{value:R}),info:C({},D,{value:I}),warn:C({},D,{value:B}),error:C({},D,{value:U}),group:C({},D,{value:z}),groupCollapsed:C({},D,{value:j}),groupEnd:C({},D,{value:G})})}y<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var lt=v.ReactCurrentDispatcher,rt;function ot(D,W,Z){{if(rt===void 0)try{throw Error()}catch(_t){var ct=_t.stack.trim().match(/\n( *(at )?)/);rt=ct&&ct[1]||""}return`
100
- `+rt+D}}var Y=!1,X;{var K=typeof WeakMap=="function"?WeakMap:Map;X=new K}function F(D,W){if(!D||Y)return"";{var Z=X.get(D);if(Z!==void 0)return Z}var ct;Y=!0;var _t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var $t;$t=lt.current,lt.current=null,q();try{if(W){var vt=function(){throw Error()};if(Object.defineProperty(vt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(vt,[])}catch(En){ct=En}Reflect.construct(D,[],vt)}else{try{vt.call()}catch(En){ct=En}D.call(vt.prototype)}}else{try{throw Error()}catch(En){ct=En}D()}}catch(En){if(En&&ct&&typeof En.stack=="string"){for(var mt=En.stack.split(`
101
- `),de=ct.stack.split(`
102
- `),jt=mt.length-1,Wt=de.length-1;jt>=1&&Wt>=0&&mt[jt]!==de[Wt];)Wt--;for(;jt>=1&&Wt>=0;jt--,Wt--)if(mt[jt]!==de[Wt]){if(jt!==1||Wt!==1)do if(jt--,Wt--,Wt<0||mt[jt]!==de[Wt]){var ke=`
103
- `+mt[jt].replace(" at new "," at ");return D.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",D.displayName)),typeof D=="function"&&X.set(D,ke),ke}while(jt>=1&&Wt>=0);break}}}finally{Y=!1,lt.current=$t,Q(),Error.prepareStackTrace=_t}var Yr=D?D.displayName||D.name:"",mv=Yr?ot(Yr):"";return typeof D=="function"&&X.set(D,mv),mv}function wt(D,W,Z){return F(D,!1)}function yt(D){var W=D.prototype;return!!(W&&W.isReactComponent)}function Ht(D,W,Z){if(D==null)return"";if(typeof D=="function")return F(D,yt(D));if(typeof D=="string")return ot(D);switch(D){case c:return ot("Suspense");case u:return ot("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case l:return wt(D.render);case h:return Ht(D.type,W,Z);case d:{var ct=D,_t=ct._payload,$t=ct._init;try{return Ht($t(_t),W,Z)}catch{}}}return""}var zt=Object.prototype.hasOwnProperty,it={},At=v.ReactDebugCurrentFrame;function Le(D){if(D){var W=D._owner,Z=Ht(D.type,D._source,W?W.type:null);At.setExtraStackFrame(Z)}else At.setExtraStackFrame(null)}function De(D,W,Z,ct,_t){{var $t=Function.call.bind(zt);for(var vt in D)if($t(D,vt)){var mt=void 0;try{if(typeof D[vt]!="function"){var de=Error((ct||"React class")+": "+Z+" type `"+vt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[vt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw de.name="Invariant Violation",de}mt=D[vt](W,vt,ct,Z,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(jt){mt=jt}mt&&!(mt instanceof Error)&&(Le(_t),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",ct||"React class",Z,vt,typeof mt),Le(null)),mt instanceof Error&&!(mt.message in it)&&(it[mt.message]=!0,Le(_t),b("Failed %s type: %s",Z,mt.message),Le(null))}}}var is=Array.isArray;function ss(D){return is(D)}function Kc(D){{var W=typeof Symbol=="function"&&Symbol.toStringTag,Z=W&&D[Symbol.toStringTag]||D.constructor.name||"Object";return Z}}function OB(D){try{return av(D),!1}catch{return!0}}function av(D){return""+D}function ov(D){if(OB(D))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Kc(D)),av(D)}var as=v.ReactCurrentOwner,TB={key:!0,ref:!0,__self:!0,__source:!0},lv,cv,Qc;Qc={};function MB(D){if(zt.call(D,"ref")){var W=Object.getOwnPropertyDescriptor(D,"ref").get;if(W&&W.isReactWarning)return!1}return D.ref!==void 0}function CB(D){if(zt.call(D,"key")){var W=Object.getOwnPropertyDescriptor(D,"key").get;if(W&&W.isReactWarning)return!1}return D.key!==void 0}function AB(D,W){if(typeof D.ref=="string"&&as.current&&W&&as.current.stateNode!==W){var Z=x(as.current.type);Qc[Z]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(as.current.type),D.ref),Qc[Z]=!0)}}function $B(D,W){{var Z=function(){lv||(lv=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W))};Z.isReactWarning=!0,Object.defineProperty(D,"key",{get:Z,configurable:!0})}}function LB(D,W){{var Z=function(){cv||(cv=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",W))};Z.isReactWarning=!0,Object.defineProperty(D,"ref",{get:Z,configurable:!0})}}var DB=function(D,W,Z,ct,_t,$t,vt){var mt={$$typeof:t,type:D,key:W,ref:Z,props:vt,_owner:$t};return mt._store={},Object.defineProperty(mt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(mt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ct}),Object.defineProperty(mt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_t}),Object.freeze&&(Object.freeze(mt.props),Object.freeze(mt)),mt};function kB(D,W,Z,ct,_t){{var $t,vt={},mt=null,de=null;Z!==void 0&&(ov(Z),mt=""+Z),CB(W)&&(ov(W.key),mt=""+W.key),MB(W)&&(de=W.ref,AB(W,_t));for($t in W)zt.call(W,$t)&&!TB.hasOwnProperty($t)&&(vt[$t]=W[$t]);if(D&&D.defaultProps){var jt=D.defaultProps;for($t in jt)vt[$t]===void 0&&(vt[$t]=jt[$t])}if(mt||de){var Wt=typeof D=="function"?D.displayName||D.name||"Unknown":D;mt&&$B(vt,Wt),de&&LB(vt,Wt)}return DB(D,mt,de,_t,ct,as.current,vt)}}var Jc=v.ReactCurrentOwner,uv=v.ReactDebugCurrentFrame;function qr(D){if(D){var W=D._owner,Z=Ht(D.type,D._source,W?W.type:null);uv.setExtraStackFrame(Z)}else uv.setExtraStackFrame(null)}var tu;tu=!1;function eu(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function hv(){{if(Jc.current){var D=x(Jc.current.type);if(D)return`
99
+ */var Ov;function ZB(){return Ov||(Ov=1,process.env.NODE_ENV!=="production"&&function(){var e=re,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function g($){if($===null||typeof $!="object")return null;var G=p&&$[p]||$[m];return typeof G=="function"?G:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y($){{for(var G=arguments.length,q=new Array(G>1?G-1:0),st=1;st<G;st++)q[st-1]=arguments[st];b("error",$,q)}}function b($,G,q){{var st=v.ReactDebugCurrentFrame,xt=st.getStackAddendum();xt!==""&&(G+="%s",q=q.concat([xt]));var Ct=q.map(function(mt){return String(mt)});Ct.unshift("Warning: "+G),Function.prototype.apply.call(console[$],console,Ct)}}var S=!1,_=!1,E=!1,T=!1,R=!1,N;N=Symbol.for("react.module.reference");function A($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===s||R||$===i||$===c||$===u||T||$===f||S||_||E||typeof $=="object"&&$!==null&&($.$$typeof===d||$.$$typeof===h||$.$$typeof===a||$.$$typeof===o||$.$$typeof===l||$.$$typeof===N||$.getModuleId!==void 0))}function C($,G,q){var st=$.displayName;if(st)return st;var xt=G.displayName||G.name||"";return xt!==""?q+"("+xt+")":q}function V($){return $.displayName||"Context"}function M($){if($==null)return null;if(typeof $.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof $=="object")switch($.$$typeof){case o:var G=$;return V(G)+".Consumer";case a:var q=$;return V(q._context)+".Provider";case l:return C($,$.render,"ForwardRef");case h:var st=$.displayName||null;return st!==null?st:M($.type)||"Memo";case d:{var xt=$,Ct=xt._payload,mt=xt._init;try{return M(mt(Ct))}catch{return null}}}return null}var k=Object.assign,w=0,P,U,I,B,j,Y,et;function pt(){}pt.__reactDisabledLog=!0;function z(){{if(w===0){P=console.log,U=console.info,I=console.warn,B=console.error,j=console.group,Y=console.groupCollapsed,et=console.groupEnd;var $={configurable:!0,enumerable:!0,value:pt,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}w++}}function K(){{if(w--,w===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},$,{value:P}),info:k({},$,{value:U}),warn:k({},$,{value:I}),error:k({},$,{value:B}),group:k({},$,{value:j}),groupCollapsed:k({},$,{value:Y}),groupEnd:k({},$,{value:et})})}w<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ht=v.ReactCurrentDispatcher,it;function Mt($,G,q){{if(it===void 0)try{throw Error()}catch(xt){var st=xt.stack.trim().match(/\n( *(at )?)/);it=st&&st[1]||""}return`
100
+ `+it+$}}var W=!1,J;{var ct=typeof WeakMap=="function"?WeakMap:Map;J=new ct}function F($,G){if(!$||W)return"";{var q=J.get($);if(q!==void 0)return q}var st;W=!0;var xt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ct;Ct=ht.current,ht.current=null,z();try{if(G){var mt=function(){throw Error()};if(Object.defineProperty(mt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(mt,[])}catch(Tn){st=Tn}Reflect.construct($,[],mt)}else{try{mt.call()}catch(Tn){st=Tn}$.call(mt.prototype)}}else{try{throw Error()}catch(Tn){st=Tn}$()}}catch(Tn){if(Tn&&st&&typeof Tn.stack=="string"){for(var gt=Tn.stack.split(`
101
+ `),de=st.stack.split(`
102
+ `),Gt=gt.length-1,Wt=de.length-1;Gt>=1&&Wt>=0&&gt[Gt]!==de[Wt];)Wt--;for(;Gt>=1&&Wt>=0;Gt--,Wt--)if(gt[Gt]!==de[Wt]){if(Gt!==1||Wt!==1)do if(Gt--,Wt--,Wt<0||gt[Gt]!==de[Wt]){var Re=`
103
+ `+gt[Gt].replace(" at new "," at ");return $.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",$.displayName)),typeof $=="function"&&J.set($,Re),Re}while(Gt>=1&&Wt>=0);break}}}finally{W=!1,ht.current=Ct,K(),Error.prepareStackTrace=xt}var Kr=$?$.displayName||$.name:"",Pv=Kr?Mt(Kr):"";return typeof $=="function"&&J.set($,Pv),Pv}function Ut($,G,q){return F($,!1)}function bt($){var G=$.prototype;return!!(G&&G.isReactComponent)}function zt($,G,q){if($==null)return"";if(typeof $=="function")return F($,bt($));if(typeof $=="string")return Mt($);switch($){case c:return Mt("Suspense");case u:return Mt("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return Ut($.render);case h:return zt($.type,G,q);case d:{var st=$,xt=st._payload,Ct=st._init;try{return zt(Ct(xt),G,q)}catch{}}}return""}var jt=Object.prototype.hasOwnProperty,nt={},It=v.ReactDebugCurrentFrame;function en($){if($){var G=$._owner,q=zt($.type,$._source,G?G.type:null);It.setExtraStackFrame(q)}else It.setExtraStackFrame(null)}function nn($,G,q,st,xt){{var Ct=Function.call.bind(jt);for(var mt in $)if(Ct($,mt)){var gt=void 0;try{if(typeof $[mt]!="function"){var de=Error((st||"React class")+": "+q+" type `"+mt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[mt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw de.name="Invariant Violation",de}gt=$[mt](G,mt,st,q,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Gt){gt=Gt}gt&&!(gt instanceof Error)&&(en(xt),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",st||"React class",q,mt,typeof gt),en(null)),gt instanceof Error&&!(gt.message in nt)&&(nt[gt.message]=!0,en(xt),y("Failed %s type: %s",q,gt.message),en(null))}}}var N3=Array.isArray;function au($){return N3($)}function P3($){{var G=typeof Symbol=="function"&&Symbol.toStringTag,q=G&&$[Symbol.toStringTag]||$.constructor.name||"Object";return q}}function U3($){try{return Mv($),!1}catch{return!0}}function Mv($){return""+$}function Cv($){if(U3($))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",P3($)),Mv($)}var os=v.ReactCurrentOwner,B3={key:!0,ref:!0,__self:!0,__source:!0},$v,Av,ou;ou={};function V3($){if(jt.call($,"ref")){var G=Object.getOwnPropertyDescriptor($,"ref").get;if(G&&G.isReactWarning)return!1}return $.ref!==void 0}function H3($){if(jt.call($,"key")){var G=Object.getOwnPropertyDescriptor($,"key").get;if(G&&G.isReactWarning)return!1}return $.key!==void 0}function F3($,G){if(typeof $.ref=="string"&&os.current&&G&&os.current.stateNode!==G){var q=M(os.current.type);ou[q]||(y('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(os.current.type),$.ref),ou[q]=!0)}}function G3($,G){{var q=function(){$v||($v=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};q.isReactWarning=!0,Object.defineProperty($,"key",{get:q,configurable:!0})}}function z3($,G){{var q=function(){Av||(Av=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",G))};q.isReactWarning=!0,Object.defineProperty($,"ref",{get:q,configurable:!0})}}var j3=function($,G,q,st,xt,Ct,mt){var gt={$$typeof:t,type:$,key:G,ref:q,props:mt,_owner:Ct};return gt._store={},Object.defineProperty(gt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(gt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:st}),Object.defineProperty(gt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:xt}),Object.freeze&&(Object.freeze(gt.props),Object.freeze(gt)),gt};function W3($,G,q,st,xt){{var Ct,mt={},gt=null,de=null;q!==void 0&&(Cv(q),gt=""+q),H3(G)&&(Cv(G.key),gt=""+G.key),V3(G)&&(de=G.ref,F3(G,xt));for(Ct in G)jt.call(G,Ct)&&!B3.hasOwnProperty(Ct)&&(mt[Ct]=G[Ct]);if($&&$.defaultProps){var Gt=$.defaultProps;for(Ct in Gt)mt[Ct]===void 0&&(mt[Ct]=Gt[Ct])}if(gt||de){var Wt=typeof $=="function"?$.displayName||$.name||"Unknown":$;gt&&G3(mt,Wt),de&&z3(mt,Wt)}return j3($,gt,de,xt,st,os.current,mt)}}var lu=v.ReactCurrentOwner,kv=v.ReactDebugCurrentFrame;function Zr($){if($){var G=$._owner,q=zt($.type,$._source,G?G.type:null);kv.setExtraStackFrame(q)}else kv.setExtraStackFrame(null)}var cu;cu=!1;function uu($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function Lv(){{if(lu.current){var $=M(lu.current.type);if($)return`
104
104
 
105
- Check the render method of \``+D+"`."}return""}}function RB(D){{if(D!==void 0){var W=D.fileName.replace(/^.*[\\\/]/,""),Z=D.lineNumber;return`
105
+ Check the render method of \``+$+"`."}return""}}function q3($){{if($!==void 0){var G=$.fileName.replace(/^.*[\\\/]/,""),q=$.lineNumber;return`
106
106
 
107
- Check your code at `+W+":"+Z+"."}return""}}var dv={};function IB(D){{var W=hv();if(!W){var Z=typeof D=="string"?D:D.displayName||D.name;Z&&(W=`
107
+ Check your code at `+G+":"+q+"."}return""}}var Rv={};function Y3($){{var G=Lv();if(!G){var q=typeof $=="string"?$:$.displayName||$.name;q&&(G=`
108
108
 
109
- Check the top-level render call using <`+Z+">.")}return W}}function fv(D,W){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var Z=IB(W);if(dv[Z])return;dv[Z]=!0;var ct="";D&&D._owner&&D._owner!==Jc.current&&(ct=" It was passed a child from "+x(D._owner.type)+"."),qr(D),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Z,ct),qr(null)}}function pv(D,W){{if(typeof D!="object")return;if(ss(D))for(var Z=0;Z<D.length;Z++){var ct=D[Z];eu(ct)&&fv(ct,W)}else if(eu(D))D._store&&(D._store.validated=!0);else if(D){var _t=g(D);if(typeof _t=="function"&&_t!==D.entries)for(var $t=_t.call(D),vt;!(vt=$t.next()).done;)eu(vt.value)&&fv(vt.value,W)}}}function PB(D){{var W=D.type;if(W==null||typeof W=="string")return;var Z;if(typeof W=="function")Z=W.propTypes;else if(typeof W=="object"&&(W.$$typeof===l||W.$$typeof===h))Z=W.propTypes;else return;if(Z){var ct=x(W);De(Z,D.props,"prop",ct,D)}else if(W.PropTypes!==void 0&&!tu){tu=!0;var _t=x(W);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_t||"Unknown")}typeof W.getDefaultProps=="function"&&!W.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function NB(D){{for(var W=Object.keys(D.props),Z=0;Z<W.length;Z++){var ct=W[Z];if(ct!=="children"&&ct!=="key"){qr(D),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ct),qr(null);break}}D.ref!==null&&(qr(D),b("Invalid attribute `ref` supplied to `React.Fragment`."),qr(null))}}function gv(D,W,Z,ct,_t,$t){{var vt=L(D);if(!vt){var mt="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(mt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var de=RB(_t);de?mt+=de:mt+=hv();var jt;D===null?jt="null":ss(D)?jt="array":D!==void 0&&D.$$typeof===t?(jt="<"+(x(D.type)||"Unknown")+" />",mt=" Did you accidentally export a JSX literal instead of a component?"):jt=typeof D,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",jt,mt)}var Wt=kB(D,W,Z,_t,$t);if(Wt==null)return Wt;if(vt){var ke=W.children;if(ke!==void 0)if(ct)if(ss(ke)){for(var Yr=0;Yr<ke.length;Yr++)pv(ke[Yr],D);Object.freeze&&Object.freeze(ke)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else pv(ke,D)}return D===r?NB(Wt):PB(Wt),Wt}}function UB(D,W,Z){return gv(D,W,Z,!0)}function BB(D,W,Z){return gv(D,W,Z,!1)}var VB=BB,HB=UB;rs.Fragment=r,rs.jsx=VB,rs.jsxs=HB}()),rs}process.env.NODE_ENV==="production"?Zc.exports=UU():Zc.exports=BU();var Ut=Zc.exports;class Pt extends re.PureComponent{constructor(){super(...arguments);nu(this,"chart");nu(this,"chartRef",re.createRef())}createChart(n,r,i){throw new Error("Method not implemented.")}componentDidUpdate(n){var r,i;this.props.data!==n.data&&((r=this.chart)==null||r.model.setData(this.props.data)),this.props.options!==n.options&&((i=this.chart)==null||i.model.setOptions(this.props.options))}componentWillUnmount(){var n;(n=this.chart)==null||n.destroy()}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}render(){return Ut.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class VU extends Pt{createChart(t,n,r){return new pU(t,{data:n,options:r})}}class HU extends Pt{createChart(t,n,r){return new gU(t,{data:n,options:r})}}class FU extends Pt{createChart(t,n,r){return new mU(t,{data:n,options:r})}}class GU extends Pt{createChart(t,n,r){return new vU(t,{data:n,options:r})}}class zU extends Pt{createChart(t,n,r){return new yU(t,{data:n,options:r})}}class jU extends Pt{createChart(t,n,r){return new bU(t,{data:n,options:r})}}class WU extends Pt{createChart(t,n,r){return new xU(t,{data:n,options:r})}}class qU extends Pt{createChart(t,n,r){return new wU(t,{data:n,options:r})}}class YU extends Pt{createChart(t,n,r){return new _U(t,{data:n,options:r})}}class XU extends Pt{createChart(t,n,r){return new EU(t,{data:n,options:r})}}class ZU extends Pt{createChart(t,n,r){return new SU(t,{data:n,options:r})}}class KU extends Pt{createChart(t,n,r){return new OU(t,{data:n,options:r})}}class QU extends Pt{createChart(t,n,r){return new TU(t,{data:n,options:r})}}class JU extends Pt{createChart(t,n,r){return new MU(t,{data:n,options:r})}}class tB extends Pt{createChart(t,n,r){return new CU(t,{data:n,options:r})}}class eB extends Pt{createChart(t,n,r){return new AU(t,{data:n,options:r})}}class nB extends Pt{createChart(t,n,r){return new nv(t,{data:n,options:r})}}class rB extends Pt{createChart(t,n,r){return new $U(t,{data:n,options:r})}}class iB extends Pt{createChart(t,n,r){return new LU(t,{data:n,options:r})}}class sB extends Pt{createChart(t,n,r){return new RU(t,{data:n,options:r})}}class aB extends Pt{createChart(t,n,r){return new IU(t,{data:n,options:r})}}class oB extends Pt{createChart(t,n,r){return new PU(t,{data:n,options:r})}}class lB extends Pt{createChart(t,n,r){return new DU(t,{data:n,options:r})}}class cB extends Pt{createChart(t,n,r){return new kU(t,{data:n,options:r})}}class uB extends Pt{createChart(t,n,r){return new NU(t,{data:n,options:r})}}var sv={exports:{}};/*!
109
+ Check the top-level render call using <`+q+">.")}return G}}function Dv($,G){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var q=Y3(G);if(Rv[q])return;Rv[q]=!0;var st="";$&&$._owner&&$._owner!==lu.current&&(st=" It was passed a child from "+M($._owner.type)+"."),Zr($),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',q,st),Zr(null)}}function Iv($,G){{if(typeof $!="object")return;if(au($))for(var q=0;q<$.length;q++){var st=$[q];uu(st)&&Dv(st,G)}else if(uu($))$._store&&($._store.validated=!0);else if($){var xt=g($);if(typeof xt=="function"&&xt!==$.entries)for(var Ct=xt.call($),mt;!(mt=Ct.next()).done;)uu(mt.value)&&Dv(mt.value,G)}}}function X3($){{var G=$.type;if(G==null||typeof G=="string")return;var q;if(typeof G=="function")q=G.propTypes;else if(typeof G=="object"&&(G.$$typeof===l||G.$$typeof===h))q=G.propTypes;else return;if(q){var st=M(G);nn(q,$.props,"prop",st,$)}else if(G.PropTypes!==void 0&&!cu){cu=!0;var xt=M(G);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",xt||"Unknown")}typeof G.getDefaultProps=="function"&&!G.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Z3($){{for(var G=Object.keys($.props),q=0;q<G.length;q++){var st=G[q];if(st!=="children"&&st!=="key"){Zr($),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",st),Zr(null);break}}$.ref!==null&&(Zr($),y("Invalid attribute `ref` supplied to `React.Fragment`."),Zr(null))}}function Nv($,G,q,st,xt,Ct){{var mt=A($);if(!mt){var gt="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(gt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var de=q3(xt);de?gt+=de:gt+=Lv();var Gt;$===null?Gt="null":au($)?Gt="array":$!==void 0&&$.$$typeof===t?(Gt="<"+(M($.type)||"Unknown")+" />",gt=" Did you accidentally export a JSX literal instead of a component?"):Gt=typeof $,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Gt,gt)}var Wt=W3($,G,q,xt,Ct);if(Wt==null)return Wt;if(mt){var Re=G.children;if(Re!==void 0)if(st)if(au(Re)){for(var Kr=0;Kr<Re.length;Kr++)Iv(Re[Kr],$);Object.freeze&&Object.freeze(Re)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Iv(Re,$)}return $===r?Z3(Wt):X3(Wt),Wt}}function K3($,G,q){return Nv($,G,q,!0)}function Q3($,G,q){return Nv($,G,q,!1)}var J3=Q3,tV=K3;as.Fragment=r,as.jsx=J3,as.jsxs=tV}()),as}process.env.NODE_ENV==="production"?su.exports=XB():su.exports=ZB();var Pt=su.exports;class Dt extends re.PureComponent{constructor(){super(...arguments);hu(this,"chart");hu(this,"chartRef",re.createRef())}createChart(n,r,i){throw new Error("Method not implemented.")}componentDidUpdate(n){var r,i;this.props.data!==n.data&&((r=this.chart)==null||r.model.setData(this.props.data)),this.props.options!==n.options&&((i=this.chart)==null||i.model.setOptions(this.props.options))}componentWillUnmount(){var n;(n=this.chart)==null||n.destroy()}componentDidMount(){this.chartRef.current&&!this.chart&&(this.chart=this.createChart(this.chartRef.current,this.props.data,this.props.options))}render(){return Pt.jsx("div",{ref:this.chartRef,className:"chart-holder"})}}class KB extends Dt{createChart(t,n,r){return new OB(t,{data:n,options:r})}}class QB extends Dt{createChart(t,n,r){return new TB(t,{data:n,options:r})}}class JB extends Dt{createChart(t,n,r){return new MB(t,{data:n,options:r})}}class t3 extends Dt{createChart(t,n,r){return new CB(t,{data:n,options:r})}}class e3 extends Dt{createChart(t,n,r){return new $B(t,{data:n,options:r})}}class n3 extends Dt{createChart(t,n,r){return new AB(t,{data:n,options:r})}}class r3 extends Dt{createChart(t,n,r){return new kB(t,{data:n,options:r})}}class i3 extends Dt{createChart(t,n,r){return new LB(t,{data:n,options:r})}}class s3 extends Dt{createChart(t,n,r){return new RB(t,{data:n,options:r})}}class a3 extends Dt{createChart(t,n,r){return new DB(t,{data:n,options:r})}}class o3 extends Dt{createChart(t,n,r){return new IB(t,{data:n,options:r})}}class l3 extends Dt{createChart(t,n,r){return new NB(t,{data:n,options:r})}}class c3 extends Dt{createChart(t,n,r){return new PB(t,{data:n,options:r})}}class u3 extends Dt{createChart(t,n,r){return new UB(t,{data:n,options:r})}}class h3 extends Dt{createChart(t,n,r){return new BB(t,{data:n,options:r})}}class d3 extends Dt{createChart(t,n,r){return new VB(t,{data:n,options:r})}}class f3 extends Dt{createChart(t,n,r){return new Ev(t,{data:n,options:r})}}class p3 extends Dt{createChart(t,n,r){return new HB(t,{data:n,options:r})}}class g3 extends Dt{createChart(t,n,r){return new FB(t,{data:n,options:r})}}class m3 extends Dt{createChart(t,n,r){return new jB(t,{data:n,options:r})}}class v3 extends Dt{createChart(t,n,r){return new WB(t,{data:n,options:r})}}class y3 extends Dt{createChart(t,n,r){return new qB(t,{data:n,options:r})}}class b3 extends Dt{createChart(t,n,r){return new GB(t,{data:n,options:r})}}class x3 extends Dt{createChart(t,n,r){return new zB(t,{data:n,options:r})}}class w3 extends Dt{createChart(t,n,r){return new YB(t,{data:n,options:r})}}var Tv={exports:{}};/*!
110
110
  Copyright (c) 2018 Jed Watson.
111
111
  Licensed under the MIT License (MIT), see
112
112
  http://jedwatson.github.io/classnames
113
- */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var s=arguments[i];if(s){var a=typeof s;if(a==="string"||a==="number")r.push(s);else if(Array.isArray(s)){if(s.length){var o=n.apply(null,s);o&&r.push(o)}}else if(a==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){r.push(s.toString());continue}for(var l in s)t.call(s,l)&&s[l]&&r.push(l)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(sv);var hB=sv.exports;const Rn=kg(hB),In="cds",dB=({tag:e="div",children:t,color:n,href:r,position:i="static",stacked:s,...a})=>{const o=r?"a":a.onClick?"button":e,l=`${In}--cc--card-node`,c=Rn(l,{[`${l}--stacked`]:s,[`${l}--${o}`]:o,[a.className]:a.className});return Ut.jsx(o,{className:c,style:{borderColor:n,position:i},tabIndex:0,...a,children:t})},fB=({children:e,farsideColumn:t=!1,...n})=>{const r=`${In}--cc--card-node`,i=Rn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return Ut.jsx("div",{className:i,...n,children:e})},pB=({children:e,...t})=>{const n=`${In}--cc--card-node`,r=Rn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return Ut.jsx("label",{className:r,...t,children:e})},gB=({children:e,...t})=>{const n=`${In}--cc--card-node`,r=Rn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return Ut.jsx("div",{className:r,...t,children:e})},mB=({children:e,...t})=>{const n=`${In}--cc--card-node`,r=Rn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return Ut.jsx("div",{className:r,...t,children:e})},vB=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:s,variant:a=null,...o})=>{const l=`${In}--cc--edge`,c=Rn(l,{[`${l}--${a}`]:a,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&s&&(u=hR(i,s)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return Ut.jsxs("g",{className:c,...o,children:[Ut.jsx("path",{d:u,className:`${l}__container`}),Ut.jsx("path",{d:u,className:`${l}__outer`}),Ut.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},or=({color:e,d:t,id:n,orient:r="auto",height:i,width:s,position:a="end",className:o,refX:l,refY:c,...u})=>{const h=`${In}--cc--marker`,d=Rn(h,o),f=a==="end"?(s||0)/2+.5:.5,p=(i||0)/2;return Ut.jsx("marker",{className:d,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||f,refY:c||p,markerUnits:"userSpaceOnUse",...u,children:Ut.jsx("path",{d:t,style:{fill:e}})})},yB=e=>Ut.jsx(or,{d:dR.d,...e}),bB=e=>Ut.jsx(or,{d:fR.d,...e}),xB=e=>Ut.jsx(or,{d:pR.d,...e}),wB=e=>Ut.jsx(or,{d:gR.d,...e}),_B=e=>Ut.jsx(or,{d:mR.d,...e}),EB=e=>Ut.jsx(or,{d:vR.d,...e}),SB=({shape:e="circle",tag:t="div",title:n="Title",subtitle:r,description:i,renderIcon:s,href:a,size:o=48,stacked:l,position:c="fixed",bodyPosition:u="absolute",...h})=>{const d=a?"a":h.onClick?"button":t,f=`${In}--cc--shape-node`,p=Rn(f,{[`${f}--stacked`]:l,[`${f}--${e}`]:e,[`${f}--${t}`]:t,[h.className]:h.className}),m=n?Ut.jsx("div",{className:`${f}__title`,children:n}):null,g=r?Ut.jsx("div",{className:`${f}__subtitle`,children:r}):null,v=i?Ut.jsx("div",{className:`${f}__description`,children:i}):null;return Ut.jsxs(d,{className:p,style:{height:o,width:o,position:c},tabIndex:0,...h,children:[Ut.jsx("div",{className:`${f}__icon`,children:s}),Ut.jsxs("div",{className:`${f}__body`,style:{position:u},children:[m,g,v]})]})};J.AlluvialChart=VU,J.AreaChart=HU,J.ArrowLeftMarker=yB,J.ArrowRightMarker=bB,J.BoxplotChart=FU,J.BubbleChart=GU,J.BulletChart=zU,J.CardNode=dB,J.CardNodeColumn=fB,J.CardNodeLabel=pB,J.CardNodeSubtitle=gB,J.CardNodeTitle=mB,J.CircleMarker=xB,J.CirclePackChart=WU,J.ComboChart=qU,J.DiamondMarker=wB,J.DonutChart=YU,J.Edge=vB,J.ExperimentalChoroplethChart=jU,J.GaugeChart=XU,J.GroupedBarChart=ZU,J.HeatmapChart=KU,J.HistogramChart=QU,J.LineChart=JU,J.LollipopChart=tB,J.Marker=or,J.MeterChart=eB,J.PieChart=nB,J.RadarChart=rB,J.ScatterChart=iB,J.ShapeNode=SB,J.SimpleBarChart=sB,J.SquareMarker=_B,J.StackedAreaChart=aB,J.StackedBarChart=oB,J.TeeMarker=EB,J.TreeChart=lB,J.TreemapChart=cB,J.WordCloudChart=uB,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
113
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var s=arguments[i];if(s){var a=typeof s;if(a==="string"||a==="number")r.push(s);else if(Array.isArray(s)){if(s.length){var o=n.apply(null,s);o&&r.push(o)}}else if(a==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){r.push(s.toString());continue}for(var l in s)t.call(s,l)&&s[l]&&r.push(l)}}}return r.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Tv);var _3=Tv.exports;const Pn=tm(_3),Un="cds",E3=({tag:e="div",children:t,color:n,href:r,position:i="static",stacked:s,...a})=>{const o=r?"a":a.onClick?"button":e,l=`${Un}--cc--card-node`,c=Pn(l,{[`${l}--stacked`]:s,[`${l}--${o}`]:o,[a.className]:a.className});return Pt.jsx(o,{className:c,style:{borderColor:n,position:i},tabIndex:0,...a,children:t})},S3=({children:e,farsideColumn:t=!1,...n})=>{const r=`${Un}--cc--card-node`,i=Pn(`${r}__column`,{[`${r}__column--farside`]:t,...n.className?{[n.className]:!0}:{}});return Pt.jsx("div",{className:i,...n,children:e})},O3=({children:e,...t})=>{const n=`${Un}--cc--card-node`,r=Pn(`${n}__label`,{...t.className?{[t.className]:!0}:{}});return Pt.jsx("label",{className:r,...t,children:e})},T3=({children:e,...t})=>{const n=`${Un}--cc--card-node`,r=Pn(`${n}__subtitle`,{...t.className?{[t.className]:!0}:{}});return Pt.jsx("div",{className:r,...t,children:e})},M3=({children:e,...t})=>{const n=`${Un}--cc--card-node`,r=Pn(`${n}__title`,{...t.className?{[t.className]:!0}:{}});return Pt.jsx("div",{className:r,...t,children:e})},C3=({color:e,markerEnd:t,markerStart:n,path:r,source:i,target:s,variant:a=null,...o})=>{const l=`${Un}--cc--edge`,c=Pn(l,{[`${l}--${a}`]:a,...o.className?{[o.className]:!0}:{}});let u=r;if(!u&&i&&s&&(u=_I(i,s)),!u)throw Error("Missing parameters for Edge component: path or source and target.");return Pt.jsxs("g",{className:c,...o,children:[Pt.jsx("path",{d:u,className:`${l}__container`}),Pt.jsx("path",{d:u,className:`${l}__outer`}),Pt.jsx("path",{d:u,className:`${l}__inner`,markerEnd:`url(#${t})`,markerStart:`url(#${n})`,style:{stroke:e}})]})},ur=({color:e,d:t,id:n,orient:r="auto",height:i,width:s,position:a="end",className:o,refX:l,refY:c,...u})=>{const h=`${Un}--cc--marker`,d=Pn(h,o),f=a==="end"?(s||0)/2+.5:.5,p=(i||0)/2;return Pt.jsx("marker",{className:d,markerHeight:i,markerWidth:s,orient:r,id:n,refX:l||f,refY:c||p,markerUnits:"userSpaceOnUse",...u,children:Pt.jsx("path",{d:t,style:{fill:e}})})},$3=e=>Pt.jsx(ur,{d:EI.d,...e}),A3=e=>Pt.jsx(ur,{d:SI.d,...e}),k3=e=>Pt.jsx(ur,{d:OI.d,...e}),L3=e=>Pt.jsx(ur,{d:TI.d,...e}),R3=e=>Pt.jsx(ur,{d:MI.d,...e}),D3=e=>Pt.jsx(ur,{d:CI.d,...e}),I3=({shape:e="circle",tag:t="div",title:n="Title",subtitle:r,description:i,renderIcon:s,href:a,size:o=48,stacked:l,position:c="fixed",bodyPosition:u="absolute",...h})=>{const d=a?"a":h.onClick?"button":t,f=`${Un}--cc--shape-node`,p=Pn(f,{[`${f}--stacked`]:l,[`${f}--${e}`]:e,[`${f}--${t}`]:t,[h.className]:h.className}),m=n?Pt.jsx("div",{className:`${f}__title`,children:n}):null,g=r?Pt.jsx("div",{className:`${f}__subtitle`,children:r}):null,v=i?Pt.jsx("div",{className:`${f}__description`,children:i}):null;return Pt.jsxs(d,{className:p,style:{height:o,width:o,position:c},tabIndex:0,...h,children:[Pt.jsx("div",{className:`${f}__icon`,children:s}),Pt.jsxs("div",{className:`${f}__body`,style:{position:u},children:[m,g,v]})]})};X.AlluvialChart=KB,X.AreaChart=QB,X.ArrowLeftMarker=$3,X.ArrowRightMarker=A3,X.BoxplotChart=JB,X.BubbleChart=t3,X.BulletChart=e3,X.CardNode=E3,X.CardNodeColumn=S3,X.CardNodeLabel=O3,X.CardNodeSubtitle=T3,X.CardNodeTitle=M3,X.CircleMarker=k3,X.CirclePackChart=r3,X.ComboChart=i3,X.DiamondMarker=L3,X.DonutChart=s3,X.Edge=C3,X.ExperimentalChoroplethChart=n3,X.GaugeChart=a3,X.GroupedBarChart=o3,X.HeatmapChart=l3,X.HistogramChart=c3,X.LineChart=u3,X.LollipopChart=h3,X.Marker=ur,X.MeterChart=d3,X.PieChart=f3,X.RadarChart=p3,X.ScatterChart=g3,X.ShapeNode=I3,X.SimpleBarChart=m3,X.SquareMarker=R3,X.StackedAreaChart=v3,X.StackedBarChart=y3,X.TeeMarker=D3,X.TreeChart=b3,X.TreemapChart=x3,X.WordCloudChart=w3,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
114
114
  //# sourceMappingURL=index.js.map