@carbon/charts 1.11.20 → 1.12.0
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/CHANGELOG.md +26 -0
- package/README.md +3 -3
- package/dist/choropleth-17b85d55.mjs.map +1 -1
- package/dist/color-scale-utils-faf67b75.mjs.map +1 -1
- package/dist/configuration-non-customizable.d.ts +1 -1
- package/dist/demo/index.mjs +239 -255
- package/dist/demo/index.mjs.map +1 -1
- package/dist/demo/styles.css +4499 -692
- package/dist/demo/styles.css.map +1 -1
- package/dist/demo/utils/package-versions.d.ts +0 -2
- package/dist/styles.css +4249 -781
- package/dist/styles.css.map +1 -1
- package/dist/styles.min.css +1 -1
- package/dist/styles.min.css.map +1 -1
- package/dist/umd/bundle.umd.js +13 -13
- package/dist/umd/bundle.umd.js.map +1 -1
- package/package.json +24 -23
- package/scss/_chart-holder.scss +18 -17
- package/scss/_chart-wrapper.scss +6 -0
- package/scss/_color-palette.scss +2 -2
- package/scss/_colors.scss +26 -25
- package/scss/_globals.scss +8 -0
- package/scss/_tokens.scss +50 -50
- package/scss/_transition.scss +4 -0
- package/scss/_type.scss +14 -14
- package/scss/components/_axis.scss +12 -11
- package/scss/components/_callouts.scss +4 -3
- package/scss/components/_color-legend.scss +4 -4
- package/scss/components/_grid-brush.scss +7 -5
- package/scss/components/_grid.scss +9 -8
- package/scss/components/_highlights.scss +6 -3
- package/scss/components/_layout.scss +5 -3
- package/scss/components/_legend.scss +14 -11
- package/scss/components/_meter-title.scss +11 -9
- package/scss/components/_modal.scss +14 -11
- package/scss/components/_ruler.scss +6 -3
- package/scss/components/_skeleton-lines.scss +9 -6
- package/scss/components/_skeleton.scss +9 -6
- package/scss/components/_threshold.scss +12 -11
- package/scss/components/_title.scss +5 -5
- package/scss/components/_toolbar.scss +6 -6
- package/scss/components/_tooltip.scss +12 -11
- package/scss/components/_zero-line.scss +4 -3
- package/scss/components/_zoom-bar.scss +16 -14
- package/scss/components/diagrams/_card-node.scss +74 -74
- package/scss/components/diagrams/_edge.scss +46 -49
- package/scss/components/diagrams/_marker.scss +4 -5
- package/scss/components/diagrams/_shape-node.scss +72 -73
- package/scss/components/diagrams/index.scss +4 -4
- package/scss/components/index.scss +20 -20
- package/scss/demos.scss +1 -0
- package/scss/graphs/_alluvial.scss +7 -6
- package/scss/graphs/_area.scss +4 -2
- package/scss/graphs/_bubble.scss +6 -5
- package/scss/graphs/_bullet.scss +11 -13
- package/scss/graphs/_choropleth.scss +7 -7
- package/scss/graphs/_circle-pack.scss +7 -6
- package/scss/graphs/_donut.scss +3 -1
- package/scss/graphs/_gauge.scss +7 -6
- package/scss/graphs/_heatmap.scss +6 -6
- package/scss/graphs/_line.scss +6 -4
- package/scss/graphs/_lollipop.scss +3 -1
- package/scss/graphs/_meter.scss +11 -10
- package/scss/graphs/_pie.scss +3 -1
- package/scss/graphs/_radar.scss +6 -5
- package/scss/graphs/_scatter-stacked.scss +4 -3
- package/scss/graphs/_scatter.scss +6 -5
- package/scss/graphs/_tree.scss +11 -9
- package/scss/graphs/_treemap.scss +3 -1
- package/scss/graphs/_wordcloud.scss +3 -1
- package/scss/graphs/index.scss +19 -19
- package/scss/index.scss +10 -31
- package/styles.css +4249 -781
- package/styles.min.css +1 -1
- package/scss/components/_edge.scss +0 -65
- package/scss/components/_marker.scss +0 -7
package/dist/umd/bundle.umd.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(z,xe){typeof exports=="object"&&typeof module<"u"?xe(exports):typeof define=="function"&&define.amd?define(["exports"],xe):(z=typeof globalThis<"u"?globalThis:z||self,xe(z.Charts={}))})(this,function(z){"use strict";function xe(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qm(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ga(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===qm?e:Xm,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Xm(){return 0}function jm(e){return e===null?NaN:+e}function*Zm(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 Km=Ga(xe).right;Ga(jm).center;const Ha=Km;function Qm(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 be(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 tu extends Map{constructor(t,n=ev){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(eu(this,t))}has(t){return super.has(eu(this,t))}set(t,n){return super.set(Jm(this,t),n)}delete(t){return super.delete(tv(this,t))}}function eu({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Jm({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function tv({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function ev(e){return e!==null&&typeof e=="object"?e.valueOf():e}function nv(e){return e}function rv(e=xe){if(e===xe)return nu;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 nu(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var iv=Array.prototype,sv=iv.slice;function Fa(e){return()=>e}const av=Math.sqrt(50),ov=Math.sqrt(10),lv=Math.sqrt(2);function Fi(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>=av?10:s>=ov?5:s>=lv?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?Fi(e,t,n*2):[o,l,c]}function zi(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?Fi(t,e,n):Fi(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 qn(e,t,n){return t=+t,e=+e,n=+n,Fi(e,t,n)[2]}function za(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?qn(t,e,n):qn(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function cv(e,t,n){let r;for(;;){const i=qn(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 uv(e){return Math.max(1,Math.ceil(Math.log(Qm(e))/Math.LN2)+1)}function hv(){var e=nv,t=be,n=uv;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const b=h,S=+f;if(t===be&&([d,h]=cv(d,h,S)),f=zi(d,h,S),f[0]<=d&&(l=qn(d,h,S)),f[f.length-1]>=h)if(b>=h&&t===be){const _=qn(d,h,S);isFinite(_)&&(_>0?h=(Math.floor(h/_)+1)*_:_<0&&(h=(Math.ceil(h*-_)+1)/-_))}else f.pop()}for(var p=f.length,g=0,v=p;f[g]<=d;)++g;for(;f[v-1]>h;)--v;(g||v<p)&&(f=f.slice(g,v),p=v-g);var m=new Array(p+1),y;for(s=0;s<=p;++s)y=m[s]=[],y.x0=s>0?f[s-1]:d,y.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&m[Math.min(p,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const b=Math.floor((d-o)*l);m[Math.min(p,b+(f[b]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&m[Ha(f,o,0,p)].push(i[s]);return m}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Fa(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Fa([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Fa(Array.isArray(i)?sv.call(i):i),r):n},r}function En(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 cn(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 ru(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?nu:rv(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(r,Math.floor(t+(l-c)*d/l+h));ru(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(kr(e,n,t),i(e[r],s)>0&&kr(e,n,r);a<o;){for(kr(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?kr(e,n,o):(++o,kr(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function kr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Wa(e,t,n){if(e=Float64Array.from(Zm(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return cn(e);if(t>=1)return En(e);var r,i=(r-1)*t,s=Math.floor(i),a=En(ru(e,s).subarray(0,s+1)),o=cn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*dv(e){for(const t of e)yield*t}function iu(e){return Array.from(dv(e))}function fv(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 pv(e){return e}var Wi=1,Yi=2,Ya=3,$r=4,su=1e-6;function gv(e){return"translate("+e+",0)"}function mv(e){return"translate(0,"+e+")"}function vv(e){return t=>+e(t)}function yv(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function xv(){return!this.__axis}function qi(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===Wi||e===$r?-1:1,u=e===$r||e===Yi?"x":"y",d=e===Wi||e===Ya?gv:mv;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):pv),v=Math.max(s,0)+o,m=t.range(),y=+m[0]+l,b=+m[m.length-1]+l,S=(t.bandwidth?yv:vv)(t.copy(),l),_=f.selection?f.selection():f,E=_.selectAll(".domain").data([null]),M=_.selectAll(".tick").data(p,t).order(),C=M.exit(),G=M.enter().append("g").attr("class","tick"),I=M.select("line"),T=M.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(G),I=I.merge(G.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),T=T.merge(G.append("text").attr("fill","currentColor").attr(u,c*v).attr("dy",e===Wi?"0em":e===Ya?"0.71em":"0.32em")),f!==_&&(E=E.transition(f),M=M.transition(f),I=I.transition(f),T=T.transition(f),C=C.transition(f).attr("opacity",su).attr("transform",function(L){return isFinite(L=S(L))?d(L+l):this.getAttribute("transform")}),G.attr("opacity",su).attr("transform",function(L){var R=this.parentNode.__axis;return d((R&&isFinite(R=R(L))?R:S(L))+l)})),C.remove(),E.attr("d",e===$r||e===Yi?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),M.attr("opacity",1).attr("transform",function(L){return d(S(L)+l)}),I.attr(u+"2",c*s),T.attr(u,c*v).text(g),_.filter(xv).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Yi?"start":e===$r?"end":"middle"),_.each(function(){this.__axis=S})}return h.scale=function(f){return arguments.length?(t=f,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),h):n.slice()},h.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),h):r&&r.slice()},h.tickFormat=function(f){return arguments.length?(i=f,h):i},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function bv(e){return qi(Wi,e)}function Ev(e){return qi(Yi,e)}function qa(e){return qi(Ya,e)}function au(e){return qi($r,e)}var Sv={value:()=>{}};function Xa(){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 Xi(n)}function Xi(e){this._=e}function _v(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}})}Xi.prototype=Xa.prototype={constructor:Xi,on:function(e,t){var n=this._,r=_v(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=wv(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]=ou(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ou(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 Xi(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 wv(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ou(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Sv,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ja="http://www.w3.org/1999/xhtml";const lu={svg:"http://www.w3.org/2000/svg",xhtml:ja,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ji(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),lu.hasOwnProperty(t)?{space:lu[t],local:e}:e}function Ov(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ja&&t.documentElement.namespaceURI===ja?t.createElement(e):t.createElementNS(n,e)}}function Tv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function cu(e){var t=ji(e);return(t.local?Tv:Ov)(t)}function Mv(){}function Za(e){return e==null?Mv:function(){return this.querySelector(e)}}function Cv(e){typeof e!="function"&&(e=Za(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 se(r,this._parents)}function Av(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Dv(){return[]}function uu(e){return e==null?Dv:function(){return this.querySelectorAll(e)}}function Lv(e){return function(){return Av(e.apply(this,arguments))}}function Rv(e){typeof e=="function"?e=Lv(e):e=uu(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 se(r,i)}function hu(e){return function(){return this.matches(e)}}function du(e){return function(t){return t.matches(e)}}var Iv=Array.prototype.find;function kv(e){return function(){return Iv.call(this.children,e)}}function $v(){return this.firstElementChild}function Pv(e){return this.select(e==null?$v:kv(typeof e=="function"?e:du(e)))}var Nv=Array.prototype.filter;function Uv(){return Array.from(this.children)}function Bv(e){return function(){return Nv.call(this.children,e)}}function Vv(e){return this.selectAll(e==null?Uv:Bv(typeof e=="function"?e:du(e)))}function Gv(e){typeof e!="function"&&(e=hu(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 se(r,this._parents)}function fu(e){return new Array(e.length)}function Hv(){return new se(this._enter||this._groups.map(fu),this._parents)}function Zi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zi.prototype={constructor:Zi,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 Fv(e){return function(){return e}}function zv(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 Zi(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function Wv(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(r[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new Zi(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function Yv(e){return e.__data__}function qv(e,t){if(!arguments.length)return Array.from(this,Yv);var n=t?Wv:zv,r=this._parents,i=this._groups;typeof e!="function"&&(e=Fv(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,f=Xv(e.call(u,u&&u.__data__,c,r)),p=f.length,g=o[c]=new Array(p),v=a[c]=new Array(p),m=l[c]=new Array(h);n(u,d,g,v,m,f,t);for(var y=0,b=0,S,_;y<p;++y)if(S=g[y]){for(y>=b&&(b=y+1);!(_=v[b])&&++b<p;);S._next=_||null}}return a=new se(a,r),a._enter=o,a._exit=l,a}function Xv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jv(){return new se(this._exit||this._groups.map(fu),this._parents)}function Zv(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 Kv(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<i;++l)o[l]=n[l];return new se(o,this._parents)}function Qv(){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 Jv(e){e||(e=t0);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new se(i,this._parents).order()}function t0(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function e0(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function n0(){return Array.from(this)}function r0(){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 i0(){let e=0;for(const t of this)++e;return e}function s0(){return!this.node()}function a0(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 o0(e){return function(){this.removeAttribute(e)}}function l0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function c0(e,t){return function(){this.setAttribute(e,t)}}function u0(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function h0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function d0(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 f0(e,t){var n=ji(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?l0:o0:typeof t=="function"?n.local?d0:h0:n.local?u0:c0)(n,t))}function pu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function p0(e){return function(){this.style.removeProperty(e)}}function g0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function m0(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function v0(e,t,n){return arguments.length>1?this.each((t==null?p0:typeof t=="function"?m0:g0)(e,t,n??"")):Xn(this.node(),e)}function Xn(e,t){return e.style.getPropertyValue(t)||pu(e).getComputedStyle(e,null).getPropertyValue(t)}function y0(e){return function(){delete this[e]}}function x0(e,t){return function(){this[e]=t}}function b0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function E0(e,t){return arguments.length>1?this.each((t==null?y0:typeof t=="function"?b0:x0)(e,t)):this.node()[e]}function gu(e){return e.trim().split(/^|\s+/)}function Ka(e){return e.classList||new mu(e)}function mu(e){this._node=e,this._names=gu(e.getAttribute("class")||"")}mu.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 vu(e,t){for(var n=Ka(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function yu(e,t){for(var n=Ka(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function S0(e){return function(){vu(this,e)}}function _0(e){return function(){yu(this,e)}}function w0(e,t){return function(){(t.apply(this,arguments)?vu:yu)(this,e)}}function O0(e,t){var n=gu(e+"");if(arguments.length<2){for(var r=Ka(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?w0:t?S0:_0)(n,t))}function T0(){this.textContent=""}function M0(e){return function(){this.textContent=e}}function C0(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function A0(e){return arguments.length?this.each(e==null?T0:(typeof e=="function"?C0:M0)(e)):this.node().textContent}function D0(){this.innerHTML=""}function L0(e){return function(){this.innerHTML=e}}function R0(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function I0(e){return arguments.length?this.each(e==null?D0:(typeof e=="function"?R0:L0)(e)):this.node().innerHTML}function k0(){this.nextSibling&&this.parentNode.appendChild(this)}function $0(){return this.each(k0)}function P0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function N0(){return this.each(P0)}function U0(e){var t=typeof e=="function"?e:cu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function B0(){return null}function V0(e,t){var n=typeof e=="function"?e:cu(e),r=t==null?B0:typeof t=="function"?t:Za(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function G0(){var e=this.parentNode;e&&e.removeChild(this)}function H0(){return this.each(G0)}function F0(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function z0(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function W0(e){return this.select(e?z0:F0)}function Y0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function q0(e){return function(t){e.call(this,t,this.__data__)}}function X0(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 j0(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 Z0(e,t,n){return function(){var r=this.__on,i,s=q0(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 K0(e,t,n){var r=X0(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?Z0:j0,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function xu(e,t,n){var r=pu(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 Q0(e,t){return function(){return xu(this,e,t)}}function J0(e,t){return function(){return xu(this,e,t.apply(this,arguments))}}function ty(e,t){return this.each((typeof t=="function"?J0:Q0)(e,t))}function*ey(){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 bu=[null];function se(e,t){this._groups=e,this._parents=t}function Pr(){return new se([[document.documentElement]],bu)}function ny(){return this}se.prototype=Pr.prototype={constructor:se,select:Cv,selectAll:Rv,selectChild:Pv,selectChildren:Vv,filter:Gv,data:qv,enter:Hv,exit:jv,join:Zv,merge:Kv,selection:ny,order:Qv,sort:Jv,call:e0,nodes:n0,node:r0,size:i0,empty:s0,each:a0,attr:f0,style:v0,property:E0,classed:O0,text:A0,html:I0,raise:$0,lower:N0,append:U0,insert:V0,remove:H0,clone:W0,datum:Y0,on:K0,dispatch:ty,[Symbol.iterator]:ey};function D(e){return typeof e=="string"?new se([[document.querySelector(e)]],[document.documentElement]):new se([[e]],bu)}function ry(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Sn(e,t){if(e=ry(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 Qa={capture:!0,passive:!1};function Ja(e){e.preventDefault(),e.stopImmediatePropagation()}function iy(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",Ja,Qa);"onselectstart"in t?n.on("selectstart.drag",Ja,Qa):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function sy(e,t){var n=e.document.documentElement,r=D(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ja,Qa),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 to(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Eu(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Nr(){}var Ur=.7,Ki=1/Ur,jn="\\s*([+-]?\\d+)\\s*",Br="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Re="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ay=/^#([0-9a-f]{3,8})$/,oy=new RegExp(`^rgb\\(${jn},${jn},${jn}\\)$`),ly=new RegExp(`^rgb\\(${Re},${Re},${Re}\\)$`),cy=new RegExp(`^rgba\\(${jn},${jn},${jn},${Br}\\)$`),uy=new RegExp(`^rgba\\(${Re},${Re},${Re},${Br}\\)$`),hy=new RegExp(`^hsl\\(${Br},${Re},${Re}\\)$`),dy=new RegExp(`^hsla\\(${Br},${Re},${Re},${Br}\\)$`),Su={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};to(Nr,Fe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_u,formatHex:_u,formatHex8:fy,formatHsl:py,formatRgb:wu,toString:wu});function _u(){return this.rgb().formatHex()}function fy(){return this.rgb().formatHex8()}function py(){return Au(this).formatHsl()}function wu(){return this.rgb().formatRgb()}function Fe(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ay.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ou(t):n===3?new Jt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qi(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=oy.exec(e))?new Jt(t[1],t[2],t[3],1):(t=ly.exec(e))?new Jt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=cy.exec(e))?Qi(t[1],t[2],t[3],t[4]):(t=uy.exec(e))?Qi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hy.exec(e))?Cu(t[1],t[2]/100,t[3]/100,1):(t=dy.exec(e))?Cu(t[1],t[2]/100,t[3]/100,t[4]):Su.hasOwnProperty(e)?Ou(Su[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function Ou(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function Qi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Jt(e,t,n,r)}function gy(e){return e instanceof Nr||(e=Fe(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function eo(e,t,n,r){return arguments.length===1?gy(e):new Jt(e,t,n,r??1)}function Jt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}to(Jt,eo,Eu(Nr,{brighter(e){return e=e==null?Ki:Math.pow(Ki,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ur:Math.pow(Ur,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(_n(this.r),_n(this.g),_n(this.b),Ji(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:Tu,formatHex:Tu,formatHex8:my,formatRgb:Mu,toString:Mu}));function Tu(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}`}function my(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}${wn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mu(){const e=Ji(this.opacity);return`${e===1?"rgb(":"rgba("}${_n(this.r)}, ${_n(this.g)}, ${_n(this.b)}${e===1?")":`, ${e})`}`}function Ji(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _n(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wn(e){return e=_n(e),(e<16?"0":"")+e.toString(16)}function Cu(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ee(e,t,n,r)}function Au(e){if(e instanceof Ee)return new Ee(e.h,e.s,e.l,e.opacity);if(e instanceof Nr||(e=Fe(e)),!e)return new Ee;if(e instanceof Ee)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 Ee(a,o,l,e.opacity)}function no(e,t,n,r){return arguments.length===1?Au(e):new Ee(e,t,n,r??1)}function Ee(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}to(Ee,no,Eu(Nr,{brighter(e){return e=e==null?Ki:Math.pow(Ki,e),new Ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ur:Math.pow(Ur,e),new Ee(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 Jt(ro(e>=240?e-240:e+120,i,r),ro(e,i,r),ro(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ee(Du(this.h),ts(this.s),ts(this.l),Ji(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=Ji(this.opacity);return`${e===1?"hsl(":"hsla("}${Du(this.h)}, ${ts(this.s)*100}%, ${ts(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Du(e){return e=(e||0)%360,e<0?e+360:e}function ts(e){return Math.max(0,Math.min(1,e||0))}function ro(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 io=e=>()=>e;function vy(e,t){return function(n){return e+n*t}}function yy(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 xy(e){return(e=+e)==1?Lu:function(t,n){return n-t?yy(t,n,e):io(isNaN(t)?n:t)}}function Lu(e,t){var n=t-e;return n?vy(e,n):io(isNaN(e)?t:e)}const es=function e(t){var n=xy(t);function r(i,s){var a=n((i=eo(i)).r,(s=eo(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Lu(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 by(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 Ey(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Sy(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]=Vr(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 _y(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ae(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function wy(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]=Vr(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var so=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ao=new RegExp(so.source,"g");function Oy(e){return function(){return e}}function Ty(e){return function(t){return e(t)+""}}function Ru(e,t){var n=so.lastIndex=ao.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=so.exec(e))&&(i=ao.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:ae(r,i)})),n=ao.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?Ty(l[0].x):Oy(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Vr(e,t){var n=typeof t,r;return t==null||n==="boolean"?io(t):(n==="number"?ae:n==="string"?(r=Fe(t))?(t=r,es):Ru:t instanceof Fe?es:t instanceof Date?_y:Ey(t)?by:Array.isArray(t)?Sy:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?wy:ae)(e,t)}function Iu(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var ku=180/Math.PI,oo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $u(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)*ku,skewX:Math.atan(l)*ku,scaleX:a,scaleY:o}}var ns;function My(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oo:$u(t.a,t.b,t.c,t.d,t.e,t.f)}function Cy(e){return e==null||(ns||(ns=document.createElementNS("http://www.w3.org/2000/svg","g")),ns.setAttribute("transform",e),!(e=ns.transform.baseVal.consolidate()))?oo:(e=e.matrix,$u(e.a,e.b,e.c,e.d,e.e,e.f))}function Pu(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x:ae(c,d)},{i:g-2,x:ae(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:ae(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:ae(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push(i(f)+"scale(",null,",",null,")");p.push({i:g-4,x:ae(c,d)},{i:g-2,x:ae(u,h)})}else(d!==1||h!==1)&&f.push(i(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,g=h.length,v;++p<g;)d[(v=h[p]).i]=v.x(f);return d.join("")}}}var Ay=Pu(My,"px, ","px)","deg)"),Dy=Pu(Cy,", ",")",")");function Ly(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var Zn=0,Gr=0,Hr=0,Nu=1e3,rs,Fr,is=0,On=0,ss=0,zr=typeof performance=="object"&&performance.now?performance:Date,Uu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function lo(){return On||(Uu(Ry),On=zr.now()+ss)}function Ry(){On=0}function as(){this._call=this._time=this._next=null}as.prototype=Bu.prototype={constructor:as,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?lo():+n)+(t==null?0:+t),!this._next&&Fr!==this&&(Fr?Fr._next=this:rs=this,Fr=this),this._call=e,this._time=n,co()},stop:function(){this._call&&(this._call=null,this._time=1/0,co())}};function Bu(e,t,n){var r=new as;return r.restart(e,t,n),r}function Iy(){lo(),++Zn;for(var e=rs,t;e;)(t=On-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zn}function Vu(){On=(is=zr.now())+ss,Zn=Gr=0;try{Iy()}finally{Zn=0,$y(),On=0}}function ky(){var e=zr.now(),t=e-is;t>Nu&&(ss-=t,is=e)}function $y(){for(var e,t=rs,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:rs=n);Fr=e,co(r)}function co(e){if(!Zn){Gr&&(Gr=clearTimeout(Gr));var t=e-On;t>24?(e<1/0&&(Gr=setTimeout(Vu,e-zr.now()-ss)),Hr&&(Hr=clearInterval(Hr))):(Hr||(is=zr.now(),Hr=setInterval(ky,Nu)),Zn=1,Uu(Vu))}}function Gu(e,t,n){var r=new as;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Py=Xa("start","end","cancel","interrupt"),Ny=[],Hu=0,Fu=1,uo=2,os=3,zu=4,ho=5,ls=6;function cs(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Uy(e,n,{name:t,index:r,group:i,on:Py,tween:Ny,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Hu})}function fo(e,t){var n=Se(e,t);if(n.state>Hu)throw new Error("too late; already scheduled");return n}function Ie(e,t){var n=Se(e,t);if(n.state>os)throw new Error("too late; already running");return n}function Se(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Uy(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bu(s,0,n.time);function s(c){n.state=Fu,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,f;if(n.state!==Fu)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===os)return Gu(a);f.state===zu?(f.state=ls,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=ls,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Gu(function(){n.state===os&&(n.state=zu,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=uo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===uo){for(n.state=os,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=f);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=ho,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===ho&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ls,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function po(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>uo&&r.state<ho,r.state=ls,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function By(e){return this.each(function(){po(this,e)})}function Vy(e,t){var n,r;return function(){var i=Ie(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 Gy(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Ie(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 Hy(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Se(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?Vy:Gy)(n,e,t))}function go(e,t,n){var r=e._id;return e.each(function(){var i=Ie(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Se(i,r).value[t]}}function Wu(e,t){var n;return(typeof t=="number"?ae:t instanceof Fe?es:(n=Fe(t))?(t=n,es):Ru)(e,t)}function Fy(e){return function(){this.removeAttribute(e)}}function zy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Wy(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 Yy(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 qy(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 Xy(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 jy(e,t){var n=ji(e),r=n==="transform"?Dy:Wu;return this.attrTween(e,typeof t=="function"?(n.local?Xy:qy)(n,r,go(this,"attr."+e,t)):t==null?(n.local?zy:Fy)(n):(n.local?Yy:Wy)(n,r,t))}function Zy(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ky(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Qy(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Ky(e,s)),n}return i._value=t,i}function Jy(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Zy(e,s)),n}return i._value=t,i}function t1(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=ji(e);return this.tween(n,(r.local?Qy:Jy)(r,t))}function e1(e,t){return function(){fo(this,e).delay=+t.apply(this,arguments)}}function n1(e,t){return t=+t,function(){fo(this,e).delay=t}}function r1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?e1:n1)(t,e)):Se(this.node(),t).delay}function i1(e,t){return function(){Ie(this,e).duration=+t.apply(this,arguments)}}function s1(e,t){return t=+t,function(){Ie(this,e).duration=t}}function a1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?i1:s1)(t,e)):Se(this.node(),t).duration}function o1(e,t){if(typeof t!="function")throw new Error;return function(){Ie(this,e).ease=t}}function l1(e){var t=this._id;return arguments.length?this.each(o1(t,e)):Se(this.node(),t).ease}function c1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ie(this,e).ease=n}}function u1(e){if(typeof e!="function")throw new Error;return this.each(c1(this._id,e))}function h1(e){typeof e!="function"&&(e=hu(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 ze(r,this._parents,this._name,this._id)}function d1(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<r;++o)a[o]=t[o];return new ze(a,this._parents,this._name,this._id)}function f1(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 p1(e,t,n){var r,i,s=f1(t)?fo:Ie;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function g1(e,t){var n=this._id;return arguments.length<2?Se(this.node(),n).on.on(e):this.each(p1(n,e,t))}function m1(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function v1(){return this.on("end.remove",m1(this._id))}function y1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Za(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,cs(c[h],t,n,h,c,Se(u,n)));return new ze(s,this._parents,t,n)}function x1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=uu(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=Se(u,n),g=0,v=h.length;g<v;++g)(f=h[g])&&cs(f,t,n,g,h,p);s.push(h),a.push(u)}return new ze(s,a,t,n)}var b1=Pr.prototype.constructor;function E1(){return new b1(this._groups,this._parents)}function S1(e,t){var n,r,i;return function(){var s=Xn(this,e),a=(this.style.removeProperty(e),Xn(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Yu(e){return function(){this.style.removeProperty(e)}}function _1(e,t,n){var r,i=n+"",s;return function(){var a=Xn(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function w1(e,t,n){var r,i,s;return function(){var a=Xn(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Xn(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function O1(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=Ie(this,e),c=l.on,u=l.value[s]==null?o||(o=Yu(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function T1(e,t,n){var r=(e+="")=="transform"?Ay:Wu;return t==null?this.styleTween(e,S1(e,r)).on("end.style."+e,Yu(e)):typeof t=="function"?this.styleTween(e,w1(e,r,go(this,"style."+e,t))).each(O1(this._id,e)):this.styleTween(e,_1(e,r,t),n).on("end.style."+e,null)}function M1(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function C1(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&M1(e,a,n)),r}return s._value=t,s}function A1(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,C1(e,t,n??""))}function D1(e){return function(){this.textContent=e}}function L1(e){return function(){var t=e(this);this.textContent=t??""}}function R1(e){return this.tween("text",typeof e=="function"?L1(go(this,"text",e)):D1(e==null?"":e+""))}function I1(e){return function(t){this.textContent=e.call(this,t)}}function k1(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&I1(i)),t}return r._value=e,r}function $1(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,k1(e))}function P1(){for(var e=this._name,t=this._id,n=qu(),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=Se(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 ze(r,this._parents,e,n)}function N1(){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=Ie(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 U1=0;function ze(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qu(){return++U1}var We=Pr.prototype;ze.prototype={constructor:ze,select:y1,selectAll:x1,selectChild:We.selectChild,selectChildren:We.selectChildren,filter:h1,merge:d1,selection:E1,transition:P1,call:We.call,nodes:We.nodes,node:We.node,size:We.size,empty:We.empty,each:We.each,on:g1,attr:jy,attrTween:t1,style:T1,styleTween:A1,text:R1,textTween:$1,remove:v1,tween:Hy,delay:r1,duration:a1,ease:l1,easeVarying:u1,end:N1,[Symbol.iterator]:We[Symbol.iterator]};const B1=e=>+e;function Xu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var V1={time:null,delay:0,duration:250,ease:Xu};function G1(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 H1(e){var t,n;e instanceof ze?(t=e._id,e=e._name):(t=qu(),(n=V1).time=lo(),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||G1(l,t));return new ze(r,this._parents,e,t)}Pr.prototype.interrupt=By,Pr.prototype.transition=H1;const mo=e=>()=>e;function F1(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 z1(e){e.stopImmediatePropagation()}function vo(e){e.preventDefault(),e.stopImmediatePropagation()}var ju={name:"drag"},yo={name:"space"},Kn={name:"handle"},Qn={name:"center"};const{abs:Zu,max:Ft,min:zt}=Math;function Ku(e){return[+e[0],+e[1]]}function Qu(e){return[Ku(e[0]),Ku(e[1])]}var us={name:"x",handles:["w","e"].map(hs),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]]}},xo={name:"y",handles:["n","s"].map(hs),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]]}},Ye={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"},Ju={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},th={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},W1={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Y1={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function hs(e){return{type:e}}function q1(e){return!e.ctrlKey&&!e.button}function X1(){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 j1(){return navigator.maxTouchPoints||"ontouchstart"in this}function bo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function Z1(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function eh(){return K1(us)}function K1(e){var t=X1,n=q1,r=j1,i=!0,s=Xa("start","brush","end"),a=6,o;function l(v){var m=v.property("__brush",g).selectAll(".overlay").data([hs("overlay")]);m.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Ye.overlay).merge(m).each(function(){var b=bo(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])}),v.selectAll(".selection").data([hs("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Ye.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=v.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 Ye[b.type]}),v.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).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(v,m,y){v.tween?v.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,M=e.input(typeof m=="function"?m.apply(this,arguments):m,S.extent),C=Vr(E,M);function G(I){S.selection=I===1&&M===null?null:C(I),c.call(b),_.brush()}return E!==null&&M!==null?G:G(1)}):v.each(function(){var b=this,S=arguments,_=b.__brush,E=e.input(typeof m=="function"?m.apply(b,S):m,_.extent),M=u(b,S).beforestart();po(b),_.selection=E===null?null:E,c.call(b),M.start(y).brush(y).end(y)})},l.clear=function(v,m){l.move(v,null,m)};function c(){var v=D(this),m=bo(this).selection;m?(v.selectAll(".selection").style("display",null).attr("x",m[0][0]).attr("y",m[0][1]).attr("width",m[1][0]-m[0][0]).attr("height",m[1][1]-m[0][1]),v.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?m[1][0]-a/2:m[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?m[1][1]-a/2:m[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?m[1][0]-m[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.type==="w"?m[1][1]-m[0][1]+a:a})):v.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(v,m,y){var b=v.__brush.emitter;return b&&(!y||!b.clean)?b:new d(v,m,y)}function d(v,m,y){this.that=v,this.args=m,this.state=v.__brush,this.active=0,this.clean=y}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(v,m){return this.starting?(this.starting=!1,this.emit("start",v,m)):this.emit("brush",v),this},brush:function(v,m){return this.emit("brush",v,m),this},end:function(v,m){return--this.active===0&&(delete this.state.emitter,this.emit("end",v,m)),this},emit:function(v,m,y){var b=D(this.that).datum();s.call(v,this.that,new F1(v,{sourceEvent:m,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),b)}};function h(v){if(o&&!v.touches||!n.apply(this,arguments))return;var m=this,y=v.target.__data__.type,b=(i&&v.metaKey?y="overlay":y)==="selection"?ju:i&&v.altKey?Qn:Kn,S=e===xo?null:W1[y],_=e===us?null:Y1[y],E=bo(m),M=E.extent,C=E.selection,G=M[0][0],I,T,L=M[0][1],R,k,O=M[1][0],U,P,N=M[1][1],B,Y,X=0,J=0,ct,W=S&&_&&i&&v.shiftKey,K,ut,rt=Array.from(v.touches||[v],et=>{const Rt=et.identifier;return et=Sn(et,m),et.point0=et.slice(),et.identifier=Rt,et});po(m);var Tt=u(m,arguments,!0).beforestart();if(y==="overlay"){C&&(ct=!0);const et=[rt[0],rt[1]||rt[0]];E.selection=C=[[I=e===xo?G:zt(et[0][0],et[1][0]),R=e===us?L:zt(et[0][1],et[1][1])],[U=e===xo?O:Ft(et[0][0],et[1][0]),B=e===us?N:Ft(et[0][1],et[1][1])]],rt.length>1&&pt(v)}else I=C[0][0],R=C[0][1],U=C[1][0],B=C[1][1];T=I,k=R,P=U,Y=B;var q=D(m).attr("pointer-events","none"),V=q.selectAll(".overlay").attr("cursor",Ye[y]);if(v.touches)Tt.moved=$,Tt.ended=yt;else{var H=D(v.view).on("mousemove.brush",$,!0).on("mouseup.brush",yt,!0);i&&H.on("keydown.brush",Kt,!0).on("keyup.brush",Qt,!0),iy(v.view)}c.call(m),Tt.start(v,b.name);function $(et){for(const Rt of et.changedTouches||[et])for(const Hi of rt)Hi.identifier===Rt.identifier&&(Hi.cur=Sn(Rt,m));if(W&&!K&&!ut&&rt.length===1){const Rt=rt[0];Zu(Rt.cur[0]-Rt[0])>Zu(Rt.cur[1]-Rt[1])?ut=!0:K=!0}for(const Rt of rt)Rt.cur&&(Rt[0]=Rt.cur[0],Rt[1]=Rt.cur[1]);ct=!0,vo(et),pt(et)}function pt(et){const Rt=rt[0],Hi=Rt.point0;var xn;switch(X=Rt[0]-Hi[0],J=Rt[1]-Hi[1],b){case yo:case ju:{S&&(X=Ft(G-I,zt(O-U,X)),T=I+X,P=U+X),_&&(J=Ft(L-R,zt(N-B,J)),k=R+J,Y=B+J);break}case Kn:{rt[1]?(S&&(T=Ft(G,zt(O,rt[0][0])),P=Ft(G,zt(O,rt[1][0])),S=1),_&&(k=Ft(L,zt(N,rt[0][1])),Y=Ft(L,zt(N,rt[1][1])),_=1)):(S<0?(X=Ft(G-I,zt(O-I,X)),T=I+X,P=U):S>0&&(X=Ft(G-U,zt(O-U,X)),T=I,P=U+X),_<0?(J=Ft(L-R,zt(N-R,J)),k=R+J,Y=B):_>0&&(J=Ft(L-B,zt(N-B,J)),k=R,Y=B+J));break}case Qn:{S&&(T=Ft(G,zt(O,I-X*S)),P=Ft(G,zt(O,U+X*S))),_&&(k=Ft(L,zt(N,R-J*_)),Y=Ft(L,zt(N,B+J*_)));break}}P<T&&(S*=-1,xn=I,I=U,U=xn,xn=T,T=P,P=xn,y in Ju&&V.attr("cursor",Ye[y=Ju[y]])),Y<k&&(_*=-1,xn=R,R=B,B=xn,xn=k,k=Y,Y=xn,y in th&&V.attr("cursor",Ye[y=th[y]])),E.selection&&(C=E.selection),K&&(T=C[0][0],P=C[1][0]),ut&&(k=C[0][1],Y=C[1][1]),(C[0][0]!==T||C[0][1]!==k||C[1][0]!==P||C[1][1]!==Y)&&(E.selection=[[T,k],[P,Y]],c.call(m),Tt.brush(et,b.name))}function yt(et){if(z1(et),et.touches){if(et.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else sy(et.view,ct),H.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),V.attr("cursor",Ye.overlay),E.selection&&(C=E.selection),Z1(C)&&(E.selection=null,c.call(m)),Tt.end(et,b.name)}function Kt(et){switch(et.keyCode){case 16:{W=S&&_;break}case 18:{b===Kn&&(S&&(U=P-X*S,I=T+X*S),_&&(B=Y-J*_,R=k+J*_),b=Qn,pt(et));break}case 32:{(b===Kn||b===Qn)&&(S<0?U=P-X:S>0&&(I=T-X),_<0?B=Y-J:_>0&&(R=k-J),b=yo,V.attr("cursor",Ye.selection),pt(et));break}default:return}vo(et)}function Qt(et){switch(et.keyCode){case 16:{W&&(K=ut=W=!1,pt(et));break}case 18:{b===Qn&&(S<0?U=P:S>0&&(I=T),_<0?B=Y:_>0&&(R=k),b=Kn,pt(et));break}case 32:{b===yo&&(et.altKey?(S&&(U=P-X*S,I=T+X*S),_&&(B=Y-J*_,R=k+J*_),b=Qn):(S<0?U=P:S>0&&(I=T),_<0?B=Y:_>0&&(R=k),b=Kn),V.attr("cursor",Ye[y]),pt(et));break}default:return}vo(et)}}function f(v){u(this,arguments).moved(v)}function p(v){u(this,arguments).ended(v)}function g(){var v=this.__brush||{selection:null};return v.extent=Qu(t.apply(this,arguments)),v.dim=e,v}return l.extent=function(v){return arguments.length?(t=typeof v=="function"?v:mo(Qu(v)),l):t},l.filter=function(v){return arguments.length?(n=typeof v=="function"?v:mo(!!v),l):n},l.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:mo(!!v),l):r},l.handleSize=function(v){return arguments.length?(a=+v,l):a},l.keyModifiers=function(v){return arguments.length?(i=!!v,l):i},l.on=function(){var v=s.on.apply(s,arguments);return v===s?l:v},l}const Eo=Math.PI,So=2*Eo,Tn=1e-6,Q1=So-Tn;function nh(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function J1(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nh;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 tx=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nh:J1(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,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Tn)if(!(Math.abs(d*l-c*u)>Tn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,g=l*l+c*c,v=f*f+p*p,m=Math.sqrt(g),y=Math.sqrt(h),b=s*Math.tan((Eo-Math.acos((g+h-v)/(2*m*y)))/2),S=b/y,_=b/m;Math.abs(S-1)>Tn&&this._append`L${t+S*u},${n+S*d}`,this._append`A${s},${s},0,0,${+(d*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,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Tn||Math.abs(this._y1-u)>Tn)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%So+So),h>Q1?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>Tn&&this._append`A${r},${r},0,${+(h>=Eo)},${d},${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 ex(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ds(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 Jn(e){return e=ds(Math.abs(e)),e?e[1]:NaN}function nx(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 rx(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var ix=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Wr(e){if(!(t=ix.exec(e)))throw new Error("invalid format: "+e);var t;return new _o({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]})}Wr.prototype=_o.prototype;function _o(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+""}_o.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 sx(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 rh;function ax(e,t){var n=ds(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(rh=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")+ds(e,Math.max(0,t+s-1))[0]}function ih(e,t){var n=ds(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 sh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ex,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)=>ih(e*100,t),r:ih,s:ax,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ah(e){return e}var oh=Array.prototype.map,lh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ox(e){var t=e.grouping===void 0||e.thousands===void 0?ah:nx(oh.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?ah:rx(oh.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(d){d=Wr(d);var h=d.fill,f=d.align,p=d.sign,g=d.symbol,v=d.zero,m=d.width,y=d.comma,b=d.precision,S=d.trim,_=d.type;_==="n"?(y=!0,_="g"):sh[_]||(b===void 0&&(b=12),S=!0,_="g"),(v||h==="0"&&f==="=")&&(v=!0,h="0",f="=");var E=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",M=g==="$"?r:/[%p]/.test(_)?a:"",C=sh[_],G=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function I(T){var L=E,R=M,k,O,U;if(_==="c")R=C(T)+R,T="";else{T=+T;var P=T<0||1/T<0;if(T=isNaN(T)?l:C(Math.abs(T),b),S&&(T=sx(T)),P&&+T==0&&p!=="+"&&(P=!1),L=(P?p==="("?p:o:p==="-"||p==="("?"":p)+L,R=(_==="s"?lh[8+rh/3]:"")+R+(P&&p==="("?")":""),G){for(k=-1,O=T.length;++k<O;)if(U=T.charCodeAt(k),48>U||U>57){R=(U===46?i+T.slice(k+1):T.slice(k))+R,T=T.slice(0,k);break}}}y&&!v&&(T=t(T,1/0));var N=L.length+T.length+R.length,B=N<m?new Array(m-N+1).join(h):"";switch(y&&v&&(T=t(B+T,B.length?m-R.length:1/0),B=""),f){case"<":T=L+T+R+B;break;case"=":T=L+B+T+R;break;case"^":T=B.slice(0,N=B.length>>1)+L+T+R+B.slice(N);break;default:T=B+L+T+R;break}return s(T)}return I.toString=function(){return d+""},I}function u(d,h){var f=c((d=Wr(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(Jn(h)/3)))*3,g=Math.pow(10,-p),v=lh[8+p/3];return function(m){return f(g*m)+v}}return{format:c,formatPrefix:u}}var fs,wo,ch;lx({thousands:",",grouping:[3],currency:["$",""]});function lx(e){return fs=ox(e),wo=fs.format,ch=fs.formatPrefix,fs}function cx(e){return Math.max(0,-Jn(Math.abs(e)))}function ux(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jn(t)/3)))*3-Jn(Math.abs(e)))}function hx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jn(t)-Jn(e))+1}var gt=1e-6,uh=1e-12,ot=Math.PI,te=ot/2,hh=ot/4,oe=ot*2,Xt=180/ot,Dt=ot/180,mt=Math.abs,dh=Math.atan,Mn=Math.atan2,xt=Math.cos,dx=Math.exp,fx=Math.log,ft=Math.sin,un=Math.sign||function(e){return e>0?1:e<0?-1:0},_e=Math.sqrt,px=Math.tan;function gx(e){return e>1?0:e<-1?ot:Math.acos(e)}function qe(e){return e>1?te:e<-1?-te:Math.asin(e)}function fe(){}function ps(e,t){e&&ph.hasOwnProperty(e.type)&&ph[e.type](e,t)}var fh={Feature:function(e,t){ps(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)ps(n[r].geometry,t)}},ph={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){Oo(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Oo(n[r],t,0)},Polygon:function(e,t){gh(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)gh(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)ps(n[r],t)}};function Oo(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 gh(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Oo(e[n],t,1);t.polygonEnd()}function tr(e,t){e&&fh.hasOwnProperty(e.type)?fh[e.type](e,t):ps(e,t)}function To(e){return[Mn(e[1],e[0]),qe(e[2])]}function er(e){var t=e[0],n=e[1],r=xt(n);return[r*xt(t),r*ft(t),ft(n)]}function gs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ms(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 Mo(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function vs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Co(e){var t=_e(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Ao(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 Do(e,t){return mt(e)>ot&&(e-=Math.round(e/oe)*oe),[e,t]}Do.invert=Do;function mh(e,t,n){return(e%=oe)?t||n?Ao(yh(e),xh(t,n)):yh(e):t||n?xh(t,n):Do}function vh(e){return function(t,n){return t+=e,mt(t)>ot&&(t-=Math.round(t/oe)*oe),[t,n]}}function yh(e){var t=vh(e);return t.invert=vh(-e),t}function xh(e,t){var n=xt(e),r=ft(e),i=xt(t),s=ft(t);function a(o,l){var c=xt(l),u=xt(o)*c,d=ft(o)*c,h=ft(l),f=h*n+u*r;return[Mn(d*i-f*s,u*n-h*r),qe(f*i+d*s)]}return a.invert=function(o,l){var c=xt(l),u=xt(o)*c,d=ft(o)*c,h=ft(l),f=h*i-d*s;return[Mn(d*i+h*s,u*n+f*r),qe(f*n-u*r)]},a}function mx(e){e=mh(e[0]*Dt,e[1]*Dt,e.length>2?e[2]*Dt:0);function t(n){return n=e(n[0]*Dt,n[1]*Dt),n[0]*=Xt,n[1]*=Xt,n}return t.invert=function(n){return n=e.invert(n[0]*Dt,n[1]*Dt),n[0]*=Xt,n[1]*=Xt,n},t}function vx(e,t,n,r,i,s){if(n){var a=xt(t),o=ft(t),l=r*n;i==null?(i=t+r*oe,s=t-l/2):(i=bh(a,i),s=bh(a,s),(r>0?i<s:i>s)&&(i+=r*oe));for(var c,u=i;r>0?u>s:u<s;u-=l)c=To([a,-o*xt(u),-o*ft(u)]),e.point(c[0],c[1])}}function bh(e,t){t=er(t),t[0]-=e,Co(t);var n=gx(-t[1]);return((-t[2]<0?-n:n)+oe-gt)%oe}function Eh(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:fe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ys(e,t){return mt(e[0]-t[0])<gt&&mt(e[1]-t[1])<gt}function xs(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 Sh(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,v=p[0],m=p[g],y;if(ys(v,m)){if(!v[2]&&!m[2]){for(i.lineStart(),o=0;o<g;++o)i.point((v=p[o])[0],v[1]);i.lineEnd();return}m[0]+=2*gt}s.push(y=new xs(v,p,null,!0)),a.push(y.o=new xs(v,null,y,!1)),s.push(y=new xs(m,p,null,!1)),a.push(y.o=new xs(m,null,y,!0))}}),!!s.length){for(a.sort(t),_h(s),_h(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,f=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,f=!f}while(!h.v);i.lineEnd()}}}function _h(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 Lo(e){return mt(e[0])<=ot?e[0]:un(e[0])*((mt(e[0])+ot)%oe-ot)}function yx(e,t){var n=Lo(t),r=t[1],i=ft(r),s=[ft(n),-xt(n),0],a=0,o=0,l=new bn;i===1?r=te+gt:i===-1&&(r=-te-gt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],p=Lo(f),g=f[1]/2+hh,v=ft(g),m=xt(g),y=0;y<h;++y,p=S,v=E,m=M,f=b){var b=d[y],S=Lo(b),_=b[1]/2+hh,E=ft(_),M=xt(_),C=S-p,G=C>=0?1:-1,I=G*C,T=I>ot,L=v*E;if(l.add(Mn(L*G*ft(I),m*M+L*xt(I))),a+=T?C+G*oe:C,T^p>=n^S>=n){var R=ms(er(f),er(b));Co(R);var k=ms(s,R);Co(k);var O=(T^C>=0?-1:1)*qe(k[2]);(r>O||r===O&&(R[0]||R[1]))&&(o+=T^C>=0?1:-1)}}return(a<-gt||a<gt&&l<-uh)^o&1}function wh(e,t,n,r){return function(i){var s=t(i),a=Eh(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:g,lineEnd:v,polygonStart:function(){h.point=m,h.lineStart=y,h.lineEnd=b,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=g,h.lineEnd=v,u=iu(u);var S=yx(c,r);u.length?(l||(i.polygonStart(),l=!0),Sh(u,bx,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 g(){h.point=p,s.lineStart()}function v(){h.point=f,s.lineEnd()}function m(S,_){d.push([S,_]),o.point(S,_)}function y(){o.lineStart(),d=[]}function b(){m(d[0][0],d[0][1]),o.lineEnd();var S=o.clean(),_=a.result(),E,M=_.length,C,G,I;if(d.pop(),c.push(d),d=null,!!M){if(S&1){if(G=_[0],(C=G.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),E=0;E<C;++E)i.point((I=G[E])[0],I[1]);i.lineEnd()}return}M>1&&S&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(xx))}}return h}}function xx(e){return e.length>1}function bx(e,t){return((e=e.x)[0]<0?e[1]-te-gt:te-e[1])-((t=t.x)[0]<0?t[1]-te-gt:te-t[1])}const Oh=wh(function(){return!0},Ex,_x,[-ot,-te]);function Ex(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?ot:-ot,l=mt(s-t);mt(l-ot)<gt?(e.point(t,n=(n+a)/2>0?te:-te),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=ot&&(mt(t-r)<gt&&(t-=r*gt),mt(s-o)<gt&&(s-=o*gt),n=Sx(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 Sx(e,t,n,r){var i,s,a=ft(e-n);return mt(a)>gt?dh((ft(t)*(s=xt(r))*ft(n)-ft(r)*(i=xt(t))*ft(e))/(i*s*a)):(t+r)/2}function _x(e,t,n,r){var i;if(e==null)i=n*te,r.point(-ot,i),r.point(0,i),r.point(ot,i),r.point(ot,0),r.point(ot,-i),r.point(0,-i),r.point(-ot,-i),r.point(-ot,0),r.point(-ot,i);else if(mt(e[0]-t[0])>gt){var s=e[0]<t[0]?ot:-ot;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function wx(e){var t=xt(e),n=6*Dt,r=t>0,i=mt(t)>gt;function s(u,d,h,f){vx(f,e,n,h,u,d)}function a(u,d){return xt(u)*xt(d)>t}function o(u){var d,h,f,p,g;return{lineStart:function(){p=f=!1,g=1},point:function(v,m){var y=[v,m],b,S=a(v,m),_=r?S?0:c(v,m):S?c(v+(v<0?ot:-ot),m):0;if(!d&&(p=f=S)&&u.lineStart(),S!==f&&(b=l(d,y),(!b||ys(d,b)||ys(y,b))&&(y[2]=1)),S!==f)g=0,S?(u.lineStart(),b=l(y,d),u.point(b[0],b[1])):(b=l(d,y),u.point(b[0],b[1],2),u.lineEnd()),d=b;else if(i&&d&&r^S){var E;!(_&h)&&(E=l(y,d,!0))&&(g=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&&(!d||!ys(d,y))&&u.point(y[0],y[1]),d=y,f=S,h=_},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return g|(p&&f)<<1}}}function l(u,d,h){var f=er(u),p=er(d),g=[1,0,0],v=ms(f,p),m=gs(v,v),y=v[0],b=m-y*y;if(!b)return!h&&u;var S=t*m/b,_=-t*y/b,E=ms(g,v),M=vs(g,S),C=vs(v,_);Mo(M,C);var G=E,I=gs(M,G),T=gs(G,G),L=I*I-T*(gs(M,M)-1);if(!(L<0)){var R=_e(L),k=vs(G,(-I-R)/T);if(Mo(k,M),k=To(k),!h)return k;var O=u[0],U=d[0],P=u[1],N=d[1],B;U<O&&(B=O,O=U,U=B);var Y=U-O,X=mt(Y-ot)<gt,J=X||Y<gt;if(!X&&N<P&&(B=P,P=N,N=B),J?X?P+N>0^k[1]<(mt(k[0]-O)<gt?P:N):P<=k[1]&&k[1]<=N:Y>ot^(O<=k[0]&&k[0]<=U)){var ct=vs(G,(-I+R)/T);return Mo(ct,M),[k,To(ct)]}}}function c(u,d){var h=r?e:ot-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return wh(a,o,s,r?[0,-e]:[-ot,e-ot])}function Ox(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,f=c-o,p;if(p=n-a,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>u&&(u=p)}if(p=i-a,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<d&&(d=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<d&&(d=p)}else if(f>0){if(p>d)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>d)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<d&&(d=p)}return u>0&&(e[0]=a+u*h,e[1]=o+u*f),d<1&&(t[0]=a+d*h,t[1]=o+d*f),!0}}}}}var Yr=1e9,bs=-Yr;function Tx(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var f=0,p=0;if(c==null||(f=a(c,d))!==(p=a(u,d))||l(c,u)<0^d>0)do h.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+d+4)%4)!==p);else h.point(u[0],u[1])}function a(c,u){return mt(c[0]-e)<gt?u>0?0:3:mt(c[0]-n)<gt?u>0?2:1:mt(c[1]-t)<gt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=Eh(),h,f,p,g,v,m,y,b,S,_,E,M={point:C,lineStart:L,lineEnd:R,polygonStart:I,polygonEnd:T};function C(O,U){i(O,U)&&u.point(O,U)}function G(){for(var O=0,U=0,P=f.length;U<P;++U)for(var N=f[U],B=1,Y=N.length,X=N[0],J,ct,W=X[0],K=X[1];B<Y;++B)J=W,ct=K,X=N[B],W=X[0],K=X[1],ct<=r?K>r&&(W-J)*(r-ct)>(K-ct)*(e-J)&&++O:K<=r&&(W-J)*(r-ct)<(K-ct)*(e-J)&&--O;return O}function I(){u=d,h=[],f=[],E=!0}function T(){var O=G(),U=E&&O,P=(h=iu(h)).length;(U||P)&&(c.polygonStart(),U&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),P&&Sh(h,o,O,s,c),c.polygonEnd()),u=c,h=f=p=null}function L(){M.point=k,f&&f.push(p=[]),_=!0,S=!1,y=b=NaN}function R(){h&&(k(g,v),m&&S&&d.rejoin(),h.push(d.result())),M.point=C,S&&u.lineEnd()}function k(O,U){var P=i(O,U);if(f&&p.push([O,U]),_)g=O,v=U,m=P,_=!1,P&&(u.lineStart(),u.point(O,U));else if(P&&S)u.point(O,U);else{var N=[y=Math.max(bs,Math.min(Yr,y)),b=Math.max(bs,Math.min(Yr,b))],B=[O=Math.max(bs,Math.min(Yr,O)),U=Math.max(bs,Math.min(Yr,U))];Ox(N,B,e,t,n,r)?(S||(u.lineStart(),u.point(N[0],N[1])),u.point(B[0],B[1]),P||u.lineEnd(),E=!1):P&&(u.lineStart(),u.point(O,U),E=!1)}y=O,b=U,S=P}return M}}const Ro=e=>e;var Io=new bn,ko=new bn,Th,Mh,$o,Po,hn={point:fe,lineStart:fe,lineEnd:fe,polygonStart:function(){hn.lineStart=Mx,hn.lineEnd=Ax},polygonEnd:function(){hn.lineStart=hn.lineEnd=hn.point=fe,Io.add(mt(ko)),ko=new bn},result:function(){var e=Io/2;return Io=new bn,e}};function Mx(){hn.point=Cx}function Cx(e,t){hn.point=Ch,Th=$o=e,Mh=Po=t}function Ch(e,t){ko.add(Po*e-$o*t),$o=e,Po=t}function Ax(){Ch(Th,Mh)}const Ah=hn;var nr=1/0,Es=nr,qr=-nr,Ss=qr,Dx={point:Lx,lineStart:fe,lineEnd:fe,polygonStart:fe,polygonEnd:fe,result:function(){var e=[[nr,Es],[qr,Ss]];return qr=Ss=-(Es=nr=1/0),e}};function Lx(e,t){e<nr&&(nr=e),e>qr&&(qr=e),t<Es&&(Es=t),t>Ss&&(Ss=t)}const _s=Dx;var No=0,Uo=0,Xr=0,ws=0,Os=0,rr=0,Bo=0,Vo=0,jr=0,Dh,Lh,ke,$e,we={point:Cn,lineStart:Rh,lineEnd:Ih,polygonStart:function(){we.lineStart=kx,we.lineEnd=$x},polygonEnd:function(){we.point=Cn,we.lineStart=Rh,we.lineEnd=Ih},result:function(){var e=jr?[Bo/jr,Vo/jr]:rr?[ws/rr,Os/rr]:Xr?[No/Xr,Uo/Xr]:[NaN,NaN];return No=Uo=Xr=ws=Os=rr=Bo=Vo=jr=0,e}};function Cn(e,t){No+=e,Uo+=t,++Xr}function Rh(){we.point=Rx}function Rx(e,t){we.point=Ix,Cn(ke=e,$e=t)}function Ix(e,t){var n=e-ke,r=t-$e,i=_e(n*n+r*r);ws+=i*(ke+e)/2,Os+=i*($e+t)/2,rr+=i,Cn(ke=e,$e=t)}function Ih(){we.point=Cn}function kx(){we.point=Px}function $x(){kh(Dh,Lh)}function Px(e,t){we.point=kh,Cn(Dh=ke=e,Lh=$e=t)}function kh(e,t){var n=e-ke,r=t-$e,i=_e(n*n+r*r);ws+=i*(ke+e)/2,Os+=i*($e+t)/2,rr+=i,i=$e*e-ke*t,Bo+=i*(ke+e),Vo+=i*($e+t),jr+=i*3,Cn(ke=e,$e=t)}const $h=we;function Ph(e){this._context=e}Ph.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,oe);break}}},result:fe};var Go=new bn,Ho,Nh,Uh,Zr,Kr,Ts={point:fe,lineStart:function(){Ts.point=Nx},lineEnd:function(){Ho&&Bh(Nh,Uh),Ts.point=fe},polygonStart:function(){Ho=!0},polygonEnd:function(){Ho=null},result:function(){var e=+Go;return Go=new bn,e}};function Nx(e,t){Ts.point=Bh,Nh=Zr=e,Uh=Kr=t}function Bh(e,t){Zr-=e,Kr-=t,Go.add(_e(Zr*Zr+Kr*Kr)),Zr=e,Kr=t}const Vh=Ts;let Gh,Ms,Hh,Fh;class zh{constructor(t){this._append=t==null?Wh:Ux(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!==Hh||this._append!==Ms){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`,Hh=r,Ms=this._append,Fh=this._,this._=i}this._+=Fh;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Wh(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Ux(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Wh;if(t!==Gh){const n=10**t;Gh=t,Ms=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 Ms}function Bx(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),tr(o,i(s))),s.result()}return a.area=function(o){return tr(o,i(Ah)),Ah.result()},a.measure=function(o){return tr(o,i(Vh)),Vh.result()},a.bounds=function(o){return tr(o,i(_s)),_s.result()},a.centroid=function(o){return tr(o,i($h)),$h.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Ro):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new zh(n)):new Ph(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 zh(n)),a},a.projection(e).digits(n).context(t)}function Fo(e){return function(t){var n=new zo;for(var r in e)n[r]=e[r];return n.stream=t,n}}function zo(){}zo.prototype={constructor:zo,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 Wo(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),tr(n,e.stream(_s)),t(_s.result()),r!=null&&e.clipExtent(r),e}function Yh(e,t,n){return Wo(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 Vx(e,t,n){return Yh(e,[[0,0],t],n)}function Gx(e,t,n){return Wo(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 Hx(e,t,n){return Wo(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 qh=16,Fx=xt(30*Dt);function Xh(e,t){return+t?Wx(e,t):zx(e)}function zx(e){return Fo({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Wx(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,g,v){var m=c-r,y=u-i,b=m*m+y*y;if(b>4*t&&g--){var S=a+h,_=o+f,E=l+p,M=_e(S*S+_*_+E*E),C=qe(E/=M),G=mt(mt(E)-1)<gt||mt(s-d)<gt?(s+d)/2:Mn(_,S),I=e(G,C),T=I[0],L=I[1],R=T-r,k=L-i,O=y*R-m*k;(O*O/b>t||mt((m*R+y*k)/b-.5)>.3||a*h+o*f+l*p<Fx)&&(n(r,i,s,a,o,l,T,L,G,S/=M,_/=M,E,g,v),v.point(T,L),n(T,L,G,S,_,E,c,u,d,h,f,p,g,v))}}return function(r){var i,s,a,o,l,c,u,d,h,f,p,g,v={point:m,lineStart:y,lineEnd:S,polygonStart:function(){r.polygonStart(),v.lineStart=_},polygonEnd:function(){r.polygonEnd(),v.lineStart=y}};function m(C,G){C=e(C,G),r.point(C[0],C[1])}function y(){d=NaN,v.point=b,r.lineStart()}function b(C,G){var I=er([C,G]),T=e(C,G);n(d,h,u,f,p,g,d=T[0],h=T[1],u=C,f=I[0],p=I[1],g=I[2],qh,r),r.point(d,h)}function S(){v.point=m,r.lineEnd()}function _(){y(),v.point=E,v.lineEnd=M}function E(C,G){b(i=C,G),s=d,a=h,o=f,l=p,c=g,v.point=b}function M(){n(d,h,u,f,p,g,s,a,i,o,l,c,qh,r),v.lineEnd=S,S()}return v}}var Yx=Fo({point:function(e,t){this.stream.point(e*Dt,t*Dt)}});function qx(e){return Fo({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Xx(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 Xx(e,t,n,r,i);var a=xt(s),o=ft(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(g,v){return g*=r,v*=i,[l*g-c*v+t,n-c*g-l*v]}return p.invert=function(g,v){return[r*(u*g-d*v+h),i*(f-d*g-u*v)]},p}function Cs(e){return Zh(function(){return e})()}function Zh(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,f=1,p=null,g=Oh,v=null,m,y,b,S=Ro,_=.5,E,M,C,G,I;function T(O){return C(O[0]*Dt,O[1]*Dt)}function L(O){return O=C.invert(O[0],O[1]),O&&[O[0]*Xt,O[1]*Xt]}T.stream=function(O){return G&&I===O?G:G=Yx(qx(u)(g(E(S(I=O)))))},T.preclip=function(O){return arguments.length?(g=O,p=void 0,k()):g},T.postclip=function(O){return arguments.length?(S=O,v=m=y=b=null,k()):S},T.clipAngle=function(O){return arguments.length?(g=+O?wx(p=O*Dt):(p=null,Oh),k()):p*Xt},T.clipExtent=function(O){return arguments.length?(S=O==null?(v=m=y=b=null,Ro):Tx(v=+O[0][0],m=+O[0][1],y=+O[1][0],b=+O[1][1]),k()):v==null?null:[[v,m],[y,b]]},T.scale=function(O){return arguments.length?(n=+O,R()):n},T.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],R()):[r,i]},T.center=function(O){return arguments.length?(s=O[0]%360*Dt,a=O[1]%360*Dt,R()):[s*Xt,a*Xt]},T.rotate=function(O){return arguments.length?(o=O[0]%360*Dt,l=O[1]%360*Dt,c=O.length>2?O[2]%360*Dt:0,R()):[o*Xt,l*Xt,c*Xt]},T.angle=function(O){return arguments.length?(d=O%360*Dt,R()):d*Xt},T.reflectX=function(O){return arguments.length?(h=O?-1:1,R()):h<0},T.reflectY=function(O){return arguments.length?(f=O?-1:1,R()):f<0},T.precision=function(O){return arguments.length?(E=Xh(M,_=O*O),k()):_e(_)},T.fitExtent=function(O,U){return Yh(T,O,U)},T.fitSize=function(O,U){return Vx(T,O,U)},T.fitWidth=function(O,U){return Gx(T,O,U)},T.fitHeight=function(O,U){return Hx(T,O,U)};function R(){var O=jh(n,0,0,h,f,d).apply(null,t(s,a)),U=jh(n,r-O[0],i-O[1],h,f,d);return u=mh(o,l,c),M=Ao(t,U),C=Ao(u,M),E=Xh(M,_),k()}function k(){return G=I=null,T}return function(){return t=e.apply(this,arguments),T.invert=t.invert&&L,R()}}function Kh(e){var t=0,n=ot/3,r=Zh(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Dt,n=s[1]*Dt):[t*Xt,n*Xt]},i}function jx(e){var t=xt(e);function n(r,i){return[r*t,ft(i)/t]}return n.invert=function(r,i){return[r/t,qe(i*t)]},n}function Zx(e,t){var n=ft(e),r=(n+ft(t))/2;if(mt(r)<gt)return jx(e);var i=1+n*(2*r-n),s=_e(i)/r;function a(o,l){var c=_e(i-2*r*ft(l))/r;return[c*ft(o*=r),s-c*xt(o)]}return a.invert=function(o,l){var c=s-l,u=Mn(o,mt(c))*un(c);return c*r<0&&(u-=ot*un(o)*un(c)),[u/r,qe((i-(o*o+c*c)*r*r)/(2*r))]},a}function Qh(){return Kh(Zx).scale(155.424).center([0,33.6442])}function Kx(){return Qh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Yo(e,t){return[e,fx(px((te+t)/2))]}Yo.invert=function(e,t){return[e,2*dh(dx(t))-te]};function Qx(){return Jx(Yo).scale(961/oe)}function Jx(e){var t=Cs(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=ot*r(),h=t(mx(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Yo?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function As(e,t){return[e,t]}As.invert=As;function tb(){return Cs(As).scale(152.63)}function eb(e,t){var n=xt(e),r=e===t?ft(e):(n-xt(t))/(t-e),i=n/r+e;if(mt(r)<gt)return As;function s(a,o){var l=i-o,c=r*a;return[l*ft(c),i-l*xt(c)]}return s.invert=function(a,o){var l=i-o,c=Mn(a,mt(l))*un(l);return l*r<0&&(c-=ot*un(a)*un(l)),[c/r,i-un(r)*_e(a*a+l*l)]},s}function nb(){return Kh(eb).scale(131.154).center([0,13.9389])}var Qr=1.340264,Jr=-.081106,ti=893e-6,ei=.003796,Ds=_e(3)/2,rb=12;function Jh(e,t){var n=qe(Ds*ft(t)),r=n*n,i=r*r*r;return[e*xt(n)/(Ds*(Qr+3*Jr*r+i*(7*ti+9*ei*r))),n*(Qr+Jr*r+i*(ti+ei*r))]}Jh.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<rb&&(o=n*(Qr+Jr*r+i*(ti+ei*r))-t,l=Qr+3*Jr*r+i*(7*ti+9*ei*r),n-=a=o/l,r=n*n,i=r*r*r,!(mt(a)<uh));++s);return[Ds*e*(Qr+3*Jr*r+i*(7*ti+9*ei*r))/xt(n),qe(ft(n)/Ds)]};function ib(){return Cs(Jh).scale(177.158)}function td(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)))]}td.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(mt(i)>gt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function sb(){return Cs(td).scale(175.295)}function ab(e,t){return e.parent===t.parent?1:2}function ob(e){return e.reduce(lb,0)/e.length}function lb(e,t){return e+t.x}function cb(e){return 1+e.reduce(ub,0)}function ub(e,t){return Math.max(e,t.y)}function hb(e){for(var t;t=e.children;)e=t[0];return e}function db(e){for(var t;t=e.children;)e=t[t.length-1];return e}function fb(){var e=ab,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=ob(f),h.y=cb(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=hb(s),c=db(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.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 pb(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 gb(){return this.eachAfter(pb)}function mb(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function vb(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 yb(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 xb(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function bb(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 Eb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Sb(e){for(var t=this,n=_b(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 _b(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 wb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Ob(){return Array.from(this)}function Tb(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Mb(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Cb(){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 ni(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Lb)):t===void 0&&(t=Db);for(var n=new ri(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 ri(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Ib)}function Ab(){return ni(this).eachBefore(Rb)}function Db(e){return e.children}function Lb(e){return Array.isArray(e)?e[1]:null}function Rb(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ib(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ri(e){this.data=e,this.depth=this.height=0,this.parent=null}ri.prototype=ni.prototype={constructor:ri,count:gb,each:mb,eachAfter:yb,eachBefore:vb,find:xb,sum:bb,sort:Eb,path:Sb,ancestors:wb,descendants:Ob,leaves:Tb,links:Mb,copy:Ab,[Symbol.iterator]:Cb};function kb(e){return e==null?null:ed(e)}function ed(e){if(typeof e!="function")throw new Error;return e}function An(){return 0}function ir(e){return function(){return e}}const $b=1664525,Pb=1013904223,nd=4294967296;function Nb(){let e=1;return()=>(e=($b*e+Pb)%nd)/nd}function Ub(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Bb(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 Vb(e,t){for(var n=0,r=(e=Bb(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&rd(a,s)?++n:(a=Hb(i=Gb(i,s)),n=0);return a}function Gb(e,t){var n,r;if(qo(t,e))return[t];for(n=0;n<e.length;++n)if(Ls(t,e[n])&&qo(ii(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(Ls(ii(e[n],e[r]),t)&&Ls(ii(e[n],t),e[r])&&Ls(ii(e[r],t),e[n])&&qo(id(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Ls(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 rd(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 qo(e,t){for(var n=0;n<t.length;++n)if(!rd(e,t[n]))return!1;return!0}function Hb(e){switch(e.length){case 1:return Fb(e[0]);case 2:return ii(e[0],e[1]);case 3:return id(e[0],e[1],e[2])}}function Fb(e){return{x:e.x,y:e.y,r:e.r}}function ii(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,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function id(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,d=n.r,h=r-a,f=r-c,p=i-o,g=i-u,v=l-s,m=d-s,y=r*r+i*i-s*s,b=y-a*a-o*o+l*l,S=y-c*c-u*u+d*d,_=f*p-h*g,E=(p*S-g*b)/(_*2)-r,M=(g*v-p*m)/_,C=(f*b-h*S)/(_*2)-i,G=(h*m-f*v)/_,I=M*M+G*G-1,T=2*(s+E*M+C*G),L=E*E+C*C-s*s,R=-(Math.abs(I)>1e-6?(T+Math.sqrt(T*T-4*I*L))/(2*I):L/T);return{x:r+E+M*R,y:i+C+G*R,r:R}}function sd(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 ad(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 od(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 Rs(e){this._=e,this.next=null,this.previous=null}function zb(e,t){if(!(s=(e=Ub(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;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;sd(r,n,i=e[2]),n=new Rs(n),r=new Rs(r),i=new Rs(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){sd(n._,r._,i=e[l]),i=new Rs(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(ad(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(ad(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=od(n);(i=i.next)!==r;)(o=od(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Vb(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function Wb(e){return Math.sqrt(e.value)}function Yb(){var e=null,t=1,n=1,r=An;function i(s){const a=Nb();return s.x=t/2,s.y=n/2,e?s.eachBefore(ld(e)).eachAfter(Xo(r,.5,a)).eachBefore(cd(1)):s.eachBefore(ld(Wb)).eachAfter(Xo(An,1,a)).eachAfter(Xo(r,s.r/Math.min(t,n),a)).eachBefore(cd(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=kb(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:ir(+s),i):r},i}function ld(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Xo(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=zb(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function cd(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 qb(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 Xb(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 jb(e,t){return e.parent===t.parent?1:2}function jo(e){var t=e.children;return t?t[0]:e.t}function Zo(e){var t=e.children;return t?t[t.length-1]:e.t}function Zb(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 Kb(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 Qb(e,t,n){return e.a.parent===t.parent?e.a:n}function Is(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}Is.prototype=Object.create(ri.prototype);function Jb(e){for(var t=new Is(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 Is(s[a],a)),i.parent=n;return(t.parent=new Is(null,0)).children=[t],t}function tE(){var e=jb,t=1,n=1,r=null;function i(c){var u=Jb(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,f=c;c.eachBefore(function(y){y.x<d.x&&(d=y),y.x>h.x&&(h=y),y.depth>f.depth&&(f=y)});var p=d===h?1:e(d,h)/2,g=p-d.x,v=t/(h.x+p+g),m=n/(f.depth||1);c.eachBefore(function(y){y.x=(y.x+g)*v,y.y=y.depth*m})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){Kb(c);var f=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-f):c.z=f}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,f=c,p=u,g=h.parent.children[0],v=h.m,m=f.m,y=p.m,b=g.m,S;p=Zo(p),h=jo(h),p&&h;)g=jo(g),f=Zo(f),f.a=c,S=p.z+y-h.z-v+e(p._,h._),S>0&&(Zb(Qb(p,c,d),c,S),v+=S,m+=S),y+=p.m,v+=h.m,b+=g.m,m+=f.m;p&&!Zo(f)&&(f.t=p,f.m+=y-m),h&&!jo(g)&&(g.t=h,g.m+=v-b,d=c)}return d}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 eE(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 nE=(1+Math.sqrt(5))/2;function rE(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,f,p,g=t.value,v,m,y,b,S,_,E;u<h;){f=i-n,p=s-r;do v=o[d++].value;while(!v&&d<h);for(m=y=v,_=Math.max(p/f,f/p)/(g*e),E=v*v*_,S=Math.max(y/E,E/m);d<h;++d){if(v+=c=o[d].value,c<m&&(m=c),c>y&&(y=c),E=v*v*_,b=Math.max(y/E,E/m),b>S){v-=c;break}S=b}a.push(l={value:v,dice:f<p,children:o.slice(u,d)}),l.dice?Xb(l,n,r,i,g?r+=p*v/g:s):eE(l,n,r,g?n+=f*v/g:i,s),g-=v,u=d}return a}const iE=function e(t){function n(r,i,s,a,o){rE(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(nE);function sE(){var e=iE,t=!1,n=1,r=1,i=[0],s=An,a=An,o=An,l=An,c=An;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(qb),h}function d(h){var f=i[h.depth],p=h.x0+f,g=h.y0+f,v=h.x1-f,m=h.y1-f;v<p&&(p=v=(p+v)/2),m<g&&(g=m=(g+m)/2),h.x0=p,h.y0=g,h.x1=v,h.y1=m,h.children&&(f=i[h.depth+1]=s(h)/2,p+=c(h)-f,g+=a(h)-f,v-=o(h)-f,m-=l(h)-f,v<p&&(p=v=(p+v)/2),m<g&&(g=m=(g+m)/2),e(h,p,g,v,m))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=ed(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:ir(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:ir(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:ir(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:ir(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:ir(+h),u):c},u}function sr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const ud=Symbol("implicit");function ks(){var e=new tu,t=[],n=[],r=ud;function i(s){let a=e.get(s);if(a===void 0){if(r!==ud)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 tu;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 ks(t,n).unknown(r)},sr.apply(i,arguments),i}function si(){var e=ks().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 d(){var h=t().length,f=i<r,p=f?i:r,g=f?r:i;s=(g-p)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),p+=(g-p-s*(h-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var v=fv(h).map(function(m){return p+s*m});return n(f?v.reverse():v)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return si(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},sr.apply(d(),arguments)}function aE(e){return function(){return e}}function oE(e){return+e}var hd=[0,1];function ar(e){return e}function Ko(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:aE(isNaN(t)?NaN:.5)}function lE(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function cE(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Ko(i,r),s=n(a,s)):(r=Ko(r,i),s=n(s,a)),function(o){return s(r(o))}}function uE(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]=Ko(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Ha(e,o,1,r)-1;return s[l](i[l](o))}}function Qo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function dd(){var e=hd,t=hd,n=Vr,r,i,s,a=ar,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==ar&&(a=lE(e[0],e[h-1])),o=h>2?uE:cE,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),ae)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,oE),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Iu,u()},d.clamp=function(h){return arguments.length?(a=h?!0:ar,u()):a!==ar},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return r=h,i=f,u()}}function fd(){return dd()(ar,ar)}function hE(e,t,n,r){var i=za(e,t,n),s;switch(r=Wr(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=ux(i,a))&&(r.precision=s),ch(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=hx(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=cx(i))&&(r.precision=s-(r.type==="%")*2);break}}return wo(r)}function pd(e){var t=e.domain;return e.ticks=function(n){var r=t();return zi(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return hE(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=qn(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 Oe(){var e=fd();return e.copy=function(){return Qo(e,Oe())},sr.apply(e,arguments),pd(e)}function gd(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 md(e){return Math.log(e)}function vd(e){return Math.exp(e)}function dE(e){return-Math.log(-e)}function fE(e){return-Math.exp(-e)}function pE(e){return isFinite(e)?+("1e"+e):e<0?0:e}function gE(e){return e===10?pE:e===Math.E?Math.exp:t=>Math.pow(e,t)}function mE(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 yd(e){return(t,n)=>-e(-t,n)}function vE(e){const t=e(md,vd),n=t.domain;let r=10,i,s;function a(){return i=mE(r),s=gE(r),n()[0]<0?(i=yd(i),s=yd(s),e(dE,fE)):e(md,vd),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 d=u<c;d&&([c,u]=[u,c]);let h=i(c),f=i(u),p,g;const v=o==null?10:+o;let m=[];if(!(r%1)&&f-h<v){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(p=1;p<r;++p)if(g=h<0?p/s(-h):p*s(h),!(g<c)){if(g>u)break;m.push(g)}}else for(;h<=f;++h)for(p=r-1;p>=1;--p)if(g=h>0?p/s(-h):p*s(h),!(g<c)){if(g>u)break;m.push(g)}m.length*2<v&&(m=zi(c,u,v))}else m=zi(h,f,Math.min(f-h,v)).map(s);return d?m.reverse():m},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Wr(l)).precision==null&&(l.trim=!0),l=wo(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(gd(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function xd(){const e=vE(dd()).domain([1,10]);return e.copy=()=>Qo(e,xd()).base(e.base()),sr.apply(e,arguments),e}function Jo(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[Ha(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 Jo().domain([e,t]).range(i).unknown(s)},sr.apply(pd(a),arguments)}const tl=new Date,el=new Date;function Pt(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=>Pt(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)=>(tl.setTime(+s),el.setTime(+a),e(tl),e(el),Math.floor(n(tl,el))),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 $s=Pt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$s.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Pt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):$s),$s.range;const Xe=1e3,pe=Xe*60,je=pe*60,Ze=je*24,nl=Ze*7,bd=Ze*30,rl=Ze*365,or=Pt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xe)},(e,t)=>(t-e)/Xe,e=>e.getUTCSeconds());or.range;const il=Pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xe)},(e,t)=>{e.setTime(+e+t*pe)},(e,t)=>(t-e)/pe,e=>e.getMinutes());il.range,Pt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pe)},(e,t)=>(t-e)/pe,e=>e.getUTCMinutes()).range;const sl=Pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xe-e.getMinutes()*pe)},(e,t)=>{e.setTime(+e+t*je)},(e,t)=>(t-e)/je,e=>e.getHours());sl.range,Pt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*je)},(e,t)=>(t-e)/je,e=>e.getUTCHours()).range;const ai=Pt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pe)/Ze,e=>e.getDate()-1);ai.range;const al=Pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ze,e=>e.getUTCDate()-1);al.range,Pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ze,e=>Math.floor(e/Ze)).range;function Dn(e){return Pt(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())*pe)/nl)}const Ps=Dn(0),Ns=Dn(1),yE=Dn(2),xE=Dn(3),lr=Dn(4),bE=Dn(5),EE=Dn(6);Ps.range,Ns.range,yE.range,xE.range,lr.range,bE.range,EE.range;function Ln(e){return Pt(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)/nl)}const Ed=Ln(0),Us=Ln(1),SE=Ln(2),_E=Ln(3),cr=Ln(4),wE=Ln(5),OE=Ln(6);Ed.range,Us.range,SE.range,_E.range,cr.range,wE.range,OE.range;const ol=Pt(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());ol.range,Pt(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 Ke=Pt(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());Ke.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pt(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)}),Ke.range;const Rn=Pt(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());Rn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pt(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)}),Rn.range;function TE(e,t,n,r,i,s){const a=[[or,1,Xe],[or,5,5*Xe],[or,15,15*Xe],[or,30,30*Xe],[s,1,pe],[s,5,5*pe],[s,15,15*pe],[s,30,30*pe],[i,1,je],[i,3,3*je],[i,6,6*je],[i,12,12*je],[r,1,Ze],[r,2,2*Ze],[n,1,nl],[t,1,bd],[t,3,3*bd],[e,1,rl]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const f=d&&typeof d.range=="function"?d:l(c,u,d),p=f?f.range(c,+u+1):[];return h?p.reverse():p}function l(c,u,d){const h=Math.abs(u-c)/d,f=Ga(([,,v])=>v).right(a,h);if(f===a.length)return e.every(za(c/rl,u/rl,d));if(f===0)return $s.every(Math.max(za(c,u,d),1));const[p,g]=a[h/a[f-1][2]<a[f][2]/h?f-1:f];return p.every(g)}return[o,l]}const[ME,CE]=TE(Ke,ol,Ps,ai,sl,il);function ll(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 cl(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 AE(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=li(i),u=ci(i),d=li(s),h=ci(s),f=li(a),p=ci(a),g=li(o),v=ci(o),m=li(l),y=ci(l),b={a:P,A:N,b:B,B:Y,c:null,d:Md,e:Md,f:QE,g:lS,G:uS,H:jE,I:ZE,j:KE,L:Cd,m:JE,M:tS,p:X,q:J,Q:kd,s:$d,S:eS,u:nS,U:rS,V:iS,w:sS,W:aS,x:null,X:null,y:oS,Y:cS,Z:hS,"%":Id},S={a:ct,A:W,b:K,B:ut,c:null,d:Dd,e:Dd,f:gS,g:OS,G:MS,H:dS,I:fS,j:pS,L:Ld,m:mS,M:vS,p:rt,q:Tt,Q:kd,s:$d,S:yS,u:xS,U:bS,V:ES,w:SS,W:_S,x:null,X:null,y:wS,Y:TS,Z:CS,"%":Id},_={a:I,A:T,b:L,B:R,c:k,d:Od,e:Od,f:WE,g:wd,G:_d,H:Td,I:Td,j:GE,L:zE,m:VE,M:HE,p:G,q:BE,Q:qE,s:XE,S:FE,u:kE,U:$E,V:PE,w:IE,W:NE,x:O,X:U,y:wd,Y:_d,Z:UE,"%":YE};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(q,V){return function(H){var $=[],pt=-1,yt=0,Kt=q.length,Qt,et,Rt;for(H instanceof Date||(H=new Date(+H));++pt<Kt;)q.charCodeAt(pt)===37&&($.push(q.slice(yt,pt)),(et=Sd[Qt=q.charAt(++pt)])!=null?Qt=q.charAt(++pt):et=Qt==="e"?" ":"0",(Rt=V[Qt])&&(Qt=Rt(H,et)),$.push(Qt),yt=pt+1);return $.push(q.slice(yt,pt)),$.join("")}}function M(q,V){return function(H){var $=oi(1900,void 0,1),pt=C($,q,H+="",0),yt,Kt;if(pt!=H.length)return null;if("Q"in $)return new Date($.Q);if("s"in $)return new Date($.s*1e3+("L"in $?$.L:0));if(V&&!("Z"in $)&&($.Z=0),"p"in $&&($.H=$.H%12+$.p*12),$.m===void 0&&($.m="q"in $?$.q:0),"V"in $){if($.V<1||$.V>53)return null;"w"in $||($.w=1),"Z"in $?(yt=cl(oi($.y,0,1)),Kt=yt.getUTCDay(),yt=Kt>4||Kt===0?Us.ceil(yt):Us(yt),yt=al.offset(yt,($.V-1)*7),$.y=yt.getUTCFullYear(),$.m=yt.getUTCMonth(),$.d=yt.getUTCDate()+($.w+6)%7):(yt=ll(oi($.y,0,1)),Kt=yt.getDay(),yt=Kt>4||Kt===0?Ns.ceil(yt):Ns(yt),yt=ai.offset(yt,($.V-1)*7),$.y=yt.getFullYear(),$.m=yt.getMonth(),$.d=yt.getDate()+($.w+6)%7)}else("W"in $||"U"in $)&&("w"in $||($.w="u"in $?$.u%7:"W"in $?1:0),Kt="Z"in $?cl(oi($.y,0,1)).getUTCDay():ll(oi($.y,0,1)).getDay(),$.m=0,$.d="W"in $?($.w+6)%7+$.W*7-(Kt+5)%7:$.w+$.U*7-(Kt+6)%7);return"Z"in $?($.H+=$.Z/100|0,$.M+=$.Z%100,cl($)):ll($)}}function C(q,V,H,$){for(var pt=0,yt=V.length,Kt=H.length,Qt,et;pt<yt;){if($>=Kt)return-1;if(Qt=V.charCodeAt(pt++),Qt===37){if(Qt=V.charAt(pt++),et=_[Qt in Sd?V.charAt(pt++):Qt],!et||($=et(q,H,$))<0)return-1}else if(Qt!=H.charCodeAt($++))return-1}return $}function G(q,V,H){var $=c.exec(V.slice(H));return $?(q.p=u.get($[0].toLowerCase()),H+$[0].length):-1}function I(q,V,H){var $=f.exec(V.slice(H));return $?(q.w=p.get($[0].toLowerCase()),H+$[0].length):-1}function T(q,V,H){var $=d.exec(V.slice(H));return $?(q.w=h.get($[0].toLowerCase()),H+$[0].length):-1}function L(q,V,H){var $=m.exec(V.slice(H));return $?(q.m=y.get($[0].toLowerCase()),H+$[0].length):-1}function R(q,V,H){var $=g.exec(V.slice(H));return $?(q.m=v.get($[0].toLowerCase()),H+$[0].length):-1}function k(q,V,H){return C(q,t,V,H)}function O(q,V,H){return C(q,n,V,H)}function U(q,V,H){return C(q,r,V,H)}function P(q){return a[q.getDay()]}function N(q){return s[q.getDay()]}function B(q){return l[q.getMonth()]}function Y(q){return o[q.getMonth()]}function X(q){return i[+(q.getHours()>=12)]}function J(q){return 1+~~(q.getMonth()/3)}function ct(q){return a[q.getUTCDay()]}function W(q){return s[q.getUTCDay()]}function K(q){return l[q.getUTCMonth()]}function ut(q){return o[q.getUTCMonth()]}function rt(q){return i[+(q.getUTCHours()>=12)]}function Tt(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var V=E(q+="",b);return V.toString=function(){return q},V},parse:function(q){var V=M(q+="",!1);return V.toString=function(){return q},V},utcFormat:function(q){var V=E(q+="",S);return V.toString=function(){return q},V},utcParse:function(q){var V=M(q+="",!0);return V.toString=function(){return q},V}}}var Sd={"-":"",_:" ",0:"0"},Bt=/^\s*\d+/,DE=/^%/,LE=/[\\^$*+?|[\]().{}]/g;function ht(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 RE(e){return e.replace(LE,"\\$&")}function li(e){return new RegExp("^(?:"+e.map(RE).join("|")+")","i")}function ci(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function IE(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function kE(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function $E(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function PE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function NE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function _d(e,t,n){var r=Bt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function wd(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function UE(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 BE(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function VE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Od(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function GE(e,t,n){var r=Bt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Td(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function HE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function FE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function zE(e,t,n){var r=Bt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function WE(e,t,n){var r=Bt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function YE(e,t,n){var r=DE.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function qE(e,t,n){var r=Bt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function XE(e,t,n){var r=Bt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Md(e,t){return ht(e.getDate(),t,2)}function jE(e,t){return ht(e.getHours(),t,2)}function ZE(e,t){return ht(e.getHours()%12||12,t,2)}function KE(e,t){return ht(1+ai.count(Ke(e),e),t,3)}function Cd(e,t){return ht(e.getMilliseconds(),t,3)}function QE(e,t){return Cd(e,t)+"000"}function JE(e,t){return ht(e.getMonth()+1,t,2)}function tS(e,t){return ht(e.getMinutes(),t,2)}function eS(e,t){return ht(e.getSeconds(),t,2)}function nS(e){var t=e.getDay();return t===0?7:t}function rS(e,t){return ht(Ps.count(Ke(e)-1,e),t,2)}function Ad(e){var t=e.getDay();return t>=4||t===0?lr(e):lr.ceil(e)}function iS(e,t){return e=Ad(e),ht(lr.count(Ke(e),e)+(Ke(e).getDay()===4),t,2)}function sS(e){return e.getDay()}function aS(e,t){return ht(Ns.count(Ke(e)-1,e),t,2)}function oS(e,t){return ht(e.getFullYear()%100,t,2)}function lS(e,t){return e=Ad(e),ht(e.getFullYear()%100,t,2)}function cS(e,t){return ht(e.getFullYear()%1e4,t,4)}function uS(e,t){var n=e.getDay();return e=n>=4||n===0?lr(e):lr.ceil(e),ht(e.getFullYear()%1e4,t,4)}function hS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ht(t/60|0,"0",2)+ht(t%60,"0",2)}function Dd(e,t){return ht(e.getUTCDate(),t,2)}function dS(e,t){return ht(e.getUTCHours(),t,2)}function fS(e,t){return ht(e.getUTCHours()%12||12,t,2)}function pS(e,t){return ht(1+al.count(Rn(e),e),t,3)}function Ld(e,t){return ht(e.getUTCMilliseconds(),t,3)}function gS(e,t){return Ld(e,t)+"000"}function mS(e,t){return ht(e.getUTCMonth()+1,t,2)}function vS(e,t){return ht(e.getUTCMinutes(),t,2)}function yS(e,t){return ht(e.getUTCSeconds(),t,2)}function xS(e){var t=e.getUTCDay();return t===0?7:t}function bS(e,t){return ht(Ed.count(Rn(e)-1,e),t,2)}function Rd(e){var t=e.getUTCDay();return t>=4||t===0?cr(e):cr.ceil(e)}function ES(e,t){return e=Rd(e),ht(cr.count(Rn(e),e)+(Rn(e).getUTCDay()===4),t,2)}function SS(e){return e.getUTCDay()}function _S(e,t){return ht(Us.count(Rn(e)-1,e),t,2)}function wS(e,t){return ht(e.getUTCFullYear()%100,t,2)}function OS(e,t){return e=Rd(e),ht(e.getUTCFullYear()%100,t,2)}function TS(e,t){return ht(e.getUTCFullYear()%1e4,t,4)}function MS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?cr(e):cr.ceil(e),ht(e.getUTCFullYear()%1e4,t,4)}function CS(){return"+0000"}function Id(){return"%"}function kd(e){return+e}function $d(e){return Math.floor(+e/1e3)}var ur,Pd;AS({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 AS(e){return ur=AE(e),Pd=ur.format,ur.parse,ur.utcFormat,ur.utcParse,ur}function DS(e){return new Date(e)}function LS(e){return e instanceof Date?+e:+new Date(+e)}function Nd(e,t,n,r,i,s,a,o,l,c){var u=fd(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),g=c("%I:%M"),v=c("%I %p"),m=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?g:s(E)<E?v:r(E)<E?i(E)<E?m:y:n(E)<E?b:S)(E)}return u.invert=function(E){return new Date(d(E))},u.domain=function(E){return arguments.length?h(Array.from(E,LS)):h().map(DS)},u.ticks=function(E){var M=h();return e(M[0],M[M.length-1],E??10)},u.tickFormat=function(E,M){return M==null?_:c(M)},u.nice=function(E){var M=h();return(!E||typeof E.range!="function")&&(E=t(M[0],M[M.length-1],E??10)),E?h(gd(M,E)):u},u.copy=function(){return Qo(u,Nd(e,t,n,r,i,s,a,o,l,c))},u}function Ud(){return sr.apply(Nd(ME,CE,Ke,ol,Ps,ai,sl,il,or,Pd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function at(e){return function(){return e}}const Bd=Math.abs,Wt=Math.atan2,In=Math.cos,RS=Math.max,ul=Math.min,Pe=Math.sin,hr=Math.sqrt,Yt=1e-12,ui=Math.PI,Bs=ui/2,Vs=2*ui;function IS(e){return e>1?0:e<-1?ui:Math.acos(e)}function Vd(e){return e>=1?Bs:e<=-1?-Bs:Math.asin(e)}function Gs(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 tx(t)}function kS(e){return e.innerRadius}function $S(e){return e.outerRadius}function PS(e){return e.startAngle}function NS(e){return e.endAngle}function US(e){return e&&e.padAngle}function BS(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<Yt))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function Hs(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/hr(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,g=r+d,v=(h+p)/2,m=(f+g)/2,y=p-h,b=g-f,S=y*y+b*b,_=i-s,E=h*g-p*f,M=(b<0?-1:1)*hr(RS(0,_*_*S-E*E)),C=(E*b-y*M)/S,G=(-E*y-b*M)/S,I=(E*b+y*M)/S,T=(-E*y+b*M)/S,L=C-v,R=G-m,k=I-v,O=T-m;return L*L+R*R>k*k+O*O&&(C=I,G=T),{cx:C,cy:G,x01:-u,y01:-d,x11:C*(i/_-1),y11:G*(i/_-1)}}function hi(){var e=kS,t=$S,n=at(0),r=null,i=PS,s=NS,a=US,o=null,l=Gs(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-Bs,g=s.apply(this,arguments)-Bs,v=Bd(g-p),m=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>Yt))o.moveTo(0,0);else if(v>Vs-Yt)o.moveTo(f*In(p),f*Pe(p)),o.arc(0,0,f,p,g,!m),h>Yt&&(o.moveTo(h*In(g),h*Pe(g)),o.arc(0,0,h,g,p,m));else{var y=p,b=g,S=p,_=g,E=v,M=v,C=a.apply(this,arguments)/2,G=C>Yt&&(r?+r.apply(this,arguments):hr(h*h+f*f)),I=ul(Bd(f-h)/2,+n.apply(this,arguments)),T=I,L=I,R,k;if(G>Yt){var O=Vd(G/h*Pe(C)),U=Vd(G/f*Pe(C));(E-=O*2)>Yt?(O*=m?1:-1,S+=O,_-=O):(E=0,S=_=(p+g)/2),(M-=U*2)>Yt?(U*=m?1:-1,y+=U,b-=U):(M=0,y=b=(p+g)/2)}var P=f*In(y),N=f*Pe(y),B=h*In(_),Y=h*Pe(_);if(I>Yt){var X=f*In(b),J=f*Pe(b),ct=h*In(S),W=h*Pe(S),K;if(v<ui)if(K=BS(P,N,ct,W,X,J,B,Y)){var ut=P-K[0],rt=N-K[1],Tt=X-K[0],q=J-K[1],V=1/Pe(IS((ut*Tt+rt*q)/(hr(ut*ut+rt*rt)*hr(Tt*Tt+q*q)))/2),H=hr(K[0]*K[0]+K[1]*K[1]);T=ul(I,(h-H)/(V-1)),L=ul(I,(f-H)/(V+1))}else T=L=0}M>Yt?L>Yt?(R=Hs(ct,W,P,N,f,L,m),k=Hs(X,J,B,Y,f,L,m),o.moveTo(R.cx+R.x01,R.cy+R.y01),L<I?o.arc(R.cx,R.cy,L,Wt(R.y01,R.x01),Wt(k.y01,k.x01),!m):(o.arc(R.cx,R.cy,L,Wt(R.y01,R.x01),Wt(R.y11,R.x11),!m),o.arc(0,0,f,Wt(R.cy+R.y11,R.cx+R.x11),Wt(k.cy+k.y11,k.cx+k.x11),!m),o.arc(k.cx,k.cy,L,Wt(k.y11,k.x11),Wt(k.y01,k.x01),!m))):(o.moveTo(P,N),o.arc(0,0,f,y,b,!m)):o.moveTo(P,N),!(h>Yt)||!(E>Yt)?o.lineTo(B,Y):T>Yt?(R=Hs(B,Y,X,J,h,-T,m),k=Hs(P,N,ct,W,h,-T,m),o.lineTo(R.cx+R.x01,R.cy+R.y01),T<I?o.arc(R.cx,R.cy,T,Wt(R.y01,R.x01),Wt(k.y01,k.x01),!m):(o.arc(R.cx,R.cy,T,Wt(R.y01,R.x01),Wt(R.y11,R.x11),!m),o.arc(0,0,h,Wt(R.cy+R.y11,R.cx+R.x11),Wt(k.cy+k.y11,k.cx+k.x11),m),o.arc(k.cx,k.cy,T,Wt(k.y11,k.x11),Wt(k.y01,k.x01),!m))):o.arc(0,0,h,_,S,m)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-ui/2;return[In(d)*u,Pe(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:at(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:at(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:at(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:at(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:at(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:at(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:at(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var VS=Array.prototype.slice;function Fs(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gd(e){this._context=e}Gd.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 zs(e){return new Gd(e)}function hl(e){return e[0]}function dl(e){return e[1]}function di(e,t){var n=at(!0),r=null,i=zs,s=null,a=Gs(o);e=typeof e=="function"?e:e===void 0?hl:at(e),t=typeof t=="function"?t:t===void 0?dl:at(t);function o(l){var c,u=(l=Fs(l)).length,d,h=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:at(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:at(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:at(!!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 fl(e,t,n){var r=null,i=at(!0),s=null,a=zs,o=null,l=Gs(c);e=typeof e=="function"?e:e===void 0?hl:at(+e),t=typeof t=="function"?t:at(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?dl:at(+n);function c(d){var h,f,p,g=(d=Fs(d)).length,v,m=!1,y,b=new Array(g),S=new Array(g);for(s==null&&(o=a(y=l())),h=0;h<=g;++h){if(!(h<g&&i(v=d[h],h,d))===m)if(m=!m)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(b[p],S[p]);o.lineEnd(),o.areaEnd()}m&&(b[h]=+e(v,h,d),S[h]=+t(v,h,d),o.point(r?+r(v,h,d):b[h],n?+n(v,h,d):S[h]))}if(y)return o=null,y+""||null}function u(){return di().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:at(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:at(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:at(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:at(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:at(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:at(+d),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(d){return arguments.length?(i=typeof d=="function"?d:at(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function GS(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function HS(e){return e}function FS(){var e=HS,t=GS,n=null,r=at(0),i=at(Vs),s=at(0);function a(o){var l,c=(o=Fs(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),g=+r.apply(this,arguments),v=Math.min(Vs,Math.max(-Vs,i.apply(this,arguments)-g)),m,y=Math.min(Math.abs(v)/c,s.apply(this,arguments)),b=y*(v<0?-1:1),S;for(l=0;l<c;++l)(S=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=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,d=h?(v-c*b)/h:0;l<c;++l,g=m)u=f[l],S=p[u],m=g+(S>0?S*d:0)+b,p[u]={data:o[u],index:l,value:S,startAngle:g,endAngle:m,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:at(+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:at(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:at(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:at(+o),a):s},a}var zS=Fd(zs);function Hd(e){this._curve=e}Hd.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 Fd(e){function t(n){return new Hd(e(n))}return t._curve=e,t}function WS(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(Fd(n)):t()._curve},e}function YS(){return WS(di().curve(zS))}class qS{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 XS(e){return new qS(e,!0)}function jS(e){return e.source}function ZS(e){return e.target}function KS(e){let t=jS,n=ZS,r=hl,i=dl,s=null,a=null,o=Gs(l);function l(){let c;const u=VS.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,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:at(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:at(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function QS(){return KS(XS)}function dn(){}function Ws(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 Ys(e){this._context=e}Ys.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:Ws(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:Ws(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JS(e){return new Ys(e)}function zd(e){this._context=e}zd.prototype={areaStart:dn,areaEnd:dn,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:Ws(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function t_(e){return new zd(e)}function Wd(e){this._context=e}Wd.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:Ws(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function e_(e){return new Wd(e)}function Yd(e,t){this._basis=new Ys(e),this._beta=t}Yd.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 n_=function e(t){function n(r){return t===1?new Ys(r):new Yd(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function qs(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 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(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:qs(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:qs(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 r_=function e(t){function n(r){return new pl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function gl(e,t){this._context=e,this._k=(1-t)/6}gl.prototype={areaStart:dn,areaEnd:dn,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:qs(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 i_=function e(t){function n(r){return new gl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function ml(e,t){this._context=e,this._k=(1-t)/6}ml.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:qs(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 s_=function e(t){function n(r){return new ml(r,t)}return n.tension=function(r){return e(+r)},n}(0);function vl(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Yt){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>Yt){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 qd(e,t){this._context=e,this._alpha=t}qd.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:vl(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 a_=function e(t){function n(r){return t?new qd(r,t):new pl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Xd(e,t){this._context=e,this._alpha=t}Xd.prototype={areaStart:dn,areaEnd:dn,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:vl(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 o_=function e(t){function n(r){return t?new Xd(r,t):new gl(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:vl(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 l_=function e(t){function n(r){return t?new jd(r,t):new ml(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Zd(e){this._context=e}Zd.prototype={areaStart:dn,areaEnd:dn,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 Kd(e){return new Zd(e)}function Qd(e){return e<0?-1:1}function Jd(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(Qd(s)+Qd(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function tf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function yl(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 Xs(e){this._context=e}Xs.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:yl(this,this._t0,tf(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,yl(this,tf(this,n=Jd(this,e,t)),n);break;default:yl(this,this._t0,n=Jd(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function ef(e){this._context=new nf(e)}(ef.prototype=Object.create(Xs.prototype)).point=function(e,t){Xs.prototype.point.call(this,t,e)};function nf(e){this._context=e}nf.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 c_(e){return new Xs(e)}function u_(e){return new ef(e)}function rf(e){this._context=e}rf.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=sf(e),i=sf(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 sf(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 h_(e){return new rf(e)}function js(e,t){this._context=e,this._t=t}js.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 d_(e){return new js(e,.5)}function f_(e){return new js(e,0)}function p_(e){return new js(e,1)}function af(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 of(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function g_(e,t){return e[t]}function m_(e){const t=[];return t.key=e,t}function xl(){var e=at([]),t=of,n=af,r=g_;function i(s){var a=Array.from(e.apply(this,arguments),m_),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=Fs(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:at(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:at(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?of:typeof s=="function"?s:at(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??af,i):n},i}function v_(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 fi(e,t,n){this.k=e,this.x=t,this.y=n}fi.prototype={constructor:fi,scale:function(e){return e===1?this:new fi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fi(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+")"}},fi.prototype;var y_=typeof global=="object"&&global&&global.Object===Object&&global;const lf=y_;var x_=typeof self=="object"&&self&&self.Object===Object&&self,b_=lf||x_||Function("return this")();const Te=b_;var E_=Te.Symbol;const ge=E_;var cf=Object.prototype,S_=cf.hasOwnProperty,__=cf.toString,pi=ge?ge.toStringTag:void 0;function w_(e){var t=S_.call(e,pi),n=e[pi];try{e[pi]=void 0;var r=!0}catch{}var i=__.call(e);return r&&(t?e[pi]=n:delete e[pi]),i}var O_=Object.prototype,T_=O_.toString;function M_(e){return T_.call(e)}var C_="[object Null]",A_="[object Undefined]",uf=ge?ge.toStringTag:void 0;function kn(e){return e==null?e===void 0?A_:C_:uf&&uf in Object(e)?w_(e):M_(e)}function Ne(e){return e!=null&&typeof e=="object"}var D_="[object Symbol]";function Zs(e){return typeof e=="symbol"||Ne(e)&&kn(e)==D_}function hf(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 L_=Array.isArray;const Vt=L_;var R_=1/0,df=ge?ge.prototype:void 0,ff=df?df.toString:void 0;function pf(e){if(typeof e=="string")return e;if(Vt(e))return hf(e,pf)+"";if(Zs(e))return ff?ff.call(e):"";var t=e+"";return t=="0"&&1/e==-R_?"-0":t}var I_=/\s/;function k_(e){for(var t=e.length;t--&&I_.test(e.charAt(t)););return t}var $_=/^\s+/;function P_(e){return e&&e.slice(0,k_(e)+1).replace($_,"")}function me(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gf=0/0,N_=/^[-+]0x[0-9a-f]+$/i,U_=/^0b[01]+$/i,B_=/^0o[0-7]+$/i,V_=parseInt;function gi(e){if(typeof e=="number")return e;if(Zs(e))return gf;if(me(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=me(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=P_(e);var n=U_.test(e);return n||B_.test(e)?V_(e.slice(2),n?2:8):N_.test(e)?gf:+e}function bl(e){return e}var G_="[object AsyncFunction]",H_="[object Function]",F_="[object GeneratorFunction]",z_="[object Proxy]";function El(e){if(!me(e))return!1;var t=kn(e);return t==H_||t==F_||t==G_||t==z_}var W_=Te["__core-js_shared__"];const Sl=W_;var mf=function(){var e=/[^.]+$/.exec(Sl&&Sl.keys&&Sl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Y_(e){return!!mf&&mf in e}var q_=Function.prototype,X_=q_.toString;function $n(e){if(e!=null){try{return X_.call(e)}catch{}try{return e+""}catch{}}return""}var j_=/[\\^$.*+?()[\]{}|]/g,Z_=/^\[object .+?Constructor\]$/,K_=Function.prototype,Q_=Object.prototype,J_=K_.toString,tw=Q_.hasOwnProperty,ew=RegExp("^"+J_.call(tw).replace(j_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nw(e){if(!me(e)||Y_(e))return!1;var t=El(e)?ew:Z_;return t.test($n(e))}function rw(e,t){return e==null?void 0:e[t]}function Pn(e,t){var n=rw(e,t);return nw(n)?n:void 0}var iw=Pn(Te,"WeakMap");const _l=iw;var vf=Object.create,sw=function(){function e(){}return function(t){if(!me(t))return{};if(vf)return vf(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const aw=sw;function ow(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 lw(){}function yf(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var cw=800,uw=16,hw=Date.now;function dw(e){var t=0,n=0;return function(){var r=hw(),i=uw-(r-n);if(n=r,i>0){if(++t>=cw)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function fw(e){return function(){return e}}var pw=function(){try{var e=Pn(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Ks=pw;var gw=Ks?function(e,t){return Ks(e,"toString",{configurable:!0,enumerable:!1,value:fw(t),writable:!0})}:bl,mw=dw(gw);const vw=mw;function yw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function xw(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 bw(e){return e!==e}function Ew(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function Sw(e,t,n){return t===t?Ew(e,t,n):xw(e,bw,n)}function _w(e,t){var n=e==null?0:e.length;return!!n&&Sw(e,t,0)>-1}var ww=9007199254740991,Ow=/^(?:0|[1-9]\d*)$/;function wl(e,t){var n=typeof e;return t=t??ww,!!t&&(n=="number"||n!="symbol"&&Ow.test(e))&&e>-1&&e%1==0&&e<t}function Qs(e,t,n){t=="__proto__"&&Ks?Ks(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function mi(e,t){return e===t||e!==e&&t!==t}var Tw=Object.prototype,Mw=Tw.hasOwnProperty;function xf(e,t,n){var r=e[t];(!(Mw.call(e,t)&&mi(r,n))||n===void 0&&!(t in e))&&Qs(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?Qs(n,o,l):xf(n,o,l)}return n}var bf=Math.max;function Cw(e,t,n){return t=bf(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=bf(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),ow(e,this,o)}}function Ef(e,t){return vw(Cw(e,t,bl),e+"")}var Aw=9007199254740991;function Ol(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Aw}function Nn(e){return e!=null&&Ol(e.length)&&!El(e)}function Sf(e,t,n){if(!me(n))return!1;var r=typeof t;return(r=="number"?Nn(n)&&wl(t,n.length):r=="string"&&t in n)?mi(n[t],e):!1}function Dw(e){return Ef(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&&Sf(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 Lw=Object.prototype;function Js(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Lw;return e===n}function Rw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Iw="[object Arguments]";function _f(e){return Ne(e)&&kn(e)==Iw}var wf=Object.prototype,kw=wf.hasOwnProperty,$w=wf.propertyIsEnumerable,Pw=_f(function(){return arguments}())?_f:function(e){return Ne(e)&&kw.call(e,"callee")&&!$w.call(e,"callee")};const dr=Pw;function Nw(){return!1}var Of=typeof z=="object"&&z&&!z.nodeType&&z,Tf=Of&&typeof module=="object"&&module&&!module.nodeType&&module,Uw=Tf&&Tf.exports===Of,Mf=Uw?Te.Buffer:void 0,Bw=Mf?Mf.isBuffer:void 0,Vw=Bw||Nw;const fr=Vw;var Gw="[object Arguments]",Hw="[object Array]",Fw="[object Boolean]",zw="[object Date]",Ww="[object Error]",Yw="[object Function]",qw="[object Map]",Xw="[object Number]",jw="[object Object]",Zw="[object RegExp]",Kw="[object Set]",Qw="[object String]",Jw="[object WeakMap]",tO="[object ArrayBuffer]",eO="[object DataView]",nO="[object Float32Array]",rO="[object Float64Array]",iO="[object Int8Array]",sO="[object Int16Array]",aO="[object Int32Array]",oO="[object Uint8Array]",lO="[object Uint8ClampedArray]",cO="[object Uint16Array]",uO="[object Uint32Array]",Ot={};Ot[nO]=Ot[rO]=Ot[iO]=Ot[sO]=Ot[aO]=Ot[oO]=Ot[lO]=Ot[cO]=Ot[uO]=!0,Ot[Gw]=Ot[Hw]=Ot[tO]=Ot[Fw]=Ot[eO]=Ot[zw]=Ot[Ww]=Ot[Yw]=Ot[qw]=Ot[Xw]=Ot[jw]=Ot[Zw]=Ot[Kw]=Ot[Qw]=Ot[Jw]=!1;function hO(e){return Ne(e)&&Ol(e.length)&&!!Ot[kn(e)]}function Tl(e){return function(t){return e(t)}}var Cf=typeof z=="object"&&z&&!z.nodeType&&z,yi=Cf&&typeof module=="object"&&module&&!module.nodeType&&module,dO=yi&&yi.exports===Cf,Ml=dO&&lf.process,fO=function(){try{var e=yi&&yi.require&&yi.require("util").types;return e||Ml&&Ml.binding&&Ml.binding("util")}catch{}}();const pr=fO;var Af=pr&&pr.isTypedArray,pO=Af?Tl(Af):hO;const ta=pO;var gO=Object.prototype,mO=gO.hasOwnProperty;function Df(e,t){var n=Vt(e),r=!n&&dr(e),i=!n&&!r&&fr(e),s=!n&&!r&&!i&&ta(e),a=n||r||i||s,o=a?Rw(e.length,String):[],l=o.length;for(var c in e)(t||mO.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wl(c,l)))&&o.push(c);return o}function Lf(e,t){return function(n){return e(t(n))}}var vO=Lf(Object.keys,Object);const yO=vO;var xO=Object.prototype,bO=xO.hasOwnProperty;function Rf(e){if(!Js(e))return yO(e);var t=[];for(var n in Object(e))bO.call(e,n)&&n!="constructor"&&t.push(n);return t}function xi(e){return Nn(e)?Df(e):Rf(e)}function EO(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var SO=Object.prototype,_O=SO.hasOwnProperty;function wO(e){if(!me(e))return EO(e);var t=Js(e),n=[];for(var r in e)r=="constructor"&&(t||!_O.call(e,r))||n.push(r);return n}function bi(e){return Nn(e)?Df(e,!0):wO(e)}var OO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TO=/^\w*$/;function Cl(e,t){if(Vt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Zs(e)?!0:TO.test(e)||!OO.test(e)||t!=null&&e in Object(t)}var MO=Pn(Object,"create");const Ei=MO;function CO(){this.__data__=Ei?Ei(null):{},this.size=0}function AO(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var DO="__lodash_hash_undefined__",LO=Object.prototype,RO=LO.hasOwnProperty;function IO(e){var t=this.__data__;if(Ei){var n=t[e];return n===DO?void 0:n}return RO.call(t,e)?t[e]:void 0}var kO=Object.prototype,$O=kO.hasOwnProperty;function PO(e){var t=this.__data__;return Ei?t[e]!==void 0:$O.call(t,e)}var NO="__lodash_hash_undefined__";function UO(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ei&&t===void 0?NO:t,this}function Un(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])}}Un.prototype.clear=CO,Un.prototype.delete=AO,Un.prototype.get=IO,Un.prototype.has=PO,Un.prototype.set=UO;function BO(){this.__data__=[],this.size=0}function ea(e,t){for(var n=e.length;n--;)if(mi(e[n][0],t))return n;return-1}var VO=Array.prototype,GO=VO.splice;function HO(e){var t=this.__data__,n=ea(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():GO.call(t,n,1),--this.size,!0}function FO(e){var t=this.__data__,n=ea(t,e);return n<0?void 0:t[n][1]}function zO(e){return ea(this.__data__,e)>-1}function WO(e,t){var n=this.__data__,r=ea(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Qe(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])}}Qe.prototype.clear=BO,Qe.prototype.delete=HO,Qe.prototype.get=FO,Qe.prototype.has=zO,Qe.prototype.set=WO;var YO=Pn(Te,"Map");const Si=YO;function qO(){this.size=0,this.__data__={hash:new Un,map:new(Si||Qe),string:new Un}}function XO(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function na(e,t){var n=e.__data__;return XO(t)?n[typeof t=="string"?"string":"hash"]:n.map}function jO(e){var t=na(this,e).delete(e);return this.size-=t?1:0,t}function ZO(e){return na(this,e).get(e)}function KO(e){return na(this,e).has(e)}function QO(e,t){var n=na(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Je(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])}}Je.prototype.clear=qO,Je.prototype.delete=jO,Je.prototype.get=ZO,Je.prototype.has=KO,Je.prototype.set=QO;var JO="Expected a function";function Al(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(JO);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(Al.Cache||Je),n}Al.Cache=Je;var tT=500;function eT(e){var t=Al(e,function(r){return n.size===tT&&n.clear(),r}),n=t.cache;return t}var nT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rT=/\\(\\)?/g,iT=eT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(nT,function(n,r,i,s){t.push(i?s.replace(rT,"$1"):r||n)}),t});const sT=iT;function _i(e){return e==null?"":pf(e)}function If(e,t){return Vt(e)?e:Cl(e,t)?[e]:sT(_i(e))}var aT=1/0;function ra(e){if(typeof e=="string"||Zs(e))return e;var t=e+"";return t=="0"&&1/e==-aT?"-0":t}function kf(e,t){t=If(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ra(t[n++])];return n&&n==r?e:void 0}function St(e,t,n){var r=e==null?void 0:kf(e,t);return r===void 0?n:r}function Dl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var $f=ge?ge.isConcatSpreadable:void 0;function oT(e){return Vt(e)||dr(e)||!!($f&&e&&e[$f])}function ia(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=oT),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?ia(o,t-1,n,r,i):Dl(i,o):r||(i[i.length]=o)}return i}function Pf(e){var t=e==null?0:e.length;return t?ia(e,1):[]}var lT=Lf(Object.getPrototypeOf,Object);const Ll=lT;var cT="[object Object]",uT=Function.prototype,hT=Object.prototype,Nf=uT.toString,dT=hT.hasOwnProperty,fT=Nf.call(Object);function pT(e){if(!Ne(e)||kn(e)!=cT)return!1;var t=Ll(e);if(t===null)return!0;var n=dT.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Nf.call(n)==fT}function gT(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 mT(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:gT(e,t,n)}var vT="\\ud800-\\udfff",yT="\\u0300-\\u036f",xT="\\ufe20-\\ufe2f",bT="\\u20d0-\\u20ff",ET=yT+xT+bT,ST="\\ufe0e\\ufe0f",_T="\\u200d",wT=RegExp("["+_T+vT+ET+ST+"]");function Uf(e){return wT.test(e)}function OT(e){return e.split("")}var Bf="\\ud800-\\udfff",TT="\\u0300-\\u036f",MT="\\ufe20-\\ufe2f",CT="\\u20d0-\\u20ff",AT=TT+MT+CT,DT="\\ufe0e\\ufe0f",LT="["+Bf+"]",Rl="["+AT+"]",Il="\\ud83c[\\udffb-\\udfff]",RT="(?:"+Rl+"|"+Il+")",Vf="[^"+Bf+"]",Gf="(?:\\ud83c[\\udde6-\\uddff]){2}",Hf="[\\ud800-\\udbff][\\udc00-\\udfff]",IT="\\u200d",Ff=RT+"?",zf="["+DT+"]?",kT="(?:"+IT+"(?:"+[Vf,Gf,Hf].join("|")+")"+zf+Ff+")*",$T=zf+Ff+kT,PT="(?:"+[Vf+Rl+"?",Rl,Gf,Hf,LT].join("|")+")",NT=RegExp(Il+"(?="+Il+")|"+PT+$T,"g");function UT(e){return e.match(NT)||[]}function BT(e){return Uf(e)?UT(e):OT(e)}function VT(e){return function(t){t=_i(t);var n=Uf(t)?BT(t):void 0,r=n?n[0]:t.charAt(0),i=n?mT(n,1).join(""):t.slice(1);return r[e]()+i}}var GT=VT("toUpperCase");const HT=GT;function FT(e){return HT(_i(e).toLowerCase())}function zT(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 WT(e){return function(t){return e==null?void 0:e[t]}}var YT={À:"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"},qT=WT(YT);const XT=qT;var jT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ZT="\\u0300-\\u036f",KT="\\ufe20-\\ufe2f",QT="\\u20d0-\\u20ff",JT=ZT+KT+QT,tM="["+JT+"]",eM=RegExp(tM,"g");function nM(e){return e=_i(e),e&&e.replace(jT,XT).replace(eM,"")}var rM=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function iM(e){return e.match(rM)||[]}var sM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function aM(e){return sM.test(e)}var Wf="\\ud800-\\udfff",oM="\\u0300-\\u036f",lM="\\ufe20-\\ufe2f",cM="\\u20d0-\\u20ff",uM=oM+lM+cM,Yf="\\u2700-\\u27bf",qf="a-z\\xdf-\\xf6\\xf8-\\xff",hM="\\xac\\xb1\\xd7\\xf7",dM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",fM="\\u2000-\\u206f",pM=" \\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",Xf="A-Z\\xc0-\\xd6\\xd8-\\xde",gM="\\ufe0e\\ufe0f",jf=hM+dM+fM+pM,Zf="['’]",Kf="["+jf+"]",mM="["+uM+"]",Qf="\\d+",vM="["+Yf+"]",Jf="["+qf+"]",tp="[^"+Wf+jf+Qf+Yf+qf+Xf+"]",yM="\\ud83c[\\udffb-\\udfff]",xM="(?:"+mM+"|"+yM+")",bM="[^"+Wf+"]",ep="(?:\\ud83c[\\udde6-\\uddff]){2}",np="[\\ud800-\\udbff][\\udc00-\\udfff]",gr="["+Xf+"]",EM="\\u200d",rp="(?:"+Jf+"|"+tp+")",SM="(?:"+gr+"|"+tp+")",ip="(?:"+Zf+"(?:d|ll|m|re|s|t|ve))?",sp="(?:"+Zf+"(?:D|LL|M|RE|S|T|VE))?",ap=xM+"?",op="["+gM+"]?",_M="(?:"+EM+"(?:"+[bM,ep,np].join("|")+")"+op+ap+")*",wM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",OM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",TM=op+ap+_M,MM="(?:"+[vM,ep,np].join("|")+")"+TM,CM=RegExp([gr+"?"+Jf+"+"+ip+"(?="+[Kf,gr,"$"].join("|")+")",SM+"+"+sp+"(?="+[Kf,gr+rp,"$"].join("|")+")",gr+"?"+rp+"+"+ip,gr+"+"+sp,OM,wM,Qf,MM].join("|"),"g");function AM(e){return e.match(CM)||[]}function DM(e,t,n){return e=_i(e),t=n?void 0:t,t===void 0?aM(e)?AM(e):iM(e):e.match(t)||[]}var LM="['’]",RM=RegExp(LM,"g");function lp(e){return function(t){return zT(DM(nM(t).replace(RM,"")),e,"")}}var IM=lp(function(e,t,n){return t=t.toLowerCase(),e+(n?FT(t):t)});const kM=IM;function $M(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function cp(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=gi(n),n=n===n?n:0),t!==void 0&&(t=gi(t),t=t===t?t:0),$M(gi(e),t,n)}function PM(){this.__data__=new Qe,this.size=0}function NM(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function UM(e){return this.__data__.get(e)}function BM(e){return this.__data__.has(e)}var VM=200;function GM(e,t){var n=this.__data__;if(n instanceof Qe){var r=n.__data__;if(!Si||r.length<VM-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Je(r)}return n.set(e,t),this.size=n.size,this}function Me(e){var t=this.__data__=new Qe(e);this.size=t.size}Me.prototype.clear=PM,Me.prototype.delete=NM,Me.prototype.get=UM,Me.prototype.has=BM,Me.prototype.set=GM;function HM(e,t){return e&&vi(t,xi(t),e)}function FM(e,t){return e&&vi(t,bi(t),e)}var up=typeof z=="object"&&z&&!z.nodeType&&z,hp=up&&typeof module=="object"&&module&&!module.nodeType&&module,zM=hp&&hp.exports===up,dp=zM?Te.Buffer:void 0,fp=dp?dp.allocUnsafe:void 0;function pp(e,t){if(t)return e.slice();var n=e.length,r=fp?fp(n):new e.constructor(n);return e.copy(r),r}function WM(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 gp(){return[]}var YM=Object.prototype,qM=YM.propertyIsEnumerable,mp=Object.getOwnPropertySymbols,XM=mp?function(e){return e==null?[]:(e=Object(e),WM(mp(e),function(t){return qM.call(e,t)}))}:gp;const kl=XM;function jM(e,t){return vi(e,kl(e),t)}var ZM=Object.getOwnPropertySymbols,KM=ZM?function(e){for(var t=[];e;)Dl(t,kl(e)),e=Ll(e);return t}:gp;const vp=KM;function QM(e,t){return vi(e,vp(e),t)}function yp(e,t,n){var r=t(e);return Vt(e)?r:Dl(r,n(e))}function $l(e){return yp(e,xi,kl)}function JM(e){return yp(e,bi,vp)}var tC=Pn(Te,"DataView");const Pl=tC;var eC=Pn(Te,"Promise");const Nl=eC;var nC=Pn(Te,"Set");const mr=nC;var xp="[object Map]",rC="[object Object]",bp="[object Promise]",Ep="[object Set]",Sp="[object WeakMap]",_p="[object DataView]",iC=$n(Pl),sC=$n(Si),aC=$n(Nl),oC=$n(mr),lC=$n(_l),Bn=kn;(Pl&&Bn(new Pl(new ArrayBuffer(1)))!=_p||Si&&Bn(new Si)!=xp||Nl&&Bn(Nl.resolve())!=bp||mr&&Bn(new mr)!=Ep||_l&&Bn(new _l)!=Sp)&&(Bn=function(e){var t=kn(e),n=t==rC?e.constructor:void 0,r=n?$n(n):"";if(r)switch(r){case iC:return _p;case sC:return xp;case aC:return bp;case oC:return Ep;case lC:return Sp}return t});const vr=Bn;var cC=Object.prototype,uC=cC.hasOwnProperty;function hC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&uC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var dC=Te.Uint8Array;const sa=dC;function Ul(e){var t=new e.constructor(e.byteLength);return new sa(t).set(new sa(e)),t}function fC(e,t){var n=t?Ul(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var pC=/\w*$/;function gC(e){var t=new e.constructor(e.source,pC.exec(e));return t.lastIndex=e.lastIndex,t}var wp=ge?ge.prototype:void 0,Op=wp?wp.valueOf:void 0;function mC(e){return Op?Object(Op.call(e)):{}}function Tp(e,t){var n=t?Ul(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var vC="[object Boolean]",yC="[object Date]",xC="[object Map]",bC="[object Number]",EC="[object RegExp]",SC="[object Set]",_C="[object String]",wC="[object Symbol]",OC="[object ArrayBuffer]",TC="[object DataView]",MC="[object Float32Array]",CC="[object Float64Array]",AC="[object Int8Array]",DC="[object Int16Array]",LC="[object Int32Array]",RC="[object Uint8Array]",IC="[object Uint8ClampedArray]",kC="[object Uint16Array]",$C="[object Uint32Array]";function PC(e,t,n){var r=e.constructor;switch(t){case OC:return Ul(e);case vC:case yC:return new r(+e);case TC:return fC(e,n);case MC:case CC:case AC:case DC:case LC:case RC:case IC:case kC:case $C:return Tp(e,n);case xC:return new r;case bC:case _C:return new r(e);case EC:return gC(e);case SC:return new r;case wC:return mC(e)}}function Mp(e){return typeof e.constructor=="function"&&!Js(e)?aw(Ll(e)):{}}var NC="[object Map]";function UC(e){return Ne(e)&&vr(e)==NC}var Cp=pr&&pr.isMap,BC=Cp?Tl(Cp):UC;const VC=BC;var GC="[object Set]";function HC(e){return Ne(e)&&vr(e)==GC}var Ap=pr&&pr.isSet,FC=Ap?Tl(Ap):HC;const zC=FC;var WC=1,YC=2,qC=4,Dp="[object Arguments]",XC="[object Array]",jC="[object Boolean]",ZC="[object Date]",KC="[object Error]",Lp="[object Function]",QC="[object GeneratorFunction]",JC="[object Map]",tA="[object Number]",Rp="[object Object]",eA="[object RegExp]",nA="[object Set]",rA="[object String]",iA="[object Symbol]",sA="[object WeakMap]",aA="[object ArrayBuffer]",oA="[object DataView]",lA="[object Float32Array]",cA="[object Float64Array]",uA="[object Int8Array]",hA="[object Int16Array]",dA="[object Int32Array]",fA="[object Uint8Array]",pA="[object Uint8ClampedArray]",gA="[object Uint16Array]",mA="[object Uint32Array]",_t={};_t[Dp]=_t[XC]=_t[aA]=_t[oA]=_t[jC]=_t[ZC]=_t[lA]=_t[cA]=_t[uA]=_t[hA]=_t[dA]=_t[JC]=_t[tA]=_t[Rp]=_t[eA]=_t[nA]=_t[rA]=_t[iA]=_t[fA]=_t[pA]=_t[gA]=_t[mA]=!0,_t[KC]=_t[Lp]=_t[sA]=!1;function aa(e,t,n,r,i,s){var a,o=t&WC,l=t&YC,c=t&qC;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!me(e))return e;var u=Vt(e);if(u){if(a=hC(e),!o)return yf(e,a)}else{var d=vr(e),h=d==Lp||d==QC;if(fr(e))return pp(e,o);if(d==Rp||d==Dp||h&&!i){if(a=l||h?{}:Mp(e),!o)return l?QM(e,FM(a,e)):jM(e,HM(a,e))}else{if(!_t[d])return i?e:{};a=PC(e,d,o)}}s||(s=new Me);var f=s.get(e);if(f)return f;s.set(e,a),zC(e)?e.forEach(function(v){a.add(aa(v,t,n,v,e,s))}):VC(e)&&e.forEach(function(v,m){a.set(m,aa(v,t,n,m,e,s))});var p=c?l?JM:$l:l?bi:xi,g=u?void 0:p(e);return yw(g||e,function(v,m){g&&(m=v,v=e[m]),xf(a,m,aa(v,t,n,m,e,s))}),a}var vA=1,yA=4;function tn(e){return aa(e,vA|yA)}var xA="__lodash_hash_undefined__";function bA(e){return this.__data__.set(e,xA),this}function EA(e){return this.__data__.has(e)}function wi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Je;++t<n;)this.add(e[t])}wi.prototype.add=wi.prototype.push=bA,wi.prototype.has=EA;function Ip(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 kp(e,t){return e.has(t)}var SA=1,_A=2;function $p(e,t,n,r,i,s){var a=n&SA,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 d=-1,h=!0,f=n&_A?new wi:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var p=e[d],g=t[d];if(r)var v=a?r(g,p,d,t,e,s):r(p,g,d,e,t,s);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!Ip(t,function(m,y){if(!kp(f,y)&&(p===m||i(p,m,n,r,s)))return f.push(y)})){h=!1;break}}else if(!(p===g||i(p,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function wA(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Bl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var OA=1,TA=2,MA="[object Boolean]",CA="[object Date]",AA="[object Error]",DA="[object Map]",LA="[object Number]",RA="[object RegExp]",IA="[object Set]",kA="[object String]",$A="[object Symbol]",PA="[object ArrayBuffer]",NA="[object DataView]",Pp=ge?ge.prototype:void 0,Vl=Pp?Pp.valueOf:void 0;function UA(e,t,n,r,i,s,a){switch(n){case NA:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case PA:return!(e.byteLength!=t.byteLength||!s(new sa(e),new sa(t)));case MA:case CA:case LA:return mi(+e,+t);case AA:return e.name==t.name&&e.message==t.message;case RA:case kA:return e==t+"";case DA:var o=wA;case IA:var l=r&OA;if(o||(o=Bl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=TA,a.set(e,t);var u=$p(o(e),o(t),r,i,s,a);return a.delete(e),u;case $A:if(Vl)return Vl.call(e)==Vl.call(t)}return!1}var BA=1,VA=Object.prototype,GA=VA.hasOwnProperty;function HA(e,t,n,r,i,s){var a=n&BA,o=$l(e),l=o.length,c=$l(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:GA.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=a;++d<l;){h=o[d];var m=e[h],y=t[h];if(r)var b=a?r(y,m,h,t,e,s):r(m,y,h,e,t,s);if(!(b===void 0?m===y||i(m,y,n,r,s):b)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var S=e.constructor,_=t.constructor;S!=_&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return s.delete(e),s.delete(t),g}var FA=1,Np="[object Arguments]",Up="[object Array]",oa="[object Object]",zA=Object.prototype,Bp=zA.hasOwnProperty;function WA(e,t,n,r,i,s){var a=Vt(e),o=Vt(t),l=a?Up:vr(e),c=o?Up:vr(t);l=l==Np?oa:l,c=c==Np?oa:c;var u=l==oa,d=c==oa,h=l==c;if(h&&fr(e)){if(!fr(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Me),a||ta(e)?$p(e,t,n,r,i,s):UA(e,t,l,n,r,i,s);if(!(n&FA)){var f=u&&Bp.call(e,"__wrapped__"),p=d&&Bp.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return s||(s=new Me),i(g,v,n,r,s)}}return h?(s||(s=new Me),HA(e,t,n,r,i,s)):!1}function la(e,t,n,r,i){return e===t?!0:e==null||t==null||!Ne(e)&&!Ne(t)?e!==e&&t!==t:WA(e,t,n,r,la,i)}var YA=1,qA=2;function XA(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 d=new Me;if(r)var h=r(c,u,l,e,t,d);if(!(h===void 0?la(u,c,YA|qA,r,d):h))return!1}}return!0}function Vp(e){return e===e&&!me(e)}function jA(e){for(var t=xi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Vp(i)]}return t}function Gp(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function ZA(e){var t=jA(e);return t.length==1&&t[0][2]?Gp(t[0][0],t[0][1]):function(n){return n===e||XA(n,e,t)}}function KA(e,t){return e!=null&&t in Object(e)}function QA(e,t,n){t=If(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=ra(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&&Ol(i)&&wl(a,i)&&(Vt(e)||dr(e)))}function JA(e,t){return e!=null&&QA(e,t,KA)}var tD=1,eD=2;function nD(e,t){return Cl(e)&&Vp(t)?Gp(ra(e),t):function(n){var r=St(n,e);return r===void 0&&r===t?JA(n,e):la(t,r,tD|eD)}}function rD(e){return function(t){return t==null?void 0:t[e]}}function iD(e){return function(t){return kf(t,e)}}function sD(e){return Cl(e)?rD(ra(e)):iD(e)}function ca(e){return typeof e=="function"?e:e==null?bl:typeof e=="object"?Vt(e)?nD(e[0],e[1]):ZA(e):sD(e)}function aD(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 oD(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 lD=oD();const Hp=lD;function cD(e,t){return e&&Hp(e,t,xi)}function uD(e,t){return function(n,r){if(n==null)return n;if(!Nn(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 hD=uD(cD);const Gl=hD;function dD(e,t,n,r){return Gl(e,function(i,s,a){t(r,i,n(i),a)}),r}function fD(e,t){return function(n,r){var i=Vt(n)?aD:dD,s=t?t():{};return i(n,e,ca(r),s)}}var pD=function(){return Te.Date.now()};const Hl=pD;var gD="Expected a function",mD=Math.max,vD=Math.min;function ua(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(gD);t=gi(t)||0,me(n)&&(u=!!n.leading,d="maxWait"in n,s=d?mD(gi(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(E){var M=r,C=i;return r=i=void 0,c=E,a=e.apply(C,M),a}function p(E){return c=E,o=setTimeout(m,t),u?f(E):a}function g(E){var M=E-l,C=E-c,G=t-M;return d?vD(G,s-C):G}function v(E){var M=E-l,C=E-c;return l===void 0||M>=t||M<0||d&&C>=s}function m(){var E=Hl();if(v(E))return y(E);o=setTimeout(m,g(E))}function y(E){return o=void 0,h&&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(Hl())}function _(){var E=Hl(),M=v(E);if(r=arguments,i=this,l=E,M){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(m,t),f(l)}return o===void 0&&(o=setTimeout(m,t)),a}return _.cancel=b,_.flush=S,_}function Fl(e,t,n){(n!==void 0&&!mi(e[t],n)||n===void 0&&!(t in e))&&Qs(e,t,n)}function zl(e){return Ne(e)&&Nn(e)}function Wl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function yD(e){return vi(e,bi(e))}function xD(e,t,n,r,i,s,a){var o=Wl(e,n),l=Wl(t,n),c=a.get(l);if(c){Fl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Vt(l),f=!h&&fr(l),p=!h&&!f&&ta(l);u=l,h||f||p?Vt(o)?u=o:zl(o)?u=yf(o):f?(d=!1,u=pp(l,!0)):p?(d=!1,u=Tp(l,!0)):u=[]:pT(l)||dr(l)?(u=o,dr(o)?u=yD(o):(!me(o)||El(o))&&(u=Mp(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),Fl(e,n,u)}function Fp(e,t,n,r,i){e!==t&&Hp(t,function(s,a){if(i||(i=new Me),me(s))xD(e,t,a,n,Fp,r,i);else{var o=r?r(Wl(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),Fl(e,a,o)}},bi)}function bD(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 ED(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function SD(e,t){var n=-1,r=Nn(e)?Array(e.length):[];return Gl(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function _D(e,t){var n=Vt(e)?hf:SD;return n(e,ca(t))}var wD=1/0;function OD(e,t){return ia(_D(e,t),wD)}function TD(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 MD=Object.prototype,CD=MD.hasOwnProperty,AD=fD(function(e,t,n){CD.call(e,n)?e[n].push(t):Qs(e,n,[t])});const DD=AD;var LD="[object Map]",RD="[object Set]",ID=Object.prototype,kD=ID.hasOwnProperty;function Ce(e){if(e==null)return!0;if(Nn(e)&&(Vt(e)||typeof e=="string"||typeof e.splice=="function"||fr(e)||ta(e)||dr(e)))return!e.length;var t=vr(e);if(t==LD||t==RD)return!e.size;if(Js(e))return!Rf(e).length;for(var n in e)if(kD.call(e,n))return!1;return!0}function zp(e,t){return la(e,t)}var $D=lp(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const yr=$D;var PD=Dw(function(e,t,n){Fp(e,t,n)});const tt=PD;function ND(e,t){var n;return Gl(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function UD(e,t,n){var r=Vt(e)?Ip:ND;return n&&Sf(e,t,n)&&(t=void 0),r(e,ca(t))}var BD=1/0,VD=mr&&1/Bl(new mr([,-0]))[1]==BD?function(e){return new mr(e)}:lw;const GD=VD;var HD=200;function Wp(e,t,n){var r=-1,i=_w,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=bD;else if(s>=HD){var c=t?null:GD(e);if(c)return Bl(c);a=!1,i=kp,l=new wi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var FD=Ef(function(e){var t=ED(e);return zl(t)&&(t=void 0),Wp(ia(e,1,zl,!0),ca(t))});const zD=FD;function Oi(e){return e&&e.length?Wp(e):[]}var Yl=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Yl||{}),ql=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(ql||{}),Xl=(e=>(e.UPDATE="model-update",e))(Xl||{}),Yp=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(Yp||{}),jl=(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))(jl||{}),Zl=(e=>(e.CHANGE="zoom-domain-change",e))(Zl||{}),Kl=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Kl||{}),Ql=(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))(Ql||{}),Jl=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Jl||{}),tc=(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))(tc||{}),ec=(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))(ec||{}),nc=(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))(nc||{}),rc=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(rc||{}),ic=(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))(ic||{}),sc=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(sc||{}),ac=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(ac||{}),oc=(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))(oc||{}),lc=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(lc||{}),cc=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(cc||{}),xr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(xr||{}),uc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(uc||{}),qp=(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))(qp||{}),Xp=(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))(Xp||{}),jp=(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))(jp||{}),Zp=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Zp||{}),Kp=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Kp||{}),br=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(br||{});const w=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:jp,Area:Jl,Axis:Ql,Bar:rc,Boxplot:ic,CanvasZoom:Kl,Chart:Yl,Choropleth:br,CirclePack:Xp,Gauge:nc,Heatmap:Kp,Legend:qp,Line:ac,Meter:Zp,Modal:ql,Model:Xl,Pie:ec,Radar:oc,Scatter:sc,Threshold:uc,Toolbar:Yp,Tooltip:xr,Tree:lc,Treemap:cc,WordCloud:tc,ZoomBar:jl,ZoomDomain:Zl},Symbol.toStringTag,{value:"Module"}));var Z=(e=>(e.HTML="html",e.SVG="svg",e))(Z||{}),hc=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(hc||{}),Q=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(Q||{}),F=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(F||{}),Ae=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ae||{}),ve=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(ve||{}),Nt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Nt||{}),j=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(j||{}),Er=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Er||{}),It=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(It||{}),Sr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Sr||{}),ha=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(ha||{}),bt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(bt||{}),nt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(nt||{}),Vn=(e=>(e.CENTER="center",e))(Vn||{}),Ti=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ti||{}),kt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(kt||{}),Ue=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Ue||{}),Be=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Be||{}),Gn=(e=>(e.SEMI="semi",e.FULL="full",e))(Gn||{}),da=(e=>(e.UP="up",e.DOWN="down",e))(da||{}),Mi=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Mi||{}),Ci=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Ci||{}),le=(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))(le||{}),Mt=(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))(Mt||{}),fa=(e=>(e.LEFT="left",e.RIGHT="right",e))(fa||{}),$t=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))($t||{}),Ai=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Ai||{}),_r=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(_r||{}),Di=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Di||{}),Ve=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Ve||{});const ee="cds",en={opacity:{unselected:.05,selected:.4}},fn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},wr={duration:1e3,ease:Xu,zoomLevel:3},Or={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},Qp={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},ye={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},WD={defaultBins:10},At={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}},nn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Gt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},wt={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}},Hn={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},De={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Jp={minCellDividerDimension:16,chartPadding:.5},tg={default:{size:24}},YD={horizontalOffset:10},eg={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}},ce={height:{[Ae.GRAPH_VIEW]:32,[Ae.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},qD=[{type:$t.RADIUS,name:"Radius"},{type:$t.AREA,name:"Poor area"},{type:$t.AREA,name:"Satisfactory area"},{type:$t.AREA,name:"Great area"},{type:$t.QUARTILE,name:"Quartiles"}];function XD(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=Sn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Ct(e,t){var i;const n=tn(e),r=Object.keys(t.axes||{});(i=t==null?void 0:t.toolbar)!=null&&i.controls&&delete n.toolbar.controls,r.length===0&&delete n.axes;for(const s in n.axes)if(r.includes(s)){const a=t.axes[s];(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");const o=a.mapsTo;if(o==null){const l=a.scaleType;l==null?a.mapsTo="value":l===j.TIME?a.mapsTo="date":l===j.LABELS&&(a.mapsTo="key")}}else delete n.axes[s];return dc(n,t),tt(n,t)}function rn(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 Li(e){const n=/\(([^)]+)\)/.exec(e);if(n&&n.length>1){const r=n[1].split(",");if(r.length>1)return{x:parseFloat(r[0]),y:parseFloat(r[1])}}return{x:0,y:0}}function ng(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 Ri(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 dc(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=qD.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=zD(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},rg=(e,t)=>t===Nt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,jt=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=rg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function sn(e,t,n){return n===Nt.VERTICAL?[e,t]:[t,e]}function fc(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 Ii(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 ki(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)?ZD(o,function(d){return d.test(a)}):jD(o,function(d){return d.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 jD(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function ZD(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function KD(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 pa(e){"@babel/helpers - typeof";return pa=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},pa(e)}function Ut(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 it(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function dt(e){it(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||pa(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 ig(e,t){it(2,arguments);var n=dt(e),r=Ut(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function pc(e,t){it(2,arguments);var n=dt(e),r=Ut(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)}function ga(e,t){it(2,arguments);var n=dt(e).getTime(),r=Ut(t);return new Date(n+r)}var QD=36e5;function sg(e,t){it(2,arguments);var n=Ut(t);return ga(e,n*QD)}var JD={};function ma(){return JD}function gc(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 ag(e){it(1,arguments);var t=dt(e);return t.setHours(0,0,0,0),t}var tL=864e5;function eL(e,t){it(2,arguments);var n=ag(e),r=ag(t),i=n.getTime()-gc(n),s=r.getTime()-gc(r);return Math.round((i-s)/tL)}var nL=6e4;function mc(e,t){it(2,arguments);var n=Ut(t);return ga(e,n*nL)}function vc(e,t){it(2,arguments);var n=Ut(t);return ga(e,n*1e3)}function og(e,t){it(2,arguments);var n=Ut(t);return pc(e,n*12)}function $i(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}var rL=6e4,iL=36e5;function sL(e){return it(1,arguments),e instanceof Date||pa(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function aL(e){if(it(1,arguments),!sL(e)&&typeof e!="number")return!1;var t=dt(e);return!isNaN(Number(t))}function oL(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function lL(e,t){it(2,arguments);var n=dt(e),r=dt(t);return n.getFullYear()-r.getFullYear()}function lg(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 cL(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=lg(n,r),s=Math.abs(eL(n,r));n.setDate(n.getDate()-i*s);var a=+(lg(n,r)===-i),o=i*(s-a);return o===0?0:o}function yc(e,t){return it(2,arguments),dt(e).getTime()-dt(t).getTime()}var cg={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},uL="trunc";function xc(e){return e?cg[e]:cg[uL]}function hL(e,t,n){it(2,arguments);var r=yc(e,t)/iL;return xc(n==null?void 0:n.roundingMethod)(r)}function ug(e,t,n){it(2,arguments);var r=yc(e,t)/rL;return xc(n==null?void 0:n.roundingMethod)(r)}function dL(e){it(1,arguments);var t=dt(e);return t.setHours(23,59,59,999),t}function fL(e){it(1,arguments);var t=dt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function pL(e){it(1,arguments);var t=dt(e);return dL(t).getTime()===fL(t).getTime()}function gL(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=$i(n,r),s=Math.abs(oL(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=$i(n,r)===-i;pL(dt(e))&&s===1&&$i(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function hg(e,t,n){it(2,arguments);var r=yc(e,t)/1e3;return xc(n==null?void 0:n.roundingMethod)(r)}function mL(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=$i(n,r),s=Math.abs(lL(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=$i(n,r)===-i,o=i*(s-Number(a));return o===0?0:o}function vL(e,t){it(2,arguments);var n=Ut(t);return ga(e,-n)}var yL=864e5;function xL(e){it(1,arguments);var t=dt(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/yL)+1}function va(e){it(1,arguments);var t=1,n=dt(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 dg(e){it(1,arguments);var t=dt(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=va(r),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=va(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function bL(e){it(1,arguments);var t=dg(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=va(n);return r}var EL=6048e5;function SL(e){it(1,arguments);var t=dt(e),n=va(t).getTime()-bL(t).getTime();return Math.round(n/EL)+1}function ya(e,t){var n,r,i,s,a,o,l,c;it(1,arguments);var u=ma(),d=Ut((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(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=dt(e),f=h.getUTCDay(),p=(f<d?7:0)+f-d;return h.setUTCDate(h.getUTCDate()-p),h.setUTCHours(0,0,0,0),h}function fg(e,t){var n,r,i,s,a,o,l,c;it(1,arguments);var u=dt(e),d=u.getUTCFullYear(),h=ma(),f=Ut((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:h.firstWeekContainsDate)!==null&&r!==void 0?r:(l=h.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(d+1,0,f),p.setUTCHours(0,0,0,0);var g=ya(p,t),v=new Date(0);v.setUTCFullYear(d,0,f),v.setUTCHours(0,0,0,0);var m=ya(v,t);return u.getTime()>=g.getTime()?d+1:u.getTime()>=m.getTime()?d:d-1}function _L(e,t){var n,r,i,s,a,o,l,c;it(1,arguments);var u=ma(),d=Ut((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),h=fg(e,t),f=new Date(0);f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0);var p=ya(f,t);return p}var wL=6048e5;function OL(e,t){it(1,arguments);var n=dt(e),r=ya(n,t).getTime()-_L(n,t).getTime();return Math.round(r/wL)+1}function vt(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var TL={y:function(t,n){var r=t.getUTCFullYear(),i=r>0?r:1-r;return vt(n==="yy"?i%100:i,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):vt(r+1,2)},d:function(t,n){return vt(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return vt(t.getUTCHours()%12||12,n.length)},H:function(t,n){return vt(t.getUTCHours(),n.length)},m:function(t,n){return vt(t.getUTCMinutes(),n.length)},s:function(t,n){return vt(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,i=t.getUTCMilliseconds(),s=Math.floor(i*Math.pow(10,r-3));return vt(s,n.length)}};const pn=TL;var Tr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ML={G:function(t,n,r){var i=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var i=t.getUTCFullYear(),s=i>0?i:1-i;return r.ordinalNumber(s,{unit:"year"})}return pn.y(t,n)},Y:function(t,n,r,i){var s=fg(t,i),a=s>0?s:1-s;if(n==="YY"){var o=a%100;return vt(o,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):vt(a,n.length)},R:function(t,n){var r=dg(t);return vt(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return vt(r,n.length)},Q:function(t,n,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return vt(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,n,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return vt(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,n,r){var i=t.getUTCMonth();switch(n){case"M":case"MM":return pn.M(t,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(t,n,r){var i=t.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return vt(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(t,n,r,i){var s=OL(t,i);return n==="wo"?r.ordinalNumber(s,{unit:"week"}):vt(s,n.length)},I:function(t,n,r){var i=SL(t);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):vt(i,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):pn.d(t,n)},D:function(t,n,r){var i=xL(t);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):vt(i,n.length)},E:function(t,n,r){var i=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(t,n,r,i){var s=t.getUTCDay(),a=(s-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(a);case"ee":return vt(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(t,n,r,i){var s=t.getUTCDay(),a=(s-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(a);case"cc":return vt(a,n.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(t,n,r){var i=t.getUTCDay(),s=i===0?7:i;switch(n){case"i":return String(s);case"ii":return vt(s,n.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(t,n,r){var i=t.getUTCHours(),s=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,n,r){var i=t.getUTCHours(),s;switch(i===12?s=Tr.noon:i===0?s=Tr.midnight:s=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,n,r){var i=t.getUTCHours(),s;switch(i>=17?s=Tr.evening:i>=12?s=Tr.afternoon:i>=4?s=Tr.morning:s=Tr.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return pn.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):pn.H(t,n)},K:function(t,n,r){var i=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):vt(i,n.length)},k:function(t,n,r){var i=t.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):vt(i,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):pn.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):pn.s(t,n)},S:function(t,n){return pn.S(t,n)},X:function(t,n,r,i){var s=i._originalDate||t,a=s.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return gg(a);case"XXXX":case"XX":return Fn(a);case"XXXXX":case"XXX":default:return Fn(a,":")}},x:function(t,n,r,i){var s=i._originalDate||t,a=s.getTimezoneOffset();switch(n){case"x":return gg(a);case"xxxx":case"xx":return Fn(a);case"xxxxx":case"xxx":default:return Fn(a,":")}},O:function(t,n,r,i){var s=i._originalDate||t,a=s.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+pg(a,":");case"OOOO":default:return"GMT"+Fn(a,":")}},z:function(t,n,r,i){var s=i._originalDate||t,a=s.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+pg(a,":");case"zzzz":default:return"GMT"+Fn(a,":")}},t:function(t,n,r,i){var s=i._originalDate||t,a=Math.floor(s.getTime()/1e3);return vt(a,n.length)},T:function(t,n,r,i){var s=i._originalDate||t,a=s.getTime();return vt(a,n.length)}};function pg(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+vt(s,2)}function gg(e,t){if(e%60===0){var n=e>0?"-":"+";return n+vt(Math.abs(e)/60,2)}return Fn(e,t)}function Fn(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e),s=vt(Math.floor(i/60),2),a=vt(i%60,2);return r+s+n+a}const CL=ML;var mg=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},vg=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},AL=function(t,n){var r=t.match(/(P+)(p+)?/)||[],i=r[1],s=r[2];if(!s)return mg(t,n);var a;switch(i){case"P":a=n.dateTime({width:"short"});break;case"PP":a=n.dateTime({width:"medium"});break;case"PPP":a=n.dateTime({width:"long"});break;case"PPPP":default:a=n.dateTime({width:"full"});break}return a.replace("{{date}}",mg(i,n)).replace("{{time}}",vg(s,n))},DL={p:vg,P:AL};const LL=DL;var RL=["D","DD"],IL=["YY","YYYY"];function kL(e){return RL.indexOf(e)!==-1}function $L(e){return IL.indexOf(e)!==-1}function yg(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 PL={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"}},NL=function(t,n,r){var i,s=PL[t];return typeof s=="string"?i=s:n===1?i=s.one:i=s.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const UL=NL;var BL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},VL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},GL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},HL={date:fc({formats:BL,defaultWidth:"full"}),time:fc({formats:VL,defaultWidth:"full"}),dateTime:fc({formats:GL,defaultWidth:"full"})};const FL=HL;var zL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WL=function(t,n,r,i){return zL[t]};const YL=WL;var qL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},XL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jL={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"]},ZL={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"]},KL={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"}},QL={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"}},JL=function(t,n){var r=Number(t),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},tR={ordinalNumber:JL,era:Ii({values:qL,defaultWidth:"wide"}),quarter:Ii({values:XL,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Ii({values:jL,defaultWidth:"wide"}),day:Ii({values:ZL,defaultWidth:"wide"}),dayPeriod:Ii({values:KL,defaultWidth:"wide",formattingValues:QL,defaultFormattingWidth:"wide"})};const eR=tR;var nR=/^(\d+)(th|st|nd|rd)?/i,rR=/\d+/i,iR={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},sR={any:[/^b/i,/^(a|c)/i]},aR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},oR={any:[/1/i,/2/i,/3/i,/4/i]},lR={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},cR={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]},uR={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},hR={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]},dR={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},fR={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}},pR={ordinalNumber:KD({matchPattern:nR,parsePattern:rR,valueCallback:function(t){return parseInt(t,10)}}),era:ki({matchPatterns:iR,defaultMatchWidth:"wide",parsePatterns:sR,defaultParseWidth:"any"}),quarter:ki({matchPatterns:aR,defaultMatchWidth:"wide",parsePatterns:oR,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ki({matchPatterns:lR,defaultMatchWidth:"wide",parsePatterns:cR,defaultParseWidth:"any"}),day:ki({matchPatterns:uR,defaultMatchWidth:"wide",parsePatterns:hR,defaultParseWidth:"any"}),dayPeriod:ki({matchPatterns:dR,defaultMatchWidth:"any",parsePatterns:fR,defaultParseWidth:"any"})},gR={code:"en-US",formatDistance:UL,formatLong:FL,formatRelative:YL,localize:eR,match:pR,options:{weekStartsOn:0,firstWeekContainsDate:1}};const xg=gR;var mR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yR=/^'([^]*?)'?$/,xR=/''/g,bR=/[a-zA-Z]/;function Mr(e,t,n){var r,i,s,a,o,l,c,u,d,h,f,p,g,v,m,y,b,S;it(2,arguments);var _=String(t),E=ma(),M=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:E.locale)!==null&&r!==void 0?r:xg,C=Ut((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:(d=E.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var G=Ut((f=(p=(g=(v=n==null?void 0:n.weekStartsOn)!==null&&v!==void 0?v:n==null||(m=n.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&g!==void 0?g: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(!(G>=0&&G<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!M.localize)throw new RangeError("locale must contain localize property");if(!M.formatLong)throw new RangeError("locale must contain formatLong property");var I=dt(e);if(!aL(I))throw new RangeError("Invalid time value");var T=gc(I),L=vL(I,T),R={firstWeekContainsDate:C,weekStartsOn:G,locale:M,_originalDate:I},k=_.match(vR).map(function(O){var U=O[0];if(U==="p"||U==="P"){var P=LL[U];return P(O,M.formatLong)}return O}).join("").match(mR).map(function(O){if(O==="''")return"'";var U=O[0];if(U==="'")return ER(O);var P=CL[U];if(P)return!(n!=null&&n.useAdditionalWeekYearTokens)&&$L(O)&&yg(O,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&kL(O)&&yg(O,t,String(e)),P(L,O,M.localize,R);if(U.match(bR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");return O}).join("");return k}function ER(e){var t=e.match(yR);return t?t[1].replace(xR,"'"):e}function SR(e,t){it(2,arguments);var n=Ut(t);return ig(e,-n)}function _R(e,t){it(2,arguments);var n=Ut(t);return pc(e,-n)}function wR(e,t){it(2,arguments);var n=Ut(t);return sg(e,-n)}function bg(e,t){it(2,arguments);var n=Ut(t);return mc(e,-n)}function Eg(e,t){it(2,arguments);var n=Ut(t);return vc(e,-n)}function OR(e,t){it(2,arguments);var n=Ut(t);return og(e,-n)}const Cr={type:ve.END_LINE,threshold:16,numCharacter:14},TR={enabled:!0,position:Er.BOTTOM,clickable:!0,truncation:Cr,alignment:It.LEFT,order:null,additionalItems:[]},MR={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},CR={enabled:!0},Sg={enabled:!0,showTotal:!0,truncation:Cr,groupLabel:"Group"},_g={top:{visible:!0,includeZero:!0,truncation:Cr},bottom:{visible:!0,includeZero:!0,truncation:Cr},left:{visible:!0,includeZero:!0,truncation:Cr},right:{visible:!0,includeZero:!0,truncation:Cr}},xa={addSpaceOnEdges:1,showDayName:!1,localeObject:xg,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"}}},AR=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),qt={width:null,height:null,resizable:!0,theme:hc.WHITE,tooltip:Sg,legend:TR,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:Mt.SHOW_AS_DATATABLE},...AR?[{type:Mt.MAKE_FULLSCREEN}]:[],{type:Mt.EXPORT_CSV},{type:Mt.EXPORT_PNG},{type:Mt.EXPORT_JPG}]}},wg=tt({},qt,{thematic:{projection:Ve.geoNaturalEarth1}}),Pi=tt({},qt,{axes:_g,timeScale:xa,grid:MR,ruler:CR,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ae.GRAPH_VIEW}}}),zn=tt({},Pi,{bars:{maxWidth:16,spacingFactor:.25},timeScale:tt(xa,{addSpaceOnEdges:1})}),DR=tt({},zn,{}),LR=tt({},zn,{}),RR=tt({},zn,{bars:tt({},zn.bars,{dividerSize:1.5})}),IR=tt({},zn,{}),bc=tt({},Pi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),kR=bc,Og=tt({},bc,{points:{radius:3,filled:!1,enabled:!0}}),Tg=tt({},Og,{timeScale:tt(xa,{addSpaceOnEdges:0})}),$R=Tg,PR=tt({},Pi,{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:$t.RADIUS,name:"Radius"}]}}),NR=tt({},Pi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:$t.AREA,name:"Poor area"},{type:$t.AREA,name:"Satisfactory area"},{type:$t.AREA,name:"Great area"},{type:$t.QUARTILE,name:"Quartiles"}]}}),UR=tt({},zn,{bars:{dividerSize:1.5},timeScale:tt(xa,{addSpaceOnEdges:0})}),BR=tt({},qt,{tooltip:tt({},Sg,{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"}}),Mg=tt({},qt,{pie:{labels:{formatter:null,enabled:!0},alignment:It.LEFT,sortFunction:null,valueMapsTo:"value"}}),VR=tt({},qt,{legend:{enabled:!1},gauge:{type:Gn.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:It.LEFT}}),GR=tt({},Mg,{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:It.LEFT}}),Cg=tt({},qt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),HR=tt({},Cg,{legend:{enabled:!0}}),FR=tt({},qt,{radar:{axes:{angle:"key",value:"value"},alignment:It.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),zR=tt({},zn,{comboChartTypes:[]}),WR=tt({tree:{type:ha.TREE}},qt,{}),YR=tt({},qt,{data:tt(qt.data,{groupMapsTo:"name"})}),qR=tt({},qt,Or,{data:tt(qt.data,{groupMapsTo:"name"})}),XR=tt({},qt,{alluvial:{data:tt(qt.data,{groupMapsTo:"source"}),nodeAlignment:It.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),jR=tt({},qt,{axes:_g,heatmap:{divider:{state:_r.AUTO},colorLegend:{type:"linear"}}}),ZR=tt({},wg,{choropleth:{colorLegend:{type:"linear"}}}),Et={alluvialChart:XR,areaChart:Tg,axisChart:Pi,boxplotChart:IR,bubbleChart:PR,bulletChart:NR,chart:qt,circlePackChart:qR,choroplethChart:ZR,comboChart:zR,donutChart:GR,gaugeChart:VR,groupedBarChart:LR,heatmapChart:jR,histogramChart:UR,lineChart:Og,lollipopChart:kR,meterChart:Cg,pieChart:Mg,proportionalMeterChart:HR,radarChart:FR,scatterChart:bc,simpleBarChart:DR,stackedAreaChart:$R,stackedBarChart:RR,thematicChart:wg,treeChart:WR,treemapChart:YR,wordCloudChart:BR};var Ag=(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))(Ag||{});const Ec=[["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 Dg(e,t,n,r,i){const s=t===0,a=Number(Mr(new Date(e),"c"))===2,o=Number(Mr(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ea(e)||Ni(e,l)||gn(e);case"minute":return s||Ea(e)||Ni(e,l)||gn(e);case"30minutes":return s||Ea(e)||Ni(e,l)||gn(e);case"hourly":return s||Ea(e)||Ni(e,l)||gn(e);case"daily":return i?s||a||gn(e):s||Ni(e,l)||gn(e);case"weekly":return s||a||gn(e);case"monthly":return s||gn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function Sc(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 d=Dg(e,t,n,r,s)?c:u;r==="15seconds"&&o.getMilliseconds()!==0&&(d=d.replace("pp","h:mm:ss.SSS a"));const h=i.localeObject;return Mr(o,d,{locale:h})}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 KR(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function QR(e){const t=Ec.reduce((n,[,r],i)=>{const s=Ec[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return Ec[t][0]}function _c(e,t){if(Ag[t])return t;if(e.length===1)return"15seconds";const n=KR(e),r=cn(n);return QR(r)}function Ea(e){const{s:t,m:n,H:r}=ba(e);return r===0&&n===0&&t===0}function Ni(e,t){const n=ba(e).M,r=ba(t).M;return n!==r}function gn(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 Lg(e){return e===void 0?"":e.toISOString()}class Ge{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===j.LINEAR||c===j.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===j.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=At.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(a=>r.find(o=>o.name===a[i]&&o.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(tn(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(r=>t.includes(r.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=At.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(r=>r.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(r=>r.name)}aggregateBinDataByGroup(t){return DD(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=WD.defaultBins}=s,l=Array.isArray(o),c=hv().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],d=Array.from(new Set(t.map(f=>f[a]))),h=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,g=this.aggregateBinDataByGroup(f);d.forEach(v=>{h.push({group:v,key:p,value:g[v]||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 xl().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=Oi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Lg(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===j.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===j.LOG||o===j.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("-"),d={x0:c,x1:u},h=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{d[f]=h.filter(p=>p[i]===f).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Lg(f[p])===l:f[p].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]: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 c=TD(o.map(u=>[u.sharedStackKey,0]));o.forEach(u=>{a.forEach(d=>{c[u.sharedStackKey]+=u[d]})}),o.forEach(u=>{a.forEach(d=>{const h=c[u.sharedStackKey];c[u.sharedStackKey]?u[d]=u[d]/h*100:u[d]=0})})}return(r?xl().offset(v_):xl()).keys(a)(o).map((c,u)=>Object.keys(c).filter(d=>!isNaN(d)).map(d=>{const h=c[d];return h[s]=a[u],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();dc(n,t),this.set({options:tt(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(w.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=At.items.status,i=this.getDataGroups(),s=i.some(u=>u.status===r),a=i.filter(u=>u.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((u,d)=>{i[d].status=n});else{const u=i.findIndex(d=>d.name===t);i[u].status=i[u].status===r?n:r}else i.forEach((u,d)=>{i[d].status=u.name===t?n:r});const o=i.filter(u=>u.status===n),l=this.getOptions();i.some(u=>u.status===r)?l.data.selectedGroups=o.map(u=>u.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(w.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 d=x(i,o);d?l=d: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==="–"?"–":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}=At.items.status,s=this.getOptions(),a=Oi(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(c=>a.includes(c))||(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(i=>{this.allDataGroups.includes(i)||console.warn(`"${i}" does not exist in data groups.`)}),this.allDataGroups.filter(i=>n[i]).forEach(i=>this.colorScale[i]=n[i])}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=Qp.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=ks().range(o).domain(this.allDataGroups)}}function JR(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 t2=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function an(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Sa(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function e2(e){const t=Sa(e,"border-left-width"),n=Sa(e,"border-right-width");return e.clientWidth+t+n}function n2(e){const t=Sa(e,"border-top-width"),n=Sa(e,"border-bottom-width");return e.clientHeight+t+n}function Rg(e,t={}){const n=t.width||e2(e),r=t.height||n2(e);return{width:n,height:r}}function r2(){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 ue=16384;function i2(e){(e.width>ue||e.height>ue)&&(e.width>ue&&e.height>ue?e.width>e.height?(e.height*=ue/e.width,e.width=ue):(e.width*=ue/e.height,e.height=ue):e.width>ue?(e.height*=ue/e.width,e.width=ue):(e.width*=ue/e.height,e.height=ue))}function _a(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 s2(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function a2(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),s2(i)}const ne=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ne(n,t)};function o2(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function l2(e){return an(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function c2(e,t,n){const r=`.${e}:${t}`,i=n.cssText?o2(n):l2(n);return document.createTextNode(`${r}{${i}}`)}function Ig(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=t2();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(c2(s,n,r)),t.appendChild(a)}function u2(e,t){Ig(e,t,":before"),Ig(e,t,":after")}const kg="application/font-woff",$g="image/jpeg",h2={woff:kg,woff2:kg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:$g,jpeg:$g,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function d2(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function wc(e){const t=d2(e).toLowerCase();return h2[t]||""}function f2(e){return e.split(/,/)[1]}function Oc(e){return e.search(/^(data:)/)!==-1}function Pg(e,t){return`data:${t};base64,${e}`}async function Ng(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 Tc={};function p2(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 Mc(e,t,n){const r=p2(e,t,n.includeQueryParams);if(Tc[r]!=null)return Tc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Ng(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),f2(o)));i=Pg(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 Tc[r]=i,i}async function g2(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):_a(t)}async function m2(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 _a(o)}const n=e.poster,r=wc(n),i=await Mc(n,r,t);return _a(i)}async function v2(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await wa(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function y2(e,t){return ne(e,HTMLCanvasElement)?g2(e):ne(e,HTMLVideoElement)?m2(e,t):ne(e,HTMLIFrameElement)?v2(e):e.cloneNode(!1)}const x2=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function b2(e,t,n){var r,i;let s=[];return x2(e)&&e.assignedNodes?s=an(e.assignedNodes()):ne(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=an(e.contentDocument.body.childNodes):s=an(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||ne(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>wa(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function E2(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):an(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`),ne(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 S2(e,t){ne(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ne(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function _2(e,t){if(ne(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function w2(e,t){return ne(t,Element)&&(E2(e,t),u2(e,t),S2(e,t),_2(e,t)),t}async function O2(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 o=n[s].getAttribute("xlink:href");if(o){const l=e.querySelector(o),c=document.querySelector(o);!l&&c&&!r[o]&&(r[o]=await wa(c,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 wa(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>y2(r,t)).then(r=>b2(e,r,t)).then(r=>w2(e,r)).then(r=>O2(r,t))}const Ug=/url\((['"]?)([^'"]+?)\1\)/g,T2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,M2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function C2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function A2(e){const t=[];return e.replace(Ug,(n,r,i)=>(t.push(i),n)),t.filter(n=>!Oc(n))}async function D2(e,t,n,r,i){try{const s=n?JR(t,n):t,a=wc(t);let o;if(i){const l=await i(s);o=Pg(l,a)}else o=await Mc(s,a,r);return e.replace(C2(t),`$1${o}$3`)}catch{}return e}function L2(e,{preferredFontFormat:t}){return t?e.replace(M2,n=>{for(;;){const[r,,i]=T2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Bg(e){return e.search(Ug)!==-1}async function Vg(e,t,n){if(!Bg(e))return e;const r=L2(e,n);return A2(r).reduce((s,a)=>s.then(o=>D2(o,a,t,n)),Promise.resolve(r))}async function Oa(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Vg(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function R2(e,t){await Oa("background",e,t)||await Oa("background-image",e,t),await Oa("mask",e,t)||await Oa("mask-image",e,t)}async function I2(e,t){const n=ne(e,HTMLImageElement);if(!(n&&!Oc(e.src))&&!(ne(e,SVGImageElement)&&!Oc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Mc(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 k2(e,t){const r=an(e.childNodes).map(i=>Gg(i,t));await Promise.all(r).then(()=>e)}async function Gg(e,t){ne(e,Element)&&(await R2(e,t),await I2(e,t),await k2(e,t))}function $2(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 Hg={};async function Fg(e){let t=Hg[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Hg[e]=t,t}async function zg(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let o=a.replace(r,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Ng(o,t.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>n)}function Wg(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 P2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{an(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Fg(l).then(u=>zg(u,t)).then(u=>Wg(u).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).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(Fg(i.href).then(o=>zg(o,t)).then(o=>Wg(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{an(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function N2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Bg(t.style.getPropertyValue("src")))}async function U2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=an(e.ownerDocument.styleSheets),r=await P2(n,t);return N2(r)}async function B2(e,t){const n=await U2(e,t);return(await Promise.all(n.map(i=>{const s=i.parentStyleSheet?i.parentStyleSheet.href:null;return Vg(i.cssText,s,t)}))).join(`
|
|
3
|
-
`)}async function
|
|
1
|
+
(function(z,xe){typeof exports=="object"&&typeof module<"u"?xe(exports):typeof define=="function"&&define.amd?define(["exports"],xe):(z=typeof globalThis<"u"?globalThis:z||self,xe(z.Charts={}))})(this,function(z){"use strict";function xe(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Wm(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ga(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===Wm?e:Ym,n=e,r=e);function i(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<0?c=d+1:u=d}while(c<u)}return c}function s(o,l,c=0,u=o.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(o[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function a(o,l,c=0,u=o.length){const d=i(o,l,c,u-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Ym(){return 0}function qm(e){return e===null?NaN:+e}function*Xm(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 jm=Ga(xe).right;Ga(qm).center;const Ha=jm;function Zm(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 be(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 tu extends Map{constructor(t,n=Jm){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(eu(this,t))}has(t){return super.has(eu(this,t))}set(t,n){return super.set(Km(this,t),n)}delete(t){return super.delete(Qm(this,t))}}function eu({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Km({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Qm({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Jm(e){return e!==null&&typeof e=="object"?e.valueOf():e}function tv(e){return e}function ev(e=xe){if(e===xe)return nu;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 nu(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var nv=Array.prototype,rv=nv.slice;function Fa(e){return()=>e}const iv=Math.sqrt(50),sv=Math.sqrt(10),av=Math.sqrt(2);function Fi(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>=iv?10:s>=sv?5:s>=av?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?Fi(e,t,n*2):[o,l,c]}function zi(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?Fi(t,e,n):Fi(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 qn(e,t,n){return t=+t,e=+e,n=+n,Fi(e,t,n)[2]}function za(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?qn(t,e,n):qn(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ov(e,t,n){let r;for(;;){const i=qn(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 lv(e){return Math.max(1,Math.ceil(Math.log(Zm(e))/Math.LN2)+1)}function cv(){var e=tv,t=be,n=lv;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const b=h,S=+f;if(t===be&&([d,h]=ov(d,h,S)),f=zi(d,h,S),f[0]<=d&&(l=qn(d,h,S)),f[f.length-1]>=h)if(b>=h&&t===be){const _=qn(d,h,S);isFinite(_)&&(_>0?h=(Math.floor(h/_)+1)*_:_<0&&(h=(Math.ceil(h*-_)+1)/-_))}else f.pop()}for(var p=f.length,g=0,v=p;f[g]<=d;)++g;for(;f[v-1]>h;)--v;(g||v<p)&&(f=f.slice(g,v),p=v-g);var m=new Array(p+1),y;for(s=0;s<=p;++s)y=m[s]=[],y.x0=s>0?f[s-1]:d,y.x1=s<p?f[s]:h;if(isFinite(l)){if(l>0)for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&m[Math.min(p,Math.floor((o-d)/l))].push(i[s]);else if(l<0){for(s=0;s<a;++s)if((o=c[s])!=null&&d<=o&&o<=h){const b=Math.floor((d-o)*l);m[Math.min(p,b+(f[b]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&m[Ha(f,o,0,p)].push(i[s]);return m}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Fa(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Fa([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Fa(Array.isArray(i)?rv.call(i):i),r):n},r}function En(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 cn(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 ru(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?nu:ev(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*d/l+h)),p=Math.min(r,Math.floor(t+(l-c)*d/l+h));ru(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(kr(e,n,t),i(e[r],s)>0&&kr(e,n,r);a<o;){for(kr(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?kr(e,n,o):(++o,kr(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function kr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Wa(e,t,n){if(e=Float64Array.from(Xm(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return cn(e);if(t>=1)return En(e);var r,i=(r-1)*t,s=Math.floor(i),a=En(ru(e,s).subarray(0,s+1)),o=cn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*uv(e){for(const t of e)yield*t}function iu(e){return Array.from(uv(e))}function hv(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 dv(e){return e}var Wi=1,Yi=2,Ya=3,$r=4,su=1e-6;function fv(e){return"translate("+e+",0)"}function pv(e){return"translate(0,"+e+")"}function gv(e){return t=>+e(t)}function mv(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function vv(){return!this.__axis}function qi(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===Wi||e===$r?-1:1,u=e===$r||e===Yi?"x":"y",d=e===Wi||e===Ya?fv:pv;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):dv),v=Math.max(s,0)+o,m=t.range(),y=+m[0]+l,b=+m[m.length-1]+l,S=(t.bandwidth?mv:gv)(t.copy(),l),_=f.selection?f.selection():f,E=_.selectAll(".domain").data([null]),M=_.selectAll(".tick").data(p,t).order(),C=M.exit(),G=M.enter().append("g").attr("class","tick"),I=M.select("line"),T=M.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),M=M.merge(G),I=I.merge(G.append("line").attr("stroke","currentColor").attr(u+"2",c*s)),T=T.merge(G.append("text").attr("fill","currentColor").attr(u,c*v).attr("dy",e===Wi?"0em":e===Ya?"0.71em":"0.32em")),f!==_&&(E=E.transition(f),M=M.transition(f),I=I.transition(f),T=T.transition(f),C=C.transition(f).attr("opacity",su).attr("transform",function(L){return isFinite(L=S(L))?d(L+l):this.getAttribute("transform")}),G.attr("opacity",su).attr("transform",function(L){var R=this.parentNode.__axis;return d((R&&isFinite(R=R(L))?R:S(L))+l)})),C.remove(),E.attr("d",e===$r||e===Yi?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),M.attr("opacity",1).attr("transform",function(L){return d(S(L)+l)}),I.attr(u+"2",c*s),T.attr(u,c*v).text(g),_.filter(vv).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Yi?"start":e===$r?"end":"middle"),_.each(function(){this.__axis=S})}return h.scale=function(f){return arguments.length?(t=f,h):t},h.ticks=function(){return n=Array.from(arguments),h},h.tickArguments=function(f){return arguments.length?(n=f==null?[]:Array.from(f),h):n.slice()},h.tickValues=function(f){return arguments.length?(r=f==null?null:Array.from(f),h):r&&r.slice()},h.tickFormat=function(f){return arguments.length?(i=f,h):i},h.tickSize=function(f){return arguments.length?(s=a=+f,h):s},h.tickSizeInner=function(f){return arguments.length?(s=+f,h):s},h.tickSizeOuter=function(f){return arguments.length?(a=+f,h):a},h.tickPadding=function(f){return arguments.length?(o=+f,h):o},h.offset=function(f){return arguments.length?(l=+f,h):l},h}function yv(e){return qi(Wi,e)}function xv(e){return qi(Yi,e)}function qa(e){return qi(Ya,e)}function au(e){return qi($r,e)}var bv={value:()=>{}};function Xa(){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 Xi(n)}function Xi(e){this._=e}function Ev(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}})}Xi.prototype=Xa.prototype={constructor:Xi,on:function(e,t){var n=this._,r=Ev(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=Sv(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]=ou(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ou(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 Xi(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 Sv(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ou(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=bv,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ja="http://www.w3.org/1999/xhtml";const lu={svg:"http://www.w3.org/2000/svg",xhtml:ja,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ji(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),lu.hasOwnProperty(t)?{space:lu[t],local:e}:e}function _v(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ja&&t.documentElement.namespaceURI===ja?t.createElement(e):t.createElementNS(n,e)}}function wv(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function cu(e){var t=ji(e);return(t.local?wv:_v)(t)}function Ov(){}function Za(e){return e==null?Ov:function(){return this.querySelector(e)}}function Tv(e){typeof e!="function"&&(e=Za(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 se(r,this._parents)}function Mv(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Cv(){return[]}function uu(e){return e==null?Cv:function(){return this.querySelectorAll(e)}}function Av(e){return function(){return Mv(e.apply(this,arguments))}}function Dv(e){typeof e=="function"?e=Av(e):e=uu(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 se(r,i)}function hu(e){return function(){return this.matches(e)}}function du(e){return function(t){return t.matches(e)}}var Lv=Array.prototype.find;function Rv(e){return function(){return Lv.call(this.children,e)}}function Iv(){return this.firstElementChild}function kv(e){return this.select(e==null?Iv:Rv(typeof e=="function"?e:du(e)))}var $v=Array.prototype.filter;function Pv(){return Array.from(this.children)}function Nv(e){return function(){return $v.call(this.children,e)}}function Uv(e){return this.selectAll(e==null?Pv:Nv(typeof e=="function"?e:du(e)))}function Bv(e){typeof e!="function"&&(e=hu(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 se(r,this._parents)}function fu(e){return new Array(e.length)}function Vv(){return new se(this._enter||this._groups.map(fu),this._parents)}function Zi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zi.prototype={constructor:Zi,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 Gv(e){return function(){return e}}function Hv(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 Zi(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function Fv(e,t,n,r,i,s,a){var o,l,c=new Map,u=t.length,d=s.length,h=new Array(u),f;for(o=0;o<u;++o)(l=t[o])&&(h[o]=f=a.call(l,l.__data__,o,t)+"",c.has(f)?i[o]=l:c.set(f,l));for(o=0;o<d;++o)f=a.call(e,s[o],o,s)+"",(l=c.get(f))?(r[o]=l,l.__data__=s[o],c.delete(f)):n[o]=new Zi(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function zv(e){return e.__data__}function Wv(e,t){if(!arguments.length)return Array.from(this,zv);var n=t?Fv:Hv,r=this._parents,i=this._groups;typeof e!="function"&&(e=Gv(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],d=i[c],h=d.length,f=Yv(e.call(u,u&&u.__data__,c,r)),p=f.length,g=o[c]=new Array(p),v=a[c]=new Array(p),m=l[c]=new Array(h);n(u,d,g,v,m,f,t);for(var y=0,b=0,S,_;y<p;++y)if(S=g[y]){for(y>=b&&(b=y+1);!(_=v[b])&&++b<p;);S._next=_||null}}return a=new se(a,r),a._enter=o,a._exit=l,a}function Yv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qv(){return new se(this._exit||this._groups.map(fu),this._parents)}function Xv(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 jv(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],u=r[l],d=c.length,h=o[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||u[p])&&(h[p]=f);for(;l<i;++l)o[l]=n[l];return new se(o,this._parents)}function Zv(){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 Kv(e){e||(e=Qv);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,u=0;u<o;++u)(c=a[u])&&(l[u]=c);l.sort(t)}return new se(i,this._parents).order()}function Qv(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Jv(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function t0(){return Array.from(this)}function e0(){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 n0(){let e=0;for(const t of this)++e;return e}function r0(){return!this.node()}function i0(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 s0(e){return function(){this.removeAttribute(e)}}function a0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function o0(e,t){return function(){this.setAttribute(e,t)}}function l0(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function c0(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function u0(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 h0(e,t){var n=ji(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?a0:s0:typeof t=="function"?n.local?u0:c0:n.local?l0:o0)(n,t))}function pu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function d0(e){return function(){this.style.removeProperty(e)}}function f0(e,t,n){return function(){this.style.setProperty(e,t,n)}}function p0(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function g0(e,t,n){return arguments.length>1?this.each((t==null?d0:typeof t=="function"?p0:f0)(e,t,n??"")):Xn(this.node(),e)}function Xn(e,t){return e.style.getPropertyValue(t)||pu(e).getComputedStyle(e,null).getPropertyValue(t)}function m0(e){return function(){delete this[e]}}function v0(e,t){return function(){this[e]=t}}function y0(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function x0(e,t){return arguments.length>1?this.each((t==null?m0:typeof t=="function"?y0:v0)(e,t)):this.node()[e]}function gu(e){return e.trim().split(/^|\s+/)}function Ka(e){return e.classList||new mu(e)}function mu(e){this._node=e,this._names=gu(e.getAttribute("class")||"")}mu.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 vu(e,t){for(var n=Ka(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function yu(e,t){for(var n=Ka(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function b0(e){return function(){vu(this,e)}}function E0(e){return function(){yu(this,e)}}function S0(e,t){return function(){(t.apply(this,arguments)?vu:yu)(this,e)}}function _0(e,t){var n=gu(e+"");if(arguments.length<2){for(var r=Ka(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?S0:t?b0:E0)(n,t))}function w0(){this.textContent=""}function O0(e){return function(){this.textContent=e}}function T0(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function M0(e){return arguments.length?this.each(e==null?w0:(typeof e=="function"?T0:O0)(e)):this.node().textContent}function C0(){this.innerHTML=""}function A0(e){return function(){this.innerHTML=e}}function D0(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function L0(e){return arguments.length?this.each(e==null?C0:(typeof e=="function"?D0:A0)(e)):this.node().innerHTML}function R0(){this.nextSibling&&this.parentNode.appendChild(this)}function I0(){return this.each(R0)}function k0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $0(){return this.each(k0)}function P0(e){var t=typeof e=="function"?e:cu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function N0(){return null}function U0(e,t){var n=typeof e=="function"?e:cu(e),r=t==null?N0:typeof t=="function"?t:Za(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function B0(){var e=this.parentNode;e&&e.removeChild(this)}function V0(){return this.each(B0)}function G0(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function H0(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function F0(e){return this.select(e?H0:G0)}function z0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function W0(e){return function(t){e.call(this,t,this.__data__)}}function Y0(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 q0(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 X0(e,t,n){return function(){var r=this.__on,i,s=W0(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 j0(e,t,n){var r=Y0(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?X0:q0,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function xu(e,t,n){var r=pu(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 Z0(e,t){return function(){return xu(this,e,t)}}function K0(e,t){return function(){return xu(this,e,t.apply(this,arguments))}}function Q0(e,t){return this.each((typeof t=="function"?K0:Z0)(e,t))}function*J0(){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 bu=[null];function se(e,t){this._groups=e,this._parents=t}function Pr(){return new se([[document.documentElement]],bu)}function ty(){return this}se.prototype=Pr.prototype={constructor:se,select:Tv,selectAll:Dv,selectChild:kv,selectChildren:Uv,filter:Bv,data:Wv,enter:Vv,exit:qv,join:Xv,merge:jv,selection:ty,order:Zv,sort:Kv,call:Jv,nodes:t0,node:e0,size:n0,empty:r0,each:i0,attr:h0,style:g0,property:x0,classed:_0,text:M0,html:L0,raise:I0,lower:$0,append:P0,insert:U0,remove:V0,clone:F0,datum:z0,on:j0,dispatch:Q0,[Symbol.iterator]:J0};function D(e){return typeof e=="string"?new se([[document.querySelector(e)]],[document.documentElement]):new se([[e]],bu)}function ey(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Sn(e,t){if(e=ey(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 Qa={capture:!0,passive:!1};function Ja(e){e.preventDefault(),e.stopImmediatePropagation()}function ny(e){var t=e.document.documentElement,n=D(e).on("dragstart.drag",Ja,Qa);"onselectstart"in t?n.on("selectstart.drag",Ja,Qa):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ry(e,t){var n=e.document.documentElement,r=D(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ja,Qa),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 to(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Eu(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Nr(){}var Ur=.7,Ki=1/Ur,jn="\\s*([+-]?\\d+)\\s*",Br="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Re="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iy=/^#([0-9a-f]{3,8})$/,sy=new RegExp(`^rgb\\(${jn},${jn},${jn}\\)$`),ay=new RegExp(`^rgb\\(${Re},${Re},${Re}\\)$`),oy=new RegExp(`^rgba\\(${jn},${jn},${jn},${Br}\\)$`),ly=new RegExp(`^rgba\\(${Re},${Re},${Re},${Br}\\)$`),cy=new RegExp(`^hsl\\(${Br},${Re},${Re}\\)$`),uy=new RegExp(`^hsla\\(${Br},${Re},${Re},${Br}\\)$`),Su={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};to(Nr,Fe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_u,formatHex:_u,formatHex8:hy,formatHsl:dy,formatRgb:wu,toString:wu});function _u(){return this.rgb().formatHex()}function hy(){return this.rgb().formatHex8()}function dy(){return Au(this).formatHsl()}function wu(){return this.rgb().formatRgb()}function Fe(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=iy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ou(t):n===3?new Jt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Qi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Qi(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=sy.exec(e))?new Jt(t[1],t[2],t[3],1):(t=ay.exec(e))?new Jt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=oy.exec(e))?Qi(t[1],t[2],t[3],t[4]):(t=ly.exec(e))?Qi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cy.exec(e))?Cu(t[1],t[2]/100,t[3]/100,1):(t=uy.exec(e))?Cu(t[1],t[2]/100,t[3]/100,t[4]):Su.hasOwnProperty(e)?Ou(Su[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function Ou(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function Qi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Jt(e,t,n,r)}function fy(e){return e instanceof Nr||(e=Fe(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function eo(e,t,n,r){return arguments.length===1?fy(e):new Jt(e,t,n,r??1)}function Jt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}to(Jt,eo,Eu(Nr,{brighter(e){return e=e==null?Ki:Math.pow(Ki,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ur:Math.pow(Ur,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(_n(this.r),_n(this.g),_n(this.b),Ji(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:Tu,formatHex:Tu,formatHex8:py,formatRgb:Mu,toString:Mu}));function Tu(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}`}function py(){return`#${wn(this.r)}${wn(this.g)}${wn(this.b)}${wn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mu(){const e=Ji(this.opacity);return`${e===1?"rgb(":"rgba("}${_n(this.r)}, ${_n(this.g)}, ${_n(this.b)}${e===1?")":`, ${e})`}`}function Ji(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _n(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wn(e){return e=_n(e),(e<16?"0":"")+e.toString(16)}function Cu(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ee(e,t,n,r)}function Au(e){if(e instanceof Ee)return new Ee(e.h,e.s,e.l,e.opacity);if(e instanceof Nr||(e=Fe(e)),!e)return new Ee;if(e instanceof Ee)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 Ee(a,o,l,e.opacity)}function no(e,t,n,r){return arguments.length===1?Au(e):new Ee(e,t,n,r??1)}function Ee(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}to(Ee,no,Eu(Nr,{brighter(e){return e=e==null?Ki:Math.pow(Ki,e),new Ee(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ur:Math.pow(Ur,e),new Ee(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 Jt(ro(e>=240?e-240:e+120,i,r),ro(e,i,r),ro(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ee(Du(this.h),ts(this.s),ts(this.l),Ji(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=Ji(this.opacity);return`${e===1?"hsl(":"hsla("}${Du(this.h)}, ${ts(this.s)*100}%, ${ts(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Du(e){return e=(e||0)%360,e<0?e+360:e}function ts(e){return Math.max(0,Math.min(1,e||0))}function ro(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 io=e=>()=>e;function gy(e,t){return function(n){return e+n*t}}function my(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 vy(e){return(e=+e)==1?Lu:function(t,n){return n-t?my(t,n,e):io(isNaN(t)?n:t)}}function Lu(e,t){var n=t-e;return n?gy(e,n):io(isNaN(e)?t:e)}const es=function e(t){var n=vy(t);function r(i,s){var a=n((i=eo(i)).r,(s=eo(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Lu(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 yy(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 xy(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function by(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]=Vr(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 Ey(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ae(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Sy(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]=Vr(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var so=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ao=new RegExp(so.source,"g");function _y(e){return function(){return e}}function wy(e){return function(t){return e(t)+""}}function Ru(e,t){var n=so.lastIndex=ao.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=so.exec(e))&&(i=ao.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:ae(r,i)})),n=ao.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?wy(l[0].x):_y(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function Vr(e,t){var n=typeof t,r;return t==null||n==="boolean"?io(t):(n==="number"?ae:n==="string"?(r=Fe(t))?(t=r,es):Ru:t instanceof Fe?es:t instanceof Date?Ey:xy(t)?yy:Array.isArray(t)?by:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Sy:ae)(e,t)}function Iu(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var ku=180/Math.PI,oo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function $u(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)*ku,skewX:Math.atan(l)*ku,scaleX:a,scaleY:o}}var ns;function Oy(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oo:$u(t.a,t.b,t.c,t.d,t.e,t.f)}function Ty(e){return e==null||(ns||(ns=document.createElementNS("http://www.w3.org/2000/svg","g")),ns.setAttribute("transform",e),!(e=ns.transform.baseVal.consolidate()))?oo:(e=e.matrix,$u(e.a,e.b,e.c,e.d,e.e,e.f))}function Pu(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x:ae(c,d)},{i:g-2,x:ae(u,h)})}else(d||h)&&f.push("translate("+d+t+h+n)}function a(c,u,d,h){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),h.push({i:d.push(i(d)+"rotate(",null,r)-2,x:ae(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function o(c,u,d,h){c!==u?h.push({i:d.push(i(d)+"skewX(",null,r)-2,x:ae(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,h,f,p){if(c!==d||u!==h){var g=f.push(i(f)+"scale(",null,",",null,")");p.push({i:g-4,x:ae(c,d)},{i:g-2,x:ae(u,h)})}else(d!==1||h!==1)&&f.push(i(f)+"scale("+d+","+h+")")}return function(c,u){var d=[],h=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,d,h),a(c.rotate,u.rotate,d,h),o(c.skewX,u.skewX,d,h),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,h),c=u=null,function(f){for(var p=-1,g=h.length,v;++p<g;)d[(v=h[p]).i]=v.x(f);return d.join("")}}}var My=Pu(Oy,"px, ","px)","deg)"),Cy=Pu(Ty,", ",")",")");function Ay(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var Zn=0,Gr=0,Hr=0,Nu=1e3,rs,Fr,is=0,On=0,ss=0,zr=typeof performance=="object"&&performance.now?performance:Date,Uu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function lo(){return On||(Uu(Dy),On=zr.now()+ss)}function Dy(){On=0}function as(){this._call=this._time=this._next=null}as.prototype=Bu.prototype={constructor:as,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?lo():+n)+(t==null?0:+t),!this._next&&Fr!==this&&(Fr?Fr._next=this:rs=this,Fr=this),this._call=e,this._time=n,co()},stop:function(){this._call&&(this._call=null,this._time=1/0,co())}};function Bu(e,t,n){var r=new as;return r.restart(e,t,n),r}function Ly(){lo(),++Zn;for(var e=rs,t;e;)(t=On-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Zn}function Vu(){On=(is=zr.now())+ss,Zn=Gr=0;try{Ly()}finally{Zn=0,Iy(),On=0}}function Ry(){var e=zr.now(),t=e-is;t>Nu&&(ss-=t,is=e)}function Iy(){for(var e,t=rs,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:rs=n);Fr=e,co(r)}function co(e){if(!Zn){Gr&&(Gr=clearTimeout(Gr));var t=e-On;t>24?(e<1/0&&(Gr=setTimeout(Vu,e-zr.now()-ss)),Hr&&(Hr=clearInterval(Hr))):(Hr||(is=zr.now(),Hr=setInterval(Ry,Nu)),Zn=1,Uu(Vu))}}function Gu(e,t,n){var r=new as;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var ky=Xa("start","end","cancel","interrupt"),$y=[],Hu=0,Fu=1,uo=2,os=3,zu=4,ho=5,ls=6;function cs(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Py(e,n,{name:t,index:r,group:i,on:ky,tween:$y,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Hu})}function fo(e,t){var n=Se(e,t);if(n.state>Hu)throw new Error("too late; already scheduled");return n}function Ie(e,t){var n=Se(e,t);if(n.state>os)throw new Error("too late; already running");return n}function Se(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Py(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bu(s,0,n.time);function s(c){n.state=Fu,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var u,d,h,f;if(n.state!==Fu)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===os)return Gu(a);f.state===zu?(f.state=ls,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=ls,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Gu(function(){n.state===os&&(n.state=zu,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=uo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===uo){for(n.state=os,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=f);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=ho,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===ho&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ls,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function po(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>uo&&r.state<ho,r.state=ls,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function Ny(e){return this.each(function(){po(this,e)})}function Uy(e,t){var n,r;return function(){var i=Ie(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 By(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Ie(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 Vy(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Se(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?Uy:By)(n,e,t))}function go(e,t,n){var r=e._id;return e.each(function(){var i=Ie(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Se(i,r).value[t]}}function Wu(e,t){var n;return(typeof t=="number"?ae:t instanceof Fe?es:(n=Fe(t))?(t=n,es):Ru)(e,t)}function Gy(e){return function(){this.removeAttribute(e)}}function Hy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fy(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 zy(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 Wy(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 Yy(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 qy(e,t){var n=ji(e),r=n==="transform"?Cy:Wu;return this.attrTween(e,typeof t=="function"?(n.local?Yy:Wy)(n,r,go(this,"attr."+e,t)):t==null?(n.local?Hy:Gy)(n):(n.local?zy:Fy)(n,r,t))}function Xy(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function jy(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Zy(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&jy(e,s)),n}return i._value=t,i}function Ky(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Xy(e,s)),n}return i._value=t,i}function Qy(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=ji(e);return this.tween(n,(r.local?Zy:Ky)(r,t))}function Jy(e,t){return function(){fo(this,e).delay=+t.apply(this,arguments)}}function t1(e,t){return t=+t,function(){fo(this,e).delay=t}}function e1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Jy:t1)(t,e)):Se(this.node(),t).delay}function n1(e,t){return function(){Ie(this,e).duration=+t.apply(this,arguments)}}function r1(e,t){return t=+t,function(){Ie(this,e).duration=t}}function i1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?n1:r1)(t,e)):Se(this.node(),t).duration}function s1(e,t){if(typeof t!="function")throw new Error;return function(){Ie(this,e).ease=t}}function a1(e){var t=this._id;return arguments.length?this.each(s1(t,e)):Se(this.node(),t).ease}function o1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ie(this,e).ease=n}}function l1(e){if(typeof e!="function")throw new Error;return this.each(o1(this._id,e))}function c1(e){typeof e!="function"&&(e=hu(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 ze(r,this._parents,this._name,this._id)}function u1(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],u=l.length,d=a[o]=new Array(u),h,f=0;f<u;++f)(h=l[f]||c[f])&&(d[f]=h);for(;o<r;++o)a[o]=t[o];return new ze(a,this._parents,this._name,this._id)}function h1(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 d1(e,t,n){var r,i,s=h1(t)?fo:Ie;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function f1(e,t){var n=this._id;return arguments.length<2?Se(this.node(),n).on.on(e):this.each(d1(n,e,t))}function p1(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function g1(){return this.on("end.remove",p1(this._id))}function m1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Za(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),u,d,h=0;h<l;++h)(u=o[h])&&(d=e.call(u,u.__data__,h,o))&&("__data__"in u&&(d.__data__=u.__data__),c[h]=d,cs(c[h],t,n,h,c,Se(u,n)));return new ze(s,this._parents,t,n)}function v1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=uu(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var h=e.call(u,u.__data__,d,l),f,p=Se(u,n),g=0,v=h.length;g<v;++g)(f=h[g])&&cs(f,t,n,g,h,p);s.push(h),a.push(u)}return new ze(s,a,t,n)}var y1=Pr.prototype.constructor;function x1(){return new y1(this._groups,this._parents)}function b1(e,t){var n,r,i;return function(){var s=Xn(this,e),a=(this.style.removeProperty(e),Xn(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Yu(e){return function(){this.style.removeProperty(e)}}function E1(e,t,n){var r,i=n+"",s;return function(){var a=Xn(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function S1(e,t,n){var r,i,s;return function(){var a=Xn(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Xn(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function _1(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=Ie(this,e),c=l.on,u=l.value[s]==null?o||(o=Yu(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function w1(e,t,n){var r=(e+="")=="transform"?My:Wu;return t==null?this.styleTween(e,b1(e,r)).on("end.style."+e,Yu(e)):typeof t=="function"?this.styleTween(e,S1(e,r,go(this,"style."+e,t))).each(_1(this._id,e)):this.styleTween(e,E1(e,r,t),n).on("end.style."+e,null)}function O1(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function T1(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&O1(e,a,n)),r}return s._value=t,s}function M1(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,T1(e,t,n??""))}function C1(e){return function(){this.textContent=e}}function A1(e){return function(){var t=e(this);this.textContent=t??""}}function D1(e){return this.tween("text",typeof e=="function"?A1(go(this,"text",e)):C1(e==null?"":e+""))}function L1(e){return function(t){this.textContent=e.call(this,t)}}function R1(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&L1(i)),t}return r._value=e,r}function I1(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,R1(e))}function k1(){for(var e=this._name,t=this._id,n=qu(),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=Se(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 ze(r,this._parents,e,n)}function $1(){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=Ie(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 P1=0;function ze(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qu(){return++P1}var We=Pr.prototype;ze.prototype={constructor:ze,select:m1,selectAll:v1,selectChild:We.selectChild,selectChildren:We.selectChildren,filter:c1,merge:u1,selection:x1,transition:k1,call:We.call,nodes:We.nodes,node:We.node,size:We.size,empty:We.empty,each:We.each,on:f1,attr:qy,attrTween:Qy,style:w1,styleTween:M1,text:D1,textTween:I1,remove:g1,tween:Vy,delay:e1,duration:i1,ease:a1,easeVarying:l1,end:$1,[Symbol.iterator]:We[Symbol.iterator]};const N1=e=>+e;function Xu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var U1={time:null,delay:0,duration:250,ease:Xu};function B1(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 V1(e){var t,n;e instanceof ze?(t=e._id,e=e._name):(t=qu(),(n=U1).time=lo(),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||B1(l,t));return new ze(r,this._parents,e,t)}Pr.prototype.interrupt=Ny,Pr.prototype.transition=V1;const mo=e=>()=>e;function G1(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 H1(e){e.stopImmediatePropagation()}function vo(e){e.preventDefault(),e.stopImmediatePropagation()}var ju={name:"drag"},yo={name:"space"},Kn={name:"handle"},Qn={name:"center"};const{abs:Zu,max:Ft,min:zt}=Math;function Ku(e){return[+e[0],+e[1]]}function Qu(e){return[Ku(e[0]),Ku(e[1])]}var us={name:"x",handles:["w","e"].map(hs),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]]}},xo={name:"y",handles:["n","s"].map(hs),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]]}},Ye={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"},Ju={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},th={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},F1={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},z1={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function hs(e){return{type:e}}function W1(e){return!e.ctrlKey&&!e.button}function Y1(){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 q1(){return navigator.maxTouchPoints||"ontouchstart"in this}function bo(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function X1(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function eh(){return j1(us)}function j1(e){var t=Y1,n=W1,r=q1,i=!0,s=Xa("start","brush","end"),a=6,o;function l(v){var m=v.property("__brush",g).selectAll(".overlay").data([hs("overlay")]);m.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Ye.overlay).merge(m).each(function(){var b=bo(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])}),v.selectAll(".selection").data([hs("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Ye.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=v.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 Ye[b.type]}),v.each(c).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(r).on("touchstart.brush",h).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(v,m,y){v.tween?v.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,M=e.input(typeof m=="function"?m.apply(this,arguments):m,S.extent),C=Vr(E,M);function G(I){S.selection=I===1&&M===null?null:C(I),c.call(b),_.brush()}return E!==null&&M!==null?G:G(1)}):v.each(function(){var b=this,S=arguments,_=b.__brush,E=e.input(typeof m=="function"?m.apply(b,S):m,_.extent),M=u(b,S).beforestart();po(b),_.selection=E===null?null:E,c.call(b),M.start(y).brush(y).end(y)})},l.clear=function(v,m){l.move(v,null,m)};function c(){var v=D(this),m=bo(this).selection;m?(v.selectAll(".selection").style("display",null).attr("x",m[0][0]).attr("y",m[0][1]).attr("width",m[1][0]-m[0][0]).attr("height",m[1][1]-m[0][1]),v.selectAll(".handle").style("display",null).attr("x",function(y){return y.type[y.type.length-1]==="e"?m[1][0]-a/2:m[0][0]-a/2}).attr("y",function(y){return y.type[0]==="s"?m[1][1]-a/2:m[0][1]-a/2}).attr("width",function(y){return y.type==="n"||y.type==="s"?m[1][0]-m[0][0]+a:a}).attr("height",function(y){return y.type==="e"||y.type==="w"?m[1][1]-m[0][1]+a:a})):v.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(v,m,y){var b=v.__brush.emitter;return b&&(!y||!b.clean)?b:new d(v,m,y)}function d(v,m,y){this.that=v,this.args=m,this.state=v.__brush,this.active=0,this.clean=y}d.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(v,m){return this.starting?(this.starting=!1,this.emit("start",v,m)):this.emit("brush",v),this},brush:function(v,m){return this.emit("brush",v,m),this},end:function(v,m){return--this.active===0&&(delete this.state.emitter,this.emit("end",v,m)),this},emit:function(v,m,y){var b=D(this.that).datum();s.call(v,this.that,new G1(v,{sourceEvent:m,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),b)}};function h(v){if(o&&!v.touches||!n.apply(this,arguments))return;var m=this,y=v.target.__data__.type,b=(i&&v.metaKey?y="overlay":y)==="selection"?ju:i&&v.altKey?Qn:Kn,S=e===xo?null:F1[y],_=e===us?null:z1[y],E=bo(m),M=E.extent,C=E.selection,G=M[0][0],I,T,L=M[0][1],R,k,O=M[1][0],U,P,N=M[1][1],B,Y,X=0,J=0,ct,W=S&&_&&i&&v.shiftKey,K,ut,rt=Array.from(v.touches||[v],et=>{const Rt=et.identifier;return et=Sn(et,m),et.point0=et.slice(),et.identifier=Rt,et});po(m);var Tt=u(m,arguments,!0).beforestart();if(y==="overlay"){C&&(ct=!0);const et=[rt[0],rt[1]||rt[0]];E.selection=C=[[I=e===xo?G:zt(et[0][0],et[1][0]),R=e===us?L:zt(et[0][1],et[1][1])],[U=e===xo?O:Ft(et[0][0],et[1][0]),B=e===us?N:Ft(et[0][1],et[1][1])]],rt.length>1&&pt(v)}else I=C[0][0],R=C[0][1],U=C[1][0],B=C[1][1];T=I,k=R,P=U,Y=B;var q=D(m).attr("pointer-events","none"),V=q.selectAll(".overlay").attr("cursor",Ye[y]);if(v.touches)Tt.moved=$,Tt.ended=yt;else{var H=D(v.view).on("mousemove.brush",$,!0).on("mouseup.brush",yt,!0);i&&H.on("keydown.brush",Kt,!0).on("keyup.brush",Qt,!0),ny(v.view)}c.call(m),Tt.start(v,b.name);function $(et){for(const Rt of et.changedTouches||[et])for(const Hi of rt)Hi.identifier===Rt.identifier&&(Hi.cur=Sn(Rt,m));if(W&&!K&&!ut&&rt.length===1){const Rt=rt[0];Zu(Rt.cur[0]-Rt[0])>Zu(Rt.cur[1]-Rt[1])?ut=!0:K=!0}for(const Rt of rt)Rt.cur&&(Rt[0]=Rt.cur[0],Rt[1]=Rt.cur[1]);ct=!0,vo(et),pt(et)}function pt(et){const Rt=rt[0],Hi=Rt.point0;var xn;switch(X=Rt[0]-Hi[0],J=Rt[1]-Hi[1],b){case yo:case ju:{S&&(X=Ft(G-I,zt(O-U,X)),T=I+X,P=U+X),_&&(J=Ft(L-R,zt(N-B,J)),k=R+J,Y=B+J);break}case Kn:{rt[1]?(S&&(T=Ft(G,zt(O,rt[0][0])),P=Ft(G,zt(O,rt[1][0])),S=1),_&&(k=Ft(L,zt(N,rt[0][1])),Y=Ft(L,zt(N,rt[1][1])),_=1)):(S<0?(X=Ft(G-I,zt(O-I,X)),T=I+X,P=U):S>0&&(X=Ft(G-U,zt(O-U,X)),T=I,P=U+X),_<0?(J=Ft(L-R,zt(N-R,J)),k=R+J,Y=B):_>0&&(J=Ft(L-B,zt(N-B,J)),k=R,Y=B+J));break}case Qn:{S&&(T=Ft(G,zt(O,I-X*S)),P=Ft(G,zt(O,U+X*S))),_&&(k=Ft(L,zt(N,R-J*_)),Y=Ft(L,zt(N,B+J*_)));break}}P<T&&(S*=-1,xn=I,I=U,U=xn,xn=T,T=P,P=xn,y in Ju&&V.attr("cursor",Ye[y=Ju[y]])),Y<k&&(_*=-1,xn=R,R=B,B=xn,xn=k,k=Y,Y=xn,y in th&&V.attr("cursor",Ye[y=th[y]])),E.selection&&(C=E.selection),K&&(T=C[0][0],P=C[1][0]),ut&&(k=C[0][1],Y=C[1][1]),(C[0][0]!==T||C[0][1]!==k||C[1][0]!==P||C[1][1]!==Y)&&(E.selection=[[T,k],[P,Y]],c.call(m),Tt.brush(et,b.name))}function yt(et){if(H1(et),et.touches){if(et.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else ry(et.view,ct),H.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),V.attr("cursor",Ye.overlay),E.selection&&(C=E.selection),X1(C)&&(E.selection=null,c.call(m)),Tt.end(et,b.name)}function Kt(et){switch(et.keyCode){case 16:{W=S&&_;break}case 18:{b===Kn&&(S&&(U=P-X*S,I=T+X*S),_&&(B=Y-J*_,R=k+J*_),b=Qn,pt(et));break}case 32:{(b===Kn||b===Qn)&&(S<0?U=P-X:S>0&&(I=T-X),_<0?B=Y-J:_>0&&(R=k-J),b=yo,V.attr("cursor",Ye.selection),pt(et));break}default:return}vo(et)}function Qt(et){switch(et.keyCode){case 16:{W&&(K=ut=W=!1,pt(et));break}case 18:{b===Qn&&(S<0?U=P:S>0&&(I=T),_<0?B=Y:_>0&&(R=k),b=Kn,pt(et));break}case 32:{b===yo&&(et.altKey?(S&&(U=P-X*S,I=T+X*S),_&&(B=Y-J*_,R=k+J*_),b=Qn):(S<0?U=P:S>0&&(I=T),_<0?B=Y:_>0&&(R=k),b=Kn),V.attr("cursor",Ye[y]),pt(et));break}default:return}vo(et)}}function f(v){u(this,arguments).moved(v)}function p(v){u(this,arguments).ended(v)}function g(){var v=this.__brush||{selection:null};return v.extent=Qu(t.apply(this,arguments)),v.dim=e,v}return l.extent=function(v){return arguments.length?(t=typeof v=="function"?v:mo(Qu(v)),l):t},l.filter=function(v){return arguments.length?(n=typeof v=="function"?v:mo(!!v),l):n},l.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:mo(!!v),l):r},l.handleSize=function(v){return arguments.length?(a=+v,l):a},l.keyModifiers=function(v){return arguments.length?(i=!!v,l):i},l.on=function(){var v=s.on.apply(s,arguments);return v===s?l:v},l}const Eo=Math.PI,So=2*Eo,Tn=1e-6,Z1=So-Tn;function nh(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function K1(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nh;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 Q1=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nh:K1(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,d=o-n,h=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>Tn)if(!(Math.abs(d*l-c*u)>Tn)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,g=l*l+c*c,v=f*f+p*p,m=Math.sqrt(g),y=Math.sqrt(h),b=s*Math.tan((Eo-Math.acos((g+h-v)/(2*m*y)))/2),S=b/y,_=b/m;Math.abs(S-1)>Tn&&this._append`L${t+S*u},${n+S*d}`,this._append`A${s},${s},0,0,${+(d*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,d=1^a,h=a?i-s:s-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Tn||Math.abs(this._y1-u)>Tn)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%So+So),h>Z1?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:h>Tn&&this._append`A${r},${r},0,${+(h>=Eo)},${d},${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 J1(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ds(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 Jn(e){return e=ds(Math.abs(e)),e?e[1]:NaN}function tx(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 ex(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var nx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Wr(e){if(!(t=nx.exec(e)))throw new Error("invalid format: "+e);var t;return new _o({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]})}Wr.prototype=_o.prototype;function _o(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+""}_o.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 rx(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 rh;function ix(e,t){var n=ds(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(rh=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")+ds(e,Math.max(0,t+s-1))[0]}function ih(e,t){var n=ds(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 sh={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:J1,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)=>ih(e*100,t),r:ih,s:ix,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ah(e){return e}var oh=Array.prototype.map,lh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function sx(e){var t=e.grouping===void 0||e.thousands===void 0?ah:tx(oh.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?ah:ex(oh.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(d){d=Wr(d);var h=d.fill,f=d.align,p=d.sign,g=d.symbol,v=d.zero,m=d.width,y=d.comma,b=d.precision,S=d.trim,_=d.type;_==="n"?(y=!0,_="g"):sh[_]||(b===void 0&&(b=12),S=!0,_="g"),(v||h==="0"&&f==="=")&&(v=!0,h="0",f="=");var E=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",M=g==="$"?r:/[%p]/.test(_)?a:"",C=sh[_],G=/[defgprs%]/.test(_);b=b===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function I(T){var L=E,R=M,k,O,U;if(_==="c")R=C(T)+R,T="";else{T=+T;var P=T<0||1/T<0;if(T=isNaN(T)?l:C(Math.abs(T),b),S&&(T=rx(T)),P&&+T==0&&p!=="+"&&(P=!1),L=(P?p==="("?p:o:p==="-"||p==="("?"":p)+L,R=(_==="s"?lh[8+rh/3]:"")+R+(P&&p==="("?")":""),G){for(k=-1,O=T.length;++k<O;)if(U=T.charCodeAt(k),48>U||U>57){R=(U===46?i+T.slice(k+1):T.slice(k))+R,T=T.slice(0,k);break}}}y&&!v&&(T=t(T,1/0));var N=L.length+T.length+R.length,B=N<m?new Array(m-N+1).join(h):"";switch(y&&v&&(T=t(B+T,B.length?m-R.length:1/0),B=""),f){case"<":T=L+T+R+B;break;case"=":T=L+B+T+R;break;case"^":T=B.slice(0,N=B.length>>1)+L+T+R+B.slice(N);break;default:T=B+L+T+R;break}return s(T)}return I.toString=function(){return d+""},I}function u(d,h){var f=c((d=Wr(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(Jn(h)/3)))*3,g=Math.pow(10,-p),v=lh[8+p/3];return function(m){return f(g*m)+v}}return{format:c,formatPrefix:u}}var fs,wo,ch;ax({thousands:",",grouping:[3],currency:["$",""]});function ax(e){return fs=sx(e),wo=fs.format,ch=fs.formatPrefix,fs}function ox(e){return Math.max(0,-Jn(Math.abs(e)))}function lx(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jn(t)/3)))*3-Jn(Math.abs(e)))}function cx(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jn(t)-Jn(e))+1}var gt=1e-6,uh=1e-12,ot=Math.PI,te=ot/2,hh=ot/4,oe=ot*2,Xt=180/ot,Dt=ot/180,mt=Math.abs,dh=Math.atan,Mn=Math.atan2,xt=Math.cos,ux=Math.exp,hx=Math.log,ft=Math.sin,un=Math.sign||function(e){return e>0?1:e<0?-1:0},_e=Math.sqrt,dx=Math.tan;function fx(e){return e>1?0:e<-1?ot:Math.acos(e)}function qe(e){return e>1?te:e<-1?-te:Math.asin(e)}function fe(){}function ps(e,t){e&&ph.hasOwnProperty(e.type)&&ph[e.type](e,t)}var fh={Feature:function(e,t){ps(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)ps(n[r].geometry,t)}},ph={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){Oo(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Oo(n[r],t,0)},Polygon:function(e,t){gh(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)gh(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)ps(n[r],t)}};function Oo(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 gh(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Oo(e[n],t,1);t.polygonEnd()}function tr(e,t){e&&fh.hasOwnProperty(e.type)?fh[e.type](e,t):ps(e,t)}function To(e){return[Mn(e[1],e[0]),qe(e[2])]}function er(e){var t=e[0],n=e[1],r=xt(n);return[r*xt(t),r*ft(t),ft(n)]}function gs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ms(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 Mo(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function vs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Co(e){var t=_e(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Ao(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 Do(e,t){return mt(e)>ot&&(e-=Math.round(e/oe)*oe),[e,t]}Do.invert=Do;function mh(e,t,n){return(e%=oe)?t||n?Ao(yh(e),xh(t,n)):yh(e):t||n?xh(t,n):Do}function vh(e){return function(t,n){return t+=e,mt(t)>ot&&(t-=Math.round(t/oe)*oe),[t,n]}}function yh(e){var t=vh(e);return t.invert=vh(-e),t}function xh(e,t){var n=xt(e),r=ft(e),i=xt(t),s=ft(t);function a(o,l){var c=xt(l),u=xt(o)*c,d=ft(o)*c,h=ft(l),f=h*n+u*r;return[Mn(d*i-f*s,u*n-h*r),qe(f*i+d*s)]}return a.invert=function(o,l){var c=xt(l),u=xt(o)*c,d=ft(o)*c,h=ft(l),f=h*i-d*s;return[Mn(d*i+h*s,u*n+f*r),qe(f*n-u*r)]},a}function px(e){e=mh(e[0]*Dt,e[1]*Dt,e.length>2?e[2]*Dt:0);function t(n){return n=e(n[0]*Dt,n[1]*Dt),n[0]*=Xt,n[1]*=Xt,n}return t.invert=function(n){return n=e.invert(n[0]*Dt,n[1]*Dt),n[0]*=Xt,n[1]*=Xt,n},t}function gx(e,t,n,r,i,s){if(n){var a=xt(t),o=ft(t),l=r*n;i==null?(i=t+r*oe,s=t-l/2):(i=bh(a,i),s=bh(a,s),(r>0?i<s:i>s)&&(i+=r*oe));for(var c,u=i;r>0?u>s:u<s;u-=l)c=To([a,-o*xt(u),-o*ft(u)]),e.point(c[0],c[1])}}function bh(e,t){t=er(t),t[0]-=e,Co(t);var n=fx(-t[1]);return((-t[2]<0?-n:n)+oe-gt)%oe}function Eh(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:fe,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ys(e,t){return mt(e[0]-t[0])<gt&&mt(e[1]-t[1])<gt}function xs(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 Sh(e,t,n,r,i){var s=[],a=[],o,l;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,v=p[0],m=p[g],y;if(ys(v,m)){if(!v[2]&&!m[2]){for(i.lineStart(),o=0;o<g;++o)i.point((v=p[o])[0],v[1]);i.lineEnd();return}m[0]+=2*gt}s.push(y=new xs(v,p,null,!0)),a.push(y.o=new xs(v,null,y,!1)),s.push(y=new xs(m,p,null,!1)),a.push(y.o=new xs(m,null,y,!0))}}),!!s.length){for(a.sort(t),_h(s),_h(a),o=0,l=a.length;o<l;++o)a[o].e=n=!n;for(var c=s[0],u,d;;){for(var h=c,f=!0;h.v;)if((h=h.n)===c)return;u=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,l=u.length;o<l;++o)i.point((d=u[o])[0],d[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(u=h.p.z,o=u.length-1;o>=0;--o)i.point((d=u[o])[0],d[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,u=h.z,f=!f}while(!h.v);i.lineEnd()}}}function _h(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 Lo(e){return mt(e[0])<=ot?e[0]:un(e[0])*((mt(e[0])+ot)%oe-ot)}function mx(e,t){var n=Lo(t),r=t[1],i=ft(r),s=[ft(n),-xt(n),0],a=0,o=0,l=new bn;i===1?r=te+gt:i===-1&&(r=-te-gt);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],p=Lo(f),g=f[1]/2+hh,v=ft(g),m=xt(g),y=0;y<h;++y,p=S,v=E,m=M,f=b){var b=d[y],S=Lo(b),_=b[1]/2+hh,E=ft(_),M=xt(_),C=S-p,G=C>=0?1:-1,I=G*C,T=I>ot,L=v*E;if(l.add(Mn(L*G*ft(I),m*M+L*xt(I))),a+=T?C+G*oe:C,T^p>=n^S>=n){var R=ms(er(f),er(b));Co(R);var k=ms(s,R);Co(k);var O=(T^C>=0?-1:1)*qe(k[2]);(r>O||r===O&&(R[0]||R[1]))&&(o+=T^C>=0?1:-1)}}return(a<-gt||a<gt&&l<-uh)^o&1}function wh(e,t,n,r){return function(i){var s=t(i),a=Eh(),o=t(a),l=!1,c,u,d,h={point:f,lineStart:g,lineEnd:v,polygonStart:function(){h.point=m,h.lineStart=y,h.lineEnd=b,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=g,h.lineEnd=v,u=iu(u);var S=mx(c,r);u.length?(l||(i.polygonStart(),l=!0),Sh(u,yx,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 g(){h.point=p,s.lineStart()}function v(){h.point=f,s.lineEnd()}function m(S,_){d.push([S,_]),o.point(S,_)}function y(){o.lineStart(),d=[]}function b(){m(d[0][0],d[0][1]),o.lineEnd();var S=o.clean(),_=a.result(),E,M=_.length,C,G,I;if(d.pop(),c.push(d),d=null,!!M){if(S&1){if(G=_[0],(C=G.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),E=0;E<C;++E)i.point((I=G[E])[0],I[1]);i.lineEnd()}return}M>1&&S&2&&_.push(_.pop().concat(_.shift())),u.push(_.filter(vx))}}return h}}function vx(e){return e.length>1}function yx(e,t){return((e=e.x)[0]<0?e[1]-te-gt:te-e[1])-((t=t.x)[0]<0?t[1]-te-gt:te-t[1])}const Oh=wh(function(){return!0},xx,Ex,[-ot,-te]);function xx(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?ot:-ot,l=mt(s-t);mt(l-ot)<gt?(e.point(t,n=(n+a)/2>0?te:-te),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=ot&&(mt(t-r)<gt&&(t-=r*gt),mt(s-o)<gt&&(s-=o*gt),n=bx(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 bx(e,t,n,r){var i,s,a=ft(e-n);return mt(a)>gt?dh((ft(t)*(s=xt(r))*ft(n)-ft(r)*(i=xt(t))*ft(e))/(i*s*a)):(t+r)/2}function Ex(e,t,n,r){var i;if(e==null)i=n*te,r.point(-ot,i),r.point(0,i),r.point(ot,i),r.point(ot,0),r.point(ot,-i),r.point(0,-i),r.point(-ot,-i),r.point(-ot,0),r.point(-ot,i);else if(mt(e[0]-t[0])>gt){var s=e[0]<t[0]?ot:-ot;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function Sx(e){var t=xt(e),n=6*Dt,r=t>0,i=mt(t)>gt;function s(u,d,h,f){gx(f,e,n,h,u,d)}function a(u,d){return xt(u)*xt(d)>t}function o(u){var d,h,f,p,g;return{lineStart:function(){p=f=!1,g=1},point:function(v,m){var y=[v,m],b,S=a(v,m),_=r?S?0:c(v,m):S?c(v+(v<0?ot:-ot),m):0;if(!d&&(p=f=S)&&u.lineStart(),S!==f&&(b=l(d,y),(!b||ys(d,b)||ys(y,b))&&(y[2]=1)),S!==f)g=0,S?(u.lineStart(),b=l(y,d),u.point(b[0],b[1])):(b=l(d,y),u.point(b[0],b[1],2),u.lineEnd()),d=b;else if(i&&d&&r^S){var E;!(_&h)&&(E=l(y,d,!0))&&(g=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&&(!d||!ys(d,y))&&u.point(y[0],y[1]),d=y,f=S,h=_},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return g|(p&&f)<<1}}}function l(u,d,h){var f=er(u),p=er(d),g=[1,0,0],v=ms(f,p),m=gs(v,v),y=v[0],b=m-y*y;if(!b)return!h&&u;var S=t*m/b,_=-t*y/b,E=ms(g,v),M=vs(g,S),C=vs(v,_);Mo(M,C);var G=E,I=gs(M,G),T=gs(G,G),L=I*I-T*(gs(M,M)-1);if(!(L<0)){var R=_e(L),k=vs(G,(-I-R)/T);if(Mo(k,M),k=To(k),!h)return k;var O=u[0],U=d[0],P=u[1],N=d[1],B;U<O&&(B=O,O=U,U=B);var Y=U-O,X=mt(Y-ot)<gt,J=X||Y<gt;if(!X&&N<P&&(B=P,P=N,N=B),J?X?P+N>0^k[1]<(mt(k[0]-O)<gt?P:N):P<=k[1]&&k[1]<=N:Y>ot^(O<=k[0]&&k[0]<=U)){var ct=vs(G,(-I+R)/T);return Mo(ct,M),[k,To(ct)]}}}function c(u,d){var h=r?e:ot-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return wh(a,o,s,r?[0,-e]:[-ot,e-ot])}function _x(e,t,n,r,i,s){var a=e[0],o=e[1],l=t[0],c=t[1],u=0,d=1,h=l-a,f=c-o,p;if(p=n-a,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<d&&(d=p)}else if(h>0){if(p>d)return;p>u&&(u=p)}if(p=i-a,!(!h&&p<0)){if(p/=h,h<0){if(p>d)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<d&&(d=p)}if(p=r-o,!(!f&&p>0)){if(p/=f,f<0){if(p<u)return;p<d&&(d=p)}else if(f>0){if(p>d)return;p>u&&(u=p)}if(p=s-o,!(!f&&p<0)){if(p/=f,f<0){if(p>d)return;p>u&&(u=p)}else if(f>0){if(p<u)return;p<d&&(d=p)}return u>0&&(e[0]=a+u*h,e[1]=o+u*f),d<1&&(t[0]=a+d*h,t[1]=o+d*f),!0}}}}}var Yr=1e9,bs=-Yr;function wx(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function s(c,u,d,h){var f=0,p=0;if(c==null||(f=a(c,d))!==(p=a(u,d))||l(c,u)<0^d>0)do h.point(f===0||f===3?e:n,f>1?r:t);while((f=(f+d+4)%4)!==p);else h.point(u[0],u[1])}function a(c,u){return mt(c[0]-e)<gt?u>0?0:3:mt(c[0]-n)<gt?u>0?2:1:mt(c[1]-t)<gt?u>0?1:0:u>0?3:2}function o(c,u){return l(c.x,u.x)}function l(c,u){var d=a(c,1),h=a(u,1);return d!==h?d-h:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=Eh(),h,f,p,g,v,m,y,b,S,_,E,M={point:C,lineStart:L,lineEnd:R,polygonStart:I,polygonEnd:T};function C(O,U){i(O,U)&&u.point(O,U)}function G(){for(var O=0,U=0,P=f.length;U<P;++U)for(var N=f[U],B=1,Y=N.length,X=N[0],J,ct,W=X[0],K=X[1];B<Y;++B)J=W,ct=K,X=N[B],W=X[0],K=X[1],ct<=r?K>r&&(W-J)*(r-ct)>(K-ct)*(e-J)&&++O:K<=r&&(W-J)*(r-ct)<(K-ct)*(e-J)&&--O;return O}function I(){u=d,h=[],f=[],E=!0}function T(){var O=G(),U=E&&O,P=(h=iu(h)).length;(U||P)&&(c.polygonStart(),U&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),P&&Sh(h,o,O,s,c),c.polygonEnd()),u=c,h=f=p=null}function L(){M.point=k,f&&f.push(p=[]),_=!0,S=!1,y=b=NaN}function R(){h&&(k(g,v),m&&S&&d.rejoin(),h.push(d.result())),M.point=C,S&&u.lineEnd()}function k(O,U){var P=i(O,U);if(f&&p.push([O,U]),_)g=O,v=U,m=P,_=!1,P&&(u.lineStart(),u.point(O,U));else if(P&&S)u.point(O,U);else{var N=[y=Math.max(bs,Math.min(Yr,y)),b=Math.max(bs,Math.min(Yr,b))],B=[O=Math.max(bs,Math.min(Yr,O)),U=Math.max(bs,Math.min(Yr,U))];_x(N,B,e,t,n,r)?(S||(u.lineStart(),u.point(N[0],N[1])),u.point(B[0],B[1]),P||u.lineEnd(),E=!1):P&&(u.lineStart(),u.point(O,U),E=!1)}y=O,b=U,S=P}return M}}const Ro=e=>e;var Io=new bn,ko=new bn,Th,Mh,$o,Po,hn={point:fe,lineStart:fe,lineEnd:fe,polygonStart:function(){hn.lineStart=Ox,hn.lineEnd=Mx},polygonEnd:function(){hn.lineStart=hn.lineEnd=hn.point=fe,Io.add(mt(ko)),ko=new bn},result:function(){var e=Io/2;return Io=new bn,e}};function Ox(){hn.point=Tx}function Tx(e,t){hn.point=Ch,Th=$o=e,Mh=Po=t}function Ch(e,t){ko.add(Po*e-$o*t),$o=e,Po=t}function Mx(){Ch(Th,Mh)}const Ah=hn;var nr=1/0,Es=nr,qr=-nr,Ss=qr,Cx={point:Ax,lineStart:fe,lineEnd:fe,polygonStart:fe,polygonEnd:fe,result:function(){var e=[[nr,Es],[qr,Ss]];return qr=Ss=-(Es=nr=1/0),e}};function Ax(e,t){e<nr&&(nr=e),e>qr&&(qr=e),t<Es&&(Es=t),t>Ss&&(Ss=t)}const _s=Cx;var No=0,Uo=0,Xr=0,ws=0,Os=0,rr=0,Bo=0,Vo=0,jr=0,Dh,Lh,ke,$e,we={point:Cn,lineStart:Rh,lineEnd:Ih,polygonStart:function(){we.lineStart=Rx,we.lineEnd=Ix},polygonEnd:function(){we.point=Cn,we.lineStart=Rh,we.lineEnd=Ih},result:function(){var e=jr?[Bo/jr,Vo/jr]:rr?[ws/rr,Os/rr]:Xr?[No/Xr,Uo/Xr]:[NaN,NaN];return No=Uo=Xr=ws=Os=rr=Bo=Vo=jr=0,e}};function Cn(e,t){No+=e,Uo+=t,++Xr}function Rh(){we.point=Dx}function Dx(e,t){we.point=Lx,Cn(ke=e,$e=t)}function Lx(e,t){var n=e-ke,r=t-$e,i=_e(n*n+r*r);ws+=i*(ke+e)/2,Os+=i*($e+t)/2,rr+=i,Cn(ke=e,$e=t)}function Ih(){we.point=Cn}function Rx(){we.point=kx}function Ix(){kh(Dh,Lh)}function kx(e,t){we.point=kh,Cn(Dh=ke=e,Lh=$e=t)}function kh(e,t){var n=e-ke,r=t-$e,i=_e(n*n+r*r);ws+=i*(ke+e)/2,Os+=i*($e+t)/2,rr+=i,i=$e*e-ke*t,Bo+=i*(ke+e),Vo+=i*($e+t),jr+=i*3,Cn(ke=e,$e=t)}const $h=we;function Ph(e){this._context=e}Ph.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,oe);break}}},result:fe};var Go=new bn,Ho,Nh,Uh,Zr,Kr,Ts={point:fe,lineStart:function(){Ts.point=$x},lineEnd:function(){Ho&&Bh(Nh,Uh),Ts.point=fe},polygonStart:function(){Ho=!0},polygonEnd:function(){Ho=null},result:function(){var e=+Go;return Go=new bn,e}};function $x(e,t){Ts.point=Bh,Nh=Zr=e,Uh=Kr=t}function Bh(e,t){Zr-=e,Kr-=t,Go.add(_e(Zr*Zr+Kr*Kr)),Zr=e,Kr=t}const Vh=Ts;let Gh,Ms,Hh,Fh;class zh{constructor(t){this._append=t==null?Wh:Px(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!==Hh||this._append!==Ms){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`,Hh=r,Ms=this._append,Fh=this._,this._=i}this._+=Fh;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Wh(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Px(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Wh;if(t!==Gh){const n=10**t;Gh=t,Ms=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 Ms}function Nx(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),tr(o,i(s))),s.result()}return a.area=function(o){return tr(o,i(Ah)),Ah.result()},a.measure=function(o){return tr(o,i(Vh)),Vh.result()},a.bounds=function(o){return tr(o,i(_s)),_s.result()},a.centroid=function(o){return tr(o,i($h)),$h.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,Ro):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new zh(n)):new Ph(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 zh(n)),a},a.projection(e).digits(n).context(t)}function Fo(e){return function(t){var n=new zo;for(var r in e)n[r]=e[r];return n.stream=t,n}}function zo(){}zo.prototype={constructor:zo,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 Wo(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),tr(n,e.stream(_s)),t(_s.result()),r!=null&&e.clipExtent(r),e}function Yh(e,t,n){return Wo(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 Yh(e,[[0,0],t],n)}function Bx(e,t,n){return Wo(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 Vx(e,t,n){return Wo(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 qh=16,Gx=xt(30*Dt);function Xh(e,t){return+t?Fx(e,t):Hx(e)}function Hx(e){return Fo({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Fx(e,t){function n(r,i,s,a,o,l,c,u,d,h,f,p,g,v){var m=c-r,y=u-i,b=m*m+y*y;if(b>4*t&&g--){var S=a+h,_=o+f,E=l+p,M=_e(S*S+_*_+E*E),C=qe(E/=M),G=mt(mt(E)-1)<gt||mt(s-d)<gt?(s+d)/2:Mn(_,S),I=e(G,C),T=I[0],L=I[1],R=T-r,k=L-i,O=y*R-m*k;(O*O/b>t||mt((m*R+y*k)/b-.5)>.3||a*h+o*f+l*p<Gx)&&(n(r,i,s,a,o,l,T,L,G,S/=M,_/=M,E,g,v),v.point(T,L),n(T,L,G,S,_,E,c,u,d,h,f,p,g,v))}}return function(r){var i,s,a,o,l,c,u,d,h,f,p,g,v={point:m,lineStart:y,lineEnd:S,polygonStart:function(){r.polygonStart(),v.lineStart=_},polygonEnd:function(){r.polygonEnd(),v.lineStart=y}};function m(C,G){C=e(C,G),r.point(C[0],C[1])}function y(){d=NaN,v.point=b,r.lineStart()}function b(C,G){var I=er([C,G]),T=e(C,G);n(d,h,u,f,p,g,d=T[0],h=T[1],u=C,f=I[0],p=I[1],g=I[2],qh,r),r.point(d,h)}function S(){v.point=m,r.lineEnd()}function _(){y(),v.point=E,v.lineEnd=M}function E(C,G){b(i=C,G),s=d,a=h,o=f,l=p,c=g,v.point=b}function M(){n(d,h,u,f,p,g,s,a,i,o,l,c,qh,r),v.lineEnd=S,S()}return v}}var zx=Fo({point:function(e,t){this.stream.point(e*Dt,t*Dt)}});function Wx(e){return Fo({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=xt(s),o=ft(s),l=a*e,c=o*e,u=a/e,d=o/e,h=(o*n-a*t)/e,f=(o*t+a*n)/e;function p(g,v){return g*=r,v*=i,[l*g-c*v+t,n-c*g-l*v]}return p.invert=function(g,v){return[r*(u*g-d*v+h),i*(f-d*g-u*v)]},p}function Cs(e){return Zh(function(){return e})()}function Zh(e){var t,n=150,r=480,i=250,s=0,a=0,o=0,l=0,c=0,u,d=0,h=1,f=1,p=null,g=Oh,v=null,m,y,b,S=Ro,_=.5,E,M,C,G,I;function T(O){return C(O[0]*Dt,O[1]*Dt)}function L(O){return O=C.invert(O[0],O[1]),O&&[O[0]*Xt,O[1]*Xt]}T.stream=function(O){return G&&I===O?G:G=zx(Wx(u)(g(E(S(I=O)))))},T.preclip=function(O){return arguments.length?(g=O,p=void 0,k()):g},T.postclip=function(O){return arguments.length?(S=O,v=m=y=b=null,k()):S},T.clipAngle=function(O){return arguments.length?(g=+O?Sx(p=O*Dt):(p=null,Oh),k()):p*Xt},T.clipExtent=function(O){return arguments.length?(S=O==null?(v=m=y=b=null,Ro):wx(v=+O[0][0],m=+O[0][1],y=+O[1][0],b=+O[1][1]),k()):v==null?null:[[v,m],[y,b]]},T.scale=function(O){return arguments.length?(n=+O,R()):n},T.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],R()):[r,i]},T.center=function(O){return arguments.length?(s=O[0]%360*Dt,a=O[1]%360*Dt,R()):[s*Xt,a*Xt]},T.rotate=function(O){return arguments.length?(o=O[0]%360*Dt,l=O[1]%360*Dt,c=O.length>2?O[2]%360*Dt:0,R()):[o*Xt,l*Xt,c*Xt]},T.angle=function(O){return arguments.length?(d=O%360*Dt,R()):d*Xt},T.reflectX=function(O){return arguments.length?(h=O?-1:1,R()):h<0},T.reflectY=function(O){return arguments.length?(f=O?-1:1,R()):f<0},T.precision=function(O){return arguments.length?(E=Xh(M,_=O*O),k()):_e(_)},T.fitExtent=function(O,U){return Yh(T,O,U)},T.fitSize=function(O,U){return Ux(T,O,U)},T.fitWidth=function(O,U){return Bx(T,O,U)},T.fitHeight=function(O,U){return Vx(T,O,U)};function R(){var O=jh(n,0,0,h,f,d).apply(null,t(s,a)),U=jh(n,r-O[0],i-O[1],h,f,d);return u=mh(o,l,c),M=Ao(t,U),C=Ao(u,M),E=Xh(M,_),k()}function k(){return G=I=null,T}return function(){return t=e.apply(this,arguments),T.invert=t.invert&&L,R()}}function Kh(e){var t=0,n=ot/3,r=Zh(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*Dt,n=s[1]*Dt):[t*Xt,n*Xt]},i}function qx(e){var t=xt(e);function n(r,i){return[r*t,ft(i)/t]}return n.invert=function(r,i){return[r/t,qe(i*t)]},n}function Xx(e,t){var n=ft(e),r=(n+ft(t))/2;if(mt(r)<gt)return qx(e);var i=1+n*(2*r-n),s=_e(i)/r;function a(o,l){var c=_e(i-2*r*ft(l))/r;return[c*ft(o*=r),s-c*xt(o)]}return a.invert=function(o,l){var c=s-l,u=Mn(o,mt(c))*un(c);return c*r<0&&(u-=ot*un(o)*un(c)),[u/r,qe((i-(o*o+c*c)*r*r)/(2*r))]},a}function Qh(){return Kh(Xx).scale(155.424).center([0,33.6442])}function jx(){return Qh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Yo(e,t){return[e,hx(dx((te+t)/2))]}Yo.invert=function(e,t){return[e,2*dh(ux(t))-te]};function Zx(){return Kx(Yo).scale(961/oe)}function Kx(e){var t=Cs(e),n=t.center,r=t.scale,i=t.translate,s=t.clipExtent,a=null,o,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(i(d),u()):i()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?a=o=l=c=null:(a=+d[0][0],o=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):a==null?null:[[a,o],[l,c]]};function u(){var d=ot*r(),h=t(px(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Yo?[[Math.max(h[0]-d,a),o],[Math.min(h[0]+d,l),c]]:[[a,Math.max(h[1]-d,o)],[l,Math.min(h[1]+d,c)]])}return u()}function As(e,t){return[e,t]}As.invert=As;function Qx(){return Cs(As).scale(152.63)}function Jx(e,t){var n=xt(e),r=e===t?ft(e):(n-xt(t))/(t-e),i=n/r+e;if(mt(r)<gt)return As;function s(a,o){var l=i-o,c=r*a;return[l*ft(c),i-l*xt(c)]}return s.invert=function(a,o){var l=i-o,c=Mn(a,mt(l))*un(l);return l*r<0&&(c-=ot*un(a)*un(l)),[c/r,i-un(r)*_e(a*a+l*l)]},s}function tb(){return Kh(Jx).scale(131.154).center([0,13.9389])}var Qr=1.340264,Jr=-.081106,ti=893e-6,ei=.003796,Ds=_e(3)/2,eb=12;function Jh(e,t){var n=qe(Ds*ft(t)),r=n*n,i=r*r*r;return[e*xt(n)/(Ds*(Qr+3*Jr*r+i*(7*ti+9*ei*r))),n*(Qr+Jr*r+i*(ti+ei*r))]}Jh.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<eb&&(o=n*(Qr+Jr*r+i*(ti+ei*r))-t,l=Qr+3*Jr*r+i*(7*ti+9*ei*r),n-=a=o/l,r=n*n,i=r*r*r,!(mt(a)<uh));++s);return[Ds*e*(Qr+3*Jr*r+i*(7*ti+9*ei*r))/xt(n),qe(ft(n)/Ds)]};function nb(){return Cs(Jh).scale(177.158)}function td(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)))]}td.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(mt(i)>gt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function rb(){return Cs(td).scale(175.295)}function ib(e,t){return e.parent===t.parent?1:2}function sb(e){return e.reduce(ab,0)/e.length}function ab(e,t){return e+t.x}function ob(e){return 1+e.reduce(lb,0)}function lb(e,t){return Math.max(e,t.y)}function cb(e){for(var t;t=e.children;)e=t[0];return e}function ub(e){for(var t;t=e.children;)e=t[t.length-1];return e}function hb(){var e=ib,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=sb(f),h.y=ob(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=cb(s),c=ub(s),u=l.x-e(l,c)/2,d=c.x+e(c,l)/2;return s.eachAfter(r?function(h){h.x=(h.x-s.x)*t,h.y=(s.y-h.y)*n}:function(h){h.x=(h.x-u)/(d-u)*t,h.y=(1-(s.y?h.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 db(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 fb(){return this.eachAfter(db)}function pb(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function gb(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 mb(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 vb(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function yb(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 xb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function bb(e){for(var t=this,n=Eb(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 Eb(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 Sb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function _b(){return Array.from(this)}function wb(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Ob(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Tb(){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 ni(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ab)):t===void 0&&(t=Cb);for(var n=new ri(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 ri(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Lb)}function Mb(){return ni(this).eachBefore(Db)}function Cb(e){return e.children}function Ab(e){return Array.isArray(e)?e[1]:null}function Db(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Lb(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function ri(e){this.data=e,this.depth=this.height=0,this.parent=null}ri.prototype=ni.prototype={constructor:ri,count:fb,each:pb,eachAfter:mb,eachBefore:gb,find:vb,sum:yb,sort:xb,path:bb,ancestors:Sb,descendants:_b,leaves:wb,links:Ob,copy:Mb,[Symbol.iterator]:Tb};function Rb(e){return e==null?null:ed(e)}function ed(e){if(typeof e!="function")throw new Error;return e}function An(){return 0}function ir(e){return function(){return e}}const Ib=1664525,kb=1013904223,nd=4294967296;function $b(){let e=1;return()=>(e=(Ib*e+kb)%nd)/nd}function Pb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Nb(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 Ub(e,t){for(var n=0,r=(e=Nb(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&rd(a,s)?++n:(a=Vb(i=Bb(i,s)),n=0);return a}function Bb(e,t){var n,r;if(qo(t,e))return[t];for(n=0;n<e.length;++n)if(Ls(t,e[n])&&qo(ii(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(Ls(ii(e[n],e[r]),t)&&Ls(ii(e[n],t),e[r])&&Ls(ii(e[r],t),e[n])&&qo(id(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Ls(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 rd(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 qo(e,t){for(var n=0;n<t.length;++n)if(!rd(e,t[n]))return!1;return!0}function Vb(e){switch(e.length){case 1:return Gb(e[0]);case 2:return ii(e[0],e[1]);case 3:return id(e[0],e[1],e[2])}}function Gb(e){return{x:e.x,y:e.y,r:e.r}}function ii(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,d=Math.sqrt(l*l+c*c);return{x:(n+s+l/d*u)/2,y:(r+a+c/d*u)/2,r:(d+i+o)/2}}function id(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,d=n.r,h=r-a,f=r-c,p=i-o,g=i-u,v=l-s,m=d-s,y=r*r+i*i-s*s,b=y-a*a-o*o+l*l,S=y-c*c-u*u+d*d,_=f*p-h*g,E=(p*S-g*b)/(_*2)-r,M=(g*v-p*m)/_,C=(f*b-h*S)/(_*2)-i,G=(h*m-f*v)/_,I=M*M+G*G-1,T=2*(s+E*M+C*G),L=E*E+C*C-s*s,R=-(Math.abs(I)>1e-6?(T+Math.sqrt(T*T-4*I*L))/(2*I):L/T);return{x:r+E+M*R,y:i+C+G*R,r:R}}function sd(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 ad(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 od(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 Rs(e){this._=e,this.next=null,this.previous=null}function Hb(e,t){if(!(s=(e=Pb(e)).length))return 0;var n,r,i,s,a,o,l,c,u,d,h;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;sd(r,n,i=e[2]),n=new Rs(n),r=new Rs(r),i=new Rs(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){sd(n._,r._,i=e[l]),i=new Rs(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(ad(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(ad(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue t}h+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=od(n);(i=i.next)!==r;)(o=od(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Ub(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function Fb(e){return Math.sqrt(e.value)}function zb(){var e=null,t=1,n=1,r=An;function i(s){const a=$b();return s.x=t/2,s.y=n/2,e?s.eachBefore(ld(e)).eachAfter(Xo(r,.5,a)).eachBefore(cd(1)):s.eachBefore(ld(Fb)).eachAfter(Xo(An,1,a)).eachAfter(Xo(r,s.r/Math.min(t,n),a)).eachBefore(cd(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=Rb(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:ir(+s),i):r},i}function ld(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Xo(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=Hb(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function cd(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 Wb(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 Yb(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 qb(e,t){return e.parent===t.parent?1:2}function jo(e){var t=e.children;return t?t[0]:e.t}function Zo(e){var t=e.children;return t?t[t.length-1]:e.t}function Xb(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 jb(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 Zb(e,t,n){return e.a.parent===t.parent?e.a:n}function Is(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}Is.prototype=Object.create(ri.prototype);function Kb(e){for(var t=new Is(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 Is(s[a],a)),i.parent=n;return(t.parent=new Is(null,0)).children=[t],t}function Qb(){var e=qb,t=1,n=1,r=null;function i(c){var u=Kb(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(a),r)c.eachBefore(l);else{var d=c,h=c,f=c;c.eachBefore(function(y){y.x<d.x&&(d=y),y.x>h.x&&(h=y),y.depth>f.depth&&(f=y)});var p=d===h?1:e(d,h)/2,g=p-d.x,v=t/(h.x+p+g),m=n/(f.depth||1);c.eachBefore(function(y){y.x=(y.x+g)*v,y.y=y.depth*m})}return c}function s(c){var u=c.children,d=c.parent.children,h=c.i?d[c.i-1]:null;if(u){jb(c);var f=(u[0].z+u[u.length-1].z)/2;h?(c.z=h.z+e(c._,h._),c.m=c.z-f):c.z=f}else h&&(c.z=h.z+e(c._,h._));c.parent.A=o(c,h,c.parent.A||d[0])}function a(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function o(c,u,d){if(u){for(var h=c,f=c,p=u,g=h.parent.children[0],v=h.m,m=f.m,y=p.m,b=g.m,S;p=Zo(p),h=jo(h),p&&h;)g=jo(g),f=Zo(f),f.a=c,S=p.z+y-h.z-v+e(p._,h._),S>0&&(Xb(Zb(p,c,d),c,S),v+=S,m+=S),y+=p.m,v+=h.m,b+=g.m,m+=f.m;p&&!Zo(f)&&(f.t=p,f.m+=y-m),h&&!jo(g)&&(g.t=h,g.m+=v-b,d=c)}return d}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 Jb(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 tE=(1+Math.sqrt(5))/2;function eE(e,t,n,r,i,s){for(var a=[],o=t.children,l,c,u=0,d=0,h=o.length,f,p,g=t.value,v,m,y,b,S,_,E;u<h;){f=i-n,p=s-r;do v=o[d++].value;while(!v&&d<h);for(m=y=v,_=Math.max(p/f,f/p)/(g*e),E=v*v*_,S=Math.max(y/E,E/m);d<h;++d){if(v+=c=o[d].value,c<m&&(m=c),c>y&&(y=c),E=v*v*_,b=Math.max(y/E,E/m),b>S){v-=c;break}S=b}a.push(l={value:v,dice:f<p,children:o.slice(u,d)}),l.dice?Yb(l,n,r,i,g?r+=p*v/g:s):Jb(l,n,r,g?n+=f*v/g:i,s),g-=v,u=d}return a}const nE=function e(t){function n(r,i,s,a,o){eE(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(tE);function rE(){var e=nE,t=!1,n=1,r=1,i=[0],s=An,a=An,o=An,l=An,c=An;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(Wb),h}function d(h){var f=i[h.depth],p=h.x0+f,g=h.y0+f,v=h.x1-f,m=h.y1-f;v<p&&(p=v=(p+v)/2),m<g&&(g=m=(g+m)/2),h.x0=p,h.y0=g,h.x1=v,h.y1=m,h.children&&(f=i[h.depth+1]=s(h)/2,p+=c(h)-f,g+=a(h)-f,v-=o(h)-f,m-=l(h)-f,v<p&&(p=v=(p+v)/2),m<g&&(g=m=(g+m)/2),e(h,p,g,v,m))}return u.round=function(h){return arguments.length?(t=!!h,u):t},u.size=function(h){return arguments.length?(n=+h[0],r=+h[1],u):[n,r]},u.tile=function(h){return arguments.length?(e=ed(h),u):e},u.padding=function(h){return arguments.length?u.paddingInner(h).paddingOuter(h):u.paddingInner()},u.paddingInner=function(h){return arguments.length?(s=typeof h=="function"?h:ir(+h),u):s},u.paddingOuter=function(h){return arguments.length?u.paddingTop(h).paddingRight(h).paddingBottom(h).paddingLeft(h):u.paddingTop()},u.paddingTop=function(h){return arguments.length?(a=typeof h=="function"?h:ir(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:ir(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:ir(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:ir(+h),u):c},u}function sr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const ud=Symbol("implicit");function ks(){var e=new tu,t=[],n=[],r=ud;function i(s){let a=e.get(s);if(a===void 0){if(r!==ud)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 tu;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 ks(t,n).unknown(r)},sr.apply(i,arguments),i}function si(){var e=ks().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 d(){var h=t().length,f=i<r,p=f?i:r,g=f?r:i;s=(g-p)/Math.max(1,h-l+c*2),o&&(s=Math.floor(s)),p+=(g-p-s*(h-l))*u,a=s*(1-l),o&&(p=Math.round(p),a=Math.round(a));var v=hv(h).map(function(m){return p+s*m});return n(f?v.reverse():v)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(h){return arguments.length?(o=!!h,d()):o},e.padding=function(h){return arguments.length?(l=Math.min(1,c=+h),d()):l},e.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),d()):l},e.paddingOuter=function(h){return arguments.length?(c=+h,d()):c},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),d()):u},e.copy=function(){return si(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},sr.apply(d(),arguments)}function iE(e){return function(){return e}}function sE(e){return+e}var hd=[0,1];function ar(e){return e}function Ko(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:iE(isNaN(t)?NaN:.5)}function aE(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function oE(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Ko(i,r),s=n(a,s)):(r=Ko(r,i),s=n(s,a)),function(o){return s(r(o))}}function lE(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]=Ko(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Ha(e,o,1,r)-1;return s[l](i[l](o))}}function Qo(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function dd(){var e=hd,t=hd,n=Vr,r,i,s,a=ar,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==ar&&(a=aE(e[0],e[h-1])),o=h>2?lE:oE,l=c=null,d}function d(h){return h==null||isNaN(h=+h)?s:(l||(l=o(e.map(r),t,n)))(r(a(h)))}return d.invert=function(h){return a(i((c||(c=o(t,e.map(r),ae)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,sE),u()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=Iu,u()},d.clamp=function(h){return arguments.length?(a=h?!0:ar,u()):a!==ar},d.interpolate=function(h){return arguments.length?(n=h,u()):n},d.unknown=function(h){return arguments.length?(s=h,d):s},function(h,f){return r=h,i=f,u()}}function fd(){return dd()(ar,ar)}function cE(e,t,n,r){var i=za(e,t,n),s;switch(r=Wr(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=lx(i,a))&&(r.precision=s),ch(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=cx(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=ox(i))&&(r.precision=s-(r.type==="%")*2);break}}return wo(r)}function pd(e){var t=e.domain;return e.ticks=function(n){var r=t();return zi(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return cE(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=qn(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 Oe(){var e=fd();return e.copy=function(){return Qo(e,Oe())},sr.apply(e,arguments),pd(e)}function gd(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 md(e){return Math.log(e)}function vd(e){return Math.exp(e)}function uE(e){return-Math.log(-e)}function hE(e){return-Math.exp(-e)}function dE(e){return isFinite(e)?+("1e"+e):e<0?0:e}function fE(e){return e===10?dE:e===Math.E?Math.exp:t=>Math.pow(e,t)}function pE(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 yd(e){return(t,n)=>-e(-t,n)}function gE(e){const t=e(md,vd),n=t.domain;let r=10,i,s;function a(){return i=pE(r),s=fE(r),n()[0]<0?(i=yd(i),s=yd(s),e(uE,hE)):e(md,vd),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 d=u<c;d&&([c,u]=[u,c]);let h=i(c),f=i(u),p,g;const v=o==null?10:+o;let m=[];if(!(r%1)&&f-h<v){if(h=Math.floor(h),f=Math.ceil(f),c>0){for(;h<=f;++h)for(p=1;p<r;++p)if(g=h<0?p/s(-h):p*s(h),!(g<c)){if(g>u)break;m.push(g)}}else for(;h<=f;++h)for(p=r-1;p>=1;--p)if(g=h>0?p/s(-h):p*s(h),!(g<c)){if(g>u)break;m.push(g)}m.length*2<v&&(m=zi(c,u,v))}else m=zi(h,f,Math.min(f-h,v)).map(s);return d?m.reverse():m},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Wr(l)).precision==null&&(l.trim=!0),l=wo(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return u=>{let d=u/s(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(gd(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function xd(){const e=gE(dd()).domain([1,10]);return e.copy=()=>Qo(e,xd()).base(e.base()),sr.apply(e,arguments),e}function Jo(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[Ha(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 Jo().domain([e,t]).range(i).unknown(s)},sr.apply(pd(a),arguments)}const tl=new Date,el=new Date;function Pt(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=>Pt(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)=>(tl.setTime(+s),el.setTime(+a),e(tl),e(el),Math.floor(n(tl,el))),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 $s=Pt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$s.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Pt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):$s),$s.range;const Xe=1e3,pe=Xe*60,je=pe*60,Ze=je*24,nl=Ze*7,bd=Ze*30,rl=Ze*365,or=Pt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Xe)},(e,t)=>(t-e)/Xe,e=>e.getUTCSeconds());or.range;const il=Pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xe)},(e,t)=>{e.setTime(+e+t*pe)},(e,t)=>(t-e)/pe,e=>e.getMinutes());il.range,Pt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pe)},(e,t)=>(t-e)/pe,e=>e.getUTCMinutes()).range;const sl=Pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Xe-e.getMinutes()*pe)},(e,t)=>{e.setTime(+e+t*je)},(e,t)=>(t-e)/je,e=>e.getHours());sl.range,Pt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*je)},(e,t)=>(t-e)/je,e=>e.getUTCHours()).range;const ai=Pt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pe)/Ze,e=>e.getDate()-1);ai.range;const al=Pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ze,e=>e.getUTCDate()-1);al.range,Pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ze,e=>Math.floor(e/Ze)).range;function Dn(e){return Pt(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())*pe)/nl)}const Ps=Dn(0),Ns=Dn(1),mE=Dn(2),vE=Dn(3),lr=Dn(4),yE=Dn(5),xE=Dn(6);Ps.range,Ns.range,mE.range,vE.range,lr.range,yE.range,xE.range;function Ln(e){return Pt(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)/nl)}const Ed=Ln(0),Us=Ln(1),bE=Ln(2),EE=Ln(3),cr=Ln(4),SE=Ln(5),_E=Ln(6);Ed.range,Us.range,bE.range,EE.range,cr.range,SE.range,_E.range;const ol=Pt(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());ol.range,Pt(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 Ke=Pt(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());Ke.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pt(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)}),Ke.range;const Rn=Pt(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());Rn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Pt(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)}),Rn.range;function wE(e,t,n,r,i,s){const a=[[or,1,Xe],[or,5,5*Xe],[or,15,15*Xe],[or,30,30*Xe],[s,1,pe],[s,5,5*pe],[s,15,15*pe],[s,30,30*pe],[i,1,je],[i,3,3*je],[i,6,6*je],[i,12,12*je],[r,1,Ze],[r,2,2*Ze],[n,1,nl],[t,1,bd],[t,3,3*bd],[e,1,rl]];function o(c,u,d){const h=u<c;h&&([c,u]=[u,c]);const f=d&&typeof d.range=="function"?d:l(c,u,d),p=f?f.range(c,+u+1):[];return h?p.reverse():p}function l(c,u,d){const h=Math.abs(u-c)/d,f=Ga(([,,v])=>v).right(a,h);if(f===a.length)return e.every(za(c/rl,u/rl,d));if(f===0)return $s.every(Math.max(za(c,u,d),1));const[p,g]=a[h/a[f-1][2]<a[f][2]/h?f-1:f];return p.every(g)}return[o,l]}const[OE,TE]=wE(Ke,ol,Ps,ai,sl,il);function ll(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 cl(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 ME(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=li(i),u=ci(i),d=li(s),h=ci(s),f=li(a),p=ci(a),g=li(o),v=ci(o),m=li(l),y=ci(l),b={a:P,A:N,b:B,B:Y,c:null,d:Md,e:Md,f:ZE,g:aS,G:lS,H:qE,I:XE,j:jE,L:Cd,m:KE,M:QE,p:X,q:J,Q:kd,s:$d,S:JE,u:tS,U:eS,V:nS,w:rS,W:iS,x:null,X:null,y:sS,Y:oS,Z:cS,"%":Id},S={a:ct,A:W,b:K,B:ut,c:null,d:Dd,e:Dd,f:fS,g:_S,G:OS,H:uS,I:hS,j:dS,L:Ld,m:pS,M:gS,p:rt,q:Tt,Q:kd,s:$d,S:mS,u:vS,U:yS,V:xS,w:bS,W:ES,x:null,X:null,y:SS,Y:wS,Z:TS,"%":Id},_={a:I,A:T,b:L,B:R,c:k,d:Od,e:Od,f:FE,g:wd,G:_d,H:Td,I:Td,j:BE,L:HE,m:UE,M:VE,p:G,q:NE,Q:WE,s:YE,S:GE,u:RE,U:IE,V:kE,w:LE,W:$E,x:O,X:U,y:wd,Y:_d,Z:PE,"%":zE};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(q,V){return function(H){var $=[],pt=-1,yt=0,Kt=q.length,Qt,et,Rt;for(H instanceof Date||(H=new Date(+H));++pt<Kt;)q.charCodeAt(pt)===37&&($.push(q.slice(yt,pt)),(et=Sd[Qt=q.charAt(++pt)])!=null?Qt=q.charAt(++pt):et=Qt==="e"?" ":"0",(Rt=V[Qt])&&(Qt=Rt(H,et)),$.push(Qt),yt=pt+1);return $.push(q.slice(yt,pt)),$.join("")}}function M(q,V){return function(H){var $=oi(1900,void 0,1),pt=C($,q,H+="",0),yt,Kt;if(pt!=H.length)return null;if("Q"in $)return new Date($.Q);if("s"in $)return new Date($.s*1e3+("L"in $?$.L:0));if(V&&!("Z"in $)&&($.Z=0),"p"in $&&($.H=$.H%12+$.p*12),$.m===void 0&&($.m="q"in $?$.q:0),"V"in $){if($.V<1||$.V>53)return null;"w"in $||($.w=1),"Z"in $?(yt=cl(oi($.y,0,1)),Kt=yt.getUTCDay(),yt=Kt>4||Kt===0?Us.ceil(yt):Us(yt),yt=al.offset(yt,($.V-1)*7),$.y=yt.getUTCFullYear(),$.m=yt.getUTCMonth(),$.d=yt.getUTCDate()+($.w+6)%7):(yt=ll(oi($.y,0,1)),Kt=yt.getDay(),yt=Kt>4||Kt===0?Ns.ceil(yt):Ns(yt),yt=ai.offset(yt,($.V-1)*7),$.y=yt.getFullYear(),$.m=yt.getMonth(),$.d=yt.getDate()+($.w+6)%7)}else("W"in $||"U"in $)&&("w"in $||($.w="u"in $?$.u%7:"W"in $?1:0),Kt="Z"in $?cl(oi($.y,0,1)).getUTCDay():ll(oi($.y,0,1)).getDay(),$.m=0,$.d="W"in $?($.w+6)%7+$.W*7-(Kt+5)%7:$.w+$.U*7-(Kt+6)%7);return"Z"in $?($.H+=$.Z/100|0,$.M+=$.Z%100,cl($)):ll($)}}function C(q,V,H,$){for(var pt=0,yt=V.length,Kt=H.length,Qt,et;pt<yt;){if($>=Kt)return-1;if(Qt=V.charCodeAt(pt++),Qt===37){if(Qt=V.charAt(pt++),et=_[Qt in Sd?V.charAt(pt++):Qt],!et||($=et(q,H,$))<0)return-1}else if(Qt!=H.charCodeAt($++))return-1}return $}function G(q,V,H){var $=c.exec(V.slice(H));return $?(q.p=u.get($[0].toLowerCase()),H+$[0].length):-1}function I(q,V,H){var $=f.exec(V.slice(H));return $?(q.w=p.get($[0].toLowerCase()),H+$[0].length):-1}function T(q,V,H){var $=d.exec(V.slice(H));return $?(q.w=h.get($[0].toLowerCase()),H+$[0].length):-1}function L(q,V,H){var $=m.exec(V.slice(H));return $?(q.m=y.get($[0].toLowerCase()),H+$[0].length):-1}function R(q,V,H){var $=g.exec(V.slice(H));return $?(q.m=v.get($[0].toLowerCase()),H+$[0].length):-1}function k(q,V,H){return C(q,t,V,H)}function O(q,V,H){return C(q,n,V,H)}function U(q,V,H){return C(q,r,V,H)}function P(q){return a[q.getDay()]}function N(q){return s[q.getDay()]}function B(q){return l[q.getMonth()]}function Y(q){return o[q.getMonth()]}function X(q){return i[+(q.getHours()>=12)]}function J(q){return 1+~~(q.getMonth()/3)}function ct(q){return a[q.getUTCDay()]}function W(q){return s[q.getUTCDay()]}function K(q){return l[q.getUTCMonth()]}function ut(q){return o[q.getUTCMonth()]}function rt(q){return i[+(q.getUTCHours()>=12)]}function Tt(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var V=E(q+="",b);return V.toString=function(){return q},V},parse:function(q){var V=M(q+="",!1);return V.toString=function(){return q},V},utcFormat:function(q){var V=E(q+="",S);return V.toString=function(){return q},V},utcParse:function(q){var V=M(q+="",!0);return V.toString=function(){return q},V}}}var Sd={"-":"",_:" ",0:"0"},Bt=/^\s*\d+/,CE=/^%/,AE=/[\\^$*+?|[\]().{}]/g;function ht(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 DE(e){return e.replace(AE,"\\$&")}function li(e){return new RegExp("^(?:"+e.map(DE).join("|")+")","i")}function ci(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function LE(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function RE(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function IE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function kE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function $E(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function _d(e,t,n){var r=Bt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function wd(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function PE(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 NE(e,t,n){var r=Bt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function UE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Od(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function BE(e,t,n){var r=Bt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Td(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function VE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function GE(e,t,n){var r=Bt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function HE(e,t,n){var r=Bt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function FE(e,t,n){var r=Bt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function zE(e,t,n){var r=CE.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function WE(e,t,n){var r=Bt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function YE(e,t,n){var r=Bt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Md(e,t){return ht(e.getDate(),t,2)}function qE(e,t){return ht(e.getHours(),t,2)}function XE(e,t){return ht(e.getHours()%12||12,t,2)}function jE(e,t){return ht(1+ai.count(Ke(e),e),t,3)}function Cd(e,t){return ht(e.getMilliseconds(),t,3)}function ZE(e,t){return Cd(e,t)+"000"}function KE(e,t){return ht(e.getMonth()+1,t,2)}function QE(e,t){return ht(e.getMinutes(),t,2)}function JE(e,t){return ht(e.getSeconds(),t,2)}function tS(e){var t=e.getDay();return t===0?7:t}function eS(e,t){return ht(Ps.count(Ke(e)-1,e),t,2)}function Ad(e){var t=e.getDay();return t>=4||t===0?lr(e):lr.ceil(e)}function nS(e,t){return e=Ad(e),ht(lr.count(Ke(e),e)+(Ke(e).getDay()===4),t,2)}function rS(e){return e.getDay()}function iS(e,t){return ht(Ns.count(Ke(e)-1,e),t,2)}function sS(e,t){return ht(e.getFullYear()%100,t,2)}function aS(e,t){return e=Ad(e),ht(e.getFullYear()%100,t,2)}function oS(e,t){return ht(e.getFullYear()%1e4,t,4)}function lS(e,t){var n=e.getDay();return e=n>=4||n===0?lr(e):lr.ceil(e),ht(e.getFullYear()%1e4,t,4)}function cS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ht(t/60|0,"0",2)+ht(t%60,"0",2)}function Dd(e,t){return ht(e.getUTCDate(),t,2)}function uS(e,t){return ht(e.getUTCHours(),t,2)}function hS(e,t){return ht(e.getUTCHours()%12||12,t,2)}function dS(e,t){return ht(1+al.count(Rn(e),e),t,3)}function Ld(e,t){return ht(e.getUTCMilliseconds(),t,3)}function fS(e,t){return Ld(e,t)+"000"}function pS(e,t){return ht(e.getUTCMonth()+1,t,2)}function gS(e,t){return ht(e.getUTCMinutes(),t,2)}function mS(e,t){return ht(e.getUTCSeconds(),t,2)}function vS(e){var t=e.getUTCDay();return t===0?7:t}function yS(e,t){return ht(Ed.count(Rn(e)-1,e),t,2)}function Rd(e){var t=e.getUTCDay();return t>=4||t===0?cr(e):cr.ceil(e)}function xS(e,t){return e=Rd(e),ht(cr.count(Rn(e),e)+(Rn(e).getUTCDay()===4),t,2)}function bS(e){return e.getUTCDay()}function ES(e,t){return ht(Us.count(Rn(e)-1,e),t,2)}function SS(e,t){return ht(e.getUTCFullYear()%100,t,2)}function _S(e,t){return e=Rd(e),ht(e.getUTCFullYear()%100,t,2)}function wS(e,t){return ht(e.getUTCFullYear()%1e4,t,4)}function OS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?cr(e):cr.ceil(e),ht(e.getUTCFullYear()%1e4,t,4)}function TS(){return"+0000"}function Id(){return"%"}function kd(e){return+e}function $d(e){return Math.floor(+e/1e3)}var ur,Pd;MS({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 MS(e){return ur=ME(e),Pd=ur.format,ur.parse,ur.utcFormat,ur.utcParse,ur}function CS(e){return new Date(e)}function AS(e){return e instanceof Date?+e:+new Date(+e)}function Nd(e,t,n,r,i,s,a,o,l,c){var u=fd(),d=u.invert,h=u.domain,f=c(".%L"),p=c(":%S"),g=c("%I:%M"),v=c("%I %p"),m=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?g:s(E)<E?v:r(E)<E?i(E)<E?m:y:n(E)<E?b:S)(E)}return u.invert=function(E){return new Date(d(E))},u.domain=function(E){return arguments.length?h(Array.from(E,AS)):h().map(CS)},u.ticks=function(E){var M=h();return e(M[0],M[M.length-1],E??10)},u.tickFormat=function(E,M){return M==null?_:c(M)},u.nice=function(E){var M=h();return(!E||typeof E.range!="function")&&(E=t(M[0],M[M.length-1],E??10)),E?h(gd(M,E)):u},u.copy=function(){return Qo(u,Nd(e,t,n,r,i,s,a,o,l,c))},u}function Ud(){return sr.apply(Nd(OE,TE,Ke,ol,Ps,ai,sl,il,or,Pd).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function at(e){return function(){return e}}const Bd=Math.abs,Wt=Math.atan2,In=Math.cos,DS=Math.max,ul=Math.min,Pe=Math.sin,hr=Math.sqrt,Yt=1e-12,ui=Math.PI,Bs=ui/2,Vs=2*ui;function LS(e){return e>1?0:e<-1?ui:Math.acos(e)}function Vd(e){return e>=1?Bs:e<=-1?-Bs:Math.asin(e)}function Gs(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 Q1(t)}function RS(e){return e.innerRadius}function IS(e){return e.outerRadius}function kS(e){return e.startAngle}function $S(e){return e.endAngle}function PS(e){return e&&e.padAngle}function NS(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,u=a-i,d=o-s,h=d*l-u*c;if(!(h*h<Yt))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function Hs(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/hr(o*o+l*l),u=c*l,d=-c*o,h=e+u,f=t+d,p=n+u,g=r+d,v=(h+p)/2,m=(f+g)/2,y=p-h,b=g-f,S=y*y+b*b,_=i-s,E=h*g-p*f,M=(b<0?-1:1)*hr(DS(0,_*_*S-E*E)),C=(E*b-y*M)/S,G=(-E*y-b*M)/S,I=(E*b+y*M)/S,T=(-E*y+b*M)/S,L=C-v,R=G-m,k=I-v,O=T-m;return L*L+R*R>k*k+O*O&&(C=I,G=T),{cx:C,cy:G,x01:-u,y01:-d,x11:C*(i/_-1),y11:G*(i/_-1)}}function hi(){var e=RS,t=IS,n=at(0),r=null,i=kS,s=$S,a=PS,o=null,l=Gs(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-Bs,g=s.apply(this,arguments)-Bs,v=Bd(g-p),m=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>Yt))o.moveTo(0,0);else if(v>Vs-Yt)o.moveTo(f*In(p),f*Pe(p)),o.arc(0,0,f,p,g,!m),h>Yt&&(o.moveTo(h*In(g),h*Pe(g)),o.arc(0,0,h,g,p,m));else{var y=p,b=g,S=p,_=g,E=v,M=v,C=a.apply(this,arguments)/2,G=C>Yt&&(r?+r.apply(this,arguments):hr(h*h+f*f)),I=ul(Bd(f-h)/2,+n.apply(this,arguments)),T=I,L=I,R,k;if(G>Yt){var O=Vd(G/h*Pe(C)),U=Vd(G/f*Pe(C));(E-=O*2)>Yt?(O*=m?1:-1,S+=O,_-=O):(E=0,S=_=(p+g)/2),(M-=U*2)>Yt?(U*=m?1:-1,y+=U,b-=U):(M=0,y=b=(p+g)/2)}var P=f*In(y),N=f*Pe(y),B=h*In(_),Y=h*Pe(_);if(I>Yt){var X=f*In(b),J=f*Pe(b),ct=h*In(S),W=h*Pe(S),K;if(v<ui)if(K=NS(P,N,ct,W,X,J,B,Y)){var ut=P-K[0],rt=N-K[1],Tt=X-K[0],q=J-K[1],V=1/Pe(LS((ut*Tt+rt*q)/(hr(ut*ut+rt*rt)*hr(Tt*Tt+q*q)))/2),H=hr(K[0]*K[0]+K[1]*K[1]);T=ul(I,(h-H)/(V-1)),L=ul(I,(f-H)/(V+1))}else T=L=0}M>Yt?L>Yt?(R=Hs(ct,W,P,N,f,L,m),k=Hs(X,J,B,Y,f,L,m),o.moveTo(R.cx+R.x01,R.cy+R.y01),L<I?o.arc(R.cx,R.cy,L,Wt(R.y01,R.x01),Wt(k.y01,k.x01),!m):(o.arc(R.cx,R.cy,L,Wt(R.y01,R.x01),Wt(R.y11,R.x11),!m),o.arc(0,0,f,Wt(R.cy+R.y11,R.cx+R.x11),Wt(k.cy+k.y11,k.cx+k.x11),!m),o.arc(k.cx,k.cy,L,Wt(k.y11,k.x11),Wt(k.y01,k.x01),!m))):(o.moveTo(P,N),o.arc(0,0,f,y,b,!m)):o.moveTo(P,N),!(h>Yt)||!(E>Yt)?o.lineTo(B,Y):T>Yt?(R=Hs(B,Y,X,J,h,-T,m),k=Hs(P,N,ct,W,h,-T,m),o.lineTo(R.cx+R.x01,R.cy+R.y01),T<I?o.arc(R.cx,R.cy,T,Wt(R.y01,R.x01),Wt(k.y01,k.x01),!m):(o.arc(R.cx,R.cy,T,Wt(R.y01,R.x01),Wt(R.y11,R.x11),!m),o.arc(0,0,h,Wt(R.cy+R.y11,R.cx+R.x11),Wt(k.cy+k.y11,k.cx+k.x11),m),o.arc(k.cx,k.cy,T,Wt(k.y11,k.x11),Wt(k.y01,k.x01),!m))):o.arc(0,0,h,_,S,m)}if(o.closePath(),u)return o=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-ui/2;return[In(d)*u,Pe(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:at(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:at(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:at(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:at(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:at(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:at(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:at(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var US=Array.prototype.slice;function Fs(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gd(e){this._context=e}Gd.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 zs(e){return new Gd(e)}function hl(e){return e[0]}function dl(e){return e[1]}function di(e,t){var n=at(!0),r=null,i=zs,s=null,a=Gs(o);e=typeof e=="function"?e:e===void 0?hl:at(e),t=typeof t=="function"?t:t===void 0?dl:at(t);function o(l){var c,u=(l=Fs(l)).length,d,h=!1,f;for(r==null&&(s=i(f=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(d,c,l),+t(d,c,l));if(f)return s=null,f+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:at(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:at(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:at(!!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 fl(e,t,n){var r=null,i=at(!0),s=null,a=zs,o=null,l=Gs(c);e=typeof e=="function"?e:e===void 0?hl:at(+e),t=typeof t=="function"?t:at(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?dl:at(+n);function c(d){var h,f,p,g=(d=Fs(d)).length,v,m=!1,y,b=new Array(g),S=new Array(g);for(s==null&&(o=a(y=l())),h=0;h<=g;++h){if(!(h<g&&i(v=d[h],h,d))===m)if(m=!m)f=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=h-1;p>=f;--p)o.point(b[p],S[p]);o.lineEnd(),o.areaEnd()}m&&(b[h]=+e(v,h,d),S[h]=+t(v,h,d),o.point(r?+r(v,h,d):b[h],n?+n(v,h,d):S[h]))}if(y)return o=null,y+""||null}function u(){return di().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:at(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:at(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:at(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:at(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:at(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:at(+d),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(d){return arguments.length?(i=typeof d=="function"?d:at(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,s!=null&&(o=a(s)),c):a},c.context=function(d){return arguments.length?(d==null?s=o=null:o=a(s=d),c):s},c}function BS(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function VS(e){return e}function GS(){var e=VS,t=BS,n=null,r=at(0),i=at(Vs),s=at(0);function a(o){var l,c=(o=Fs(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),g=+r.apply(this,arguments),v=Math.min(Vs,Math.max(-Vs,i.apply(this,arguments)-g)),m,y=Math.min(Math.abs(v)/c,s.apply(this,arguments)),b=y*(v<0?-1:1),S;for(l=0;l<c;++l)(S=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=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,d=h?(v-c*b)/h:0;l<c;++l,g=m)u=f[l],S=p[u],m=g+(S>0?S*d:0)+b,p[u]={data:o[u],index:l,value:S,startAngle:g,endAngle:m,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:at(+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:at(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:at(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:at(+o),a):s},a}var HS=Fd(zs);function Hd(e){this._curve=e}Hd.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 Fd(e){function t(n){return new Hd(e(n))}return t._curve=e,t}function FS(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(Fd(n)):t()._curve},e}function zS(){return FS(di().curve(HS))}class WS{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 YS(e){return new WS(e,!0)}function qS(e){return e.source}function XS(e){return e.target}function jS(e){let t=qS,n=XS,r=hl,i=dl,s=null,a=null,o=Gs(l);function l(){let c;const u=US.call(arguments),d=t.apply(this,u),h=n.apply(this,u);if(s==null&&(a=e(c=o())),a.lineStart(),u[0]=d,a.point(+r.apply(this,u),+i.apply(this,u)),u[0]=h,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:at(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:at(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function ZS(){return jS(YS)}function dn(){}function Ws(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 Ys(e){this._context=e}Ys.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:Ws(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:Ws(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function KS(e){return new Ys(e)}function zd(e){this._context=e}zd.prototype={areaStart:dn,areaEnd:dn,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:Ws(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function QS(e){return new zd(e)}function Wd(e){this._context=e}Wd.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:Ws(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JS(e){return new Wd(e)}function Yd(e,t){this._basis=new Ys(e),this._beta=t}Yd.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 t_=function e(t){function n(r){return t===1?new Ys(r):new Yd(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function qs(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 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(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:qs(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:qs(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 e_=function e(t){function n(r){return new pl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function gl(e,t){this._context=e,this._k=(1-t)/6}gl.prototype={areaStart:dn,areaEnd:dn,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:qs(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 n_=function e(t){function n(r){return new gl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function ml(e,t){this._context=e,this._k=(1-t)/6}ml.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:qs(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 r_=function e(t){function n(r){return new ml(r,t)}return n.tension=function(r){return e(+r)},n}(0);function vl(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Yt){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>Yt){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 qd(e,t){this._context=e,this._alpha=t}qd.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:vl(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 i_=function e(t){function n(r){return t?new qd(r,t):new pl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Xd(e,t){this._context=e,this._alpha=t}Xd.prototype={areaStart:dn,areaEnd:dn,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:vl(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 s_=function e(t){function n(r){return t?new Xd(r,t):new gl(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:vl(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 a_=function e(t){function n(r){return t?new jd(r,t):new ml(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Zd(e){this._context=e}Zd.prototype={areaStart:dn,areaEnd:dn,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 Kd(e){return new Zd(e)}function Qd(e){return e<0?-1:1}function Jd(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(Qd(s)+Qd(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function tf(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function yl(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 Xs(e){this._context=e}Xs.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:yl(this,this._t0,tf(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,yl(this,tf(this,n=Jd(this,e,t)),n);break;default:yl(this,this._t0,n=Jd(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function ef(e){this._context=new nf(e)}(ef.prototype=Object.create(Xs.prototype)).point=function(e,t){Xs.prototype.point.call(this,t,e)};function nf(e){this._context=e}nf.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 o_(e){return new Xs(e)}function l_(e){return new ef(e)}function rf(e){this._context=e}rf.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=sf(e),i=sf(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 sf(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 c_(e){return new rf(e)}function js(e,t){this._context=e,this._t=t}js.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 u_(e){return new js(e,.5)}function h_(e){return new js(e,0)}function d_(e){return new js(e,1)}function af(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 of(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function f_(e,t){return e[t]}function p_(e){const t=[];return t.key=e,t}function xl(){var e=at([]),t=of,n=af,r=f_;function i(s){var a=Array.from(e.apply(this,arguments),p_),o,l=a.length,c=-1,u;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,u=Fs(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:at(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:at(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?of:typeof s=="function"?s:at(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??af,i):n},i}function g_(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 fi(e,t,n){this.k=e,this.x=t,this.y=n}fi.prototype={constructor:fi,scale:function(e){return e===1?this:new fi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fi(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+")"}},fi.prototype;var m_=typeof global=="object"&&global&&global.Object===Object&&global;const lf=m_;var v_=typeof self=="object"&&self&&self.Object===Object&&self,y_=lf||v_||Function("return this")();const Te=y_;var x_=Te.Symbol;const ge=x_;var cf=Object.prototype,b_=cf.hasOwnProperty,E_=cf.toString,pi=ge?ge.toStringTag:void 0;function S_(e){var t=b_.call(e,pi),n=e[pi];try{e[pi]=void 0;var r=!0}catch{}var i=E_.call(e);return r&&(t?e[pi]=n:delete e[pi]),i}var __=Object.prototype,w_=__.toString;function O_(e){return w_.call(e)}var T_="[object Null]",M_="[object Undefined]",uf=ge?ge.toStringTag:void 0;function kn(e){return e==null?e===void 0?M_:T_:uf&&uf in Object(e)?S_(e):O_(e)}function Ne(e){return e!=null&&typeof e=="object"}var C_="[object Symbol]";function Zs(e){return typeof e=="symbol"||Ne(e)&&kn(e)==C_}function hf(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 A_=Array.isArray;const Vt=A_;var D_=1/0,df=ge?ge.prototype:void 0,ff=df?df.toString:void 0;function pf(e){if(typeof e=="string")return e;if(Vt(e))return hf(e,pf)+"";if(Zs(e))return ff?ff.call(e):"";var t=e+"";return t=="0"&&1/e==-D_?"-0":t}var L_=/\s/;function R_(e){for(var t=e.length;t--&&L_.test(e.charAt(t)););return t}var I_=/^\s+/;function k_(e){return e&&e.slice(0,R_(e)+1).replace(I_,"")}function me(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gf=0/0,$_=/^[-+]0x[0-9a-f]+$/i,P_=/^0b[01]+$/i,N_=/^0o[0-7]+$/i,U_=parseInt;function gi(e){if(typeof e=="number")return e;if(Zs(e))return gf;if(me(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=me(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=k_(e);var n=P_.test(e);return n||N_.test(e)?U_(e.slice(2),n?2:8):$_.test(e)?gf:+e}function bl(e){return e}var B_="[object AsyncFunction]",V_="[object Function]",G_="[object GeneratorFunction]",H_="[object Proxy]";function El(e){if(!me(e))return!1;var t=kn(e);return t==V_||t==G_||t==B_||t==H_}var F_=Te["__core-js_shared__"];const Sl=F_;var mf=function(){var e=/[^.]+$/.exec(Sl&&Sl.keys&&Sl.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function z_(e){return!!mf&&mf in e}var W_=Function.prototype,Y_=W_.toString;function $n(e){if(e!=null){try{return Y_.call(e)}catch{}try{return e+""}catch{}}return""}var q_=/[\\^$.*+?()[\]{}|]/g,X_=/^\[object .+?Constructor\]$/,j_=Function.prototype,Z_=Object.prototype,K_=j_.toString,Q_=Z_.hasOwnProperty,J_=RegExp("^"+K_.call(Q_).replace(q_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tw(e){if(!me(e)||z_(e))return!1;var t=El(e)?J_:X_;return t.test($n(e))}function ew(e,t){return e==null?void 0:e[t]}function Pn(e,t){var n=ew(e,t);return tw(n)?n:void 0}var nw=Pn(Te,"WeakMap");const _l=nw;var vf=Object.create,rw=function(){function e(){}return function(t){if(!me(t))return{};if(vf)return vf(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const iw=rw;function sw(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 aw(){}function yf(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var ow=800,lw=16,cw=Date.now;function uw(e){var t=0,n=0;return function(){var r=cw(),i=lw-(r-n);if(n=r,i>0){if(++t>=ow)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function hw(e){return function(){return e}}var dw=function(){try{var e=Pn(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Ks=dw;var fw=Ks?function(e,t){return Ks(e,"toString",{configurable:!0,enumerable:!1,value:hw(t),writable:!0})}:bl,pw=uw(fw);const gw=pw;function mw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function vw(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 yw(e){return e!==e}function xw(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function bw(e,t,n){return t===t?xw(e,t,n):vw(e,yw,n)}function Ew(e,t){var n=e==null?0:e.length;return!!n&&bw(e,t,0)>-1}var Sw=9007199254740991,_w=/^(?:0|[1-9]\d*)$/;function wl(e,t){var n=typeof e;return t=t??Sw,!!t&&(n=="number"||n!="symbol"&&_w.test(e))&&e>-1&&e%1==0&&e<t}function Qs(e,t,n){t=="__proto__"&&Ks?Ks(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function mi(e,t){return e===t||e!==e&&t!==t}var ww=Object.prototype,Ow=ww.hasOwnProperty;function xf(e,t,n){var r=e[t];(!(Ow.call(e,t)&&mi(r,n))||n===void 0&&!(t in e))&&Qs(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?Qs(n,o,l):xf(n,o,l)}return n}var bf=Math.max;function Tw(e,t,n){return t=bf(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=bf(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),sw(e,this,o)}}function Ef(e,t){return gw(Tw(e,t,bl),e+"")}var Mw=9007199254740991;function Ol(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Mw}function Nn(e){return e!=null&&Ol(e.length)&&!El(e)}function Sf(e,t,n){if(!me(n))return!1;var r=typeof t;return(r=="number"?Nn(n)&&wl(t,n.length):r=="string"&&t in n)?mi(n[t],e):!1}function Cw(e){return Ef(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&&Sf(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 Aw=Object.prototype;function Js(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Aw;return e===n}function Dw(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Lw="[object Arguments]";function _f(e){return Ne(e)&&kn(e)==Lw}var wf=Object.prototype,Rw=wf.hasOwnProperty,Iw=wf.propertyIsEnumerable,kw=_f(function(){return arguments}())?_f:function(e){return Ne(e)&&Rw.call(e,"callee")&&!Iw.call(e,"callee")};const dr=kw;function $w(){return!1}var Of=typeof z=="object"&&z&&!z.nodeType&&z,Tf=Of&&typeof module=="object"&&module&&!module.nodeType&&module,Pw=Tf&&Tf.exports===Of,Mf=Pw?Te.Buffer:void 0,Nw=Mf?Mf.isBuffer:void 0,Uw=Nw||$w;const fr=Uw;var Bw="[object Arguments]",Vw="[object Array]",Gw="[object Boolean]",Hw="[object Date]",Fw="[object Error]",zw="[object Function]",Ww="[object Map]",Yw="[object Number]",qw="[object Object]",Xw="[object RegExp]",jw="[object Set]",Zw="[object String]",Kw="[object WeakMap]",Qw="[object ArrayBuffer]",Jw="[object DataView]",tO="[object Float32Array]",eO="[object Float64Array]",nO="[object Int8Array]",rO="[object Int16Array]",iO="[object Int32Array]",sO="[object Uint8Array]",aO="[object Uint8ClampedArray]",oO="[object Uint16Array]",lO="[object Uint32Array]",Ot={};Ot[tO]=Ot[eO]=Ot[nO]=Ot[rO]=Ot[iO]=Ot[sO]=Ot[aO]=Ot[oO]=Ot[lO]=!0,Ot[Bw]=Ot[Vw]=Ot[Qw]=Ot[Gw]=Ot[Jw]=Ot[Hw]=Ot[Fw]=Ot[zw]=Ot[Ww]=Ot[Yw]=Ot[qw]=Ot[Xw]=Ot[jw]=Ot[Zw]=Ot[Kw]=!1;function cO(e){return Ne(e)&&Ol(e.length)&&!!Ot[kn(e)]}function Tl(e){return function(t){return e(t)}}var Cf=typeof z=="object"&&z&&!z.nodeType&&z,yi=Cf&&typeof module=="object"&&module&&!module.nodeType&&module,uO=yi&&yi.exports===Cf,Ml=uO&&lf.process,hO=function(){try{var e=yi&&yi.require&&yi.require("util").types;return e||Ml&&Ml.binding&&Ml.binding("util")}catch{}}();const pr=hO;var Af=pr&&pr.isTypedArray,dO=Af?Tl(Af):cO;const ta=dO;var fO=Object.prototype,pO=fO.hasOwnProperty;function Df(e,t){var n=Vt(e),r=!n&&dr(e),i=!n&&!r&&fr(e),s=!n&&!r&&!i&&ta(e),a=n||r||i||s,o=a?Dw(e.length,String):[],l=o.length;for(var c in e)(t||pO.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wl(c,l)))&&o.push(c);return o}function Lf(e,t){return function(n){return e(t(n))}}var gO=Lf(Object.keys,Object);const mO=gO;var vO=Object.prototype,yO=vO.hasOwnProperty;function Rf(e){if(!Js(e))return mO(e);var t=[];for(var n in Object(e))yO.call(e,n)&&n!="constructor"&&t.push(n);return t}function xi(e){return Nn(e)?Df(e):Rf(e)}function xO(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var bO=Object.prototype,EO=bO.hasOwnProperty;function SO(e){if(!me(e))return xO(e);var t=Js(e),n=[];for(var r in e)r=="constructor"&&(t||!EO.call(e,r))||n.push(r);return n}function bi(e){return Nn(e)?Df(e,!0):SO(e)}var _O=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wO=/^\w*$/;function Cl(e,t){if(Vt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Zs(e)?!0:wO.test(e)||!_O.test(e)||t!=null&&e in Object(t)}var OO=Pn(Object,"create");const Ei=OO;function TO(){this.__data__=Ei?Ei(null):{},this.size=0}function MO(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var CO="__lodash_hash_undefined__",AO=Object.prototype,DO=AO.hasOwnProperty;function LO(e){var t=this.__data__;if(Ei){var n=t[e];return n===CO?void 0:n}return DO.call(t,e)?t[e]:void 0}var RO=Object.prototype,IO=RO.hasOwnProperty;function kO(e){var t=this.__data__;return Ei?t[e]!==void 0:IO.call(t,e)}var $O="__lodash_hash_undefined__";function PO(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ei&&t===void 0?$O:t,this}function Un(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])}}Un.prototype.clear=TO,Un.prototype.delete=MO,Un.prototype.get=LO,Un.prototype.has=kO,Un.prototype.set=PO;function NO(){this.__data__=[],this.size=0}function ea(e,t){for(var n=e.length;n--;)if(mi(e[n][0],t))return n;return-1}var UO=Array.prototype,BO=UO.splice;function VO(e){var t=this.__data__,n=ea(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():BO.call(t,n,1),--this.size,!0}function GO(e){var t=this.__data__,n=ea(t,e);return n<0?void 0:t[n][1]}function HO(e){return ea(this.__data__,e)>-1}function FO(e,t){var n=this.__data__,r=ea(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Qe(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])}}Qe.prototype.clear=NO,Qe.prototype.delete=VO,Qe.prototype.get=GO,Qe.prototype.has=HO,Qe.prototype.set=FO;var zO=Pn(Te,"Map");const Si=zO;function WO(){this.size=0,this.__data__={hash:new Un,map:new(Si||Qe),string:new Un}}function YO(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function na(e,t){var n=e.__data__;return YO(t)?n[typeof t=="string"?"string":"hash"]:n.map}function qO(e){var t=na(this,e).delete(e);return this.size-=t?1:0,t}function XO(e){return na(this,e).get(e)}function jO(e){return na(this,e).has(e)}function ZO(e,t){var n=na(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Je(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])}}Je.prototype.clear=WO,Je.prototype.delete=qO,Je.prototype.get=XO,Je.prototype.has=jO,Je.prototype.set=ZO;var KO="Expected a function";function Al(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(KO);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(Al.Cache||Je),n}Al.Cache=Je;var QO=500;function JO(e){var t=Al(e,function(r){return n.size===QO&&n.clear(),r}),n=t.cache;return t}var tT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,eT=/\\(\\)?/g,nT=JO(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(tT,function(n,r,i,s){t.push(i?s.replace(eT,"$1"):r||n)}),t});const rT=nT;function _i(e){return e==null?"":pf(e)}function If(e,t){return Vt(e)?e:Cl(e,t)?[e]:rT(_i(e))}var iT=1/0;function ra(e){if(typeof e=="string"||Zs(e))return e;var t=e+"";return t=="0"&&1/e==-iT?"-0":t}function kf(e,t){t=If(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ra(t[n++])];return n&&n==r?e:void 0}function St(e,t,n){var r=e==null?void 0:kf(e,t);return r===void 0?n:r}function Dl(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var $f=ge?ge.isConcatSpreadable:void 0;function sT(e){return Vt(e)||dr(e)||!!($f&&e&&e[$f])}function ia(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=sT),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?ia(o,t-1,n,r,i):Dl(i,o):r||(i[i.length]=o)}return i}function Pf(e){var t=e==null?0:e.length;return t?ia(e,1):[]}var aT=Lf(Object.getPrototypeOf,Object);const Ll=aT;var oT="[object Object]",lT=Function.prototype,cT=Object.prototype,Nf=lT.toString,uT=cT.hasOwnProperty,hT=Nf.call(Object);function dT(e){if(!Ne(e)||kn(e)!=oT)return!1;var t=Ll(e);if(t===null)return!0;var n=uT.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Nf.call(n)==hT}function fT(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 pT(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:fT(e,t,n)}var gT="\\ud800-\\udfff",mT="\\u0300-\\u036f",vT="\\ufe20-\\ufe2f",yT="\\u20d0-\\u20ff",xT=mT+vT+yT,bT="\\ufe0e\\ufe0f",ET="\\u200d",ST=RegExp("["+ET+gT+xT+bT+"]");function Uf(e){return ST.test(e)}function _T(e){return e.split("")}var Bf="\\ud800-\\udfff",wT="\\u0300-\\u036f",OT="\\ufe20-\\ufe2f",TT="\\u20d0-\\u20ff",MT=wT+OT+TT,CT="\\ufe0e\\ufe0f",AT="["+Bf+"]",Rl="["+MT+"]",Il="\\ud83c[\\udffb-\\udfff]",DT="(?:"+Rl+"|"+Il+")",Vf="[^"+Bf+"]",Gf="(?:\\ud83c[\\udde6-\\uddff]){2}",Hf="[\\ud800-\\udbff][\\udc00-\\udfff]",LT="\\u200d",Ff=DT+"?",zf="["+CT+"]?",RT="(?:"+LT+"(?:"+[Vf,Gf,Hf].join("|")+")"+zf+Ff+")*",IT=zf+Ff+RT,kT="(?:"+[Vf+Rl+"?",Rl,Gf,Hf,AT].join("|")+")",$T=RegExp(Il+"(?="+Il+")|"+kT+IT,"g");function PT(e){return e.match($T)||[]}function NT(e){return Uf(e)?PT(e):_T(e)}function UT(e){return function(t){t=_i(t);var n=Uf(t)?NT(t):void 0,r=n?n[0]:t.charAt(0),i=n?pT(n,1).join(""):t.slice(1);return r[e]()+i}}var BT=UT("toUpperCase");const VT=BT;function GT(e){return VT(_i(e).toLowerCase())}function HT(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 FT(e){return function(t){return e==null?void 0:e[t]}}var zT={À:"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"},WT=FT(zT);const YT=WT;var qT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,XT="\\u0300-\\u036f",jT="\\ufe20-\\ufe2f",ZT="\\u20d0-\\u20ff",KT=XT+jT+ZT,QT="["+KT+"]",JT=RegExp(QT,"g");function tM(e){return e=_i(e),e&&e.replace(qT,YT).replace(JT,"")}var eM=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function nM(e){return e.match(eM)||[]}var rM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function iM(e){return rM.test(e)}var Wf="\\ud800-\\udfff",sM="\\u0300-\\u036f",aM="\\ufe20-\\ufe2f",oM="\\u20d0-\\u20ff",lM=sM+aM+oM,Yf="\\u2700-\\u27bf",qf="a-z\\xdf-\\xf6\\xf8-\\xff",cM="\\xac\\xb1\\xd7\\xf7",uM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hM="\\u2000-\\u206f",dM=" \\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",Xf="A-Z\\xc0-\\xd6\\xd8-\\xde",fM="\\ufe0e\\ufe0f",jf=cM+uM+hM+dM,Zf="['’]",Kf="["+jf+"]",pM="["+lM+"]",Qf="\\d+",gM="["+Yf+"]",Jf="["+qf+"]",tp="[^"+Wf+jf+Qf+Yf+qf+Xf+"]",mM="\\ud83c[\\udffb-\\udfff]",vM="(?:"+pM+"|"+mM+")",yM="[^"+Wf+"]",ep="(?:\\ud83c[\\udde6-\\uddff]){2}",np="[\\ud800-\\udbff][\\udc00-\\udfff]",gr="["+Xf+"]",xM="\\u200d",rp="(?:"+Jf+"|"+tp+")",bM="(?:"+gr+"|"+tp+")",ip="(?:"+Zf+"(?:d|ll|m|re|s|t|ve))?",sp="(?:"+Zf+"(?:D|LL|M|RE|S|T|VE))?",ap=vM+"?",op="["+fM+"]?",EM="(?:"+xM+"(?:"+[yM,ep,np].join("|")+")"+op+ap+")*",SM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_M="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wM=op+ap+EM,OM="(?:"+[gM,ep,np].join("|")+")"+wM,TM=RegExp([gr+"?"+Jf+"+"+ip+"(?="+[Kf,gr,"$"].join("|")+")",bM+"+"+sp+"(?="+[Kf,gr+rp,"$"].join("|")+")",gr+"?"+rp+"+"+ip,gr+"+"+sp,_M,SM,Qf,OM].join("|"),"g");function MM(e){return e.match(TM)||[]}function CM(e,t,n){return e=_i(e),t=n?void 0:t,t===void 0?iM(e)?MM(e):nM(e):e.match(t)||[]}var AM="['’]",DM=RegExp(AM,"g");function lp(e){return function(t){return HT(CM(tM(t).replace(DM,"")),e,"")}}var LM=lp(function(e,t,n){return t=t.toLowerCase(),e+(n?GT(t):t)});const RM=LM;function IM(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function cp(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=gi(n),n=n===n?n:0),t!==void 0&&(t=gi(t),t=t===t?t:0),IM(gi(e),t,n)}function kM(){this.__data__=new Qe,this.size=0}function $M(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function PM(e){return this.__data__.get(e)}function NM(e){return this.__data__.has(e)}var UM=200;function BM(e,t){var n=this.__data__;if(n instanceof Qe){var r=n.__data__;if(!Si||r.length<UM-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Je(r)}return n.set(e,t),this.size=n.size,this}function Me(e){var t=this.__data__=new Qe(e);this.size=t.size}Me.prototype.clear=kM,Me.prototype.delete=$M,Me.prototype.get=PM,Me.prototype.has=NM,Me.prototype.set=BM;function VM(e,t){return e&&vi(t,xi(t),e)}function GM(e,t){return e&&vi(t,bi(t),e)}var up=typeof z=="object"&&z&&!z.nodeType&&z,hp=up&&typeof module=="object"&&module&&!module.nodeType&&module,HM=hp&&hp.exports===up,dp=HM?Te.Buffer:void 0,fp=dp?dp.allocUnsafe:void 0;function pp(e,t){if(t)return e.slice();var n=e.length,r=fp?fp(n):new e.constructor(n);return e.copy(r),r}function FM(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 gp(){return[]}var zM=Object.prototype,WM=zM.propertyIsEnumerable,mp=Object.getOwnPropertySymbols,YM=mp?function(e){return e==null?[]:(e=Object(e),FM(mp(e),function(t){return WM.call(e,t)}))}:gp;const kl=YM;function qM(e,t){return vi(e,kl(e),t)}var XM=Object.getOwnPropertySymbols,jM=XM?function(e){for(var t=[];e;)Dl(t,kl(e)),e=Ll(e);return t}:gp;const vp=jM;function ZM(e,t){return vi(e,vp(e),t)}function yp(e,t,n){var r=t(e);return Vt(e)?r:Dl(r,n(e))}function $l(e){return yp(e,xi,kl)}function KM(e){return yp(e,bi,vp)}var QM=Pn(Te,"DataView");const Pl=QM;var JM=Pn(Te,"Promise");const Nl=JM;var tC=Pn(Te,"Set");const mr=tC;var xp="[object Map]",eC="[object Object]",bp="[object Promise]",Ep="[object Set]",Sp="[object WeakMap]",_p="[object DataView]",nC=$n(Pl),rC=$n(Si),iC=$n(Nl),sC=$n(mr),aC=$n(_l),Bn=kn;(Pl&&Bn(new Pl(new ArrayBuffer(1)))!=_p||Si&&Bn(new Si)!=xp||Nl&&Bn(Nl.resolve())!=bp||mr&&Bn(new mr)!=Ep||_l&&Bn(new _l)!=Sp)&&(Bn=function(e){var t=kn(e),n=t==eC?e.constructor:void 0,r=n?$n(n):"";if(r)switch(r){case nC:return _p;case rC:return xp;case iC:return bp;case sC:return Ep;case aC:return Sp}return t});const vr=Bn;var oC=Object.prototype,lC=oC.hasOwnProperty;function cC(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&lC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var uC=Te.Uint8Array;const sa=uC;function Ul(e){var t=new e.constructor(e.byteLength);return new sa(t).set(new sa(e)),t}function hC(e,t){var n=t?Ul(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var dC=/\w*$/;function fC(e){var t=new e.constructor(e.source,dC.exec(e));return t.lastIndex=e.lastIndex,t}var wp=ge?ge.prototype:void 0,Op=wp?wp.valueOf:void 0;function pC(e){return Op?Object(Op.call(e)):{}}function Tp(e,t){var n=t?Ul(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var gC="[object Boolean]",mC="[object Date]",vC="[object Map]",yC="[object Number]",xC="[object RegExp]",bC="[object Set]",EC="[object String]",SC="[object Symbol]",_C="[object ArrayBuffer]",wC="[object DataView]",OC="[object Float32Array]",TC="[object Float64Array]",MC="[object Int8Array]",CC="[object Int16Array]",AC="[object Int32Array]",DC="[object Uint8Array]",LC="[object Uint8ClampedArray]",RC="[object Uint16Array]",IC="[object Uint32Array]";function kC(e,t,n){var r=e.constructor;switch(t){case _C:return Ul(e);case gC:case mC:return new r(+e);case wC:return hC(e,n);case OC:case TC:case MC:case CC:case AC:case DC:case LC:case RC:case IC:return Tp(e,n);case vC:return new r;case yC:case EC:return new r(e);case xC:return fC(e);case bC:return new r;case SC:return pC(e)}}function Mp(e){return typeof e.constructor=="function"&&!Js(e)?iw(Ll(e)):{}}var $C="[object Map]";function PC(e){return Ne(e)&&vr(e)==$C}var Cp=pr&&pr.isMap,NC=Cp?Tl(Cp):PC;const UC=NC;var BC="[object Set]";function VC(e){return Ne(e)&&vr(e)==BC}var Ap=pr&&pr.isSet,GC=Ap?Tl(Ap):VC;const HC=GC;var FC=1,zC=2,WC=4,Dp="[object Arguments]",YC="[object Array]",qC="[object Boolean]",XC="[object Date]",jC="[object Error]",Lp="[object Function]",ZC="[object GeneratorFunction]",KC="[object Map]",QC="[object Number]",Rp="[object Object]",JC="[object RegExp]",tA="[object Set]",eA="[object String]",nA="[object Symbol]",rA="[object WeakMap]",iA="[object ArrayBuffer]",sA="[object DataView]",aA="[object Float32Array]",oA="[object Float64Array]",lA="[object Int8Array]",cA="[object Int16Array]",uA="[object Int32Array]",hA="[object Uint8Array]",dA="[object Uint8ClampedArray]",fA="[object Uint16Array]",pA="[object Uint32Array]",_t={};_t[Dp]=_t[YC]=_t[iA]=_t[sA]=_t[qC]=_t[XC]=_t[aA]=_t[oA]=_t[lA]=_t[cA]=_t[uA]=_t[KC]=_t[QC]=_t[Rp]=_t[JC]=_t[tA]=_t[eA]=_t[nA]=_t[hA]=_t[dA]=_t[fA]=_t[pA]=!0,_t[jC]=_t[Lp]=_t[rA]=!1;function aa(e,t,n,r,i,s){var a,o=t&FC,l=t&zC,c=t&WC;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!me(e))return e;var u=Vt(e);if(u){if(a=cC(e),!o)return yf(e,a)}else{var d=vr(e),h=d==Lp||d==ZC;if(fr(e))return pp(e,o);if(d==Rp||d==Dp||h&&!i){if(a=l||h?{}:Mp(e),!o)return l?ZM(e,GM(a,e)):qM(e,VM(a,e))}else{if(!_t[d])return i?e:{};a=kC(e,d,o)}}s||(s=new Me);var f=s.get(e);if(f)return f;s.set(e,a),HC(e)?e.forEach(function(v){a.add(aa(v,t,n,v,e,s))}):UC(e)&&e.forEach(function(v,m){a.set(m,aa(v,t,n,m,e,s))});var p=c?l?KM:$l:l?bi:xi,g=u?void 0:p(e);return mw(g||e,function(v,m){g&&(m=v,v=e[m]),xf(a,m,aa(v,t,n,m,e,s))}),a}var gA=1,mA=4;function tn(e){return aa(e,gA|mA)}var vA="__lodash_hash_undefined__";function yA(e){return this.__data__.set(e,vA),this}function xA(e){return this.__data__.has(e)}function wi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Je;++t<n;)this.add(e[t])}wi.prototype.add=wi.prototype.push=yA,wi.prototype.has=xA;function Ip(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 kp(e,t){return e.has(t)}var bA=1,EA=2;function $p(e,t,n,r,i,s){var a=n&bA,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 d=-1,h=!0,f=n&EA?new wi:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var p=e[d],g=t[d];if(r)var v=a?r(g,p,d,t,e,s):r(p,g,d,e,t,s);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!Ip(t,function(m,y){if(!kp(f,y)&&(p===m||i(p,m,n,r,s)))return f.push(y)})){h=!1;break}}else if(!(p===g||i(p,g,n,r,s))){h=!1;break}}return s.delete(e),s.delete(t),h}function SA(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Bl(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var _A=1,wA=2,OA="[object Boolean]",TA="[object Date]",MA="[object Error]",CA="[object Map]",AA="[object Number]",DA="[object RegExp]",LA="[object Set]",RA="[object String]",IA="[object Symbol]",kA="[object ArrayBuffer]",$A="[object DataView]",Pp=ge?ge.prototype:void 0,Vl=Pp?Pp.valueOf:void 0;function PA(e,t,n,r,i,s,a){switch(n){case $A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case kA:return!(e.byteLength!=t.byteLength||!s(new sa(e),new sa(t)));case OA:case TA:case AA:return mi(+e,+t);case MA:return e.name==t.name&&e.message==t.message;case DA:case RA:return e==t+"";case CA:var o=SA;case LA:var l=r&_A;if(o||(o=Bl),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=wA,a.set(e,t);var u=$p(o(e),o(t),r,i,s,a);return a.delete(e),u;case IA:if(Vl)return Vl.call(e)==Vl.call(t)}return!1}var NA=1,UA=Object.prototype,BA=UA.hasOwnProperty;function VA(e,t,n,r,i,s){var a=n&NA,o=$l(e),l=o.length,c=$l(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:BA.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=a;++d<l;){h=o[d];var m=e[h],y=t[h];if(r)var b=a?r(y,m,h,t,e,s):r(m,y,h,e,t,s);if(!(b===void 0?m===y||i(m,y,n,r,s):b)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var S=e.constructor,_=t.constructor;S!=_&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return s.delete(e),s.delete(t),g}var GA=1,Np="[object Arguments]",Up="[object Array]",oa="[object Object]",HA=Object.prototype,Bp=HA.hasOwnProperty;function FA(e,t,n,r,i,s){var a=Vt(e),o=Vt(t),l=a?Up:vr(e),c=o?Up:vr(t);l=l==Np?oa:l,c=c==Np?oa:c;var u=l==oa,d=c==oa,h=l==c;if(h&&fr(e)){if(!fr(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Me),a||ta(e)?$p(e,t,n,r,i,s):PA(e,t,l,n,r,i,s);if(!(n&GA)){var f=u&&Bp.call(e,"__wrapped__"),p=d&&Bp.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return s||(s=new Me),i(g,v,n,r,s)}}return h?(s||(s=new Me),VA(e,t,n,r,i,s)):!1}function la(e,t,n,r,i){return e===t?!0:e==null||t==null||!Ne(e)&&!Ne(t)?e!==e&&t!==t:FA(e,t,n,r,la,i)}var zA=1,WA=2;function YA(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 d=new Me;if(r)var h=r(c,u,l,e,t,d);if(!(h===void 0?la(u,c,zA|WA,r,d):h))return!1}}return!0}function Vp(e){return e===e&&!me(e)}function qA(e){for(var t=xi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Vp(i)]}return t}function Gp(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function XA(e){var t=qA(e);return t.length==1&&t[0][2]?Gp(t[0][0],t[0][1]):function(n){return n===e||YA(n,e,t)}}function jA(e,t){return e!=null&&t in Object(e)}function ZA(e,t,n){t=If(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=ra(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&&Ol(i)&&wl(a,i)&&(Vt(e)||dr(e)))}function KA(e,t){return e!=null&&ZA(e,t,jA)}var QA=1,JA=2;function tD(e,t){return Cl(e)&&Vp(t)?Gp(ra(e),t):function(n){var r=St(n,e);return r===void 0&&r===t?KA(n,e):la(t,r,QA|JA)}}function eD(e){return function(t){return t==null?void 0:t[e]}}function nD(e){return function(t){return kf(t,e)}}function rD(e){return Cl(e)?eD(ra(e)):nD(e)}function ca(e){return typeof e=="function"?e:e==null?bl:typeof e=="object"?Vt(e)?tD(e[0],e[1]):XA(e):rD(e)}function iD(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 sD(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 aD=sD();const Hp=aD;function oD(e,t){return e&&Hp(e,t,xi)}function lD(e,t){return function(n,r){if(n==null)return n;if(!Nn(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 cD=lD(oD);const Gl=cD;function uD(e,t,n,r){return Gl(e,function(i,s,a){t(r,i,n(i),a)}),r}function hD(e,t){return function(n,r){var i=Vt(n)?iD:uD,s=t?t():{};return i(n,e,ca(r),s)}}var dD=function(){return Te.Date.now()};const Hl=dD;var fD="Expected a function",pD=Math.max,gD=Math.min;function ua(e,t,n){var r,i,s,a,o,l,c=0,u=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(fD);t=gi(t)||0,me(n)&&(u=!!n.leading,d="maxWait"in n,s=d?pD(gi(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(E){var M=r,C=i;return r=i=void 0,c=E,a=e.apply(C,M),a}function p(E){return c=E,o=setTimeout(m,t),u?f(E):a}function g(E){var M=E-l,C=E-c,G=t-M;return d?gD(G,s-C):G}function v(E){var M=E-l,C=E-c;return l===void 0||M>=t||M<0||d&&C>=s}function m(){var E=Hl();if(v(E))return y(E);o=setTimeout(m,g(E))}function y(E){return o=void 0,h&&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(Hl())}function _(){var E=Hl(),M=v(E);if(r=arguments,i=this,l=E,M){if(o===void 0)return p(l);if(d)return clearTimeout(o),o=setTimeout(m,t),f(l)}return o===void 0&&(o=setTimeout(m,t)),a}return _.cancel=b,_.flush=S,_}function Fl(e,t,n){(n!==void 0&&!mi(e[t],n)||n===void 0&&!(t in e))&&Qs(e,t,n)}function zl(e){return Ne(e)&&Nn(e)}function Wl(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function mD(e){return vi(e,bi(e))}function vD(e,t,n,r,i,s,a){var o=Wl(e,n),l=Wl(t,n),c=a.get(l);if(c){Fl(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=Vt(l),f=!h&&fr(l),p=!h&&!f&&ta(l);u=l,h||f||p?Vt(o)?u=o:zl(o)?u=yf(o):f?(d=!1,u=pp(l,!0)):p?(d=!1,u=Tp(l,!0)):u=[]:dT(l)||dr(l)?(u=o,dr(o)?u=mD(o):(!me(o)||El(o))&&(u=Mp(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),Fl(e,n,u)}function Fp(e,t,n,r,i){e!==t&&Hp(t,function(s,a){if(i||(i=new Me),me(s))vD(e,t,a,n,Fp,r,i);else{var o=r?r(Wl(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),Fl(e,a,o)}},bi)}function yD(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 xD(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function bD(e,t){var n=-1,r=Nn(e)?Array(e.length):[];return Gl(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function ED(e,t){var n=Vt(e)?hf:bD;return n(e,ca(t))}var SD=1/0;function _D(e,t){return ia(ED(e,t),SD)}function wD(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 OD=Object.prototype,TD=OD.hasOwnProperty,MD=hD(function(e,t,n){TD.call(e,n)?e[n].push(t):Qs(e,n,[t])});const CD=MD;var AD="[object Map]",DD="[object Set]",LD=Object.prototype,RD=LD.hasOwnProperty;function Ce(e){if(e==null)return!0;if(Nn(e)&&(Vt(e)||typeof e=="string"||typeof e.splice=="function"||fr(e)||ta(e)||dr(e)))return!e.length;var t=vr(e);if(t==AD||t==DD)return!e.size;if(Js(e))return!Rf(e).length;for(var n in e)if(RD.call(e,n))return!1;return!0}function zp(e,t){return la(e,t)}var ID=lp(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const yr=ID;var kD=Cw(function(e,t,n){Fp(e,t,n)});const tt=kD;function $D(e,t){var n;return Gl(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function PD(e,t,n){var r=Vt(e)?Ip:$D;return n&&Sf(e,t,n)&&(t=void 0),r(e,ca(t))}var ND=1/0,UD=mr&&1/Bl(new mr([,-0]))[1]==ND?function(e){return new mr(e)}:aw;const BD=UD;var VD=200;function Wp(e,t,n){var r=-1,i=Ew,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=yD;else if(s>=VD){var c=t?null:BD(e);if(c)return Bl(c);a=!1,i=kp,l=new wi}else l=t?[]:o;t:for(;++r<s;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,a&&d===d){for(var h=l.length;h--;)if(l[h]===d)continue t;t&&l.push(d),o.push(u)}else i(l,d,n)||(l!==o&&l.push(d),o.push(u))}return o}var GD=Ef(function(e){var t=xD(e);return zl(t)&&(t=void 0),Wp(ia(e,1,zl,!0),ca(t))});const HD=GD;function Oi(e){return e&&e.length?Wp(e):[]}var Yl=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Yl||{}),ql=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(ql||{}),Xl=(e=>(e.UPDATE="model-update",e))(Xl||{}),Yp=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(Yp||{}),jl=(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))(jl||{}),Zl=(e=>(e.CHANGE="zoom-domain-change",e))(Zl||{}),Kl=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Kl||{}),Ql=(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))(Ql||{}),Jl=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Jl||{}),tc=(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))(tc||{}),ec=(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))(ec||{}),nc=(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))(nc||{}),rc=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(rc||{}),ic=(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))(ic||{}),sc=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(sc||{}),ac=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(ac||{}),oc=(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))(oc||{}),lc=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(lc||{}),cc=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(cc||{}),xr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(xr||{}),uc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(uc||{}),qp=(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))(qp||{}),Xp=(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))(Xp||{}),jp=(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))(jp||{}),Zp=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Zp||{}),Kp=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Kp||{}),br=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(br||{});const w=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:jp,Area:Jl,Axis:Ql,Bar:rc,Boxplot:ic,CanvasZoom:Kl,Chart:Yl,Choropleth:br,CirclePack:Xp,Gauge:nc,Heatmap:Kp,Legend:qp,Line:ac,Meter:Zp,Modal:ql,Model:Xl,Pie:ec,Radar:oc,Scatter:sc,Threshold:uc,Toolbar:Yp,Tooltip:xr,Tree:lc,Treemap:cc,WordCloud:tc,ZoomBar:jl,ZoomDomain:Zl},Symbol.toStringTag,{value:"Module"}));var Z=(e=>(e.HTML="html",e.SVG="svg",e))(Z||{}),hc=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(hc||{}),Q=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(Q||{}),F=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(F||{}),Ae=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ae||{}),ve=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(ve||{}),Nt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(Nt||{}),j=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(j||{}),Er=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Er||{}),It=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(It||{}),Sr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Sr||{}),ha=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(ha||{}),bt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(bt||{}),nt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(nt||{}),Vn=(e=>(e.CENTER="center",e))(Vn||{}),Ti=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ti||{}),kt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(kt||{}),Ue=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Ue||{}),Be=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(Be||{}),Gn=(e=>(e.SEMI="semi",e.FULL="full",e))(Gn||{}),da=(e=>(e.UP="up",e.DOWN="down",e))(da||{}),Mi=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(Mi||{}),Ci=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(Ci||{}),le=(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))(le||{}),Mt=(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))(Mt||{}),fa=(e=>(e.LEFT="left",e.RIGHT="right",e))(fa||{}),$t=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))($t||{}),Ai=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(Ai||{}),_r=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(_r||{}),Di=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(Di||{}),Ve=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(Ve||{});const ee="cds",en={opacity:{unselected:.05,selected:.4}},fn={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},wr={duration:1e3,ease:Xu,zoomLevel:3},Or={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},Qp={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},ye={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},FD={defaultBins:10},At={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}},nn={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Gt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},wt={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}},Hn={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},De={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Jp={minCellDividerDimension:16,chartPadding:.5},tg={default:{size:24}},zD={horizontalOffset:10},eg={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}},ce={height:{[Ae.GRAPH_VIEW]:32,[Ae.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},WD=[{type:$t.RADIUS,name:"Radius"},{type:$t.AREA,name:"Poor area"},{type:$t.AREA,name:"Satisfactory area"},{type:$t.AREA,name:"Great area"},{type:$t.QUARTILE,name:"Quartiles"}];function YD(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=Sn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function Ct(e,t){var i;const n=tn(e),r=Object.keys(t.axes||{});(i=t==null?void 0:t.toolbar)!=null&&i.controls&&delete n.toolbar.controls,r.length===0&&delete n.axes;for(const s in n.axes)if(r.includes(s)){const a=t.axes[s];(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");const o=a.mapsTo;if(o==null){const l=a.scaleType;l==null?a.mapsTo="value":l===j.TIME?a.mapsTo="date":l===j.LABELS&&(a.mapsTo="key")}}else delete n.axes[s];return dc(n,t),tt(n,t)}function rn(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 Li(e){const n=/\(([^)]+)\)/.exec(e);if(n&&n.length>1){const r=n[1].split(",");if(r.length>1)return{x:parseFloat(r[0]),y:parseFloat(r[1])}}return{x:0,y:0}}function ng(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 Ri(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 dc(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=WD.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=HD(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},rg=(e,t)=>t===Nt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,jt=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=rg(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function sn(e,t,n){return n===Nt.VERTICAL?[e,t]:[t,e]}function fc(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 Ii(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 ki(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)?XD(o,function(d){return d.test(a)}):qD(o,function(d){return d.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 qD(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function XD(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function jD(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 pa(e){"@babel/helpers - typeof";return pa=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},pa(e)}function Ut(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 it(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function dt(e){it(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||pa(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 ig(e,t){it(2,arguments);var n=dt(e),r=Ut(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function pc(e,t){it(2,arguments);var n=dt(e),r=Ut(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)}function ga(e,t){it(2,arguments);var n=dt(e).getTime(),r=Ut(t);return new Date(n+r)}var ZD=36e5;function sg(e,t){it(2,arguments);var n=Ut(t);return ga(e,n*ZD)}var KD={};function ma(){return KD}function gc(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 ag(e){it(1,arguments);var t=dt(e);return t.setHours(0,0,0,0),t}var QD=864e5;function JD(e,t){it(2,arguments);var n=ag(e),r=ag(t),i=n.getTime()-gc(n),s=r.getTime()-gc(r);return Math.round((i-s)/QD)}var tL=6e4;function mc(e,t){it(2,arguments);var n=Ut(t);return ga(e,n*tL)}function vc(e,t){it(2,arguments);var n=Ut(t);return ga(e,n*1e3)}function og(e,t){it(2,arguments);var n=Ut(t);return pc(e,n*12)}function $i(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}var eL=6e4,nL=36e5;function rL(e){return it(1,arguments),e instanceof Date||pa(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function iL(e){if(it(1,arguments),!rL(e)&&typeof e!="number")return!1;var t=dt(e);return!isNaN(Number(t))}function sL(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function aL(e,t){it(2,arguments);var n=dt(e),r=dt(t);return n.getFullYear()-r.getFullYear()}function lg(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 oL(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=lg(n,r),s=Math.abs(JD(n,r));n.setDate(n.getDate()-i*s);var a=+(lg(n,r)===-i),o=i*(s-a);return o===0?0:o}function yc(e,t){return it(2,arguments),dt(e).getTime()-dt(t).getTime()}var cg={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},lL="trunc";function xc(e){return e?cg[e]:cg[lL]}function cL(e,t,n){it(2,arguments);var r=yc(e,t)/nL;return xc(n==null?void 0:n.roundingMethod)(r)}function ug(e,t,n){it(2,arguments);var r=yc(e,t)/eL;return xc(n==null?void 0:n.roundingMethod)(r)}function uL(e){it(1,arguments);var t=dt(e);return t.setHours(23,59,59,999),t}function hL(e){it(1,arguments);var t=dt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function dL(e){it(1,arguments);var t=dt(e);return uL(t).getTime()===hL(t).getTime()}function fL(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=$i(n,r),s=Math.abs(sL(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=$i(n,r)===-i;dL(dt(e))&&s===1&&$i(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function hg(e,t,n){it(2,arguments);var r=yc(e,t)/1e3;return xc(n==null?void 0:n.roundingMethod)(r)}function pL(e,t){it(2,arguments);var n=dt(e),r=dt(t),i=$i(n,r),s=Math.abs(aL(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=$i(n,r)===-i,o=i*(s-Number(a));return o===0?0:o}function gL(e,t){it(2,arguments);var n=Ut(t);return ga(e,-n)}var mL=864e5;function vL(e){it(1,arguments);var t=dt(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/mL)+1}function va(e){it(1,arguments);var t=1,n=dt(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 dg(e){it(1,arguments);var t=dt(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=va(r),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var a=va(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function yL(e){it(1,arguments);var t=dg(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=va(n);return r}var xL=6048e5;function bL(e){it(1,arguments);var t=dt(e),n=va(t).getTime()-yL(t).getTime();return Math.round(n/xL)+1}function ya(e,t){var n,r,i,s,a,o,l,c;it(1,arguments);var u=ma(),d=Ut((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(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=dt(e),f=h.getUTCDay(),p=(f<d?7:0)+f-d;return h.setUTCDate(h.getUTCDate()-p),h.setUTCHours(0,0,0,0),h}function fg(e,t){var n,r,i,s,a,o,l,c;it(1,arguments);var u=dt(e),d=u.getUTCFullYear(),h=ma(),f=Ut((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:h.firstWeekContainsDate)!==null&&r!==void 0?r:(l=h.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(d+1,0,f),p.setUTCHours(0,0,0,0);var g=ya(p,t),v=new Date(0);v.setUTCFullYear(d,0,f),v.setUTCHours(0,0,0,0);var m=ya(v,t);return u.getTime()>=g.getTime()?d+1:u.getTime()>=m.getTime()?d:d-1}function EL(e,t){var n,r,i,s,a,o,l,c;it(1,arguments);var u=ma(),d=Ut((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),h=fg(e,t),f=new Date(0);f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0);var p=ya(f,t);return p}var SL=6048e5;function _L(e,t){it(1,arguments);var n=dt(e),r=ya(n,t).getTime()-EL(n,t).getTime();return Math.round(r/SL)+1}function vt(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var wL={y:function(t,n){var r=t.getUTCFullYear(),i=r>0?r:1-r;return vt(n==="yy"?i%100:i,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):vt(r+1,2)},d:function(t,n){return vt(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return vt(t.getUTCHours()%12||12,n.length)},H:function(t,n){return vt(t.getUTCHours(),n.length)},m:function(t,n){return vt(t.getUTCMinutes(),n.length)},s:function(t,n){return vt(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,i=t.getUTCMilliseconds(),s=Math.floor(i*Math.pow(10,r-3));return vt(s,n.length)}};const pn=wL;var Tr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},OL={G:function(t,n,r){var i=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var i=t.getUTCFullYear(),s=i>0?i:1-i;return r.ordinalNumber(s,{unit:"year"})}return pn.y(t,n)},Y:function(t,n,r,i){var s=fg(t,i),a=s>0?s:1-s;if(n==="YY"){var o=a%100;return vt(o,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):vt(a,n.length)},R:function(t,n){var r=dg(t);return vt(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return vt(r,n.length)},Q:function(t,n,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(i);case"QQ":return vt(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,n,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(i);case"qq":return vt(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,n,r){var i=t.getUTCMonth();switch(n){case"M":case"MM":return pn.M(t,n);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(t,n,r){var i=t.getUTCMonth();switch(n){case"L":return String(i+1);case"LL":return vt(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(t,n,r,i){var s=_L(t,i);return n==="wo"?r.ordinalNumber(s,{unit:"week"}):vt(s,n.length)},I:function(t,n,r){var i=bL(t);return n==="Io"?r.ordinalNumber(i,{unit:"week"}):vt(i,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):pn.d(t,n)},D:function(t,n,r){var i=vL(t);return n==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):vt(i,n.length)},E:function(t,n,r){var i=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(t,n,r,i){var s=t.getUTCDay(),a=(s-i.weekStartsOn+8)%7||7;switch(n){case"e":return String(a);case"ee":return vt(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(t,n,r,i){var s=t.getUTCDay(),a=(s-i.weekStartsOn+8)%7||7;switch(n){case"c":return String(a);case"cc":return vt(a,n.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(t,n,r){var i=t.getUTCDay(),s=i===0?7:i;switch(n){case"i":return String(s);case"ii":return vt(s,n.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(t,n,r){var i=t.getUTCHours(),s=i/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,n,r){var i=t.getUTCHours(),s;switch(i===12?s=Tr.noon:i===0?s=Tr.midnight:s=i/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,n,r){var i=t.getUTCHours(),s;switch(i>=17?s=Tr.evening:i>=12?s=Tr.afternoon:i>=4?s=Tr.morning:s=Tr.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return pn.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):pn.H(t,n)},K:function(t,n,r){var i=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(i,{unit:"hour"}):vt(i,n.length)},k:function(t,n,r){var i=t.getUTCHours();return i===0&&(i=24),n==="ko"?r.ordinalNumber(i,{unit:"hour"}):vt(i,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):pn.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):pn.s(t,n)},S:function(t,n){return pn.S(t,n)},X:function(t,n,r,i){var s=i._originalDate||t,a=s.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return gg(a);case"XXXX":case"XX":return Fn(a);case"XXXXX":case"XXX":default:return Fn(a,":")}},x:function(t,n,r,i){var s=i._originalDate||t,a=s.getTimezoneOffset();switch(n){case"x":return gg(a);case"xxxx":case"xx":return Fn(a);case"xxxxx":case"xxx":default:return Fn(a,":")}},O:function(t,n,r,i){var s=i._originalDate||t,a=s.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+pg(a,":");case"OOOO":default:return"GMT"+Fn(a,":")}},z:function(t,n,r,i){var s=i._originalDate||t,a=s.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+pg(a,":");case"zzzz":default:return"GMT"+Fn(a,":")}},t:function(t,n,r,i){var s=i._originalDate||t,a=Math.floor(s.getTime()/1e3);return vt(a,n.length)},T:function(t,n,r,i){var s=i._originalDate||t,a=s.getTime();return vt(a,n.length)}};function pg(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+vt(s,2)}function gg(e,t){if(e%60===0){var n=e>0?"-":"+";return n+vt(Math.abs(e)/60,2)}return Fn(e,t)}function Fn(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e),s=vt(Math.floor(i/60),2),a=vt(i%60,2);return r+s+n+a}const TL=OL;var mg=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},vg=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},ML=function(t,n){var r=t.match(/(P+)(p+)?/)||[],i=r[1],s=r[2];if(!s)return mg(t,n);var a;switch(i){case"P":a=n.dateTime({width:"short"});break;case"PP":a=n.dateTime({width:"medium"});break;case"PPP":a=n.dateTime({width:"long"});break;case"PPPP":default:a=n.dateTime({width:"full"});break}return a.replace("{{date}}",mg(i,n)).replace("{{time}}",vg(s,n))},CL={p:vg,P:ML};const AL=CL;var DL=["D","DD"],LL=["YY","YYYY"];function RL(e){return DL.indexOf(e)!==-1}function IL(e){return LL.indexOf(e)!==-1}function yg(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 kL={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"}},$L=function(t,n,r){var i,s=kL[t];return typeof s=="string"?i=s:n===1?i=s.one:i=s.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const PL=$L;var NL={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},UL={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},BL={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},VL={date:fc({formats:NL,defaultWidth:"full"}),time:fc({formats:UL,defaultWidth:"full"}),dateTime:fc({formats:BL,defaultWidth:"full"})};const GL=VL;var HL={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},FL=function(t,n,r,i){return HL[t]};const zL=FL;var WL={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},YL={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qL={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"]},XL={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"]},jL={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"}},ZL={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"}},KL=function(t,n){var r=Number(t),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},QL={ordinalNumber:KL,era:Ii({values:WL,defaultWidth:"wide"}),quarter:Ii({values:YL,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Ii({values:qL,defaultWidth:"wide"}),day:Ii({values:XL,defaultWidth:"wide"}),dayPeriod:Ii({values:jL,defaultWidth:"wide",formattingValues:ZL,defaultFormattingWidth:"wide"})};const JL=QL;var tR=/^(\d+)(th|st|nd|rd)?/i,eR=/\d+/i,nR={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},rR={any:[/^b/i,/^(a|c)/i]},iR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sR={any:[/1/i,/2/i,/3/i,/4/i]},aR={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},oR={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]},lR={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},cR={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]},uR={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},hR={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}},dR={ordinalNumber:jD({matchPattern:tR,parsePattern:eR,valueCallback:function(t){return parseInt(t,10)}}),era:ki({matchPatterns:nR,defaultMatchWidth:"wide",parsePatterns:rR,defaultParseWidth:"any"}),quarter:ki({matchPatterns:iR,defaultMatchWidth:"wide",parsePatterns:sR,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ki({matchPatterns:aR,defaultMatchWidth:"wide",parsePatterns:oR,defaultParseWidth:"any"}),day:ki({matchPatterns:lR,defaultMatchWidth:"wide",parsePatterns:cR,defaultParseWidth:"any"}),dayPeriod:ki({matchPatterns:uR,defaultMatchWidth:"any",parsePatterns:hR,defaultParseWidth:"any"})},fR={code:"en-US",formatDistance:PL,formatLong:GL,formatRelative:zL,localize:JL,match:dR,options:{weekStartsOn:0,firstWeekContainsDate:1}};const xg=fR;var pR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mR=/^'([^]*?)'?$/,vR=/''/g,yR=/[a-zA-Z]/;function Mr(e,t,n){var r,i,s,a,o,l,c,u,d,h,f,p,g,v,m,y,b,S;it(2,arguments);var _=String(t),E=ma(),M=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:E.locale)!==null&&r!==void 0?r:xg,C=Ut((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:(d=E.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var G=Ut((f=(p=(g=(v=n==null?void 0:n.weekStartsOn)!==null&&v!==void 0?v:n==null||(m=n.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&g!==void 0?g: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(!(G>=0&&G<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!M.localize)throw new RangeError("locale must contain localize property");if(!M.formatLong)throw new RangeError("locale must contain formatLong property");var I=dt(e);if(!iL(I))throw new RangeError("Invalid time value");var T=gc(I),L=gL(I,T),R={firstWeekContainsDate:C,weekStartsOn:G,locale:M,_originalDate:I},k=_.match(gR).map(function(O){var U=O[0];if(U==="p"||U==="P"){var P=AL[U];return P(O,M.formatLong)}return O}).join("").match(pR).map(function(O){if(O==="''")return"'";var U=O[0];if(U==="'")return xR(O);var P=TL[U];if(P)return!(n!=null&&n.useAdditionalWeekYearTokens)&&IL(O)&&yg(O,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&RL(O)&&yg(O,t,String(e)),P(L,O,M.localize,R);if(U.match(yR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");return O}).join("");return k}function xR(e){var t=e.match(mR);return t?t[1].replace(vR,"'"):e}function bR(e,t){it(2,arguments);var n=Ut(t);return ig(e,-n)}function ER(e,t){it(2,arguments);var n=Ut(t);return pc(e,-n)}function SR(e,t){it(2,arguments);var n=Ut(t);return sg(e,-n)}function bg(e,t){it(2,arguments);var n=Ut(t);return mc(e,-n)}function Eg(e,t){it(2,arguments);var n=Ut(t);return vc(e,-n)}function _R(e,t){it(2,arguments);var n=Ut(t);return og(e,-n)}const Cr={type:ve.END_LINE,threshold:16,numCharacter:14},wR={enabled:!0,position:Er.BOTTOM,clickable:!0,truncation:Cr,alignment:It.LEFT,order:null,additionalItems:[]},OR={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},TR={enabled:!0},Sg={enabled:!0,showTotal:!0,truncation:Cr,groupLabel:"Group"},_g={top:{visible:!0,includeZero:!0,truncation:Cr},bottom:{visible:!0,includeZero:!0,truncation:Cr},left:{visible:!0,includeZero:!0,truncation:Cr},right:{visible:!0,includeZero:!0,truncation:Cr}},xa={addSpaceOnEdges:1,showDayName:!1,localeObject:xg,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"}}},MR=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),qt={width:null,height:null,resizable:!0,theme:hc.WHITE,tooltip:Sg,legend:wR,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:Mt.SHOW_AS_DATATABLE},...MR?[{type:Mt.MAKE_FULLSCREEN}]:[],{type:Mt.EXPORT_CSV},{type:Mt.EXPORT_PNG},{type:Mt.EXPORT_JPG}]}},wg=tt({},qt,{thematic:{projection:Ve.geoNaturalEarth1}}),Pi=tt({},qt,{axes:_g,timeScale:xa,grid:OR,ruler:TR,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ae.GRAPH_VIEW}}}),zn=tt({},Pi,{bars:{maxWidth:16,spacingFactor:.25},timeScale:tt(xa,{addSpaceOnEdges:1})}),CR=tt({},zn,{}),AR=tt({},zn,{}),DR=tt({},zn,{bars:tt({},zn.bars,{dividerSize:1.5})}),LR=tt({},zn,{}),bc=tt({},Pi,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),RR=bc,Og=tt({},bc,{points:{radius:3,filled:!1,enabled:!0}}),Tg=tt({},Og,{timeScale:tt(xa,{addSpaceOnEdges:0})}),IR=Tg,kR=tt({},Pi,{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:$t.RADIUS,name:"Radius"}]}}),$R=tt({},Pi,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:$t.AREA,name:"Poor area"},{type:$t.AREA,name:"Satisfactory area"},{type:$t.AREA,name:"Great area"},{type:$t.QUARTILE,name:"Quartiles"}]}}),PR=tt({},zn,{bars:{dividerSize:1.5},timeScale:tt(xa,{addSpaceOnEdges:0})}),NR=tt({},qt,{tooltip:tt({},Sg,{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"}}),Mg=tt({},qt,{pie:{labels:{formatter:null,enabled:!0},alignment:It.LEFT,sortFunction:null,valueMapsTo:"value"}}),UR=tt({},qt,{legend:{enabled:!1},gauge:{type:Gn.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:It.LEFT}}),BR=tt({},Mg,{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:It.LEFT}}),Cg=tt({},qt,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),VR=tt({},Cg,{legend:{enabled:!0}}),GR=tt({},qt,{radar:{axes:{angle:"key",value:"value"},alignment:It.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),HR=tt({},zn,{comboChartTypes:[]}),FR=tt({tree:{type:ha.TREE}},qt,{}),zR=tt({},qt,{data:tt(qt.data,{groupMapsTo:"name"})}),WR=tt({},qt,Or,{data:tt(qt.data,{groupMapsTo:"name"})}),YR=tt({},qt,{alluvial:{data:tt(qt.data,{groupMapsTo:"source"}),nodeAlignment:It.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),qR=tt({},qt,{axes:_g,heatmap:{divider:{state:_r.AUTO},colorLegend:{type:"linear"}}}),XR=tt({},wg,{choropleth:{colorLegend:{type:"linear"}}}),Et={alluvialChart:YR,areaChart:Tg,axisChart:Pi,boxplotChart:LR,bubbleChart:kR,bulletChart:$R,chart:qt,circlePackChart:WR,choroplethChart:XR,comboChart:HR,donutChart:BR,gaugeChart:UR,groupedBarChart:AR,heatmapChart:qR,histogramChart:PR,lineChart:Og,lollipopChart:RR,meterChart:Cg,pieChart:Mg,proportionalMeterChart:VR,radarChart:GR,scatterChart:bc,simpleBarChart:CR,stackedAreaChart:IR,stackedBarChart:DR,thematicChart:wg,treeChart:FR,treemapChart:zR,wordCloudChart:NR};var Ag=(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))(Ag||{});const Ec=[["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 Dg(e,t,n,r,i){const s=t===0,a=Number(Mr(new Date(e),"c"))===2,o=Number(Mr(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ea(e)||Ni(e,l)||gn(e);case"minute":return s||Ea(e)||Ni(e,l)||gn(e);case"30minutes":return s||Ea(e)||Ni(e,l)||gn(e);case"hourly":return s||Ea(e)||Ni(e,l)||gn(e);case"daily":return i?s||a||gn(e):s||Ni(e,l)||gn(e);case"weekly":return s||a||gn(e);case"monthly":return s||gn(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function Sc(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 d=Dg(e,t,n,r,s)?c:u;r==="15seconds"&&o.getMilliseconds()!==0&&(d=d.replace("pp","h:mm:ss.SSS a"));const h=i.localeObject;return Mr(o,d,{locale:h})}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 jR(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function ZR(e){const t=Ec.reduce((n,[,r],i)=>{const s=Ec[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return Ec[t][0]}function _c(e,t){if(Ag[t])return t;if(e.length===1)return"15seconds";const n=jR(e),r=cn(n);return ZR(r)}function Ea(e){const{s:t,m:n,H:r}=ba(e);return r===0&&n===0&&t===0}function Ni(e,t){const n=ba(e).M,r=ba(t).M;return n!==r}function gn(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 Lg(e){return e===void 0?"":e.toISOString()}class Ge{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===j.LINEAR||c===j.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===j.LABELS)r=r.filter(u=>a[o].domain.includes(u[l]));else{const[u,d]=a[o].domain;r=r.filter(h=>!(l in h)||h[l]>=u&&h[l]<=d)}}),r.filter(o=>i.find(l=>l.name===o[s]))}getDisplayData(t){if(!this.get("data"))return null;const{ACTIVE:n}=At.items.status,r=this.getDataGroups(t),{groupMapsTo:i}=this.getOptions().data;return this.getAllDataFromDomain(t).filter(a=>r.find(o=>o.name===a[i]&&o.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(t){const n=this.sanitize(tn(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(r=>t.includes(r.name)):this.get("dataGroups")}getActiveDataGroups(t){const{ACTIVE:n}=At.items.status;return this.getDataGroups(t).filter(r=>r.status===n)}getDataGroupNames(t){return this.getDataGroups(t).map(r=>r.name)}getActiveDataGroupNames(t){return this.getActiveDataGroups(t).map(r=>r.name)}aggregateBinDataByGroup(t){return CD(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=FD.defaultBins}=s,l=Array.isArray(o),c=cv().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],d=Array.from(new Set(t.map(f=>f[a]))),h=[];return c.forEach(f=>{const p=`${f.x0}-${f.x1}`,g=this.aggregateBinDataByGroup(f);d.forEach(v=>{h.push({group:v,key:p,value:g[v]||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 xl().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=Oi(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Lg(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===j.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===j.LOG||o===j.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("-"),d={x0:c,x1:u},h=t.find(f=>f.x0.toString()===c.toString());return a.forEach(f=>{d[f]=h.filter(p=>p[i]===f).length}),d}):o.map(l=>{const c={sharedStackKey:l};return a.forEach(u=>{const d=s.find(f=>{const p=this.services.cartesianScales.getDomainIdentifier(f);return f[i]===u&&Object.prototype.hasOwnProperty.call(f,p)&&(f[p]instanceof Date?Lg(f[p])===l:f[p].toString()===l)}),h=this.services.cartesianScales.getRangeIdentifier(c);c[u]=d?d[h]: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 c=wD(o.map(u=>[u.sharedStackKey,0]));o.forEach(u=>{a.forEach(d=>{c[u.sharedStackKey]+=u[d]})}),o.forEach(u=>{a.forEach(d=>{const h=c[u.sharedStackKey];c[u.sharedStackKey]?u[d]=u[d]/h*100:u[d]=0})})}return(r?xl().offset(g_):xl()).keys(a)(o).map((c,u)=>Object.keys(c).filter(d=>!isNaN(d)).map(d=>{const h=c[d];return h[s]=a[u],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();dc(n,t),this.set({options:tt(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(w.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=At.items.status,i=this.getDataGroups(),s=i.some(u=>u.status===r),a=i.filter(u=>u.status===n);if(s)if(a.length===1&&a[0].name===t)i.forEach((u,d)=>{i[d].status=n});else{const u=i.findIndex(d=>d.name===t);i[u].status=i[u].status===r?n:r}else i.forEach((u,d)=>{i[d].status=u.name===t?n:r});const o=i.filter(u=>u.status===n),l=this.getOptions();i.some(u=>u.status===r)?l.data.selectedGroups=o.map(u=>u.name):l.data.selectedGroups=[],this.services.events.dispatchEvent(w.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 d=x(i,o);d?l=d: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==="–"?"–":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}=At.items.status,s=this.getOptions(),a=Oi(t.map(l=>l[n]));s.data.selectedGroups.length&&(s.data.selectedGroups.every(c=>a.includes(c))||(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(i=>{this.allDataGroups.includes(i)||console.warn(`"${i}" does not exist in data groups.`)}),this.allDataGroups.filter(i=>n[i]).forEach(i=>this.colorScale[i]=n[i])}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=Qp.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=ks().range(o).domain(this.allDataGroups)}}function KR(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 QR=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function an(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Sa(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function JR(e){const t=Sa(e,"border-left-width"),n=Sa(e,"border-right-width");return e.clientWidth+t+n}function t2(e){const t=Sa(e,"border-top-width"),n=Sa(e,"border-bottom-width");return e.clientHeight+t+n}function Rg(e,t={}){const n=t.width||JR(e),r=t.height||t2(e);return{width:n,height:r}}function e2(){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 ue=16384;function n2(e){(e.width>ue||e.height>ue)&&(e.width>ue&&e.height>ue?e.width>e.height?(e.height*=ue/e.width,e.width=ue):(e.width*=ue/e.height,e.height=ue):e.width>ue?(e.height*=ue/e.width,e.width=ue):(e.width*=ue/e.height,e.height=ue))}function _a(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 r2(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function i2(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),r2(i)}const ne=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ne(n,t)};function s2(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function a2(e){return an(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function o2(e,t,n){const r=`.${e}:${t}`,i=n.cssText?s2(n):a2(n);return document.createTextNode(`${r}{${i}}`)}function Ig(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=QR();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(o2(s,n,r)),t.appendChild(a)}function l2(e,t){Ig(e,t,":before"),Ig(e,t,":after")}const kg="application/font-woff",$g="image/jpeg",c2={woff:kg,woff2:kg,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:$g,jpeg:$g,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function u2(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function wc(e){const t=u2(e).toLowerCase();return c2[t]||""}function h2(e){return e.split(/,/)[1]}function Oc(e){return e.search(/^(data:)/)!==-1}function Pg(e,t){return`data:${t};base64,${e}`}async function Ng(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 Tc={};function d2(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 Mc(e,t,n){const r=d2(e,t,n.includeQueryParams);if(Tc[r]!=null)return Tc[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Ng(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),h2(o)));i=Pg(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 Tc[r]=i,i}async function f2(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):_a(t)}async function p2(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 _a(o)}const n=e.poster,r=wc(n),i=await Mc(n,r,t);return _a(i)}async function g2(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await wa(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function m2(e,t){return ne(e,HTMLCanvasElement)?f2(e):ne(e,HTMLVideoElement)?p2(e,t):ne(e,HTMLIFrameElement)?g2(e):e.cloneNode(!1)}const v2=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function y2(e,t,n){var r,i;let s=[];return v2(e)&&e.assignedNodes?s=an(e.assignedNodes()):ne(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=an(e.contentDocument.body.childNodes):s=an(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||ne(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>wa(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function x2(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):an(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`),ne(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 b2(e,t){ne(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ne(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function E2(e,t){if(ne(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function S2(e,t){return ne(t,Element)&&(x2(e,t),l2(e,t),b2(e,t),E2(e,t)),t}async function _2(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 o=n[s].getAttribute("xlink:href");if(o){const l=e.querySelector(o),c=document.querySelector(o);!l&&c&&!r[o]&&(r[o]=await wa(c,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 wa(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>m2(r,t)).then(r=>y2(e,r,t)).then(r=>S2(e,r)).then(r=>_2(r,t))}const Ug=/url\((['"]?)([^'"]+?)\1\)/g,w2=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,O2=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function T2(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function M2(e){const t=[];return e.replace(Ug,(n,r,i)=>(t.push(i),n)),t.filter(n=>!Oc(n))}async function C2(e,t,n,r,i){try{const s=n?KR(t,n):t,a=wc(t);let o;if(i){const l=await i(s);o=Pg(l,a)}else o=await Mc(s,a,r);return e.replace(T2(t),`$1${o}$3`)}catch{}return e}function A2(e,{preferredFontFormat:t}){return t?e.replace(O2,n=>{for(;;){const[r,,i]=w2.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Bg(e){return e.search(Ug)!==-1}async function Vg(e,t,n){if(!Bg(e))return e;const r=A2(e,n);return M2(r).reduce((s,a)=>s.then(o=>C2(o,a,t,n)),Promise.resolve(r))}async function Oa(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Vg(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function D2(e,t){await Oa("background",e,t)||await Oa("background-image",e,t),await Oa("mask",e,t)||await Oa("mask-image",e,t)}async function L2(e,t){const n=ne(e,HTMLImageElement);if(!(n&&!Oc(e.src))&&!(ne(e,SVGImageElement)&&!Oc(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Mc(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 R2(e,t){const r=an(e.childNodes).map(i=>Gg(i,t));await Promise.all(r).then(()=>e)}async function Gg(e,t){ne(e,Element)&&(await D2(e,t),await L2(e,t),await R2(e,t))}function I2(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 Hg={};async function Fg(e){let t=Hg[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Hg[e]=t,t}async function zg(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let o=a.replace(r,"$1");return o.startsWith("https://")||(o=new URL(o,e.url).href),Ng(o,t.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>n)}function Wg(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 k2(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{an(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Fg(l).then(u=>zg(u,t)).then(u=>Wg(u).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?o+=1:i.cssRules.length)}catch(h){console.error("Error inserting rule from remote css",{rule:d,error:h})}})).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(Fg(i.href).then(o=>zg(o,t)).then(o=>Wg(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{an(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function $2(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Bg(t.style.getPropertyValue("src")))}async function P2(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=an(e.ownerDocument.styleSheets),r=await k2(n,t);return $2(r)}async function N2(e,t){const n=await P2(e,t);return(await Promise.all(n.map(i=>{const s=i.parentStyleSheet?i.parentStyleSheet.href:null;return Vg(i.cssText,s,t)}))).join(`
|
|
3
|
+
`)}async function U2(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await N2(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 B2(e,t={}){const{width:n,height:r}=Rg(e,t),i=await wa(e,t,!0);return await U2(i,t),await Gg(i,t),I2(i,t),await i2(i,n,r)}async function Yg(e,t={}){const{width:n,height:r}=Rg(e,t),i=await B2(e,t),s=await _a(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||e2(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||n2(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 V2(e,t={}){return(await Yg(e,t)).toDataURL()}async function G2(e,t={}){return(await Yg(e,t)).toDataURL("image/jpeg",t.quality||1)}class on{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const H2="DONT_STYLE_ME_css_styles_verifier";class A extends on{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=h=>{h&&Object.keys(r).forEach(f=>{if(h[f]){const p=h[f],g=parseFloat(p);p&&g>r[f]&&(""+p).indexOf("%")===-1&&(r[f]=g)}})},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(h){console.error(h)}try{typeof(a==null?void 0:a.getBoundingClientRect)=="function"&&(c=a.getBoundingClientRect(),u={width:c.width,height:c.height})}catch(h){console.error(h)}let d;if(a instanceof SVGSVGElement&&(d={width:a.clientWidth,height:a.clientHeight}),n){if(n.useAttrs&&(i(s),r.width>0&&r.height>0))return r;if(n.useClientDimensions&&(i(d),r.width>0&&r.height>0))return d;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 h={width:x(t.node(),"width","baseVal","value"),height:x(t.node(),"height","baseVal","value")};i(h)}catch{i(d),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(`${ee}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",H2),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(`${ee}--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),G2(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),V2(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}=A.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(A.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(w.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(w.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=ua(()=>{var a;t&&(Math.abs(n-t.clientWidth)>1||Math.abs(r-t.clientHeight)>1)&&(n=t.clientWidth,r=t.clientHeight,(a=this.services.events)==null||a.dispatchEvent(w.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}}class lt{constructor(t,n,r){if(this.type="",this.renderType=Z.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 r;const n=this.parent;if(this.parent=t,!(n&&n.node()===t.node())&&this.type){const i=x(this.model.getOptions(),"style","prefix");(r=this.parent)==null||r.classed(`${ee}--${i}--${this.type}`,!0),n&&n.classed(`${ee}--${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=A.appendOrSelect(this.parent,`${this.renderType===Z.SVG?"svg":"div"}${r}.${ee}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const o=D(`#${s}`).select("rect");o.size()!==0&&parseFloat(o.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?tt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const qg=class Fm extends lt{constructor(){super(...arguments),this.type="toolbar",this.renderType=Z.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(w.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(w.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:i,overflowMenuItemList:s}=this.getControlConfigs();s&&i.push(this.getOverflowButtonConfig());const a=n.selectAll("div.toolbar-control").data(i,c=>c.id);a.exit().remove();const o=a.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),l=this;o.merge(a).classed("disabled",c=>c.shouldBeDisabled()).attr("aria-disabled",c=>c.shouldBeDisabled()).attr("aria-label",c=>c.title).html(c=>`
|
|
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-${c.id}`)}" aria-label="${c.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
|
${c.iconSVG.content}
|
|
9
9
|
</svg>
|
|
10
|
-
</button>`).each(function(c,u){D(this).select("svg").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),D(this).select("button").on("click",d=>{c.shouldBeDisabled()||l.triggerFunctionAndEvent(c,d,this)}).on("keydown",d=>{d.key&&d.key==="Enter"||d.key===" "?(d.preventDefault(),l.triggerFunctionAndEvent(c,d,this)):d.key&&d.key==="ArrowLeft"?l.focusOnPreviousEnabledToolbarItem(u):d.key&&d.key==="ArrowRight"&&l.focusOnNextEnabledToolbarItem(u)})}),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(w.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(w.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((i,s)=>{const a=D(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(i,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",o=>{o&&o.key==="Enter"?n.triggerFunctionAndEvent(i,t,a.node()):o&&o.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(s):o&&o.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(s):o&&o.key==="Escape"&&n.updateOverflowMenu(!1),o.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(w.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===Mt.CUSTOM?(x(a,"id")===null&&(a.id=`toolbar-button-${
|
|
10
|
+
</button>`).each(function(c,u){D(this).select("svg").style("will-change","transform").style("width",c.iconSVG.width!==void 0?c.iconSVG.width:"20px").style("height",c.iconSVG.height!==void 0?c.iconSVG.height:"20px"),D(this).select("button").on("click",d=>{c.shouldBeDisabled()||l.triggerFunctionAndEvent(c,d,this)}).on("keydown",d=>{d.key&&d.key==="Enter"||d.key===" "?(d.preventDefault(),l.triggerFunctionAndEvent(c,d,this)):d.key&&d.key==="ArrowLeft"?l.focusOnPreviousEnabledToolbarItem(u):d.key&&d.key==="ArrowRight"&&l.focusOnNextEnabledToolbarItem(u)})}),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(w.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(w.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((i,s)=>{const a=D(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);a!==null&&(a.on("click",()=>{n.triggerFunctionAndEvent(i,t,a.node()),n.updateOverflowMenu(!1)}),a.on("keydown",o=>{o&&o.key==="Enter"?n.triggerFunctionAndEvent(i,t,a.node()):o&&o.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(s):o&&o.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(s):o&&o.key==="Escape"&&n.updateOverflowMenu(!1),o.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(w.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===Mt.CUSTOM?(x(a,"id")===null&&(a.id=`toolbar-button-${Fm.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
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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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(w.Modal.SHOW)};break;case Mt.EXPORT_CSV:i={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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)}}};qg.buttonID=0;let Ta=qg;const Xg=class
|
|
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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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 Mt.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)}}};qg.buttonID=0;let Ta=qg;const Xg=class zm extends lt{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=zm.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===nt.PREFERRED||i===nt.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(n=>x(n,"growth")===nt.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=A.getHTMLElementSize(n.node()),s=this.configs.direction===bt.ROW||this.configs.direction===bt.ROW_REVERSE,a=x(this.model.getOptions(),"style","prefix"),o=n.classed(`${ee}--${a}--layout-row`,this.configs.direction===bt.ROW).classed(`${ee}--${a}--layout-row-reverse`,this.configs.direction===bt.ROW_REVERSE).classed(`${ee}--${a}--layout-column`,this.configs.direction===bt.COLUMN).classed(`${ee}--${a}--layout-column-reverse`,this.configs.direction===bt.COLUMN_REVERSE).classed(`${ee}--${a}--layout-alignitems-center`,this.configs.alignItems===Vn.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",u=>`layout-child layout-child-${this._instanceID} ${u.id}`).each(function(u){u.components.forEach(d=>{const h=D(this),p=x(u,"renderType")===Z.SVG;d.setParent(p?A.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const g=x(u,"growth");(g===nt.PREFERRED||g===nt.FIXED)&&d.render(t)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const d=x(u,"growth"),f=x(u,"renderType")===Z.SVG?A.getSVGElementSize(D(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):A.getHTMLElementSize(this);if(d===nt.PREFERRED){const p=s?f.width:f.height,g=s?r:i;u.size=p/g*100}}),o.exit().remove(),this.children.filter(u=>x(u,"growth")===nt.STRETCH).forEach(u=>{u.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const c=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);s?c.style("width",u=>`${u.size/100*r}px`).style("height","100%"):c.style("height",u=>`${u.size/100*i}px`).style("width","100%"),c.each(function(u){u.components.forEach(d=>{x(u,"growth")===nt.STRETCH&&d.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())})}};Xg.instanceID=Math.floor(Math.random()*99999999999);let he=Xg;class ln extends lt{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||tg.default.size}px`).style("height",`${this.configs.size||tg.default.size}px`).attr("opacity",0)}}var F2={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
|
-
`},Cc=
|
|
25
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
26
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yI(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 xI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bI(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 EI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tm(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 SI(e,t,n){return t&&tm(e.prototype,t),n&&tm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _I(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(r,i){return r.__proto__=i,r},Pc(e,t)}function wI(e){var t=MI();return function(){var r=Aa(e),i;if(t){var s=Aa(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return OI(this,i)}}function OI(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 TI(e)}function TI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MI(){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 Aa(e){return Aa=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Aa(e)}function CI(e){var t=function(n){_I(i,n);var r=wI(i);function i(){return EI(this,i),r.apply(this,arguments)}return SI(i,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var a=this,o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];var u=typeof l[0]=="string"?l.shift():void 0,d=Object(l[0])===l[0]&&typeof l[0]!="function"?l.shift():void 0,h=typeof l[0]=="function"?l.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(u,d)){h&&h(null,!0);return}var f={group:d&&d.group,state:u},p=[f.group,u].filter(Boolean).join("-").split("-").map(function(S){return S[0].toUpperCase()+S.substr(1)}).join(""),g=new CustomEvent(this.options["eventBefore".concat(p)],{bubbles:!0,cancelable:!0,detail:d}),v=d&&d.delegatorNode||this.element,m=!v.dispatchEvent(g);if(m){if(h){var y=new Error("Changing state (".concat(JSON.stringify(f),") has been canceled."));y.canceled=!0,h(y)}}else{var b=[u,d].filter(Boolean);this._changeState.apply(this,mI(b).concat([function(){v.dispatchEvent(new CustomEvent(a.options["eventAfter".concat(p)],{bubbles:!0,cancelable:!0,detail:d})),h&&h()}]))}}}]),i}(e);return t}function Nc(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 em(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 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 AI(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 DI(e,t,n){return t&&nm(e.prototype,t),n&&nm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LI(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&&Bc(e,t)}function Bc(e,t){return Bc=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Bc(e,t)}function RI(e){var t=$I();return function(){var r=Da(e),i;if(t){var s=Da(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return II(this,i)}}function II(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 kI(e)}function kI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $I(){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 Da(e){return Da=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Da(e)}function PI(e){var t=function(n){LI(i,n);var r=RI(i);function i(){return AI(this,i),r.apply(this,arguments)}return DI(i,[{key:"show",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("shown",em(a),o)}},{key:"hide",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("hidden",em(a),o)}}]),i}(e);return t}var NI=[CI,PI];const UI=NI;function rm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function BI(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):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 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 VI=im;const GI=rm(VI);function Vc(e){"@babel/helpers - typeof";return Vc=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},Vc(e)}function HI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sm(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 FI(e,t,n){return t&&sm(e.prototype,t),n&&sm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zI(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(r,i){return r.__proto__=i,r},Gc(e,t)}function WI(e){var t=XI();return function(){var r=La(e),i;if(t){var s=La(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return YI(this,i)}}function YI(e,t){if(t&&(Vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qI(e)}function qI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XI(){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 La(e){return La=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},La(e)}function jI(e){var t=function(n){zI(i,n);var r=WI(i);function i(){return HI(this,i),r.apply(this,arguments)}return FI(i,null,[{key:"init",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=Object.assign(Object.create(this.options),l);if(!o||o.nodeType!==Node.ELEMENT_NODE&&o.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(o.nodeType===Node.ELEMENT_NODE&&o.matches(c.selectorInit))this.create(o,l);else{var u=c.initEventNames.map(function(d){return Ui(o,d,function(h){var f=Nc(h,"[".concat(c.attribInitTarget,"]"));if(f){h.delegateTarget=f;var p=f.ownerDocument.querySelectorAll(f.getAttribute(c.attribInitTarget));if(p.length>1)throw new Error("Target widget must be unique.");if(p.length===1){f.tagName==="A"&&h.preventDefault();var g=a.create(p[0],l);typeof g.createdByLauncher=="function"&&g.createdByLauncher(h)}}})});return{release:function(){for(var h=u.pop();h;h=u.pop())h.release()}}}return""}}]),i.forLazyInit=!0,i}(e);return t}function Hc(e){"@babel/helpers - typeof";return Hc=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},Hc(e)}function ZI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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 KI(e,t,n){return t&&am(e.prototype,t),n&&am(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function QI(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&&Fc(e,t)}function Fc(e,t){return Fc=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Fc(e,t)}function JI(e){var t=nk();return function(){var r=Ra(e),i;if(t){var s=Ra(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return tk(this,i)}}function tk(e,t){if(t&&(Hc(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 Ra(e){return Ra=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Ra(e)}var rk=function(e){QI(n,e);var t=JI(n);function n(r,i){var s;return ZI(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!Nc(a,l)})&&s.element.querySelector(Cc.selectorTabbable).focus()},s._hookCloseActions(),s}return KI(n,[{key:"createdByLauncher",value:function(i){this.show(i)}},{key:"shouldStateBeChanged",value:function(i){return i==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(i,s,a){var o=this,l,c=function(){if(l&&(l=o.unmanage(l).release()),i==="shown"&&o.element.offsetWidth>0&&o.element.offsetHeight>0){o.previouslyFocusedNode=o.element.ownerDocument.activeElement;var f=o.element.querySelector(o.options.selectorPrimaryFocus)||o.element.querySelector(Cc.selectorTabbable);f.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&GI(f,"Modals need to contain a focusable element by either using "+"`".concat(o.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}a()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),i==="shown"){var u="onfocusin"in this.element.ownerDocument.defaultView,d=u?"focusin":"focus";this._handleFocusinListener=this.manage(Ui(this.element.ownerDocument,d,this._handleFocusin,!u))}i==="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()):i==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),l=this.manage(Ui(this.element,"transitionend",c))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(Ui(this.element,"click",function(s){var a=Nc(s,i.options.selectorModalClose);a&&(s.delegateTarget=a),(a||s.target===i.element)&&i.hide(s)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Ui(this.element.ownerDocument.body,"keydown",function(s){s.which===27&&i.shouldStateBeChanged("hidden")&&(s.stopPropagation(),i.hide(s))}))}}],[{key:"options",get:function(){var i=Cc.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(i,"--overflow-menu-options"),".".concat(i,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(i,"--modal-container"),classVisible:"is-visible",classBody:"".concat(i,"--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}(J2(aI,jI,UI,gI));const ik=rk;class Ia extends lt{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()),ik.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(w.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(w.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.model.getOptions(),n=x(t,"style","prefix"),r=this.model.getTabularDataArray();return`
|
|
24
|
+
`},Cc=F2;function jg(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 z2(e,t,n){return t&&jg(e.prototype,t),n&&jg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function W2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y2(e){return Z2(e)||j2(e)||X2(e)||q2()}function q2(){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 X2(e,t){if(e){if(typeof e=="string")return Ac(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 Ac(e,t)}}function j2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Z2(e){if(Array.isArray(e))return Ac(e)}function Ac(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 Zg(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,Y2(Zg(n))):t.push(n),t},[])}function K2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Zg(t).reduce(function(r,i){return i(r)},function(){function r(){W2(this,r)}return z2(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 Q2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kg(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 J2(e,t,n){return t&&Kg(e.prototype,t),n&&Kg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tI(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(r,i){return r.__proto__=i,r},Lc(e,t)}function eI(e){var t=rI();return function(){var r=Ma(e),i;if(t){var s=Ma(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return nI(this,i)}}function nI(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 Qg(e)}function Qg(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rI(){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 Ma(e){return Ma=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Ma(e)}function iI(e){var t=function(n){tI(i,n);var r=eI(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Q2(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,Qg(a)),a}return J2(i,[{key:"release",value:function(){for(var a=this.children.pop();a;a=this.children.pop())a.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(a,o){return this.components.get(a)||new this(a,o)}}]),i}(e);return t}function Rc(e){"@babel/helpers - typeof";return Rc=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},Rc(e)}function sI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jg(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 aI(e,t,n){return t&&Jg(e.prototype,t),n&&Jg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ca(){return typeof Reflect<"u"&&Reflect.get?Ca=Reflect.get:Ca=function(t,n,r){var i=oI(t,n);if(i){var s=Object.getOwnPropertyDescriptor(i,n);return s.get?s.get.call(arguments.length<3?t:r):s.value}},Ca.apply(this,arguments)}function oI(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Ar(e),e!==null););return e}function lI(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(r,i){return r.__proto__=i,r},Ic(e,t)}function cI(e){var t=dI();return function(){var r=Ar(e),i;if(t){var s=Ar(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return uI(this,i)}}function uI(e,t){if(t&&(Rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hI(e)}function hI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dI(){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 Ar(e){return Ar=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Ar(e)}function fI(e){var t=function(n){lI(i,n);var r=cI(i);function i(){var s;sI(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 aI(i,[{key:"manage",value:function(a){return this.handles.add(a),a}},{key:"unmanage",value:function(a){return this.handles.delete(a),a}},{key:"release",value:function(){var a=this;return this.handles.forEach(function(o){o.release(),a.handles.delete(o)}),Ca(Ar(i.prototype),"release",this).call(this)}}]),i}(e);return t}function Ui(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 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 pI(e){return yI(e)||vI(e)||mI(e)||gI()}function gI(){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 mI(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 vI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yI(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 xI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tm(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 bI(e,t,n){return t&&tm(e.prototype,t),n&&tm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function EI(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(r,i){return r.__proto__=i,r},Pc(e,t)}function SI(e){var t=OI();return function(){var r=Aa(e),i;if(t){var s=Aa(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return _I(this,i)}}function _I(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 wI(e)}function wI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OI(){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 Aa(e){return Aa=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Aa(e)}function TI(e){var t=function(n){EI(i,n);var r=SI(i);function i(){return xI(this,i),r.apply(this,arguments)}return bI(i,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var a=this,o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];var u=typeof l[0]=="string"?l.shift():void 0,d=Object(l[0])===l[0]&&typeof l[0]!="function"?l.shift():void 0,h=typeof l[0]=="function"?l.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(u,d)){h&&h(null,!0);return}var f={group:d&&d.group,state:u},p=[f.group,u].filter(Boolean).join("-").split("-").map(function(S){return S[0].toUpperCase()+S.substr(1)}).join(""),g=new CustomEvent(this.options["eventBefore".concat(p)],{bubbles:!0,cancelable:!0,detail:d}),v=d&&d.delegatorNode||this.element,m=!v.dispatchEvent(g);if(m){if(h){var y=new Error("Changing state (".concat(JSON.stringify(f),") has been canceled."));y.canceled=!0,h(y)}}else{var b=[u,d].filter(Boolean);this._changeState.apply(this,pI(b).concat([function(){v.dispatchEvent(new CustomEvent(a.options["eventAfter".concat(p)],{bubbles:!0,cancelable:!0,detail:d})),h&&h()}]))}}}]),i}(e);return t}function Nc(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 em(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 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 MI(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 CI(e,t,n){return t&&nm(e.prototype,t),n&&nm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function AI(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&&Bc(e,t)}function Bc(e,t){return Bc=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Bc(e,t)}function DI(e){var t=II();return function(){var r=Da(e),i;if(t){var s=Da(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return LI(this,i)}}function LI(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 RI(e)}function RI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function II(){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 Da(e){return Da=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Da(e)}function kI(e){var t=function(n){AI(i,n);var r=DI(i);function i(){return MI(this,i),r.apply(this,arguments)}return CI(i,[{key:"show",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("shown",em(a),o)}},{key:"hide",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("hidden",em(a),o)}}]),i}(e);return t}var $I=[TI,kI];const PI=$I;function NI(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function UI(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):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}function Vc(e){"@babel/helpers - typeof";return Vc=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},Vc(e)}function BI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rm(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 VI(e,t,n){return t&&rm(e.prototype,t),n&&rm(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function GI(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(r,i){return r.__proto__=i,r},Gc(e,t)}function HI(e){var t=WI();return function(){var r=La(e),i;if(t){var s=La(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return FI(this,i)}}function FI(e,t){if(t&&(Vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zI(e)}function zI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WI(){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 La(e){return La=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},La(e)}function YI(e){var t=function(n){GI(i,n);var r=HI(i);function i(){return BI(this,i),r.apply(this,arguments)}return VI(i,null,[{key:"init",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=Object.assign(Object.create(this.options),l);if(!o||o.nodeType!==Node.ELEMENT_NODE&&o.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(o.nodeType===Node.ELEMENT_NODE&&o.matches(c.selectorInit))this.create(o,l);else{var u=c.initEventNames.map(function(d){return Ui(o,d,function(h){var f=Nc(h,"[".concat(c.attribInitTarget,"]"));if(f){h.delegateTarget=f;var p=f.ownerDocument.querySelectorAll(f.getAttribute(c.attribInitTarget));if(p.length>1)throw new Error("Target widget must be unique.");if(p.length===1){f.tagName==="A"&&h.preventDefault();var g=a.create(p[0],l);typeof g.createdByLauncher=="function"&&g.createdByLauncher(h)}}})});return{release:function(){for(var h=u.pop();h;h=u.pop())h.release()}}}return""}}]),i.forLazyInit=!0,i}(e);return t}function Hc(e){"@babel/helpers - typeof";return Hc=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},Hc(e)}function qI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function im(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 XI(e,t,n){return t&&im(e.prototype,t),n&&im(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jI(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&&Fc(e,t)}function Fc(e,t){return Fc=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Fc(e,t)}function ZI(e){var t=JI();return function(){var r=Ra(e),i;if(t){var s=Ra(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return KI(this,i)}}function KI(e,t){if(t&&(Hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QI(e)}function QI(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JI(){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 Ra(e){return Ra=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Ra(e)}var tk=function(e){jI(n,e);var t=ZI(n);function n(r,i){var s;return qI(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!Nc(a,l)})&&s.element.querySelector(Cc.selectorTabbable).focus()},s._hookCloseActions(),s}return XI(n,[{key:"createdByLauncher",value:function(i){this.show(i)}},{key:"shouldStateBeChanged",value:function(i){return i==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(i,s,a){var o=this,l,c=function(){if(l&&(l=o.unmanage(l).release()),i==="shown"&&o.element.offsetWidth>0&&o.element.offsetHeight>0){o.previouslyFocusedNode=o.element.ownerDocument.activeElement;var f=o.element.querySelector(o.options.selectorPrimaryFocus)||o.element.querySelector(Cc.selectorTabbable);f.focus()}a()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),i==="shown"){var u="onfocusin"in this.element.ownerDocument.defaultView,d=u?"focusin":"focus";this._handleFocusinListener=this.manage(Ui(this.element.ownerDocument,d,this._handleFocusin,!u))}i==="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()):i==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),l=this.manage(Ui(this.element,"transitionend",c))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(Ui(this.element,"click",function(s){var a=Nc(s,i.options.selectorModalClose);a&&(s.delegateTarget=a),(a||s.target===i.element)&&i.hide(s)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(Ui(this.element.ownerDocument.body,"keydown",function(s){s.which===27&&i.shouldStateBeChanged("hidden")&&(s.stopPropagation(),i.hide(s))}))}}],[{key:"options",get:function(){var i=Cc.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(i,"--overflow-menu-options"),".".concat(i,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(i,"--modal-container"),classVisible:"is-visible",classBody:"".concat(i,"--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}(K2(iI,YI,PI,fI));const ek=tk;class Ia extends lt{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()),ek.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(w.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(w.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="${ee}--${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=D(this.services.domUtils.getHolder()),i=x(n,"style","prefix");this.modal=A.appendOrSelect(r,`div.${ee}--${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 Bi extends lt{constructor(){super(...arguments),this.type="title",this.renderType=Z.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(w.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(w.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(w.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=A.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(w.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(w.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(w.Tooltip.HIDE)})}}getMaxTitleWidth(){return A.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}}var st=(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))(st||{});class zc extends lt{constructor(){super(...arguments),this.type="legend",this.renderType=Z.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}=At.items.status,l=a.some(y=>y.status===o),c=x(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===It.CENTER).classed("right-aligned",i===It.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",st.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,y=>y.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(y){return y.status===At.items.status.ACTIVE});const f=x(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=At.checkbox.radius,g=h.append("div").classed("checkbox",!0),v=g.merge(d.select("div.checkbox")).attr("role",st.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===At.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",y=>this.model.getColorClassName({classNameTypes:[Q.BACKGROUND],dataGroupName:y.name,originalClassName:"checkbox"})).style("background",y=>y.status===At.items.status.ACTIVE?this.model.getFillColor(y.name)||this.model.getStrokeColor(y.name):null).classed("active",function(y){return y.status===At.items.status.ACTIVE});g.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"),h.append("p").merge(d.select("p"));const m=x(n,"legend","additionalItems");if(m&&a.length){const y=this,b=u.selectAll("div.additional-item").data(m);b.exit().remove();const S=b.enter().append("div").merge(b).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(M,C)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${v.size()+C}-title`));S.selectAll("*").remove();let _,E=1;S.append("svg").classed("icon",!0).each(function(M){const C=D(this);!_||_!=M.type?(_=M.type,E=1):E++,y.addAdditionalItem(C,M,E)}),S.append("p").merge(S.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&h.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}=At.area;if(n.type===$t.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===$t.RADIUS){const{iconData:a,fill:o,stroke:l}=At.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",st.IMG).attr("aria-label","radius").attr("cx",u=>u.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===$t.LINE){const a=At.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",st.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===$t.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",st.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?At.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===$t.SIZE){const{iconData:a,fill:o,stroke:l}=At.size;t.attr("fill","none").attr("role",st.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.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===$t.QUARTILE){const{iconData:a}=At.quartile;t.selectAll("rect").attr("role",st.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(l,c)=>`quartile-${c===0?"wrapper":"line"}`).attr("x",l=>l.x).attr("y",l=>l.y).attr("width",l=>l.width).attr("height",l=>l.height)}else if(n.type===$t.ZOOM){const{iconData:a,color:o}=x(At,"zoom"),l=t.attr("role",st.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?Ri(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(w.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(w.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(w.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(w.Legend.ITEM_CLICK,{clickedElement:D(this)});const o=D(this).datum();t.model.toggleDataLabel(o.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(w.Tooltip.HIDE),t.services.events.dispatchEvent(w.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(w.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(w.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(w.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class om extends lt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=Z.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=A.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=A.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 sk extends om{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}=A.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=A.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=A.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 Dr,Ht;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Ht||(Ht={}));var lm=(Dr={},Dr[Ht.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)}},Dr[Ht.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)}},Dr[Ht.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)}},Dr[Ht.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)}},Dr),cm=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},ka=function(){function e(t){t===void 0&&(t={}),this.positions=lm,this.positions=Object.assign({},lm,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),d=0,h=0,f=i();u.top<f.top?d=f.top-u.top:u.bottom>f.height&&(d=u.bottom-f.height),u.left<f.left?h=f.left-u.left:u.right>f.width&&(h=u.right-f.width),d&&!h?h=1:h&&!d&&(d=1);var p=n.offsetHeight*n.offsetWidth,g=d*h,v=p-g,m=v/p;return{placement:l,weight:m}});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:cm.innerHeight,width:cm.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 ka;class Wc extends lt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=Z.HTML,this.isEventListenerAdded=!1,this.positionService=new ka,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=A.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 d=o[u];o[u]&&o[u].color&&D(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",d.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(w.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(w.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(w.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(w.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(w.Tooltip.MOVE,null),this.services.events.removeEventListener(w.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(w.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(w.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=Ri(a.label,r,s)),a.value&&a.value.length>i&&(a.value=Ri(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=A.appendOrSelect(r,`div.${ee}--${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 Bi extends lt{constructor(){super(...arguments),this.type="title",this.renderType=Z.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(w.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(w.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(w.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=A.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(w.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(w.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(w.Tooltip.HIDE)})}}getMaxTitleWidth(){return A.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}}var st=(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))(st||{});class zc extends lt{constructor(){super(...arguments),this.type="legend",this.renderType=Z.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}=At.items.status,l=a.some(y=>y.status===o),c=x(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===It.CENTER).classed("right-aligned",i===It.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",st.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");c&&(a=this.sortDataGroups(a,c));const d=u.selectAll("div.legend-item").data(a,y=>y.name),h=d.enter().append("div").attr("class","legend-item");h.merge(u.selectAll("div.legend-item")).classed("active",function(y){return y.status===At.items.status.ACTIVE});const f=x(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=At.checkbox.radius,g=h.append("div").classed("checkbox",!0),v=g.merge(d.select("div.checkbox")).attr("role",st.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===At.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",y=>this.model.getColorClassName({classNameTypes:[Q.BACKGROUND],dataGroupName:y.name,originalClassName:"checkbox"})).style("background",y=>y.status===At.items.status.ACTIVE?this.model.getFillColor(y.name)||this.model.getStrokeColor(y.name):null).classed("active",function(y){return y.status===At.items.status.ACTIVE});g.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"),h.append("p").merge(d.select("p"));const m=x(n,"legend","additionalItems");if(m&&a.length){const y=this,b=u.selectAll("div.additional-item").data(m);b.exit().remove();const S=b.enter().append("div").merge(b).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(M,C)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${v.size()+C}-title`));S.selectAll("*").remove();let _,E=1;S.append("svg").classed("icon",!0).each(function(M){const C=D(this);!_||_!=M.type?(_=M.type,E=1):E++,y.addAdditionalItem(C,M,E)}),S.append("p").merge(S.select("p")),this.truncateLegendText()}d.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),f&&h.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}=At.area;if(n.type===$t.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===$t.RADIUS){const{iconData:a,fill:o,stroke:l}=At.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",st.IMG).attr("aria-label","radius").attr("cx",u=>u.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:l)}else if(n.type===$t.LINE){const a=At.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",st.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===$t.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",st.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?At.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===$t.SIZE){const{iconData:a,fill:o,stroke:l}=At.size;t.attr("fill","none").attr("role",st.IMG).attr("aria-label","size").selectAll("rect").data(a).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.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===$t.QUARTILE){const{iconData:a}=At.quartile;t.selectAll("rect").attr("role",st.IMG).attr("aria-label","quartile").data(a).enter().append("rect").attr("class",(l,c)=>`quartile-${c===0?"wrapper":"line"}`).attr("x",l=>l.x).attr("y",l=>l.y).attr("width",l=>l.width).attr("height",l=>l.height)}else if(n.type===$t.ZOOM){const{iconData:a,color:o}=x(At,"zoom"),l=t.attr("role",st.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?Ri(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(w.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(w.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(w.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(w.Legend.ITEM_CLICK,{clickedElement:D(this)});const o=D(this).datum();t.model.toggleDataLabel(o.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(w.Tooltip.HIDE),t.services.events.dispatchEvent(w.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(w.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(w.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(w.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class sm extends lt{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=Z.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=A.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const c=A.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 nk extends sm{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}=A.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=A.appendOrSelect(t,`clipPath.${this.type}`).attr("id",this.chartClipId);const i=A.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 Dr,Ht;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(Ht||(Ht={}));var am=(Dr={},Dr[Ht.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)}},Dr[Ht.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)}},Dr[Ht.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)}},Dr[Ht.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)}},Dr),om=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},ka=function(){function e(t){t===void 0&&(t={}),this.positions=am,this.positions=Object.assign({},am,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),d=0,h=0,f=i();u.top<f.top?d=f.top-u.top:u.bottom>f.height&&(d=u.bottom-f.height),u.left<f.left?h=f.left-u.left:u.right>f.width&&(h=u.right-f.width),d&&!h?h=1:h&&!d&&(d=1);var p=n.offsetHeight*n.offsetWidth,g=d*h,v=p-g,m=v/p;return{placement:l,weight:m}});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:om.innerHeight,width:om.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 ka;class Wc extends lt{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=Z.HTML,this.isEventListenerAdded=!1,this.positionService=new ka,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=A.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 d=o[u];o[u]&&o[u].color&&D(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",d.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(w.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(w.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(w.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(w.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(w.Tooltip.MOVE,null),this.services.events.removeEventListener(w.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(w.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(w.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=Ri(a.label,r,s)),a.value&&a.value.length>i&&(a.value=Ri(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,17 +68,17 @@ 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=x(r,"tooltip","valueFormatter");if(i)return i(t,n);if(typeof t.getTime=="function")return Mr(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 Mr(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=A.appendOrSelect(i,`div.${ee}--${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=Sn(x(t,"detail","event"),n);else{const h=x(i,"zoomBar","top","type"),f=ce.height[h];s&&(a[1]+=f+ce.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=Ht.LEFT:a[0]/o<.1?c=Ht.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[Ht.RIGHT,Ht.LEFT,Ht.TOP,Ht.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=YD;c===Ht.LEFT&&(u*=-1);const d=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,d)}}class ak extends on{zoomIn(t,n,r){let i,s,a;const o=r||wr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=A.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(w.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||wr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(w.CanvasZoom.CANVAS_ZOOM_OUT)}}class ok extends on{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 lk extends on{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 Vi extends on{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:Vi.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}}class ck extends on{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(w.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(eg,n,"duration")||eg.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Le{constructor(t,n){this.components=[],this.services={canvasZoom:ak,domUtils:A,events:ok,files:lk,gradientUtils:Vi,transitions:ck},this.model=new Ge(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(w.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(w.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(a=>a));Promise.all(r).then(()=>this.services.events.dispatchEvent(w.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 zc(this.model,this.services)],growth:nt.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new sk(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Bi(this.model,this.services)],growth:nt.STRETCH},c={id:"toolbar",components:[new Ta(this.model,this.services)],growth:nt.PREFERRED},u={id:"header",components:[new he(this.model,this.services,[l,...i?[c]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},d={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:x(n,"graphFrameRenderType")||Z.SVG},h=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=bt.COLUMN;if(h){const m=x(r,"legend","position");m==="left"?(f=bt.ROW,r.legend.orientation||(r.legend.orientation=Sr.VERTICAL)):m==="right"?(f=bt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Sr.VERTICAL)):m==="bottom"&&(f=bt.COLUMN_REVERSE)}const p={id:"spacer",components:[new ln(this.model,this.services)],growth:nt.PREFERRED},g={id:"full-frame",components:[new he(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:nt.STRETCH},v=[];if(o||i){v.push(u);const m={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};v.push(m)}return v.push(g),[new Wc(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,v,{direction:bt.COLUMN})]}}class Wn extends Ge{constructor(t){super(t),this.axisFlavor=Di.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===j.TIME&&(u=h=>Mr(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...l?[l.label]:[]],...t.map(h=>[h[r],h[s.identifier]===null?"–":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"–":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"–":h[o.identifier]]:[],...l?[h[l.identifier]===null||isNaN(h[l.identifier])?"–":h[l.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),x(this.getOptions(),"zoomBar",F.TOP,"enabled"))){const r=x(this.getOptions(),"zoomBar",F.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(tn(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=Oi(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[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(F).forEach(i=>{const s=F[i],a=n.axes[s];if(a&&a.scaleType===j.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}}class uk extends Wn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();return t.sort((r,i)=>r.source.localeCompare(i.source)),[["Source","Target","Value"],...t.map(r=>[r.source,r.target,r.value])]}}function um(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 hk(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 Yc(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 dk(e){return e.depth}function fk(e,t){return t-1-e.height}function hm(e,t){return e.sourceLinks.length?e.depth:t-1}function $a(e){return function(){return e}}function dm(e,t){return Pa(e.source,t.source)||e.index-t.index}function fm(e,t){return Pa(e.target,t.target)||e.index-t.index}function Pa(e,t){return e.y0-t.y0}function qc(e){return e.value}function pk(e){return e.index}function gk(e){return e.nodes}function mk(e){return e.links}function pm(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function gm({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 vk(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=pk,l=hm,c,u,d=gk,h=mk,f=6;function p(){const O={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(O),v(O),m(O),y(O),_(O),gm(O),O}p.update=function(O){return gm(O),O},p.nodeId=function(O){return arguments.length?(o=typeof O=="function"?O:$a(O),p):o},p.nodeAlign=function(O){return arguments.length?(l=typeof O=="function"?O:$a(O),p):l},p.nodeSort=function(O){return arguments.length?(c=O,p):c},p.nodeWidth=function(O){return arguments.length?(i=+O,p):i},p.nodePadding=function(O){return arguments.length?(s=a=+O,p):s},p.nodes=function(O){return arguments.length?(d=typeof O=="function"?O:$a(O),p):d},p.links=function(O){return arguments.length?(h=typeof O=="function"?O:$a(O),p):h},p.linkSort=function(O){return arguments.length?(u=O,p):u},p.size=function(O){return arguments.length?(e=t=0,n=+O[0],r=+O[1],p):[n-e,r-t]},p.extent=function(O){return arguments.length?(e=+O[0][0],n=+O[1][0],t=+O[0][1],r=+O[1][1],p):[[e,t],[n,r]]},p.iterations=function(O){return arguments.length?(f=+O,p):f};function g({nodes:O,links:U}){for(const[N,B]of O.entries())B.index=N,B.sourceLinks=[],B.targetLinks=[];const P=new Map(O.map((N,B)=>[o(N,B,O),N]));for(const[N,B]of U.entries()){B.index=N;let{source:Y,target:X}=B;typeof Y!="object"&&(Y=B.source=pm(P,Y)),typeof X!="object"&&(X=B.target=pm(P,X)),Y.sourceLinks.push(B),X.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:N,targetLinks:B}of O)N.sort(u),B.sort(u)}function v({nodes:O}){for(const U of O)U.value=U.fixedValue===void 0?Math.max(Yc(U.sourceLinks,qc),Yc(U.targetLinks,qc)):U.fixedValue}function m({nodes:O}){const U=O.length;let P=new Set(O),N=new Set,B=0;for(;P.size;){for(const Y of P){Y.depth=B;for(const{target:X}of Y.sourceLinks)N.add(X)}if(++B>U)throw new Error("circular link");P=N,N=new Set}}function y({nodes:O}){const U=O.length;let P=new Set(O),N=new Set,B=0;for(;P.size;){for(const Y of P){Y.height=B;for(const{source:X}of Y.targetLinks)N.add(X)}if(++B>U)throw new Error("circular link");P=N,N=new Set}}function b({nodes:O}){const U=um(O,B=>B.depth)+1,P=(n-e-i)/(U-1),N=new Array(U);for(const B of O){const Y=Math.max(0,Math.min(U-1,Math.floor(l.call(null,B,U))));B.layer=Y,B.x0=e+Y*P,B.x1=B.x0+i,N[Y]?N[Y].push(B):N[Y]=[B]}if(c)for(const B of N)B.sort(c);return N}function S(O){const U=hk(O,P=>(r-t-(P.length-1)*a)/Yc(P,qc));for(const P of O){let N=t;for(const B of P){B.y0=N,B.y1=N+B.value*U,N=B.y1+a;for(const Y of B.sourceLinks)Y.width=Y.value*U}N=(r-N+a)/(P.length+1);for(let B=0;B<P.length;++B){const Y=P[B];Y.y0+=N*(B+1),Y.y1+=N*(B+1)}L(P)}}function _(O){const U=b(O);a=Math.min(s,(r-t)/(um(U,P=>P.length)-1)),S(U);for(let P=0;P<f;++P){const N=Math.pow(.99,P),B=Math.max(1-N,(P+1)/f);M(U,N,B),E(U,N,B)}}function E(O,U,P){for(let N=1,B=O.length;N<B;++N){const Y=O[N];for(const X of Y){let J=0,ct=0;for(const{source:K,value:ut}of X.targetLinks){let rt=ut*(X.layer-K.layer);J+=R(K,X)*rt,ct+=rt}if(!(ct>0))continue;let W=(J/ct-X.y0)*U;X.y0+=W,X.y1+=W,T(X)}c===void 0&&Y.sort(Pa),C(Y,P)}}function M(O,U,P){for(let N=O.length,B=N-2;B>=0;--B){const Y=O[B];for(const X of Y){let J=0,ct=0;for(const{target:K,value:ut}of X.sourceLinks){let rt=ut*(K.layer-X.layer);J+=k(X,K)*rt,ct+=rt}if(!(ct>0))continue;let W=(J/ct-X.y0)*U;X.y0+=W,X.y1+=W,T(X)}c===void 0&&Y.sort(Pa),C(Y,P)}}function C(O,U){const P=O.length>>1,N=O[P];I(O,N.y0-a,P-1,U),G(O,N.y1+a,P+1,U),I(O,r,O.length-1,U),G(O,t,0,U)}function G(O,U,P,N){for(;P<O.length;++P){const B=O[P],Y=(U-B.y0)*N;Y>1e-6&&(B.y0+=Y,B.y1+=Y),U=B.y1+a}}function I(O,U,P,N){for(;P>=0;--P){const B=O[P],Y=(B.y1-U)*N;Y>1e-6&&(B.y0-=Y,B.y1-=Y),U=B.y0-a}}function T({sourceLinks:O,targetLinks:U}){if(u===void 0){for(const{source:{sourceLinks:P}}of U)P.sort(fm);for(const{target:{targetLinks:P}}of O)P.sort(dm)}}function L(O){if(u===void 0)for(const{sourceLinks:U,targetLinks:P}of O)U.sort(fm),P.sort(dm)}function R(O,U){let P=O.y0-(O.sourceLinks.length-1)*a/2;for(const{target:N,width:B}of O.sourceLinks){if(N===U)break;P+=B+a}for(const{source:N,width:B}of U.targetLinks){if(N===O)break;P-=B}return P}function k(O,U){let P=U.y0-(U.targetLinks.length-1)*a/2;for(const{source:N,width:B}of U.targetLinks){if(N===O)break;P+=B+a}for(const{target:N,width:B}of O.sourceLinks){if(N===U)break;P-=B}return P}return p}var Xc=Math.PI,jc=2*Xc,Yn=1e-6,yk=jc-Yn;function Zc(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mm(){return new Zc}Zc.prototype=mm.prototype={constructor:Zc,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,d=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(d>Yn)if(!(Math.abs(u*o-l*c)>Yn)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,f=r-a,p=o*o+l*l,g=h*h+f*f,v=Math.sqrt(p),m=Math.sqrt(d),y=i*Math.tan((Xc-Math.acos((p+d-g)/(2*v*m)))/2),b=y/m,S=y/v;Math.abs(b-1)>Yn&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>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,d=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)>Yn||Math.abs(this._y1-c)>Yn)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%jc+jc),d>yk?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>Yn&&(this._+="A"+n+","+n+",0,"+ +(d>=Xc)+","+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 vm(e){return function(){return e}}function xk(e){return e[0]}function bk(e){return e[1]}var Ek=Array.prototype.slice;function Sk(e){return e.source}function _k(e){return e.target}function wk(e){var t=Sk,n=_k,r=xk,i=bk,s=null;function a(){var o,l=Ek.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=mm()),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:vm(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:vm(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function Ok(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function Tk(){return wk(Ok)}function Mk(e){return[e.source.x1,e.y0]}function Ck(e){return[e.target.x0,e.y1]}function Ak(){return Tk().source(Mk).target(Ck)}class Dk extends lt{constructor(){super(...arguments),this.type="alluvial",this.renderType=Z.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}=A.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=De.minNodePadding;s.alluvial.nodePadding>De.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=hm;c===It.LEFT?u=dk:c===It.RIGHT&&(u=fk);const d=vk().nodeId(m=>m.name).nodeWidth(De.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(m=>Object.assign({},m)),links:a.map(m=>Object.assign({},m))}),this.graph.nodes=this.graph.nodes.filter(m=>m.value!==0);const h={};this.graph.nodes.forEach(m=>{const y=m.x0;m.category&&(h[y]=m==null?void 0:m.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",m=>`translate(${m}, 0)`).append("text").attr("id",(m,y)=>this.services.domUtils.generateElementIDString(`alluvial-category-${y}`)).style("font-size","14px").text(m=>h[m]?h[m]:"").attr("y",20).attr("x",(m,y)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-category-${y}`),{width:S}=A.getSVGElementSize(D(`text#${b}`),{useBBox:!0});let _=0;return m+_>=S&&(_=-S+4),_});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const m=x(this.getOptions(),"color","scale");m&&p.enter().append("linearGradient").attr("id",y=>`${this.gradient_id}-link-${y.index}`).attr("gradientUnits","userSpaceOnUse").call(y=>y.append("stop").attr("offset","0%").attr("stop-color",b=>m[b.source.name])).call(y=>y.append("stop").attr("offset","100%").attr("stop-color",b=>m[b.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",Ak()).attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-line-${m.index}`)).attr("class",m=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:m.source.index,originalClassName:"link"})).style("stroke",m=>o?`url(#${this.gradient_id}-link-${m.index})`:this.model.getFillColor(m.source.name)).attr("stroke-width",m=>Math.max(1,m.width)).style("stroke-opacity",De.opacity.default).attr("aria-label",m=>`${m.source.name} → ${m.target.name} (${m.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const g=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-${m.index}`)).classed("node-group",!0).attr("transform",m=>`translate(${m.x0}, ${m.y0})`);g.append("rect").classed("node",!0).attr("height",m=>m.y1-m.y0).attr("width",m=>m.x1-m.x0).attr("fill","black");const v=g.append("g").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${m.index}`));v.append("text").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${m.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(m=>`${m.name} (${m.value})`).attr("aria-label",m=>`${m.name} (${m.value})`),v.append("rect").classed("node-text-bg",!0).attr("width",(m,y)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${y}`),{width:S}=A.getSVGElementSize(D(`text#${b}`),{useBBox:!0});return S+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(m,y)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${y}`),{width:S}=A.getSVGElementSize(D(`text#${b}`),{useBBox:!0}),_=(m.y1-m.y0)/2-9;let E=m.x1-m.x0;return m.x1>=S?E=E-(S+16):E+=4,`translate(${E}, ${_})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=ua((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",De.opacity.default)):a.style("stroke-opacity",function(){return i===this?(D(this).raise(),De.opacity.selected):De.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(w.Alluvial.LINE_MOUSEOVER,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(w.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(w.Alluvial.LINE_MOUSEMOVE,{event:i,element:D(this),datum:s}),n.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,s){n.services.events.dispatchEvent(w.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(w.Alluvial.LINE_MOUSEOUT,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(w.Tooltip.HIDE,{event:i,hoveredElement:a})})}addNodeEventListener(){const t=this,n=ua((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,a=>a.index).order().style("stroke-opacity",De.opacity.default);return}t.parent.selectAll("path.link").transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(a){return r.some(o=>o===a.index)?(D(this).classed("link-hovered",!0).raise(),De.opacity.selected):De.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=Li(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}`),d=Li(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.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(w.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(w.Alluvial.NODE_MOUSEMOVE,{event:r,element:D(this),datum:i}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(w.Alluvial.NODE_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=Li(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",De.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Li(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(w.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(s=>(r.push(s.index),s[t.node])).forEach(s=>this.traverse(t,s,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 Mr(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 Mr(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=A.appendOrSelect(i,`div.${ee}--${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=Sn(x(t,"detail","event"),n);else{const h=x(i,"zoomBar","top","type"),f=ce.height[h];s&&(a[1]+=f+ce.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=Ht.LEFT:a[0]/o<.1?c=Ht.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[Ht.RIGHT,Ht.LEFT,Ht.TOP,Ht.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=zD;c===Ht.LEFT&&(u*=-1);const d=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,d)}}class rk extends on{zoomIn(t,n,r){let i,s,a;const o=r||wr;t&&(i=t.x,s=t.y,a=2);const{width:l,height:c}=A.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(w.CanvasZoom.CANVAS_ZOOM_IN,{element:D(t)})}zoomOut(t,n){const r=n||wr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(w.CanvasZoom.CANVAS_ZOOM_OUT)}}class ik extends on{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 sk extends on{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 Vi extends on{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:Vi.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}}class ak extends on{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(w.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(eg,n,"duration")||eg.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Le{constructor(t,n){this.components=[],this.services={canvasZoom:rk,domUtils:A,events:ik,files:sk,gradientUtils:Vi,transitions:ak},this.model=new Ge(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(w.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(w.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(a=>a));Promise.all(r).then(()=>this.services.events.dispatchEvent(w.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 zc(this.model,this.services)],growth:nt.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new nk(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new Bi(this.model,this.services)],growth:nt.STRETCH},c={id:"toolbar",components:[new Ta(this.model,this.services)],growth:nt.PREFERRED},u={id:"header",components:[new he(this.model,this.services,[l,...i?[c]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},d={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:x(n,"graphFrameRenderType")||Z.SVG},h=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=bt.COLUMN;if(h){const m=x(r,"legend","position");m==="left"?(f=bt.ROW,r.legend.orientation||(r.legend.orientation=Sr.VERTICAL)):m==="right"?(f=bt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Sr.VERTICAL)):m==="bottom"&&(f=bt.COLUMN_REVERSE)}const p={id:"spacer",components:[new ln(this.model,this.services)],growth:nt.PREFERRED},g={id:"full-frame",components:[new he(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:nt.STRETCH},v=[];if(o||i){v.push(u);const m={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};v.push(m)}return v.push(g),[new Wc(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,v,{direction:bt.COLUMN})]}}class Wn extends Ge{constructor(t){super(t),this.axisFlavor=Di.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===j.TIME&&(u=h=>Mr(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...l?[l.label]:[]],...t.map(h=>[h[r],h[s.identifier]===null?"–":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"–":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"–":h[o.identifier]]:[],...l?[h[l.identifier]===null||isNaN(h[l.identifier])?"–":h[l.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),x(this.getOptions(),"zoomBar",F.TOP,"enabled"))){const r=x(this.getOptions(),"zoomBar",F.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(tn(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=Oi(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(d=>{d[s].getTime()===l&&(c+=d[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(F).forEach(i=>{const s=F[i],a=n.axes[s];if(a&&a.scaleType===j.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}}class ok extends Wn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();return t.sort((r,i)=>r.source.localeCompare(i.source)),[["Source","Target","Value"],...t.map(r=>[r.source,r.target,r.value])]}}function lm(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 lk(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 Yc(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 ck(e){return e.depth}function uk(e,t){return t-1-e.height}function cm(e,t){return e.sourceLinks.length?e.depth:t-1}function $a(e){return function(){return e}}function um(e,t){return Pa(e.source,t.source)||e.index-t.index}function hm(e,t){return Pa(e.target,t.target)||e.index-t.index}function Pa(e,t){return e.y0-t.y0}function qc(e){return e.value}function hk(e){return e.index}function dk(e){return e.nodes}function fk(e){return e.links}function dm(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function fm({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 pk(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=hk,l=cm,c,u,d=dk,h=fk,f=6;function p(){const O={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(O),v(O),m(O),y(O),_(O),fm(O),O}p.update=function(O){return fm(O),O},p.nodeId=function(O){return arguments.length?(o=typeof O=="function"?O:$a(O),p):o},p.nodeAlign=function(O){return arguments.length?(l=typeof O=="function"?O:$a(O),p):l},p.nodeSort=function(O){return arguments.length?(c=O,p):c},p.nodeWidth=function(O){return arguments.length?(i=+O,p):i},p.nodePadding=function(O){return arguments.length?(s=a=+O,p):s},p.nodes=function(O){return arguments.length?(d=typeof O=="function"?O:$a(O),p):d},p.links=function(O){return arguments.length?(h=typeof O=="function"?O:$a(O),p):h},p.linkSort=function(O){return arguments.length?(u=O,p):u},p.size=function(O){return arguments.length?(e=t=0,n=+O[0],r=+O[1],p):[n-e,r-t]},p.extent=function(O){return arguments.length?(e=+O[0][0],n=+O[1][0],t=+O[0][1],r=+O[1][1],p):[[e,t],[n,r]]},p.iterations=function(O){return arguments.length?(f=+O,p):f};function g({nodes:O,links:U}){for(const[N,B]of O.entries())B.index=N,B.sourceLinks=[],B.targetLinks=[];const P=new Map(O.map((N,B)=>[o(N,B,O),N]));for(const[N,B]of U.entries()){B.index=N;let{source:Y,target:X}=B;typeof Y!="object"&&(Y=B.source=dm(P,Y)),typeof X!="object"&&(X=B.target=dm(P,X)),Y.sourceLinks.push(B),X.targetLinks.push(B)}if(u!=null)for(const{sourceLinks:N,targetLinks:B}of O)N.sort(u),B.sort(u)}function v({nodes:O}){for(const U of O)U.value=U.fixedValue===void 0?Math.max(Yc(U.sourceLinks,qc),Yc(U.targetLinks,qc)):U.fixedValue}function m({nodes:O}){const U=O.length;let P=new Set(O),N=new Set,B=0;for(;P.size;){for(const Y of P){Y.depth=B;for(const{target:X}of Y.sourceLinks)N.add(X)}if(++B>U)throw new Error("circular link");P=N,N=new Set}}function y({nodes:O}){const U=O.length;let P=new Set(O),N=new Set,B=0;for(;P.size;){for(const Y of P){Y.height=B;for(const{source:X}of Y.targetLinks)N.add(X)}if(++B>U)throw new Error("circular link");P=N,N=new Set}}function b({nodes:O}){const U=lm(O,B=>B.depth)+1,P=(n-e-i)/(U-1),N=new Array(U);for(const B of O){const Y=Math.max(0,Math.min(U-1,Math.floor(l.call(null,B,U))));B.layer=Y,B.x0=e+Y*P,B.x1=B.x0+i,N[Y]?N[Y].push(B):N[Y]=[B]}if(c)for(const B of N)B.sort(c);return N}function S(O){const U=lk(O,P=>(r-t-(P.length-1)*a)/Yc(P,qc));for(const P of O){let N=t;for(const B of P){B.y0=N,B.y1=N+B.value*U,N=B.y1+a;for(const Y of B.sourceLinks)Y.width=Y.value*U}N=(r-N+a)/(P.length+1);for(let B=0;B<P.length;++B){const Y=P[B];Y.y0+=N*(B+1),Y.y1+=N*(B+1)}L(P)}}function _(O){const U=b(O);a=Math.min(s,(r-t)/(lm(U,P=>P.length)-1)),S(U);for(let P=0;P<f;++P){const N=Math.pow(.99,P),B=Math.max(1-N,(P+1)/f);M(U,N,B),E(U,N,B)}}function E(O,U,P){for(let N=1,B=O.length;N<B;++N){const Y=O[N];for(const X of Y){let J=0,ct=0;for(const{source:K,value:ut}of X.targetLinks){let rt=ut*(X.layer-K.layer);J+=R(K,X)*rt,ct+=rt}if(!(ct>0))continue;let W=(J/ct-X.y0)*U;X.y0+=W,X.y1+=W,T(X)}c===void 0&&Y.sort(Pa),C(Y,P)}}function M(O,U,P){for(let N=O.length,B=N-2;B>=0;--B){const Y=O[B];for(const X of Y){let J=0,ct=0;for(const{target:K,value:ut}of X.sourceLinks){let rt=ut*(K.layer-X.layer);J+=k(X,K)*rt,ct+=rt}if(!(ct>0))continue;let W=(J/ct-X.y0)*U;X.y0+=W,X.y1+=W,T(X)}c===void 0&&Y.sort(Pa),C(Y,P)}}function C(O,U){const P=O.length>>1,N=O[P];I(O,N.y0-a,P-1,U),G(O,N.y1+a,P+1,U),I(O,r,O.length-1,U),G(O,t,0,U)}function G(O,U,P,N){for(;P<O.length;++P){const B=O[P],Y=(U-B.y0)*N;Y>1e-6&&(B.y0+=Y,B.y1+=Y),U=B.y1+a}}function I(O,U,P,N){for(;P>=0;--P){const B=O[P],Y=(B.y1-U)*N;Y>1e-6&&(B.y0-=Y,B.y1-=Y),U=B.y0-a}}function T({sourceLinks:O,targetLinks:U}){if(u===void 0){for(const{source:{sourceLinks:P}}of U)P.sort(hm);for(const{target:{targetLinks:P}}of O)P.sort(um)}}function L(O){if(u===void 0)for(const{sourceLinks:U,targetLinks:P}of O)U.sort(hm),P.sort(um)}function R(O,U){let P=O.y0-(O.sourceLinks.length-1)*a/2;for(const{target:N,width:B}of O.sourceLinks){if(N===U)break;P+=B+a}for(const{source:N,width:B}of U.targetLinks){if(N===O)break;P-=B}return P}function k(O,U){let P=U.y0-(U.targetLinks.length-1)*a/2;for(const{source:N,width:B}of U.targetLinks){if(N===O)break;P+=B+a}for(const{target:N,width:B}of O.sourceLinks){if(N===U)break;P-=B}return P}return p}var Xc=Math.PI,jc=2*Xc,Yn=1e-6,gk=jc-Yn;function Zc(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pm(){return new Zc}Zc.prototype=pm.prototype={constructor:Zc,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,d=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(d>Yn)if(!(Math.abs(u*o-l*c)>Yn)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,f=r-a,p=o*o+l*l,g=h*h+f*f,v=Math.sqrt(p),m=Math.sqrt(d),y=i*Math.tan((Xc-Math.acos((p+d-g)/(2*v*m)))/2),b=y/m,S=y/v;Math.abs(b-1)>Yn&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>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,d=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)>Yn||Math.abs(this._y1-c)>Yn)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%jc+jc),d>gk?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>Yn&&(this._+="A"+n+","+n+",0,"+ +(d>=Xc)+","+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 gm(e){return function(){return e}}function mk(e){return e[0]}function vk(e){return e[1]}var yk=Array.prototype.slice;function xk(e){return e.source}function bk(e){return e.target}function Ek(e){var t=xk,n=bk,r=mk,i=vk,s=null;function a(){var o,l=yk.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=pm()),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:gm(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:gm(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function Sk(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function _k(){return Ek(Sk)}function wk(e){return[e.source.x1,e.y0]}function Ok(e){return[e.target.x0,e.y1]}function Tk(){return _k().source(wk).target(Ok)}class Mk extends lt{constructor(){super(...arguments),this.type="alluvial",this.renderType=Z.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}=A.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=De.minNodePadding;s.alluvial.nodePadding>De.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=cm;c===It.LEFT?u=ck:c===It.RIGHT&&(u=uk);const d=pk().nodeId(m=>m.name).nodeWidth(De.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(m=>Object.assign({},m)),links:a.map(m=>Object.assign({},m))}),this.graph.nodes=this.graph.nodes.filter(m=>m.value!==0);const h={};this.graph.nodes.forEach(m=>{const y=m.x0;m.category&&(h[y]=m==null?void 0:m.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",m=>`translate(${m}, 0)`).append("text").attr("id",(m,y)=>this.services.domUtils.generateElementIDString(`alluvial-category-${y}`)).style("font-size","14px").text(m=>h[m]?h[m]:"").attr("y",20).attr("x",(m,y)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-category-${y}`),{width:S}=A.getSVGElementSize(D(`text#${b}`),{useBBox:!0});let _=0;return m+_>=S&&(_=-S+4),_});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const m=x(this.getOptions(),"color","scale");m&&p.enter().append("linearGradient").attr("id",y=>`${this.gradient_id}-link-${y.index}`).attr("gradientUnits","userSpaceOnUse").call(y=>y.append("stop").attr("offset","0%").attr("stop-color",b=>m[b.source.name])).call(y=>y.append("stop").attr("offset","100%").attr("stop-color",b=>m[b.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",Tk()).attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-line-${m.index}`)).attr("class",m=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:m.source.index,originalClassName:"link"})).style("stroke",m=>o?`url(#${this.gradient_id}-link-${m.index})`:this.model.getFillColor(m.source.name)).attr("stroke-width",m=>Math.max(1,m.width)).style("stroke-opacity",De.opacity.default).attr("aria-label",m=>`${m.source.name} → ${m.target.name} (${m.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const g=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-${m.index}`)).classed("node-group",!0).attr("transform",m=>`translate(${m.x0}, ${m.y0})`);g.append("rect").classed("node",!0).attr("height",m=>m.y1-m.y0).attr("width",m=>m.x1-m.x0).attr("fill","black");const v=g.append("g").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${m.index}`));v.append("text").attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${m.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(m=>`${m.name} (${m.value})`).attr("aria-label",m=>`${m.name} (${m.value})`),v.append("rect").classed("node-text-bg",!0).attr("width",(m,y)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${y}`),{width:S}=A.getSVGElementSize(D(`text#${b}`),{useBBox:!0});return S+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(m,y)=>{const b=this.services.domUtils.generateElementIDString(`alluvial-node-text-${y}`),{width:S}=A.getSVGElementSize(D(`text#${b}`),{useBBox:!0}),_=(m.y1-m.y0)/2-9;let E=m.x1-m.x0;return m.x1>=S?E=E-(S+16):E+=4,`translate(${E}, ${_})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=ua((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",De.opacity.default)):a.style("stroke-opacity",function(){return i===this?(D(this).raise(),De.opacity.selected):De.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(w.Alluvial.LINE_MOUSEOVER,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(w.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(w.Alluvial.LINE_MOUSEMOVE,{event:i,element:D(this),datum:s}),n.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,s){n.services.events.dispatchEvent(w.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(w.Alluvial.LINE_MOUSEOUT,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(w.Tooltip.HIDE,{event:i,hoveredElement:a})})}addNodeEventListener(){const t=this,n=ua((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,a=>a.index).order().style("stroke-opacity",De.opacity.default);return}t.parent.selectAll("path.link").transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(a){return r.some(o=>o===a.index)?(D(this).classed("link-hovered",!0).raise(),De.opacity.selected):De.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=Li(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}`),d=Li(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.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(w.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(w.Alluvial.NODE_MOUSEMOVE,{event:r,element:D(this),datum:i}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(w.Alluvial.NODE_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){const s=D(this),a=Li(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",De.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=Li(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(w.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(s=>(r.push(s.index),s[t.node])).forEach(s=>this.traverse(t,s,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 Lk extends Le{constructor(t,n){super(t,n),this.model=new uk(this.services),this.model.setOptions(Ct(Et.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Dk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ym=class Va extends lt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=Z.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=A.appendOrSelect(n,"svg.chart-grid-backdrop"),s=A.appendOrSelect(i,`g.${this.type}`),a=A.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=A.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=A.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===j.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=_=>{const E=_[1]-_[0];let M="0,"+E.toString();const C=Math.floor(l/Va.DASH_LENGTH),G=C*Va.DASH_LENGTH;for(let I=0;I<C;I++)M+=","+Va.DASH_LENGTH;M+=","+(l-G),C%2===1&&(M+=",0"),M+=","+E.toString(),M+=","+l.toString(),f.attr("stroke-dasharray",M)},v=_=>{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),g(E))},m=(_,E)=>{const M=Ud().range([0,o]).domain(p);let C=[M.invert(_),M.invert(E)];C[0].valueOf()===C[1].valueOf()&&(C=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==C[0].valueOf()||p[1].valueOf()!==C[1].valueOf())&&this.services.zoom.handleDomainChange(C)};let y;const b=_=>{const E=_.selection;E!==null&&(m(E[0],E[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=eh().extent([[0,0],[o-1,l]]).on("start brush end",v).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(),M=Sn(s.node(),E)[0];let C=M-o*S/2;C<0&&(C=0);let G=M+o*S/2;G>o&&(G=o),m(C,G)}})}}};ym.DASH_LENGTH=4;let Rk=ym;class Ik extends lt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=Z.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=eh(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(w.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",F.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(F.TOP),i=this.services.zoom.isZoomBarLocked(F.TOP),s=x(this.getOptions(),"zoomBar",F.TOP,"type"),a=x(this.getOptions(),"axes",F.BOTTOM,"highlights"),o=ce.height[s],{width:l}=A.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 d=A.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(A.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",ce.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ae.GRAPH_VIEW?A.appendOrSelect(d,"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===Ae.SLIDER_VIEW&&A.appendOrSelect(d,"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(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===j.TIME){let v=this.services.zoom.getZoomBarData();if(Ce(v)||v.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const m=this.services.zoom.getDefaultZoomBarDomain(v);v=this.compensateDataForDefaultDomain(v,m);const y=this.model.get("initialZoomDomain"),b=x(this.getOptions(),"zoomBar",F.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:tt([],b),zoomDomain:b?tt([],b):m},{skipUpdate:!0}):b===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:tt([],m)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(m),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(be(v,E=>E.value));const S=this.model.get("zoomDomain");if(s===Ae.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",v,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",v,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const E=a.highlightStartMapsTo,M=a.highlightEndMapsTo,C=a.color,G=a.labelMapsTo;a.data.forEach((I,T)=>{A.appendOrSelect(d,`rect.highlight-${T}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(I[E])).attr("width",this.xScale(I[M])-this.xScale(I[E])).style("fill",C&&C.scale[I[G]]?C.scale[I[G]]:null).style("fill-opacity",.1).style("stroke",C&&C.scale[I[G]]?C.scale[I[G]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(S,c,l);const _=A.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(M=>this.xScale(M));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",F.TOP,"type"),a=ce.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=w.ZoomBar.SELECTION_START:t.type==="brush"?a=w.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=w.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(w.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=ce.handleWidth,s=x(this.getOptions(),"zoomBar",F.TOP,"type"),a=ce.height[s],o=-i/2,l=ce.handleBarWidth,c=s===Ae.GRAPH_VIEW?ce.handleBarHeight:6,u=-l/2,d=(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 h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.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",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ae.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",F.TOP,"type"),r=ce.height[n],s=this.getComponentContainer().select("svg.zoom-container");A.appendOrSelect(s,"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=(m,y,b)=>S=>s.getValueFromScale(m,y,b,S),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=x(this.getOptions(),"zoomBar",F.TOP,"type"),p=ce.height[f],g=fl().x(m=>d(m)).y0(p).y1(m=>p-h(m)),v=A.appendOrSelect(t,n).datum(r).attr("d",g);i&&v.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=A.appendOrSelect(t,"clipPath").attr("id",n);A.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=tn(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",F.TOP,"type"),a=ce.height[s],o=di()([[n,a],[r,a]]);A.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),A.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),x(this.getOptions(),"zoomBar",F.TOP,"type")===Ae.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(w.ZoomBar.UPDATE,this.render.bind(this))}}class kk extends lt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=Z.SVG,this.positionService=new ka}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(F).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&r.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const s=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,v=null;h===F.LEFT||h===F.RIGHT?(v=f,g=d.services.cartesianScales.getMainXScale()):(g=f,v=d.services.cartesianScales.getMainYScale());const m=p===j.LABELS,[y,b]=g.range(),[S,_]=v.range(),{cartesianScales:E}=d.services,M=E.getOrientation(),C=R=>E.getDomainValue(R),G=R=>E.getRangeValue(R),[I,T]=sn(C,G,M),L=D(this);h===F.TOP||h===F.BOTTOM?(L.selectAll("line.threshold-line").transition().call(R=>d.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",_).attr("y2",S).attr("x1",({datum:R})=>I(R)+(m?f.step()/2:0)).attr("x2",({datum:R})=>I(R)+(m?f.step()/2:0)).style("stroke",({fillColor:R})=>R),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-I(R)).attr("width",Math.abs(S-_)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(R=>d.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",y).attr("x2",b).attr("y1",({datum:R})=>T(R)+(m?f.step()/2:0)).attr("y2",({datum:R})=>T(R)+(m?f.step()/2:0)).style("stroke",({fillColor:R})=>R),L.selectAll("rect.threshold-hoverable-area").attr("x",y).attr("y",({datum:R})=>T(R)).attr("width",Math.abs(b-y)).classed("rotate",!1))}),this.services.events.addEventListener(w.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(w.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)===j.TIME){const a=[F.LEFT,F.RIGHT].includes(r),o=this.services.cartesianScales.getMainXScale(),l=this.services.cartesianScales.getMainYScale(),c=a?l:o,u=x(i,"timeScale"),d=_c(c.ticks(),x(u,"timeInterval"));return Sc(n,0,c.ticks(),d,u)}return n.toLocaleString("en")}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=A.appendOrSelect(t,`div.${ee}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Sn(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,[Ht.RIGHT,Ht.LEFT,Ht.TOP,Ht.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(r){D(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(w.Threshold.SHOW,{event:r,hoveredElement:D(this),datum:D(this).datum()})}).on("mouseout",function(r){D(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(w.Threshold.HIDE,{event:r,hoveredElement:D(this),datum:D(this).datum()})})}}class $k extends lt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=Z.SVG,this.positionService=new ka,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(F).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&r.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,v]=f.range(),[m,y]=p.range(),{cartesianScales:b}=d.services,S=b.getOrientation(),_=I=>b.getDomainValue(I),E=I=>b.getRangeValue(I),[M,C]=sn(_,E,S),G=D(this);h===F.TOP||h===F.BOTTOM?G.selectAll("rect.highlight-bar").transition().call(I=>d.services.transitions.setupTransition({transition:I,name:"highlight-bar-update",animate:t})).attr("y",Math.max(y+d.highlightStrokeWidth,0)).attr("height",Math.max(m-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:I,...T})=>M(T[I])).attr("width",({highlightStartMapsTo:I,highlightEndMapsTo:T,...L})=>Math.max(M(L[T])-M(L[I]),0)).style("stroke",({color:I,labelMapsTo:T,...L})=>I&&I.scale[L[T]]?I.scale[L[T]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:I,labelMapsTo:T,...L})=>I&&I.scale[L[T]]?I.scale[L[T]]:null):G.selectAll("rect.highlight-bar").transition().call(I=>d.services.transitions.setupTransition({transition:I,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(v-g,0)).attr("y",({highlightEndMapsTo:I,...T})=>C(T[I])).attr("height",({highlightStartMapsTo:I,highlightEndMapsTo:T,...L})=>Math.max(C(L[I])-C(L[T]),0)).style("stroke",({color:I,labelMapsTo:T,...L})=>I&&I.scale[L[T]]?I.scale[L[T]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:I,labelMapsTo:T,...L})=>I&&I.scale[L[T]]?I.scale[L[T]]:null)})}}class xm extends Wc{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!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 d;if(n.length===1){const h=n[0],f=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:r.tooltip.groupLabel,value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&x(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:St(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}class Pk extends on{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){const r=this.getAxisOptions(t).title;return r||(t===F.BOTTOM||t===F.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(F).map(n=>F[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}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===F.LEFT||this.rangeAxisPosition===F.RIGHT)&&(this.domainAxisPosition===F.BOTTOM||this.domainAxisPosition===F.TOP)?this.orientation=Nt.VERTICAL:this.orientation=Nt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=x(t,"axes");((r=n[F.LEFT])!=null&&r.correspondingDatasets&&n[F.RIGHT]||(i=n[F.RIGHT])!=null&&i.correspondingDatasets&&n[F.LEFT]||(s=n[F.TOP])!=null&&s.correspondingDatasets&&n[F.BOTTOM]||(a=n[F.BOTTOM])!=null&&a.correspondingDatasets&&n[F.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]===j.LINEAR||this.scaleTypes[t]===j.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=[F.BOTTOM,F.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[F.LEFT,F.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(),o=x(s,"axes")[r],{mapsTo:l}=o,c=x(i,l)!==null?i[l]:i;let u;switch(n){case j.LABELS:u=t(c)+t.step()/2;break;case j.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),o=x(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(x(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}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===j.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return Nk(n,s)}else return Uk(n,fn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,F.LEFT)===null&&x(n,F.RIGHT)!==null||x(n,F.RIGHT,"main")===!0||r&&x(n,F.LEFT,"correspondingDatasets")?{primary:F.RIGHT,secondary:F.LEFT}:{primary:F.LEFT,secondary:F.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,F.BOTTOM)===null&&x(n,F.TOP)!==null||x(n,F.TOP,"main")===!0||r&&x(n,F.BOTTOM,"correspondingDatasets")?{primary:F.TOP,secondary:F.BOTTOM}:{primary:F.BOTTOM,secondary:F.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||j.LINEAR,o=s.scaleType||j.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===j.LABELS||o===j.TIME)&&a===j.LABELS||a===j.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")||j.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:m}=this.model.getBinConfigurations();return[0,En(m,y=>y.length)]}else if(r.limitDomainToBins){const{bins:m}=this.model.getBinConfigurations(),y=this.model.getStackKeys({bins:m});return[y[0].split("-")[0],y[y.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=fn.ratio;if(r.domain)return a===j.LABELS?r.domain:(a===j.TIME&&(r.domain=r.domain.map(m=>m.getTime===void 0?new Date(m):m)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===j.LABELS)return Oi(o.map(m=>m[c]));let p,g;const v=this.model.getDataGroupNames();if(a===j.LABELS_RATIO)return o.map(m=>`${m[h]}/${m[f]}`);if(a===j.TIME)g=o.map(m=>+new Date(m[c]));else if(i&&n.axes)g=[],o.forEach(m=>{g.push(m[c]),m[i.upperBoundMapsTo]&&g.push(m[i.upperBoundMapsTo]),m[i.lowerBoundMapsTo]&&g.push(m[i.lowerBoundMapsTo])});else if(r.stacked===!0&&v&&t===this.getRangeAxisPosition()){const{groupMapsTo:m}=n.data,y=this.model.getDataValuesGroupedByKeys({groups:v}),b=o.filter(_=>!v.includes(_[m])),S=[];y.forEach(_=>{const{...E}=_;let M=0,C=0;Object.values(E).forEach(G=>{isNaN(G)||(G<0?C+=G:M+=G)}),S.push([C,M])}),g=[...Pf(S),...b.map(_=>_[c])]}else g=[],o.forEach(m=>{const y=m[c];Array.isArray(y)&&y.length===2?(g.push(y[0]),g.push(y[1])):(l&&g.push(Math.max(m[c],m[l])),g.push(y))});return a!==j.TIME&&a!==j.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(m=>{const y=x(m,"value");y!==null&&g.push(y)}),p=be(g),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")||j.LINEAR;this.scaleTypes[t]=i;let s;return i===j.TIME?s=Ud():i===j.LOG?s=xd().base(r.base||10):i===j.LABELS||i===j.LABELS_RATIO?s=si():s=Oe(),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((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===j.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 Nk(e,t){const n=new Date(e[0]),r=new Date(e[1]);return mL(r,n)>1?[OR(n,t),og(r,t)]:gL(r,n)>1?[_R(n,t),pc(r,t)]:cL(r,n)>1?[SR(n,t),ig(r,t)]:hL(r,n)>1?[wR(n,t),sg(r,t)]:ug(r,n)>30?[bg(n,t*30),mc(r,t*30)]:ug(r,n)>1?[bg(n,t),mc(r,t)]:hg(r,n)>15?[Eg(n,t*15),vc(r,t*15)]:hg(r,n)>1?[Eg(n,t),vc(r,t)]:[n,r]}function Uk([e,t],n,r){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(r===j.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class Bk extends on{constructor(){super(...arguments),this.curveTypes={curveLinear:zs,curveLinearClosed:Kd,curveBasis:JS,curveBasisClosed:t_,curveBasisOpen:e_,curveBundle:n_,curveCardinal:r_,curveCardinalClosed:i_,curveCardinalOpen:s_,curveCatmullRom:a_,curveCatmullRomClosed:o_,curveCatmullRomOpen:l_,curveMonotoneX:c_,curveMonotoneY:u_,curveNatural:h_,curveStep:d_,curveStepAfter:p_,curveStepBefore:f_}}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 Vk extends on{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===F.BOTTOM&&n===j.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,be(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(w.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=x(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const o=i.stacked?"sharedStackKey":(a=this.services.cartesianScales)==null?void 0:a.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=r[0]&&new Date(c[o])<=r[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var f;const n=this.model.get("zoomDomain"),r=ce.handleWidth,i=(f=this.services.cartesianScales)==null?void 0:f.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-r/2,d=a-l/2+r/2);const h=[i.invert(u),i.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}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")}}class re extends Le{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:Pk,curves:Bk,zoom:Vk}),this.model=new Wn(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",F.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===F.BOTTOM&&o===j.TIME,c=this.services.zoom.isZoomBarLocked(F.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Bi(this.model,this.services)],growth:nt.STRETCH},h={id:"toolbar",components:[new Ta(this.model,this.services)],growth:nt.PREFERRED},f={id:"header",components:[new he(this.model,this.services,[d,...s?[h]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},p={id:"legend",components:[new zc(this.model,this.services)],growth:nt.PREFERRED};l&&!c&&t.push(new om(this.model,this.services),new Rk(this.model,this.services)),t.push(new kk(this.model,this.services)),t.push(new $k(this.model,this.services));const g={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},v=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let m=bt.COLUMN;if(v){const E=x(this.model.getOptions(),"legend","position");E===Er.LEFT?(m=bt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Sr.VERTICAL)):E===Er.RIGHT?(m=bt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Sr.VERTICAL)):E===Er.BOTTOM&&(m=bt.COLUMN_REVERSE)}const y={id:"spacer",components:[new ln(this.model,this.services)],growth:nt.PREFERRED},b={id:"full-frame",components:[new he(this.model,this.services,[...v?[p]:[],...v?[y]:[],g],{direction:m})],growth:nt.STRETCH},S={id:"zoom-bar",components:[new Ik(this.model,this.services)],growth:nt.PREFERRED,renderType:Z.SVG},_=[];if(u||s){_.push(f);const E={id:"spacer",components:[new ln(this.model,this.services,s?{size:15}:void 0)],growth:nt.PREFERRED};_.push(E)}return l&&_.push(S),_.push(b),[new xm(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,_,{direction:bt.COLUMN})]}}class de extends lt{constructor(){super(...arguments),this.type="grid",this.renderType=Z.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&&(A.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(A.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=qa(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=x(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=x(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=au(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=x(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=x(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(rn(u).tx)-Number(rn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+rn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+rn(o).tx;else if(o)l=+rn(o).tx-+rn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=A.getSVGElementSize(u).width-+rn(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 a=rn(this),o={min:Number(a.tx)-r,max:Number(a.tx)+r};return o.min<=t[0]&&t[0]<=o.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=A.appendOrSelect(r,"svg.chart-grid-backdrop");const u=A.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 bm extends lt{constructor(){super(...arguments),this.type="area",this.renderType=Z.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?en.opacity.unselected:en.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",en.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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=fl().curve(this.services.curves.getD3Curve()).defined(_=>{const E=s.getRangeIdentifier(),M=_[E];return M!=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 d=0;const h=(_,E)=>{x(r,"axes",_,"includeZero")===!1&&E[0]>0&&E[1]>0&&(d=E[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(d),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Nt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const g=x(r,"color","gradient","enabled"),v=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const m=n.selectAll("path.area").data(l,_=>_.name),y=D(this.services.domUtils.getMainContainer());if(m.exit().attr("opacity",0).remove(),!l.length)return;if(v){const _=y.select(`path.${this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:l[0].name})}`).node();let E;if(_)E=getComputedStyle(_,null).getPropertyValue("stroke");else{const M=x(this.model.getOptions(),"color","scale");if(M!==null){const C=Object.keys(M);E=M[C[0]]}}Vi.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:Vi.getStops(i,E)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const b=this,S=m.enter().append("path");v?S.merge(m).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:E}=_;return o(E)}):(S.attr("opacity",0).merge(m).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.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:en.opacity.selected).attr("d",_=>{const{data:E}=_;return o(E)}),u&&S.attr("fill-opacity",en.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Lr extends lt{constructor(){super(...arguments),this.type="line",this.renderType=Z.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?nn.opacity.unselected:nn.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",nn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=sn(s,a,r.getOrientation()),c=this.getOptions(),u=di().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),v=p[g];return v!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(m=>c.axes[m].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(m=>{const y=this.services.cartesianScales.getDomainIdentifier(m),b=this.services.cartesianScales.getRangeIdentifier(m);return{name:x(m,0,g),data:m.map(S=>({[y]:S.data.sharedStackKey,[g]:S[g],[b]:S[1]})),hidden:!UD(m,S=>S[0]!==S[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name)).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(v=>{const m=this.services.cartesianScales.getRangeIdentifier(v);return v[m]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:g}=p;return u(g)})}destroy(){const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Em=5;function Gk(e,t){return e>t-Em&&e<t+Em}class mn extends lt{constructor(){super(...arguments),this.type="ruler",this.renderType=Z.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===Nt.HORIZONTAL?r:n,d=A.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=A.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(v=>({domainValue:this.services.cartesianScales.getDomainValue(v),originalData:v})).filter(v=>Gk(v.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(v=>v.domainValue).join()===this.pointsWithinLine.map(v=>v.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(w.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((v,m)=>{if(v.length===0)return v.push(m),v;const y=v[0].domainValue,b=Math.abs(u-m.domainValue),S=Math.abs(u-y);return b>S||(b<S?v=[m]:v.push(m)),v},[]);if(g.length>0){const v=g.map(S=>S.originalData).filter(S=>{const _=this.services.cartesianScales.getRangeIdentifier(S),E=S[_];return E!=null}),m=g.map(S=>S.domainValue),y=f.filter(S=>{const _=this.services.cartesianScales.getDomainValue(S);return m.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!zp(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(w.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(v)}),d.attr("opacity",1);const b=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",b.domainValue).attr("y2",b.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",b.domainValue).attr("x2",b.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=A.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(w.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=Sn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=XD(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=A.appendOrSelect(t,"svg.chart-grid-backdrop")}}class He extends lt{constructor(){super(...arguments),this.type="scatter",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(w.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(w.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 r=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.selectAll("circle.dot").data(this.getScatterData(),d=>`${d[s]}-${d[o]}`);l.exit().attr("opacity",0).remove();const u=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(u,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]=sn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=sn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),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,d]=sn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),v=this.model.getIsFilled(f[o],f[p],f,i)?[Q.FILL,Q.STROKE]:[Q.STROKE];return this.model.getColorClassName({classNameTypes:v,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",d).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",h?0:1).attr("role",st.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 a,o;const s=D(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:l[n],originalClassName:s.attr("class")})).style("fill",l=>{var u;const c=(u=t.services.cartesianScales)==null?void 0:u.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),(a=t.services.events)==null||a.dispatchEvent(w.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(w.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=D(this);(a=t.services.events)==null||a.dispatchEvent(w.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(w.Scatter.SCATTER_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=D(this);if(s.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);s.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(o=t.services.events)==null||o.dispatchEvent(w.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:s})})}destroy(){var n;(n=this.parent)==null||n.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(w.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(w.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Sm extends lt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=Z.SVG,this.truncation={[F.LEFT]:!1,[F.RIGHT]:!1,[F.TOP]:!1,[F.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}=A.getSVGElementSize(s,{useAttrs:!0}),l=A.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===F.BOTTOM||n===F.TOP?(c=this.configs.axes[F.LEFT]?this.margins.left:0,u=this.configs.axes[F.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 d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===j.LABELS||this.scaleType===j.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case F.LEFT:h=au;break;case F.BOTTOM:h=qa;break;case F.RIGHT:h=Ev;break;case F.TOP:h=bv;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=A.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${st.GRAPHICS_OBJECT} ${st.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=A.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),v=x(r,"axes",n),m=this.scaleType===j.TIME||v.scaleType===j.TIME,y=n===F.LEFT||n===F.RIGHT,b=this.model.get("zoomDomain");if(b&&m&&!y&&d.domain(b),!i){p.attr("aria-hidden",!0);return}const S=x(v,"scaleType"),_=x(r,"data","loading"),E=x(v,"ticks","number"),M=x(v,"ticks","values"),C=x(v,"truncation","type"),G=x(v,"truncation","threshold"),I=x(v,"truncation","numCharacter"),T=E!==null,L=x(r,"timeScale"),R=A.appendOrSelect(g,"g.tick"),k=A.appendOrSelect(R,"text").text("0"),O=A.getSVGElementSize(k.node(),{useBBox:!0}).height;R.remove();const U=this.scaleType||v.scaleType||j.LINEAR,P=h(d).tickSizeOuter(0);if(d.ticks){let W;if(T?W=E:(W=fn.ticks.number,y&&(W=this.getNumberOfFittingTicks(o,O,fn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(W=0),P.ticks(W),m)if(!d.ticks(W).length)P.tickValues([]);else{const K=x(r,"timeScale","addSpaceOnEdges"),ut=x(r,"axes",n,"domain"),rt=d.copy();K&&!ut&&rt.nice(W);const Tt=rt.ticks(W);K&&Tt.length>2&&!ut&&(Tt.splice(Tt.length-1,1),Tt.splice(0,1)),P.tickValues(Tt)}}let N;const B=x(v,"ticks","formatter");if(m){const W=_c(P.tickValues(),x(r,"timeScale","timeInterval"));B===null?N=(K,ut)=>Sc(K,ut,P.tickValues(),W,L):N=(K,ut)=>{const rt=Sc(K,ut,P.tickValues(),W,L);return B(K,ut,rt)}}else B===null?U===j.LINEAR&&(N=W=>W.toLocaleString()):N=B;P.tickFormat(N);const[Y,X]=this.services.cartesianScales.getScaleByPosition(n).domain();let J;if(M){if(m)M.forEach((W,K)=>{W.getTime===void 0&&(M[K]=new Date(W))}),J=M.filter(W=>{const K=W.getTime();return K>=new Date(Y).getTime()&&K<=new Date(X).getTime()});else if(S===j.LABELS){const W=this.services.cartesianScales.getScaleByPosition(n).domain();J=M.filter(K=>W.includes(K))}else J=M.filter(W=>W>=Y&&W<=X);P.tickValues(J)}switch(n){case F.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case F.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case F.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case F.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const ct=this.model.isDataEmpty();if(v.title){const W=A.appendOrSelect(l,"text.axis-title").html(ct||_?"":v.title),K=x(v,"titleOrientation");let ut;switch(n){case F.LEFT:K===fa.RIGHT?W.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):W.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case F.BOTTOM:W.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case F.RIGHT:K===fa.LEFT?W.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):W.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case F.TOP:ut=A.getSVGElementSize(W,{useBBox:!0}).height,W.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ut/2})`).style("text-anchor","middle");break}}if(m){const W=_c(P.tickValues(),x(r,"timeScale","timeInterval")),K=L.showDayName,ut=p;t&&(p=p.transition().call(Tt=>this.services.transitions.setupTransition({transition:Tt,name:"axis-update",animate:t}))),p=p.call(P),ut.selectAll(".tick").data(P.tickValues(),d).order().select("text").style("font-weight",(Tt,q)=>Dg(Tt,q,P.tickValues(),W,K)?"bold":"normal")}else!t||!f?p=p.call(P):p=p.transition().call(W=>this.services.transitions.setupTransition({transition:W,name:"axis-update",animate:t})).call(P);if(g.call(P),n===F.BOTTOM||n===F.TOP){let W=!1;const K=x(v,"ticks","rotation");if(K===Ci.ALWAYS)W=!0;else if(K===Ci.NEVER)W=!1;else if(!K||K===Ci.AUTO)if(d.step)W=g.selectAll("g.tick text").nodes().some(rt=>A.getSVGElementSize(rt,{useBBox:!0}).width>=d.step());else{W=!1;const ut=g.append("text").text("A"),rt=A.getSVGElementSize(ut.node(),{useBBox:!0}).width;let Tt;g.selectAll("g.tick").each(function(){const q=D(this),V=parseFloat(x(rn(this),"tx"));V!==null&&Tt+q.text().length*rt*.8>=V&&(W=!0),Tt=V}),ut.remove()}W?(T||(P.ticks(this.getNumberOfFittingTicks(a,O,fn.ticks.horizontalSpaceRatio)),g.call(P),p.call(P)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===F.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",W=>W),g.selectAll("g.tick").attr("aria-label",W=>W),C!==ve.NONE&&S===j.LABELS&&!M){const W=this.services.cartesianScales.getScaleDomain(n);if(W.length>0){const K=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(K);const ut=this;l.selectAll("g.tick text").data(W).text(function(rt){return rt.length>G?(ut.truncation[n]=!0,Ri(rt,C,I)):rt}),this.getInvisibleAxisRef().selectAll("g.tick text").data(W).text(function(rt){return rt.length>G?Ri(rt,C,I):rt}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(W)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=A.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(w.Axis.LABEL_MOUSEOVER,{event:c,element:D(this),datum:u}),a===j.LABELS&&u.length>o&&l.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,hoveredElement:D(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEMOVE,{event:c,element:D(this),datum:u}),a===j.LABELS&&u.length>o&&l.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOUT,{event:c,element:D(this),datum:u}),a===j.LABELS&&l.services.events.dispatchEvent(w.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 cp(i,2,fn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;A.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class Hk 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=A.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:d}=A.getSVGElementSize(c,{useBBox:!0}),h=A.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case F.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case F.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case F.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case F.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-fn.hover.rectanglePadding).attr("y",p).attr("width",u+fn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=A.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"),d=u.datum();l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===j.LABELS&&d.length>o&&l.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=D(this).select("text"),d=u.datum();l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(w.Axis.LABEL_CLICK,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOUT,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()}),a===j.LABELS&&l.services.events.dispatchEvent(w.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(w.Axis.LABEL_FOCUS,{event:{...c,...u},element:D(this),datum:D(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(w.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(w.Tooltip.HIDE),l.services.events.dispatchEvent(w.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})),n===F.LEFT||n===F.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;A.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 ie extends lt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=Z.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(F),i=x(this.getOptions(),"axes");r.forEach(o=>{i[F[o]]&&(n[F[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=F[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===Di.DEFAULT?new Sm(this.model,this.services,c):new Hk(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=A.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=A.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===F.LEFT||c===F.RIGHT)&&(f+=5)),c){case F.TOP:s.top=h+f;break;case F.BOTTOM:s.bottom=h+f;break;case F.LEFT:s.left=d+f;break;case F.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(w.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(w.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class Zt extends lt{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===kt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===kt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===kt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===kt.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===Nt.VERTICAL&&this.drawYGrid(t),n===Nt.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=Oe().domain([0,1]).range(t),this.yScale=Oe().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=A.getSVGElementSize(n,{useAttrs:!0});this.backdrop=A.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=A.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=A.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=A.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}=A.getSVGElementSize(i,{useAttrs:!0}),o=A.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=x(this.getOptions(),l,"alignment");A.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=hi().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(wt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=A.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).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+wt.xOffset;c===It.CENTER?p=s/2:c===It.RIGHT&&(p=s-t-wt.xOffset);const g=t+wt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=A.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+wt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=A.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=A.appendOrSelect(o,"defs").lower(),h=A.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
|
|
75
|
+
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Ck extends Le{constructor(t,n){super(t,n),this.model=new ok(this.services),this.model.setOptions(Ct(Et.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new Mk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const mm=class Va extends lt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=Z.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=A.appendOrSelect(n,"svg.chart-grid-backdrop"),s=A.appendOrSelect(i,`g.${this.type}`),a=A.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=A.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=A.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===j.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=_=>{const E=_[1]-_[0];let M="0,"+E.toString();const C=Math.floor(l/Va.DASH_LENGTH),G=C*Va.DASH_LENGTH;for(let I=0;I<C;I++)M+=","+Va.DASH_LENGTH;M+=","+(l-G),C%2===1&&(M+=",0"),M+=","+E.toString(),M+=","+l.toString(),f.attr("stroke-dasharray",M)},v=_=>{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),g(E))},m=(_,E)=>{const M=Ud().range([0,o]).domain(p);let C=[M.invert(_),M.invert(E)];C[0].valueOf()===C[1].valueOf()&&(C=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==C[0].valueOf()||p[1].valueOf()!==C[1].valueOf())&&this.services.zoom.handleDomainChange(C)};let y;const b=_=>{const E=_.selection;E!==null&&(m(E[0],E[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=eh().extent([[0,0],[o-1,l]]).on("start brush end",v).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(),M=Sn(s.node(),E)[0];let C=M-o*S/2;C<0&&(C=0);let G=M+o*S/2;G>o&&(G=o),m(C,G)}})}}};mm.DASH_LENGTH=4;let Ak=mm;class Dk extends lt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=Z.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=eh(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(w.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",F.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(F.TOP),i=this.services.zoom.isZoomBarLocked(F.TOP),s=x(this.getOptions(),"zoomBar",F.TOP,"type"),a=x(this.getOptions(),"axes",F.BOTTOM,"highlights"),o=ce.height[s],{width:l}=A.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 d=A.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(A.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",ce.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ae.GRAPH_VIEW?A.appendOrSelect(d,"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===Ae.SLIDER_VIEW&&A.appendOrSelect(d,"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(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===j.TIME){let v=this.services.zoom.getZoomBarData();if(Ce(v)||v.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const m=this.services.zoom.getDefaultZoomBarDomain(v);v=this.compensateDataForDefaultDomain(v,m);const y=this.model.get("initialZoomDomain"),b=x(this.getOptions(),"zoomBar",F.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:tt([],b),zoomDomain:b?tt([],b):m},{skipUpdate:!0}):b===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:tt([],m)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(m),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(be(v,E=>E.value));const S=this.model.get("zoomDomain");if(s===Ae.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",v,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",v,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const E=a.highlightStartMapsTo,M=a.highlightEndMapsTo,C=a.color,G=a.labelMapsTo;a.data.forEach((I,T)=>{A.appendOrSelect(d,`rect.highlight-${T}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(I[E])).attr("width",this.xScale(I[M])-this.xScale(I[E])).style("fill",C&&C.scale[I[G]]?C.scale[I[G]]:null).style("fill-opacity",.1).style("stroke",C&&C.scale[I[G]]?C.scale[I[G]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(S,c,l);const _=A.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(M=>this.xScale(M));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",F.TOP,"type"),a=ce.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=w.ZoomBar.SELECTION_START:t.type==="brush"?a=w.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=w.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(w.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=ce.handleWidth,s=x(this.getOptions(),"zoomBar",F.TOP,"type"),a=ce.height[s],o=-i/2,l=ce.handleBarWidth,c=s===Ae.GRAPH_VIEW?ce.handleBarHeight:6,u=-l/2,d=(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 h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.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",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ae.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",F.TOP,"type"),r=ce.height[n],s=this.getComponentContainer().select("svg.zoom-container");A.appendOrSelect(s,"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=(m,y,b)=>S=>s.getValueFromScale(m,y,b,S),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=x(this.getOptions(),"zoomBar",F.TOP,"type"),p=ce.height[f],g=fl().x(m=>d(m)).y0(p).y1(m=>p-h(m)),v=A.appendOrSelect(t,n).datum(r).attr("d",g);i&&v.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=A.appendOrSelect(t,"clipPath").attr("id",n);A.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=tn(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",F.TOP,"type"),a=ce.height[s],o=di()([[n,a],[r,a]]);A.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),A.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),x(this.getOptions(),"zoomBar",F.TOP,"type")===Ae.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(w.ZoomBar.UPDATE,this.render.bind(this))}}class Lk extends lt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=Z.SVG,this.positionService=new ka}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(F).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&r.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const s=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,v=null;h===F.LEFT||h===F.RIGHT?(v=f,g=d.services.cartesianScales.getMainXScale()):(g=f,v=d.services.cartesianScales.getMainYScale());const m=p===j.LABELS,[y,b]=g.range(),[S,_]=v.range(),{cartesianScales:E}=d.services,M=E.getOrientation(),C=R=>E.getDomainValue(R),G=R=>E.getRangeValue(R),[I,T]=sn(C,G,M),L=D(this);h===F.TOP||h===F.BOTTOM?(L.selectAll("line.threshold-line").transition().call(R=>d.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",_).attr("y2",S).attr("x1",({datum:R})=>I(R)+(m?f.step()/2:0)).attr("x2",({datum:R})=>I(R)+(m?f.step()/2:0)).style("stroke",({fillColor:R})=>R),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-I(R)).attr("width",Math.abs(S-_)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(R=>d.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",y).attr("x2",b).attr("y1",({datum:R})=>T(R)+(m?f.step()/2:0)).attr("y2",({datum:R})=>T(R)+(m?f.step()/2:0)).style("stroke",({fillColor:R})=>R),L.selectAll("rect.threshold-hoverable-area").attr("x",y).attr("y",({datum:R})=>T(R)).attr("width",Math.abs(b-y)).classed("rotate",!1))}),this.services.events.addEventListener(w.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(w.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)===j.TIME){const a=[F.LEFT,F.RIGHT].includes(r),o=this.services.cartesianScales.getMainXScale(),l=this.services.cartesianScales.getMainYScale(),c=a?l:o,u=x(i,"timeScale"),d=_c(c.ticks(),x(u,"timeInterval"));return Sc(n,0,c.ticks(),d,u)}return n.toLocaleString("en")}appendThresholdLabel(){const t=D(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=A.appendOrSelect(t,`div.${ee}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Sn(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,[Ht.RIGHT,Ht.LEFT,Ht.TOP,Ht.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(r){D(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(w.Threshold.SHOW,{event:r,hoveredElement:D(this),datum:D(this).datum()})}).on("mouseout",function(r){D(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(w.Threshold.HIDE,{event:r,hoveredElement:D(this),datum:D(this).datum()})})}}class Rk extends lt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=Z.SVG,this.positionService=new ka,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(F).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&r.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,v]=f.range(),[m,y]=p.range(),{cartesianScales:b}=d.services,S=b.getOrientation(),_=I=>b.getDomainValue(I),E=I=>b.getRangeValue(I),[M,C]=sn(_,E,S),G=D(this);h===F.TOP||h===F.BOTTOM?G.selectAll("rect.highlight-bar").transition().call(I=>d.services.transitions.setupTransition({transition:I,name:"highlight-bar-update",animate:t})).attr("y",Math.max(y+d.highlightStrokeWidth,0)).attr("height",Math.max(m-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:I,...T})=>M(T[I])).attr("width",({highlightStartMapsTo:I,highlightEndMapsTo:T,...L})=>Math.max(M(L[T])-M(L[I]),0)).style("stroke",({color:I,labelMapsTo:T,...L})=>I&&I.scale[L[T]]?I.scale[L[T]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:I,labelMapsTo:T,...L})=>I&&I.scale[L[T]]?I.scale[L[T]]:null):G.selectAll("rect.highlight-bar").transition().call(I=>d.services.transitions.setupTransition({transition:I,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(v-g,0)).attr("y",({highlightEndMapsTo:I,...T})=>C(T[I])).attr("height",({highlightStartMapsTo:I,highlightEndMapsTo:T,...L})=>Math.max(C(L[I])-C(L[T]),0)).style("stroke",({color:I,labelMapsTo:T,...L})=>I&&I.scale[L[T]]?I.scale[L[T]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:I,labelMapsTo:T,...L})=>I&&I.scale[L[T]]?I.scale[L[T]]:null)})}}class vm extends Wc{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!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 d;if(n.length===1){const h=n[0],f=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:r.tooltip.groupLabel,value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&x(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:St(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}class Ik extends on{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){const r=this.getAxisOptions(t).title;return r||(t===F.BOTTOM||t===F.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(F).map(n=>F[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}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===F.LEFT||this.rangeAxisPosition===F.RIGHT)&&(this.domainAxisPosition===F.BOTTOM||this.domainAxisPosition===F.TOP)?this.orientation=Nt.VERTICAL:this.orientation=Nt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=x(t,"axes");((r=n[F.LEFT])!=null&&r.correspondingDatasets&&n[F.RIGHT]||(i=n[F.RIGHT])!=null&&i.correspondingDatasets&&n[F.LEFT]||(s=n[F.TOP])!=null&&s.correspondingDatasets&&n[F.BOTTOM]||(a=n[F.BOTTOM])!=null&&a.correspondingDatasets&&n[F.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]===j.LINEAR||this.scaleTypes[t]===j.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=[F.BOTTOM,F.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[F.LEFT,F.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(),o=x(s,"axes")[r],{mapsTo:l}=o,c=x(i,l)!==null?i[l]:i;let u;switch(n){case j.LABELS:u=t(c)+t.step()/2;break;case j.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),o=x(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(x(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(x(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}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===j.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return kk(n,s)}else return $k(n,fn.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,F.LEFT)===null&&x(n,F.RIGHT)!==null||x(n,F.RIGHT,"main")===!0||r&&x(n,F.LEFT,"correspondingDatasets")?{primary:F.RIGHT,secondary:F.LEFT}:{primary:F.LEFT,secondary:F.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,F.BOTTOM)===null&&x(n,F.TOP)!==null||x(n,F.TOP,"main")===!0||r&&x(n,F.BOTTOM,"correspondingDatasets")?{primary:F.TOP,secondary:F.BOTTOM}:{primary:F.BOTTOM,secondary:F.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||j.LINEAR,o=s.scaleType||j.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===j.LABELS||o===j.TIME)&&a===j.LABELS||a===j.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")||j.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:m}=this.model.getBinConfigurations();return[0,En(m,y=>y.length)]}else if(r.limitDomainToBins){const{bins:m}=this.model.getBinConfigurations(),y=this.model.getStackKeys({bins:m});return[y[0].split("-")[0],y[y.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=fn.ratio;if(r.domain)return a===j.LABELS?r.domain:(a===j.TIME&&(r.domain=r.domain.map(m=>m.getTime===void 0?new Date(m):m)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===j.LABELS)return Oi(o.map(m=>m[c]));let p,g;const v=this.model.getDataGroupNames();if(a===j.LABELS_RATIO)return o.map(m=>`${m[h]}/${m[f]}`);if(a===j.TIME)g=o.map(m=>+new Date(m[c]));else if(i&&n.axes)g=[],o.forEach(m=>{g.push(m[c]),m[i.upperBoundMapsTo]&&g.push(m[i.upperBoundMapsTo]),m[i.lowerBoundMapsTo]&&g.push(m[i.lowerBoundMapsTo])});else if(r.stacked===!0&&v&&t===this.getRangeAxisPosition()){const{groupMapsTo:m}=n.data,y=this.model.getDataValuesGroupedByKeys({groups:v}),b=o.filter(_=>!v.includes(_[m])),S=[];y.forEach(_=>{const{...E}=_;let M=0,C=0;Object.values(E).forEach(G=>{isNaN(G)||(G<0?C+=G:M+=G)}),S.push([C,M])}),g=[...Pf(S),...b.map(_=>_[c])]}else g=[],o.forEach(m=>{const y=m[c];Array.isArray(y)&&y.length===2?(g.push(y[0]),g.push(y[1])):(l&&g.push(Math.max(m[c],m[l])),g.push(y))});return a!==j.TIME&&a!==j.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(m=>{const y=x(m,"value");y!==null&&g.push(y)}),p=be(g),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")||j.LINEAR;this.scaleTypes[t]=i;let s;return i===j.TIME?s=Ud():i===j.LOG?s=xd().base(r.base||10):i===j.LABELS||i===j.LABELS_RATIO?s=si():s=Oe(),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((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===j.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 kk(e,t){const n=new Date(e[0]),r=new Date(e[1]);return pL(r,n)>1?[_R(n,t),og(r,t)]:fL(r,n)>1?[ER(n,t),pc(r,t)]:oL(r,n)>1?[bR(n,t),ig(r,t)]:cL(r,n)>1?[SR(n,t),sg(r,t)]:ug(r,n)>30?[bg(n,t*30),mc(r,t*30)]:ug(r,n)>1?[bg(n,t),mc(r,t)]:hg(r,n)>15?[Eg(n,t*15),vc(r,t*15)]:hg(r,n)>1?[Eg(n,t),vc(r,t)]:[n,r]}function $k([e,t],n,r){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(r===j.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class Pk extends on{constructor(){super(...arguments),this.curveTypes={curveLinear:zs,curveLinearClosed:Kd,curveBasis:KS,curveBasisClosed:QS,curveBasisOpen:JS,curveBundle:t_,curveCardinal:e_,curveCardinalClosed:n_,curveCardinalOpen:r_,curveCatmullRom:i_,curveCatmullRomClosed:s_,curveCatmullRomOpen:a_,curveMonotoneX:o_,curveMonotoneY:l_,curveNatural:c_,curveStep:u_,curveStepAfter:d_,curveStepBefore:h_}}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 Nk extends on{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===F.BOTTOM&&n===j.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,be(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(w.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return x(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=x(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const o=i.stacked?"sharedStackKey":(a=this.services.cartesianScales)==null?void 0:a.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=r[0]&&new Date(c[o])<=r[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var f;const n=this.model.get("zoomDomain"),r=ce.handleWidth,i=(f=this.services.cartesianScales)==null?void 0:f.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-r/2,d=a-l/2+r/2);const h=[i.invert(u),i.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}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")}}class re extends Le{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:Ik,curves:Pk,zoom:Nk}),this.model=new Wn(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",F.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===F.BOTTOM&&o===j.TIME,c=this.services.zoom.isZoomBarLocked(F.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new Bi(this.model,this.services)],growth:nt.STRETCH},h={id:"toolbar",components:[new Ta(this.model,this.services)],growth:nt.PREFERRED},f={id:"header",components:[new he(this.model,this.services,[d,...s?[h]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},p={id:"legend",components:[new zc(this.model,this.services)],growth:nt.PREFERRED};l&&!c&&t.push(new sm(this.model,this.services),new Ak(this.model,this.services)),t.push(new Lk(this.model,this.services)),t.push(new Rk(this.model,this.services));const g={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},v=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let m=bt.COLUMN;if(v){const E=x(this.model.getOptions(),"legend","position");E===Er.LEFT?(m=bt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Sr.VERTICAL)):E===Er.RIGHT?(m=bt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Sr.VERTICAL)):E===Er.BOTTOM&&(m=bt.COLUMN_REVERSE)}const y={id:"spacer",components:[new ln(this.model,this.services)],growth:nt.PREFERRED},b={id:"full-frame",components:[new he(this.model,this.services,[...v?[p]:[],...v?[y]:[],g],{direction:m})],growth:nt.STRETCH},S={id:"zoom-bar",components:[new Dk(this.model,this.services)],growth:nt.PREFERRED,renderType:Z.SVG},_=[];if(u||s){_.push(f);const E={id:"spacer",components:[new ln(this.model,this.services,s?{size:15}:void 0)],growth:nt.PREFERRED};_.push(E)}return l&&_.push(S),_.push(b),[new vm(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,_,{direction:bt.COLUMN})]}}class de extends lt{constructor(){super(...arguments),this.type="grid",this.renderType=Z.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&&(A.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(A.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=qa(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=x(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=x(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=au(i).tickSizeInner(-r).tickSizeOuter(0);if(x(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=x(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=x(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(rn(u).tx)-Number(rn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+rn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+rn(o).tx;else if(o)l=+rn(o).tx-+rn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=A.getSVGElementSize(u).width-+rn(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 a=rn(this),o={min:Number(a.tx)-r,max:Number(a.tx)+r};return o.min<=t[0]&&t[0]<=o.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=A.appendOrSelect(r,"svg.chart-grid-backdrop");const u=A.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 ym extends lt{constructor(){super(...arguments),this.type="area",this.renderType=Z.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?en.opacity.unselected:en.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",en.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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=fl().curve(this.services.curves.getD3Curve()).defined(_=>{const E=s.getRangeIdentifier(),M=_[E];return M!=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 d=0;const h=(_,E)=>{x(r,"axes",_,"includeZero")===!1&&E[0]>0&&E[1]>0&&(d=E[0])},f=_=>u?s.getBoundedScaledValues(_)[0]:s.getRangeValue(d),p=_=>u?s.getBoundedScaledValues(_)[1]:s.getRangeValue(_);a===Nt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(_=>s.getDomainValue(_)).y0(_=>f(_)).y1(_=>p(_))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(_=>f(_)).x1(_=>p(_)).y(_=>s.getDomainValue(_)));const g=x(r,"color","gradient","enabled"),v=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const m=n.selectAll("path.area").data(l,_=>_.name),y=D(this.services.domUtils.getMainContainer());if(m.exit().attr("opacity",0).remove(),!l.length)return;if(v){const _=y.select(`path.${this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:l[0].name})}`).node();let E;if(_)E=getComputedStyle(_,null).getPropertyValue("stroke");else{const M=x(this.model.getOptions(),"color","scale");if(M!==null){const C=Object.keys(M);E=M[C[0]]}}Vi.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:Vi.getStops(i,E)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const b=this,S=m.enter().append("path");v?S.merge(m).style("fill",_=>`url(#${this.services.domUtils.generateElementIDString(`${_.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:_.name,originalClassName:"area"})).attr("d",_=>{const{data:E}=_;return o(E)}):(S.attr("opacity",0).merge(m).attr("class","area").attr("class",_=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.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:en.opacity.selected).attr("d",_=>{const{data:E}=_;return o(E)}),u&&S.attr("fill-opacity",en.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Lr extends lt{constructor(){super(...arguments),this.type="line",this.renderType=Z.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?nn.opacity.unselected:nn.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",nn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=sn(s,a,r.getOrientation()),c=this.getOptions(),u=di().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),v=p[g];return v!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(m=>c.axes[m].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(m=>{const y=this.services.cartesianScales.getDomainIdentifier(m),b=this.services.cartesianScales.getRangeIdentifier(m);return{name:x(m,0,g),data:m.map(S=>({[y]:S.data.sharedStackKey,[g]:S[g],[b]:S[1]})),hidden:!PD(m,S=>S[0]!==S[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name)).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(v=>{const m=this.services.cartesianScales.getRangeIdentifier(v);return v[m]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:g}=p;return u(g)})}destroy(){const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const xm=5;function Uk(e,t){return e>t-xm&&e<t+xm}class mn extends lt{constructor(){super(...arguments),this.type="ruler",this.renderType=Z.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===Nt.HORIZONTAL?r:n,d=A.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=A.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(v=>({domainValue:this.services.cartesianScales.getDomainValue(v),originalData:v})).filter(v=>Uk(v.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(v=>v.domainValue).join()===this.pointsWithinLine.map(v=>v.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(w.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((v,m)=>{if(v.length===0)return v.push(m),v;const y=v[0].domainValue,b=Math.abs(u-m.domainValue),S=Math.abs(u-y);return b>S||(b<S?v=[m]:v.push(m)),v},[]);if(g.length>0){const v=g.map(S=>S.originalData).filter(S=>{const _=this.services.cartesianScales.getRangeIdentifier(S),E=S[_];return E!=null}),m=g.map(S=>S.domainValue),y=f.filter(S=>{const _=this.services.cartesianScales.getDomainValue(S);return m.includes(_)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!zp(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(w.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(v)}),d.attr("opacity",1);const b=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",b.domainValue).attr("y2",b.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",b.domainValue).attr("x2",b.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=A.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(w.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=Sn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=YD(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=A.appendOrSelect(t,"svg.chart-grid-backdrop")}}class He extends lt{constructor(){super(...arguments),this.type="scatter",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(w.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(w.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 r=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.selectAll("circle.dot").data(this.getScatterData(),d=>`${d[s]}-${d[o]}`);l.exit().attr("opacity",0).remove();const u=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(u,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]=sn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=sn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),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,d]=sn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),v=this.model.getIsFilled(f[o],f[p],f,i)?[Q.FILL,Q.STROKE]:[Q.STROKE];return this.model.getColorClassName({classNameTypes:v,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",d).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",h?0:1).attr("role",st.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 a,o;const s=D(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:l[n],originalClassName:s.attr("class")})).style("fill",l=>{var u;const c=(u=t.services.cartesianScales)==null?void 0:u.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),(a=t.services.events)==null||a.dispatchEvent(w.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(w.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=D(this);(a=t.services.events)==null||a.dispatchEvent(w.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(w.Scatter.SCATTER_CLICK,{event:r,element:D(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=D(this);if(s.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);s.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(o=t.services.events)==null||o.dispatchEvent(w.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:s})})}destroy(){var n;(n=this.parent)==null||n.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(w.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(w.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class bm extends lt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=Z.SVG,this.truncation={[F.LEFT]:!1,[F.RIGHT]:!1,[F.TOP]:!1,[F.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}=A.getSVGElementSize(s,{useAttrs:!0}),l=A.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===F.BOTTOM||n===F.TOP?(c=this.configs.axes[F.LEFT]?this.margins.left:0,u=this.configs.axes[F.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 d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===j.LABELS||this.scaleType===j.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case F.LEFT:h=au;break;case F.BOTTOM:h=qa;break;case F.RIGHT:h=xv;break;case F.TOP:h=yv;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=A.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${st.GRAPHICS_OBJECT} ${st.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=A.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),v=x(r,"axes",n),m=this.scaleType===j.TIME||v.scaleType===j.TIME,y=n===F.LEFT||n===F.RIGHT,b=this.model.get("zoomDomain");if(b&&m&&!y&&d.domain(b),!i){p.attr("aria-hidden",!0);return}const S=x(v,"scaleType"),_=x(r,"data","loading"),E=x(v,"ticks","number"),M=x(v,"ticks","values"),C=x(v,"truncation","type"),G=x(v,"truncation","threshold"),I=x(v,"truncation","numCharacter"),T=E!==null,L=x(r,"timeScale"),R=A.appendOrSelect(g,"g.tick"),k=A.appendOrSelect(R,"text").text("0"),O=A.getSVGElementSize(k.node(),{useBBox:!0}).height;R.remove();const U=this.scaleType||v.scaleType||j.LINEAR,P=h(d).tickSizeOuter(0);if(d.ticks){let W;if(T?W=E:(W=fn.ticks.number,y&&(W=this.getNumberOfFittingTicks(o,O,fn.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(W=0),P.ticks(W),m)if(!d.ticks(W).length)P.tickValues([]);else{const K=x(r,"timeScale","addSpaceOnEdges"),ut=x(r,"axes",n,"domain"),rt=d.copy();K&&!ut&&rt.nice(W);const Tt=rt.ticks(W);K&&Tt.length>2&&!ut&&(Tt.splice(Tt.length-1,1),Tt.splice(0,1)),P.tickValues(Tt)}}let N;const B=x(v,"ticks","formatter");if(m){const W=_c(P.tickValues(),x(r,"timeScale","timeInterval"));B===null?N=(K,ut)=>Sc(K,ut,P.tickValues(),W,L):N=(K,ut)=>{const rt=Sc(K,ut,P.tickValues(),W,L);return B(K,ut,rt)}}else B===null?U===j.LINEAR&&(N=W=>W.toLocaleString()):N=B;P.tickFormat(N);const[Y,X]=this.services.cartesianScales.getScaleByPosition(n).domain();let J;if(M){if(m)M.forEach((W,K)=>{W.getTime===void 0&&(M[K]=new Date(W))}),J=M.filter(W=>{const K=W.getTime();return K>=new Date(Y).getTime()&&K<=new Date(X).getTime()});else if(S===j.LABELS){const W=this.services.cartesianScales.getScaleByPosition(n).domain();J=M.filter(K=>W.includes(K))}else J=M.filter(W=>W>=Y&&W<=X);P.tickValues(J)}switch(n){case F.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case F.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case F.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case F.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const ct=this.model.isDataEmpty();if(v.title){const W=A.appendOrSelect(l,"text.axis-title").html(ct||_?"":v.title),K=x(v,"titleOrientation");let ut;switch(n){case F.LEFT:K===fa.RIGHT?W.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):W.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case F.BOTTOM:W.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case F.RIGHT:K===fa.LEFT?W.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):W.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case F.TOP:ut=A.getSVGElementSize(W,{useBBox:!0}).height,W.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ut/2})`).style("text-anchor","middle");break}}if(m){const W=_c(P.tickValues(),x(r,"timeScale","timeInterval")),K=L.showDayName,ut=p;t&&(p=p.transition().call(Tt=>this.services.transitions.setupTransition({transition:Tt,name:"axis-update",animate:t}))),p=p.call(P),ut.selectAll(".tick").data(P.tickValues(),d).order().select("text").style("font-weight",(Tt,q)=>Dg(Tt,q,P.tickValues(),W,K)?"bold":"normal")}else!t||!f?p=p.call(P):p=p.transition().call(W=>this.services.transitions.setupTransition({transition:W,name:"axis-update",animate:t})).call(P);if(g.call(P),n===F.BOTTOM||n===F.TOP){let W=!1;const K=x(v,"ticks","rotation");if(K===Ci.ALWAYS)W=!0;else if(K===Ci.NEVER)W=!1;else if(!K||K===Ci.AUTO)if(d.step)W=g.selectAll("g.tick text").nodes().some(rt=>A.getSVGElementSize(rt,{useBBox:!0}).width>=d.step());else{W=!1;const ut=g.append("text").text("A"),rt=A.getSVGElementSize(ut.node(),{useBBox:!0}).width;let Tt;g.selectAll("g.tick").each(function(){const q=D(this),V=parseFloat(x(rn(this),"tx"));V!==null&&Tt+q.text().length*rt*.8>=V&&(W=!0),Tt=V}),ut.remove()}W?(T||(P.ticks(this.getNumberOfFittingTicks(a,O,fn.ticks.horizontalSpaceRatio)),g.call(P),p.call(P)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===F.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",W=>W),g.selectAll("g.tick").attr("aria-label",W=>W),C!==ve.NONE&&S===j.LABELS&&!M){const W=this.services.cartesianScales.getScaleDomain(n);if(W.length>0){const K=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(K);const ut=this;l.selectAll("g.tick text").data(W).text(function(rt){return rt.length>G?(ut.truncation[n]=!0,Ri(rt,C,I)):rt}),this.getInvisibleAxisRef().selectAll("g.tick text").data(W).text(function(rt){return rt.length>G?Ri(rt,C,I):rt}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(W)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=A.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(w.Axis.LABEL_MOUSEOVER,{event:c,element:D(this),datum:u}),a===j.LABELS&&u.length>o&&l.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,hoveredElement:D(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEMOVE,{event:c,element:D(this),datum:u}),a===j.LABELS&&u.length>o&&l.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOUT,{event:c,element:D(this),datum:u}),a===j.LABELS&&l.services.events.dispatchEvent(w.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 cp(i,2,fn.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;A.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class Bk extends bm{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=A.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:d}=A.getSVGElementSize(c,{useBBox:!0}),h=A.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case F.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case F.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case F.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case F.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-fn.hover.rectanglePadding).attr("y",p).attr("width",u+fn.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=A.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"),d=u.datum();l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===j.LABELS&&d.length>o&&l.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=D(this).select("text"),d=u.datum();l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(w.Axis.LABEL_CLICK,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(w.Axis.LABEL_MOUSEOUT,{event:c,element:D(this).select("text"),datum:D(this).select("text").datum()}),a===j.LABELS&&l.services.events.dispatchEvent(w.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(w.Axis.LABEL_FOCUS,{event:{...c,...u},element:D(this),datum:D(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(w.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(w.Tooltip.HIDE),l.services.events.dispatchEvent(w.Axis.LABEL_BLUR,{event:c,element:D(this),datum:D(this).select("text").datum()})),n===F.LEFT||n===F.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;A.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 ie extends lt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=Z.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(F),i=x(this.getOptions(),"axes");r.forEach(o=>{i[F[o]]&&(n[F[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=F[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===Di.DEFAULT?new bm(this.model,this.services,c):new Bk(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=A.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=A.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===F.LEFT||c===F.RIGHT)&&(f+=5)),c){case F.TOP:s.top=h+f;break;case F.BOTTOM:s.bottom=h+f;break;case F.LEFT:s.left=d+f;break;case F.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(w.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(w.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class Zt extends lt{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===kt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===kt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===kt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===kt.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===Nt.VERTICAL&&this.drawYGrid(t),n===Nt.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=Oe().domain([0,1]).range(t),this.yScale=Oe().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=A.getSVGElementSize(n,{useAttrs:!0});this.backdrop=A.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=A.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=A.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=A.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}=A.getSVGElementSize(i,{useAttrs:!0}),o=A.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=x(this.getOptions(),l,"alignment");A.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=hi().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(wt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=A.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).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+wt.xOffset;c===It.CENTER?p=s/2:c===It.RIGHT&&(p=s-t-wt.xOffset);const g=t+wt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=A.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+wt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=A.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=A.appendOrSelect(o,"defs").lower(),h=A.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
|
|
76
76
|
<stop class="${s}" offset="${c}"></stop>
|
|
77
77
|
<stop class="${a}" offset="${c+.2}"></stop>
|
|
78
78
|
<stop class="${s}" offset="${c+2*.2}"></stop>
|
|
79
|
-
`;h.html(f),p();function p(){h.attr("gradientTransform",`translate(${c-3*.2*l}, 0)`).transition().duration(2e3).delay(1e3).ease(B1).attr("gradientTransform",`translate(${u+3*.2*l}, 0)`).on("end",p)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class Fk extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(tn(Et.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new Lr(this.model,this.services),new bm(this.model,this.services),new He(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class zk extends Wn{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Wa(t,.25),q_50:Wa(t,.5),q_75:Wa(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,d=c.quartiles.q_75,h=(d-u)*1.5,f=u-h,p=d+h,g=[],v=[];for(const b of l)b<f||b>p?g.push(b):v.push(b);c.outliers=g;const m=cn(v),y=En(v);c.whiskers={min:m||cn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||En([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(s=>{let a=x(s,"outliers");return(a===null||a.length===0)&&(a=["–"]),[s[n],x(s,"whiskers","min")!==null?x(s,"whiskers","min").toLocaleString():"–",x(s,"quartiles","q_25")!==null?x(s,"quartiles","q_25").toLocaleString():"–",x(s,"quartiles","q_50")!==null?x(s,"quartiles","q_50").toLocaleString():"–",x(s,"quartiles","q_75")!==null?x(s,"quartiles","q_75").toLocaleString():"–",x(s,"whiskers","max")!==null?x(s,"whiskers","max").toLocaleString():"–",x(s,"quartiles","q_75")!==null&&x(s,"quartiles","q_25")!==null?(x(s,"quartiles","q_75")-x(s,"quartiles","q_25")).toLocaleString():"–",a.map(o=>o.toLocaleString()).join(",")]})]}setColorClassNames(){const n=x(this.getOptions(),"color","pairing");let r=x(n,"option");const i=Qp.pairingOptions;r=r<=i["1-color"]?r:1;const s=this.allDataGroups.map(()=>`1-${r}-1`);this.colorClassNames=ks().range(s).domain(this.allDataGroups)}}class Wk extends lt{constructor(){super(...arguments),this.type="boxplot",this.renderType=Z.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,d]=o.range(),h=c-l,f=u-d;if(h===0)return;const{cartesianScales:p}=this.services,g=p.getOrientation(),v=g===Nt.VERTICAL,[m,y]=sn(T=>this.services.cartesianScales.getDomainValue(T),T=>this.services.cartesianScales.getRangeValue(T),g),b=Math.floor((v?h:f)/s.length),S=Math.min(b/2,16),_=this.model.getBoxplotData(),E=n.selectAll(".box-group").data(_);E.exit().remove();const M=E.enter().append("g").attr("class","box-group"),C=E.merge(M);M.append("path").merge(E.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",ye.strokeWidth.default).attr("fill","none").transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-verticalstartline",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i]),R=L,k=p.getRangeValue(T.whiskers.min),O=p.getRangeValue(T.quartiles.q_25);return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",ye.strokeWidth.default).attr("fill","none").transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-verticalendline",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i]),R=L,k=p.getRangeValue(T.whiskers.max),O=p.getRangeValue(T.quartiles.q_75);return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],originalClassName:"box"})).attr("fill-opacity",ye.box.opacity.default).attr("stroke-width",ye.strokeWidth.default).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",T=>T[i]).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-quartiles",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i])-S/2,R=L+S,k=p.getRangeValue(Math[v?"max":"min"](T.quartiles.q_75,T.quartiles.q_25)),O=k+Math.abs(p.getRangeValue(T.quartiles.q_75)-p.getRangeValue(T.quartiles.q_25));return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",T=>{const L=p.getDomainValue(T[i])-S/2,R=L+S,k=p.getRangeValue(T.whiskers.min),O=p.getRangeValue(T.whiskers.max);return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"whisker start"})).attr("stroke-width",ye.strokeWidth.thicker).attr("fill","none").transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-startingwhisker",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i])-S/4,R=L+S/2,k=p.getRangeValue(T.whiskers.min),O=p.getRangeValue(T.whiskers.min);return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-median",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i])-S/2,R=L+S,k=p.getRangeValue(T.quartiles.q_50);return jt({x0:L,x1:R,y0:k,y1:k},g)}),M.append("path").merge(E.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"whisker end"})).attr("stroke-width",ye.strokeWidth.thicker).attr("fill","none").transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-endingwhisker",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i])-S/4,R=L+S/2,k=p.getRangeValue(T.whiskers.max),O=p.getRangeValue(T.whiskers.max);return jt({x0:L,x1:R,y0:k,y1:O},g)});const G=C.selectAll("circle.outlier").data(T=>T.outliers.map(L=>({min:T.whiskers.min,max:T.whiskers.max,[i]:T[i],value:L})));G.exit().remove();const I=G.enter().append("circle");G.merge(I).attr("r",ye.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],originalClassName:"outlier"})).attr("fill-opacity",ye.circle.opacity.default).attr("cx",m).transition().call(T=>this.services.transitions.setupTransition({transition:T,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",ye.box.opacity.hovered),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[r],class:t.model.getColorClassName({classNameTypes:[Q.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(w.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=D(this);t.services.events.dispatchEvent(w.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(w.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",ye.box.opacity.default),t.services.events.dispatchEvent(w.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(w.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",ye.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[r],class:t.model.getColorClassName({classNameTypes:[Q.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(w.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=D(this);t.services.events.dispatchEvent(w.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(w.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",ye.circle.opacity.default),t.services.events.dispatchEvent(w.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o})})}}class Rr extends lt{constructor(){super(...arguments),this.type="zero-line",this.renderType=Z.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 d=rg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());A.appendOrSelect(o,"line.domain").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class Yk extends re{constructor(t,n){super(t,n),this.model=new zk(this.services),this.model.setOptions(Ct(Et.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Wk(this.model,this.services),new Rr(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class qk extends He{constructor(){super(...arguments),this.type="bubble",this.renderType=Z.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=A.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?be(s):[1,1];return Oe().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=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=sn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",h=>{const f=o.getRangeIdentifier(h);return h[f]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[f],h)}).style("stroke",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[f],h)}).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 Xk extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new qk(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class jk extends Wn{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(o=>[o.title,o[r],o.value===null?"–":o.value,x(o,"marker")===null?"–":o.marker,x(o,"marker")===null?"–":`${Math.floor(o[i]/o.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(o)]])]}}class Zk extends lt{constructor(){super(...arguments),this.type="bullet",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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(),d=()=>{const g=[];s.forEach(y=>{y.ranges?y.ranges.forEach((b,S)=>{b!=null&&b<u&&g.push({datum:y,value:b,order:S+1})}):g.push({datum:y,order:1})});const v=A.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(g,y=>`${y[r]}-${y.order}`);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).attr("class",y=>`range-box order-${y.order}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-range-box-update-enter",animate:t})).attr("d",y=>{let S,_,E,M;return y.order===1?(S=this.services.cartesianScales.getDomainValue(y.datum)-16/2,_=S+16,E=c-2,M=l+1):(S=this.services.cartesianScales.getDomainValue(y.datum)-16/2,_=S+16,E=this.services.cartesianScales.getRangeValue(y.value),M=c),jt({x0:S,x1:_,y0:E,y1:M},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=A.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-bar-update-enter",animate:t})).attr("class",m=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>this.model.getFillColor(m[r])).attr("d",m=>{const b=this.services.cartesianScales.getDomainValue(m)-4,S=b+8,_=this.services.cartesianScales.getRangeValue(0)+1,E=this.services.cartesianScales.getRangeValue(m);return jt({x0:b,x1:S,y0:_,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},f=()=>{const g=A.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>x(m,"marker")!==null),m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const b=this.services.cartesianScales.getDomainValue(m)-12,S=b+24,_=this.services.cartesianScales.getRangeValue(m.marker);return jt({x0:b,x1:S,y0:_,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let g=[];s.filter(y=>x(y,"marker")!==null).forEach(y=>{const b=y.marker,S=y[o];g=g.concat([{datum:y,value:b*.25,barValue:S},{datum:y,value:b*.5,barValue:S},{datum:y,value:b*.75,barValue:S}])});const v=A.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,y=>y[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).attr("class",y=>`quartile ${y.value<=y.barValue?"over-bar":""}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:y,value:b})=>{let S=4;y.ranges&&y.ranges.indexOf(b)!==-1&&(S=8);const _=this.services.cartesianScales.getDomainValue(y)-S/2,E=_+S,M=this.services.cartesianScales.getRangeValue(b);return jt({x0:_,x1:E,y0:M,y1:M},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),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(w.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=x(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[Q.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(w.Bar.BAR_MOUSEMOVE,{event:s,element:D(this),datum:a}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(w.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(w.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Kk extends re{constructor(t,n){super(t,n),this.model=new jk(this.services),this.model.setOptions(Ct(Et.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Zk(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}function _m(e){const t=be(e,r=>r.value),n=Oe().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 wm(e,t){const n=x(t,"gradient","colors"),r=!Ce(n);let i=x(t,"pairing","option");const s=_m(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 Jo().domain(s).range(o)}class Qk extends Ge{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ce(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ce(n)&&!Ce(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(r=>[r.id===null?"–":r.id,r.name,r.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=x(this.getOptions(),"color");this._colorScale=wm(this.getDisplayData(),t)}}function Jk(e){return e}function t$(e){if(e==null)return Jk;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,d=new Array(u);for(d[0]=(t+=o[0])*r+s,d[1]=(n+=o[1])*i+a;c<u;)d[c]=o[c],++c;return d}}function e$(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function n$(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=Kc(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 Kc(e,t){var n=t$(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],f=0,p=h.length;f<p;++f)d.push(n(h[f],f));u<0&&e$(d,p)}function s(u){return n(u)}function a(u){for(var d=[],h=0,f=u.length;h<f;++h)i(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=s(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(s);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function r$(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++a],t[a]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],f,p;if(f=i[d])if(delete i[f.end],f.push(c),f.end=h,p=r[h]){delete r[p.start];var g=p===f?f:f.concat(p);r[g.start=f.start]=i[g.end=p.end]=g}else r[f.start]=i[f.end]=f;else if(f=r[h])if(delete r[f.start],f.unshift(c),f.start=d,p=i[d]){delete i[p.end];var v=p===f?f:p.concat(f);r[v.start=p.start]=i[v.end=f.end]=v}else r[f.start]=i[f.end]=f;else f=[c],r[f.start=d]=i[f.end=h]=f});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(f){h[0]+=f[0],h[1]+=f[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(f){n[f<0?~f:f]=1}),s.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function i$(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 s$(e){return Kc(e,a$.apply(this,arguments))}function a$(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 i$(Kc(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(d){d.forEach(function(h){n[h<0?~h:h].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(g){g.forEach(function(v){v.forEach(function(m){n[m<0?~m:m].length<2&&c.push(m)})})}),c=r$(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),f,p;d<u;++d)(f=o(c[d]))>h&&(p=c[0],c[0]=c[d],c[d]=p,h=f);return c}).filter(function(l){return l.length>0})}}class o$ extends mn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=Z.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(),d=a.getDomainScale(),h=d.invert(o===Nt.VERTICAL?n:r),f=A.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=A.appendOrSelect(f,"line.ruler-line"),v=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(St(m,"data.x0"))<=h&&parseFloat(St(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!zp(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=D(v.nodes()[0]).datum(),y=parseFloat(St(m,"data.x0")),b=parseFloat(St(m,"data.x1")),S=this.model.getActiveDataGroupNames(),_=S.reverse().map(M=>({label:M,value:St(m,`data.${M}`),class:this.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:M})})).filter(M=>M.value!==0);if(_.length>0){this.services.events.dispatchEvent(w.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:St(s,"bins.rangeLabel")||"Range",value:`${y} – ${b}`},..._,...x(s,"tooltip","showTotal")===!0?[{label:St(s,"tooltip.totalLabel")||"Total",value:S.reduce((C,G)=>C+parseFloat(St(m,`data.${G}`)),0)}]:[]]}),f.attr("opacity",1);const M=d((y+b)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",M).attr("y2",M):p.attr("y1",u).attr("y2",c).attr("x1",M).attr("x2",M)}else this.hideRuler()}else this.hideRuler()}}class Na extends mn{formatTooltipData(t){return t.reverse()}}class Tm extends zc{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=Z.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=A.getSVGElementSize(i,{useAttrs:!0}),a=x(this.getOptions(),"data","loading");if(s>At.color.barWidth&&!a){const o=x(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,u=l.getMainXScale().range();if(u[0]>1&&(i.select("g.legend").attr("transform",`translate(${u[0]}, 0)`),o)){const{width:d}=A.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),h=u[0]-d-9;h>1?i.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(i.select("g.legend").attr("transform",`translate(${u[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${u[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(w.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer(),{width:i}=A.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 u=!Ce(s),d=_m(this.model.getDisplayData()),h=!(i<=At.color.barWidth),f=h?At.color.barWidth:i,p=A.appendOrSelect(r,"g.legend"),g=A.appendOrSelect(p,"g.legend-axis");if(l){const C=A.appendOrSelect(r,"g.legend-title");A.appendOrSelect(C,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const v=d[0]<0&&d[1]>0?"diverge":"mono";(o<1&&o>4&&v==="mono"||o<1&&o>2&&v==="diverge")&&(o=1);let m=[];const y=v==="diverge"?17:11;if(u)m=s;else for(let C=1;C<y+1;C++)m.push(a===Ai.LINEAR?`stop-color-${v}-${o}-${C}`:`fill-${v}-${o}-${C}`);const b=ae(d[0],d[1]),S=Ly(b,3),_=Oe().domain(d).range([0,f]),E=qa(_).tickSize(0).tickValues(S);let M;switch(a){case Ai.LINEAR:this.drawLinear(m,p,f);break;case Ai.QUANTIZE:M=this.drawQuantize(m,v,u,p,f),_.range([M,f]);break;default:throw Error("Entered color legend type is not supported.")}g.attr("transform",`translate(0,${At.color.axisYTranslation})`).call(E),g.select(".domain").remove(),g.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),g.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);A.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(o,l)=>`${l*i}%`).attr("class",(o,l)=>t[l]).attr("stop-color",o=>o),A.appendOrSelect(n,"rect").attr("width",r).attr("height",At.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=si().domain(t).range([0,s]);return A.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",l=>a(l)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",At.color.barHeight).attr("class",l=>l).attr("fill",l=>l),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(w.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class l$ extends Bi{constructor(){super(...arguments),this.type="meter-title",this.renderType=Z.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 c=i.selectAll("text.meter-title").data([n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(u=>u),c.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),l=A.appendOrSelect(i,"text.meter-title");o>0&&l.node().getComputedTextLength()>o&&this.truncateTitle(l,o)}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,d=x(n,"meter","proportional","breakdownFormatter");a=d!==null?d({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=A.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=A.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-Gt.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(d=>d),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=A.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=r.width?r.width:0,s=this.model.getStatus(),a=Gt.status.indicatorSize/2,o=A.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=A.appendOrSelect(n,"text.meter-title"),i=x(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(i),a=Gt.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=A.appendOrSelect(this.parent,"tspan"),i=Gt.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());A.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=A.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=A.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=A.getSVGElementSize(i,{useBBox:!0}).width;return r-s-Gt.total.paddingLeft}else{const i=A.appendOrSelect(this.parent,"text.percent-value"),s=Gt.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=A.appendOrSelect(this.parent,"g.status-indicator").node(),l=A.getSVGElementSize(o,{useBBox:!0}).width+Gt.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case Mi.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 Mi.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Mi.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 Qc extends lt{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=A.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 i=this.model.get("zoomDomain");if(i!==void 0){const s=this.services.cartesianScales.getDomainScale();return t<s(i[0])||n>s(i[1])}return!1}}class c$ extends lt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=Z.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:Or.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}=A.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=ni({children:s}).sum(g=>g.value).sort((g,v)=>v.value-g.value),h=Yb().size([r,i]).padding(g=>g.depth>=1?Or.padding.children+3:Or.padding.mainGroup+3)(u).descendants().splice(1).filter(g=>g.depth<=o),f=n.selectAll("circle.node").data(h);f.exit().attr("width",0).attr("height",0).remove();const p=f.enter().append("circle").classed("node",!0);p.merge(f).attr("class",g=>{const v=c&&o===3?this.getZoomClass(g):"";return this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:g.data.dataGroupName,originalClassName:g.children?`node ${v}`:`node node-leaf ${v}`})}).style("fill",g=>this.model.getFillColor(g.data.dataGroupName)).style("stroke",g=>this.model.getFillColor(g.data.dataGroupName)).attr("cx",g=>g.x).attr("cy",g=>g.y).transition("circlepack-leaf-update-enter").call(g=>this.services.transitions.setupTransition({transition:g,name:"circlepack-leaf-update-enter"})).attr("r",g=>g.r).attr("opacity",1).attr("fill-opacity",Or.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,wr),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",Or.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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,wr)})}getZoomIcon(){return`
|
|
79
|
+
`;h.html(f),p();function p(){h.attr("gradientTransform",`translate(${c-3*.2*l}, 0)`).transition().duration(2e3).delay(1e3).ease(N1).attr("gradientTransform",`translate(${u+3*.2*l}, 0)`).on("end",p)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class Vk extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(tn(Et.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new Lr(this.model,this.services),new ym(this.model,this.services),new He(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class Gk extends Wn{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Wa(t,.25),q_50:Wa(t,.5),q_75:Wa(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,d=c.quartiles.q_75,h=(d-u)*1.5,f=u-h,p=d+h,g=[],v=[];for(const b of l)b<f||b>p?g.push(b):v.push(b);c.outliers=g;const m=cn(v),y=En(v);c.whiskers={min:m||cn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||En([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(s=>{let a=x(s,"outliers");return(a===null||a.length===0)&&(a=["–"]),[s[n],x(s,"whiskers","min")!==null?x(s,"whiskers","min").toLocaleString():"–",x(s,"quartiles","q_25")!==null?x(s,"quartiles","q_25").toLocaleString():"–",x(s,"quartiles","q_50")!==null?x(s,"quartiles","q_50").toLocaleString():"–",x(s,"quartiles","q_75")!==null?x(s,"quartiles","q_75").toLocaleString():"–",x(s,"whiskers","max")!==null?x(s,"whiskers","max").toLocaleString():"–",x(s,"quartiles","q_75")!==null&&x(s,"quartiles","q_25")!==null?(x(s,"quartiles","q_75")-x(s,"quartiles","q_25")).toLocaleString():"–",a.map(o=>o.toLocaleString()).join(",")]})]}setColorClassNames(){const n=x(this.getOptions(),"color","pairing");let r=x(n,"option");const i=Qp.pairingOptions;r=r<=i["1-color"]?r:1;const s=this.allDataGroups.map(()=>`1-${r}-1`);this.colorClassNames=ks().range(s).domain(this.allDataGroups)}}class Hk extends lt{constructor(){super(...arguments),this.type="boxplot",this.renderType=Z.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,d]=o.range(),h=c-l,f=u-d;if(h===0)return;const{cartesianScales:p}=this.services,g=p.getOrientation(),v=g===Nt.VERTICAL,[m,y]=sn(T=>this.services.cartesianScales.getDomainValue(T),T=>this.services.cartesianScales.getRangeValue(T),g),b=Math.floor((v?h:f)/s.length),S=Math.min(b/2,16),_=this.model.getBoxplotData(),E=n.selectAll(".box-group").data(_);E.exit().remove();const M=E.enter().append("g").attr("class","box-group"),C=E.merge(M);M.append("path").merge(E.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",ye.strokeWidth.default).attr("fill","none").transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-verticalstartline",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i]),R=L,k=p.getRangeValue(T.whiskers.min),O=p.getRangeValue(T.quartiles.q_25);return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",ye.strokeWidth.default).attr("fill","none").transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-verticalendline",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i]),R=L,k=p.getRangeValue(T.whiskers.max),O=p.getRangeValue(T.quartiles.q_75);return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],originalClassName:"box"})).attr("fill-opacity",ye.box.opacity.default).attr("stroke-width",ye.strokeWidth.default).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",T=>T[i]).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-quartiles",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i])-S/2,R=L+S,k=p.getRangeValue(Math[v?"max":"min"](T.quartiles.q_75,T.quartiles.q_25)),O=k+Math.abs(p.getRangeValue(T.quartiles.q_75)-p.getRangeValue(T.quartiles.q_25));return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",T=>{const L=p.getDomainValue(T[i])-S/2,R=L+S,k=p.getRangeValue(T.whiskers.min),O=p.getRangeValue(T.whiskers.max);return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"whisker start"})).attr("stroke-width",ye.strokeWidth.thicker).attr("fill","none").transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-startingwhisker",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i])-S/4,R=L+S/2,k=p.getRangeValue(T.whiskers.min),O=p.getRangeValue(T.whiskers.min);return jt({x0:L,x1:R,y0:k,y1:O},g)}),M.append("path").merge(E.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-median",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i])-S/2,R=L+S,k=p.getRangeValue(T.quartiles.q_50);return jt({x0:L,x1:R,y0:k,y1:k},g)}),M.append("path").merge(E.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.STROKE],originalClassName:"whisker end"})).attr("stroke-width",ye.strokeWidth.thicker).attr("fill","none").transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"boxplot-update-endingwhisker",animate:t})).attr("d",T=>{const L=p.getDomainValue(T[i])-S/4,R=L+S/2,k=p.getRangeValue(T.whiskers.max),O=p.getRangeValue(T.whiskers.max);return jt({x0:L,x1:R,y0:k,y1:O},g)});const G=C.selectAll("circle.outlier").data(T=>T.outliers.map(L=>({min:T.whiskers.min,max:T.whiskers.max,[i]:T[i],value:L})));G.exit().remove();const I=G.enter().append("circle");G.merge(I).attr("r",ye.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],originalClassName:"outlier"})).attr("fill-opacity",ye.circle.opacity.default).attr("cx",m).transition().call(T=>this.services.transitions.setupTransition({transition:T,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",ye.box.opacity.hovered),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[r],class:t.model.getColorClassName({classNameTypes:[Q.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(w.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=D(this);t.services.events.dispatchEvent(w.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(w.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",ye.box.opacity.default),t.services.events.dispatchEvent(w.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(w.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",ye.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[r],class:t.model.getColorClassName({classNameTypes:[Q.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(w.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=D(this);t.services.events.dispatchEvent(w.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(w.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",ye.circle.opacity.default),t.services.events.dispatchEvent(w.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o})})}}class Rr extends lt{constructor(){super(...arguments),this.type="zero-line",this.renderType=Z.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 d=rg({x0:l,x1:c,y0:u,y1:u},this.services.cartesianScales.getOrientation());A.appendOrSelect(o,"line.domain").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"zero-line-update",animate:t})).attr("y1",d.y0).attr("y2",d.y1).attr("x1",d.x0).attr("x2",d.x1)}}class Fk extends re{constructor(t,n){super(t,n),this.model=new Gk(this.services),this.model.setOptions(Ct(Et.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Hk(this.model,this.services),new Rr(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class zk extends He{constructor(){super(...arguments),this.type="bubble",this.renderType=Z.SVG}getRadiusScale(t){const n=this.getOptions(),{radiusMapsTo:r}=n.bubble,i=t.data(),s=i.map(c=>c[r]).filter(c=>c),a=A.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=s.length>0,l=o?be(s):[1,1];return Oe().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=h=>o.getDomainValue(h),c=h=>o.getRangeValue(h),[u,d]=sn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",h=>{const f=o.getRangeIdentifier(h);return h[f]}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bubble-update-enter",animate:n})).attr("cx",u).attr("cy",d).attr("r",h=>s(h[i]||1)).attr("class",h=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:h[a],originalClassName:"dot"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[a],h[f],h)}).style("stroke",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getStrokeColor(h[a],h[f],h)}).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 Wk extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new zk(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class Yk extends Wn{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(o=>[o.title,o[r],o.value===null?"–":o.value,x(o,"marker")===null?"–":o.marker,x(o,"marker")===null?"–":`${Math.floor(o[i]/o.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(o)]])]}}class qk extends lt{constructor(){super(...arguments),this.type="bullet",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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(),d=()=>{const g=[];s.forEach(y=>{y.ranges?y.ranges.forEach((b,S)=>{b!=null&&b<u&&g.push({datum:y,value:b,order:S+1})}):g.push({datum:y,order:1})});const v=A.appendOrSelect(i,"g.range-boxes").selectAll("path.range-box").data(g,y=>`${y[r]}-${y.order}`);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).attr("class",y=>`range-box order-${y.order}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-range-box-update-enter",animate:t})).attr("d",y=>{let S,_,E,M;return y.order===1?(S=this.services.cartesianScales.getDomainValue(y.datum)-16/2,_=S+16,E=c-2,M=l+1):(S=this.services.cartesianScales.getDomainValue(y.datum)-16/2,_=S+16,E=this.services.cartesianScales.getRangeValue(y.value),M=c),jt({x0:S,x1:_,y0:E,y1:M},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},h=()=>{const g=A.appendOrSelect(i,"g.bars").selectAll("path.bar").data(s,m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("bar",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-bar-update-enter",animate:t})).attr("class",m=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>this.model.getFillColor(m[r])).attr("d",m=>{const b=this.services.cartesianScales.getDomainValue(m)-4,S=b+8,_=this.services.cartesianScales.getRangeValue(0)+1,E=this.services.cartesianScales.getRangeValue(m);return jt({x0:b,x1:S,y0:_,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",m=>m.value)},f=()=>{const g=A.appendOrSelect(i,"g.markers").selectAll("path.marker").data(s.filter(m=>x(m,"marker")!==null),m=>m[r]);g.exit().attr("opacity",0).remove(),g.enter().append("path").attr("opacity",0).merge(g).classed("marker",!0).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"bullet-marker-update-enter",animate:t})).attr("d",m=>{const b=this.services.cartesianScales.getDomainValue(m)-12,S=b+24,_=this.services.cartesianScales.getRangeValue(m.marker);return jt({x0:b,x1:S,y0:_,y1:_},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let g=[];s.filter(y=>x(y,"marker")!==null).forEach(y=>{const b=y.marker,S=y[o];g=g.concat([{datum:y,value:b*.25,barValue:S},{datum:y,value:b*.5,barValue:S},{datum:y,value:b*.75,barValue:S}])});const v=A.appendOrSelect(i,"g.quartiles").selectAll("path.quartile").data(g,y=>y[r]);v.exit().attr("opacity",0).remove(),v.enter().append("path").attr("opacity",0).merge(v).attr("class",y=>`quartile ${y.value<=y.barValue?"over-bar":""}`).transition().call(y=>this.services.transitions.setupTransition({transition:y,name:"bullet-quartile-update-enter",animate:t})).attr("d",({datum:y,value:b})=>{let S=4;y.ranges&&y.ranges.indexOf(b)!==-1&&(S=8);const _=this.services.cartesianScales.getDomainValue(y)-S/2,E=_+S,M=this.services.cartesianScales.getRangeValue(b);return jt({x0:_,x1:E,y0:M,y1:M},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};d(),h(),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(w.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=x(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[Q.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(w.Bar.BAR_MOUSEMOVE,{event:s,element:D(this),datum:a}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(w.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(w.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Xk extends re{constructor(t,n){super(t,n),this.model=new Yk(this.services),this.model.setOptions(Ct(Et.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new qk(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}function Em(e){const t=be(e,r=>r.value),n=Oe().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 Sm(e,t){const n=x(t,"gradient","colors"),r=!Ce(n);let i=x(t,"pairing","option");const s=Em(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 Jo().domain(s).range(o)}class jk extends Ge{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(Ce(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!Ce(n)&&!Ce(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(r=>[r.id===null?"–":r.id,r.name,r.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=x(this.getOptions(),"color");this._colorScale=Sm(this.getDisplayData(),t)}}function Zk(e){return e}function Kk(e){if(e==null)return Zk;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,d=new Array(u);for(d[0]=(t+=o[0])*r+s,d[1]=(n+=o[1])*i+a;c<u;)d[c]=o[c],++c;return d}}function Qk(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function Jk(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return _m(e,n)})}:_m(e,t)}function _m(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Kc(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 Kc(e,t){var n=Kk(e.transform),r=e.arcs;function i(u,d){d.length&&d.pop();for(var h=r[u<0?~u:u],f=0,p=h.length;f<p;++f)d.push(n(h[f],f));u<0&&Qk(d,p)}function s(u){return n(u)}function a(u){for(var d=[],h=0,f=u.length;h<f;++h)i(u[h],d);return d.length<2&&d.push(d[0]),d}function o(u){for(var d=a(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(o)}function c(u){var d=u.type,h;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":h=s(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(s);break;case"LineString":h=a(u.arcs);break;case"MultiLineString":h=u.arcs.map(a);break;case"Polygon":h=l(u.arcs);break;case"MultiPolygon":h=u.arcs.map(l);break;default:return null}return{type:d,coordinates:h}}return c(t)}function t$(e,t){var n={},r={},i={},s=[],a=-1;t.forEach(function(c,u){var d=e.arcs[c<0?~c:c],h;d.length<3&&!d[1][0]&&!d[1][1]&&(h=t[++a],t[a]=c,t[u]=h)}),t.forEach(function(c){var u=o(c),d=u[0],h=u[1],f,p;if(f=i[d])if(delete i[f.end],f.push(c),f.end=h,p=r[h]){delete r[p.start];var g=p===f?f:f.concat(p);r[g.start=f.start]=i[g.end=p.end]=g}else r[f.start]=i[f.end]=f;else if(f=r[h])if(delete r[f.start],f.unshift(c),f.start=d,p=i[d]){delete i[p.end];var v=p===f?f:p.concat(f);r[v.start=p.start]=i[v.end=f.end]=v}else r[f.start]=i[f.end]=f;else f=[c],r[f.start=d]=i[f.end=h]=f});function o(c){var u=e.arcs[c<0?~c:c],d=u[0],h;return e.transform?(h=[0,0],u.forEach(function(f){h[0]+=f[0],h[1]+=f[1]})):h=u[u.length-1],c<0?[h,d]:[d,h]}function l(c,u){for(var d in c){var h=c[d];delete u[h.start],delete h.start,delete h.end,h.forEach(function(f){n[f<0?~f:f]=1}),s.push(h)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||s.push([c])}),s}function e$(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 n$(e){return Kc(e,r$.apply(this,arguments))}function r$(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 e$(Kc(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(d){d.forEach(function(h){n[h<0?~h:h].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(g){g.forEach(function(v){v.forEach(function(m){n[m<0?~m:m].length<2&&c.push(m)})})}),c=t$(e,c),(u=c.length)>1)for(var d=1,h=o(c[0]),f,p;d<u;++d)(f=o(c[d]))>h&&(p=c[0],c[0]=c[d],c[d]=p,h=f);return c}).filter(function(l){return l.length>0})}}class i$ extends mn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=Z.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(),d=a.getDomainScale(),h=d.invert(o===Nt.VERTICAL?n:r),f=A.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),p=A.appendOrSelect(f,"line.ruler-line"),v=i.selectAll("[role=graphics-symbol]").filter(m=>{if(parseFloat(St(m,"data.x0"))<=h&&parseFloat(St(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!zp(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=D(v.nodes()[0]).datum(),y=parseFloat(St(m,"data.x0")),b=parseFloat(St(m,"data.x1")),S=this.model.getActiveDataGroupNames(),_=S.reverse().map(M=>({label:M,value:St(m,`data.${M}`),class:this.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:M})})).filter(M=>M.value!==0);if(_.length>0){this.services.events.dispatchEvent(w.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:St(s,"bins.rangeLabel")||"Range",value:`${y} – ${b}`},..._,...x(s,"tooltip","showTotal")===!0?[{label:St(s,"tooltip.totalLabel")||"Total",value:S.reduce((C,G)=>C+parseFloat(St(m,`data.${G}`)),0)}]:[]]}),f.attr("opacity",1);const M=d((y+b)/2);o==="horizontal"?p.attr("x1",u).attr("x2",c).attr("y1",M).attr("y2",M):p.attr("y1",u).attr("y2",c).attr("x1",M).attr("x2",M)}else this.hideRuler()}else this.hideRuler()}}class Na extends mn{formatTooltipData(t){return t.reverse()}}class wm extends zc{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=Z.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const i=this.getComponentContainer(),{width:s}=A.getSVGElementSize(i,{useAttrs:!0}),a=x(this.getOptions(),"data","loading");if(s>At.color.barWidth&&!a){const o=x(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:l}=this.services,u=l.getMainXScale().range();if(u[0]>1&&(i.select("g.legend").attr("transform",`translate(${u[0]}, 0)`),o)){const{width:d}=A.getSVGElementSize(i.select("g.legend-title").select("text"),{useBBox:!0}),h=u[0]-d-9;h>1?i.select("g.legend-title").attr("transform",`translate(${h}, 0)`):(i.select("g.legend").attr("transform",`translate(${u[0]}, 16)`),i.select("g.legend-title").attr("transform",`translate(${u[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(w.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(t=!1){const n=this.getOptions(),r=this.getComponentContainer(),{width:i}=A.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 u=!Ce(s),d=Em(this.model.getDisplayData()),h=!(i<=At.color.barWidth),f=h?At.color.barWidth:i,p=A.appendOrSelect(r,"g.legend"),g=A.appendOrSelect(p,"g.legend-axis");if(l){const C=A.appendOrSelect(r,"g.legend-title");A.appendOrSelect(C,"text").text(l).attr("dy","0.7em"),p.attr("transform","translate(0, 16)")}const v=d[0]<0&&d[1]>0?"diverge":"mono";(o<1&&o>4&&v==="mono"||o<1&&o>2&&v==="diverge")&&(o=1);let m=[];const y=v==="diverge"?17:11;if(u)m=s;else for(let C=1;C<y+1;C++)m.push(a===Ai.LINEAR?`stop-color-${v}-${o}-${C}`:`fill-${v}-${o}-${C}`);const b=ae(d[0],d[1]),S=Ay(b,3),_=Oe().domain(d).range([0,f]),E=qa(_).tickSize(0).tickValues(S);let M;switch(a){case Ai.LINEAR:this.drawLinear(m,p,f);break;case Ai.QUANTIZE:M=this.drawQuantize(m,v,u,p,f),_.range([M,f]);break;default:throw Error("Entered color legend type is not supported.")}g.attr("transform",`translate(0,${At.color.axisYTranslation})`).call(E),g.select(".domain").remove(),g.select("g.tick:last-of-type text").style("text-anchor",h?"middle":"end"),g.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);A.appendOrSelect(n,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(t).enter().append("stop").attr("offset",(o,l)=>`${l*i}%`).attr("class",(o,l)=>t[l]).attr("stop-color",o=>o),A.appendOrSelect(n,"rect").attr("width",r).attr("height",At.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=si().domain(t).range([0,s]);return A.appendOrSelect(i,"g.quantized-rect").selectAll("rect").data(a.domain()).join("rect").attr("x",l=>a(l)).attr("y",0).attr("width",Math.max(0,a.bandwidth()-1)).attr("height",At.color.barHeight).attr("class",l=>l).attr("fill",l=>l),(!r&&n)==="mono"?a.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(w.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class s$ extends Bi{constructor(){super(...arguments),this.type="meter-title",this.renderType=Z.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 c=i.selectAll("text.meter-title").data([n[s]]);c.enter().append("text").classed("meter-title",!0).merge(c).attr("x",0).attr("y","1em").text(u=>u),c.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),l=A.appendOrSelect(i,"text.meter-title");o>0&&l.node().getComputedTextLength()>o&&this.truncateTitle(l,o)}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,d=x(n,"meter","proportional","breakdownFormatter");a=d!==null?d({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=A.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=A.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-Gt.total.paddingRight:c).attr("y","1em").attr("text-anchor","end").text(d=>d),u.exit().remove()}displayStatus(){const t=this,n=this.getComponentContainer(),r=A.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=r.width?r.width:0,s=this.model.getStatus(),a=Gt.status.indicatorSize/2,o=A.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=A.appendOrSelect(n,"text.meter-title"),i=x(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[t]:[],s=n.selectAll("text.percent-value").data(i),a=Gt.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=A.appendOrSelect(this.parent,"tspan"),i=Gt.statusBar.paddingRight,s=Math.ceil(r.node().getComputedTextLength());A.appendOrSelect(this.parent,"text.percent-value").attr("x",+t.attr("x")+t.node().getComputedTextLength()+s+i)}getMaxTitleWidth(){const t=A.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=A.appendOrSelect(this.parent,"text.proportional-meter-total").node(),s=A.getSVGElementSize(i,{useBBox:!0}).width;return r-s-Gt.total.paddingLeft}else{const i=A.appendOrSelect(this.parent,"text.percent-value"),s=Gt.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=A.appendOrSelect(this.parent,"g.status-indicator").node(),l=A.getSVGElementSize(o,{useBBox:!0}).width+Gt.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case Mi.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 Mi.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case Mi.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 Qc extends lt{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=A.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 i=this.model.get("zoomDomain");if(i!==void 0){const s=this.services.cartesianScales.getDomainScale();return t<s(i[0])||n>s(i[1])}return!1}}class a$ extends lt{constructor(){super(...arguments),this.type="circle-pack",this.renderType=Z.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:Or.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}=A.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=ni({children:s}).sum(g=>g.value).sort((g,v)=>v.value-g.value),h=zb().size([r,i]).padding(g=>g.depth>=1?Or.padding.children+3:Or.padding.mainGroup+3)(u).descendants().splice(1).filter(g=>g.depth<=o),f=n.selectAll("circle.node").data(h);f.exit().attr("width",0).attr("height",0).remove();const p=f.enter().append("circle").classed("node",!0);p.merge(f).attr("class",g=>{const v=c&&o===3?this.getZoomClass(g):"";return this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:g.data.dataGroupName,originalClassName:g.children?`node ${v}`:`node node-leaf ${v}`})}).style("fill",g=>this.model.getFillColor(g.data.dataGroupName)).style("stroke",g=>this.model.getFillColor(g.data.dataGroupName)).attr("cx",g=>g.x).attr("cy",g=>g.y).transition("circlepack-leaf-update-enter").call(g=>this.services.transitions.setupTransition({transition:g,name:"circlepack-leaf-update-enter"})).attr("r",g=>g.r).attr("opacity",1).attr("fill-opacity",Or.circles.fillOpacity),c===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,p,wr),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",Or.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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,wr)})}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=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=[],d=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:St(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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,wr)}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,wr),n.stopPropagation()}t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function u$(e,t){const n=Vr(this._current,e);return r=>(this._current=n(r),t(this._current))}class Mm extends lt{constructor(){super(...arguments),this.type="pie",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return wt.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(L=>L[a]>0),l=this.computeRadius();this.arc=hi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=hi().innerRadius(this.getInnerRadius()).outerRadius(l+wt.hoverArc.outerRadiusOffset);const u=FS().value(L=>L[a]).sort(x(i,"pie","sortFunction")).padAngle(wt.padAngle)(o),h=A.appendOrSelect(r,"g.slices").attr("role",st.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,L=>L.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",L=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:L.data[s],originalClassName:"slice"})).style("fill",L=>n.model.getFillColor(L.data[s])).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[a]}, ${ng(L.data[a],o,a)+"%"}`).attrTween("d",function(L){return u$.bind(this)(L,n.arc)});const g=i.pie.labels.enabled,v=g?u.filter(L=>L.data[a]>0):[],y=A.appendOrSelect(r,"g.labels").attr("role",st.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(v,L=>L.data[s]);y.exit().attr("opacity",0).remove();const b=y.enter().append("text").classed("pie-label",!0),S=[];b.merge(y).style("text-anchor","middle").text(L=>i.pie.labels.formatter?i.pie.labels.formatter(L):ng(L.data[a],o,a)+"%").datum(function(L){const R=l+7,k=(L.endAngle-L.startAngle)/2+L.startAngle,O=k/Math.PI*180,U=this.getComputedTextLength();return L.textOffsetX=U/2,L.textOffsetY=O>90&&O<270?10:0,L.xPosition=(L.textOffsetX+R)*Math.sin(k),L.yPosition=(L.textOffsetY+R)*-Math.cos(k),L}).attr("transform",function(L,R){const k=v.length,O=(L.endAngle-L.startAngle)*(180/Math.PI);if(R>=k-2&&O<wt.callout.minSliceDegree){let U,P;return L.index===k-1?(U=L.xPosition+wt.callout.offsetX+wt.callout.textMargin+L.textOffsetX,P=L.yPosition-wt.callout.offsetY,L.direction=Ti.RIGHT,S.push(L)):(U=L.xPosition-wt.callout.offsetX-L.textOffsetX-wt.callout.textMargin,P=L.yPosition-wt.callout.offsetY,L.direction=Ti.LEFT,S.push(L)),`translate(${U}, ${P})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(S);const _=x(i,"donut")?"donut":"pie",E=x(i,_,"alignment"),{width:M}=A.getSVGElementSize(this.getParent(),{useAttrs:!0}),C=g?wt.xOffset:0,G=g?wt.yOffset:0;let I=l+C;E===It.CENTER?I=M/2:E===It.RIGHT&&(I=M-l-wt.xOffset);let T=l+G;S.length>0&&(T+=wt.yOffsetCallout),r.attr("x",I+7).attr("y",T),this.addEventListeners()}renderCallouts(t){const n=A.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",st.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",st.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===Ti.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+wt.callout.offsetX,y:c-wt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-wt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-wt.callout.offsetX,y:c-wt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+wt.callout.horizontalLineLength),o}),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",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.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",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.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(w.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(w.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(w.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.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(w.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=A.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+wt.radiusOffset:i}}class h$ extends Mm{constructor(){super(...arguments),this.type="donut",this.renderType=Z.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=A.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");A.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!==""&&A.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=Iu:s=ae;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 d$ extends lt{constructor(){super(...arguments),this.type="gauge",this.renderType=Z.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return cp(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===Gn.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 da.UP:return Cm;case da.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,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=hi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=hi().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),A.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:[Q.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=x(r,"gauge","alignment"),{width:v}=A.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;g===It.CENTER?m=v/2:g===It.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),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 d=0;r===Gn.FULL&&!s?d=l(a):r===Gn.SEMI&&s&&(d=-(l(a)+c));const h=A.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=A.appendOrSelect(h,"g.gauge-value-number"),g=x(n,"gauge","numberFormatter"),v=p.selectAll("text.gauge-value-number").data([i]);v.enter().append("text").attr("class","gauge-value-number").merge(v).style("font-size",`${f}px`).attr("text-anchor","middle").text(M=>g(M));const{width:m}=A.getSVGElementSize(A.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,b=u?"%":"",S=A.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",m/2).text(b),{width:_,height:E}=A.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"),d=A.appendOrSelect(n,"g.gauge-numbers"),h=A.appendOrSelect(d,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=A.appendOrSelect(h,"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:g}=A.getSVGElementSize(A.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),v=x(r,"gauge","deltaArrow","enabled"),m=h.selectAll("svg.gauge-delta-arrow").data(i!==null&&v?[i]:[]);m.enter().append("svg").merge(m).attr("class","gauge-delta-arrow").attr("x",-l(s)-g/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);A.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=x(r,"gauge","status");A.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),m.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(w.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=A.getSVGElementSize(this.parent,{useAttrs:!0});return n===Gn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Dm extends Qc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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=Oi(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",st.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Nt.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[i])).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,v=f+p,m=this.services.cartesianScales.getRangeAxisPosition({datum:h}),y=this.services.cartesianScales.getValueThroughAxisPosition(m,0),b=this.services.cartesianScales.getRangeValue(h),S=this.services.cartesianScales.getDomainValue(h)-p/2,_=S+p;if(!this.isOutsideZoomedDomain(S,_))return jt({x0:g,x1:v,y0:y,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.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(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.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(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].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 s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=si().domain(t).rangeRound([0,this.getGroupWidth()])}}class f$ extends lt{constructor(){super(...arguments),this.type="heatmap",this.renderType=Z.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="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${cn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${cn(l.range())},${c(r)})`),this.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n.event,hoveredElement:D(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(w.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(w.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(w.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(w.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(w.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(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[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",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value))).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[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=A.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);A.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),A.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),A.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),A.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!==_r.OFF&&(t===_r.AUTO&&Jp.minCellDividerDimension<=this.xBandwidth&&Jp.minCellDividerDimension<=this.yBandwidth||t===_r.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=St(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 d=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=Li(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i||"Total",value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const h=D(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class p$ extends lt{constructor(){super(...arguments),this.type="histogram",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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=>St(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",st.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,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const d=St(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let v=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(v-g)>0&&Math.abs(v-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Nt.VERTICAL?v+=1:v-=1),jt({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.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(St(s,"data.x0")),l=parseFloat(St(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:St(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:s[n]})},{label:u,value:St(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("mouseout",function(){D(this).classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class g$ extends He{constructor(){super(...arguments),this.type="lollipop",this.renderType=Z.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]?nn.weight.unselected:nn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",nn.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?nn.opacity.unselected:nn.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",nn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,f]=sn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);p.exit().attr("opacity",0).remove();const v=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Nt.HORIZONTAL?v.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>f(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class m$ extends lt{constructor(){super(...arguments),this.type="meter",this.renderType=Z.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Gt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Gt.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}=A.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(x(i,"meter","proportional")===null)u=100;else{const b=x(i,"meter","proportional","total");u=b||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Oe().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=x(i,"meter","height");A.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Gt.height.proportional:Gt.height.default)),A.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Gt.height.proportional:Gt.height.default));const p=r.selectAll("rect.value").data(h),g=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?Gt.height.proportional:Gt.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:b[c],originalClassName:g})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):b.width).style("fill",b=>n.model.getFillColor(b[c])).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const v=x(i,"meter","peak");let m=v;v!==null&&(v>u?m=u:v<a[0].value&&(m=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(m==null?[]:[m]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?Gt.height.proportional:Gt.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",st.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(w.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(w.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(w.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function Lm(e){const t=v$(Rm(e),360);return vn(t,[0,10])||vn(t,[350,0])?{textAnchor:Ue.START,dominantBaseline:Be.MIDDLE}:vn(t,[10,80])?{textAnchor:Ue.START,dominantBaseline:Be.HANGING}:vn(t,[80,100])?{textAnchor:Ue.MIDDLE,dominantBaseline:Be.HANGING}:vn(t,[100,170])?{textAnchor:Ue.END,dominantBaseline:Be.HANGING}:vn(t,[170,190])?{textAnchor:Ue.END,dominantBaseline:Be.MIDDLE}:vn(t,[190,260])?{textAnchor:Ue.END,dominantBaseline:Be.BASELINE}:vn(t,[260,280])?{textAnchor:Ue.MIDDLE,dominantBaseline:Be.BASELINE}:{textAnchor:Ue.START,dominantBaseline:Be.BASELINE}}function v$(e,t){return(e%t+t)%t}function vn(e,[t,n]){return e>=t&&e<=n}function Rm(e){return e*(180/Math.PI)}function Lt(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 y$(e,t){return t*Math.sin(e-Math.PI/2)}class x$ extends lt{constructor(){super(...arguments),this.type="radar",this.renderType=Z.SVG,this.getLabelDimensions=t=>{const n=A.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=A.appendOrSelect(n,"text").text(t),{width:i,height:s}=A.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=OD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return tt(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:tt(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?Hn.opacity.unselected:Hn.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?Hn.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",Hn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=A.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:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:v}=Hn;this.uniqueKeys=Array.from(new Set(s.map(V=>V[u]))),this.uniqueGroups=Array.from(new Set(s.map(V=>V[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),_=(Math.min(r,i)-y)/2;if(_<=0)return;const E=si().domain(this.fullDataNormalized.map(V=>V[u])).range([0,2*Math.PI].map(V=>V-Math.PI/2)),M=cn(this.fullDataNormalized.map(V=>V[d])),C=Oe().domain([M>=0?0:M,En(this.fullDataNormalized.map(V=>V[d]))]).range([g,_]).nice(p),G=C.ticks(p),I=V=>this.model.getFillColor(V),T=YS().angle(V=>E(V[u])+Math.PI/2).radius(V=>C(V[d])).curve(Kd),L=this.uniqueKeys.map(V=>{const H=this.getLabelDimensions(V).width,$=y$(E(V),_);return H+$}),k={x:En(L)+h,y:i/2},U=A.appendOrSelect(n,"g.y-axes").attr("role",st.GROUP).selectAll("path").data(G,V=>V),P=V=>this.uniqueKeys.map(H=>({[u]:H,[d]:V}));U.join(V=>V.append("path").attr("opacity",0).attr("transform",`translate(${k.x}, ${k.y})`).attr("fill","none").call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",$=>T(P($)))),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",$=>T(P($)))),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_exit",animate:t})).attr("d",$=>T(P($))).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-axes").attr("role",st.GROUP).selectAll("line").data(this.uniqueKeys,V=>V).join(V=>V.append("line").attr("opacity",0).attr("class",H=>`x-axis-${yr(H)}`).attr("stroke-dasharray","0").attr("x1",H=>Lt(E(H),0,k).x).attr("y1",H=>Lt(E(H),0,k).y).attr("x2",H=>Lt(E(H),0,k).x).attr("y2",H=>Lt(E(H),0,k).y).call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",$=>Lt(E($),C.range()[0],k).x).attr("y1",$=>Lt(E($),C.range()[0],k).y).attr("x2",$=>Lt(E($),C.range()[1],k).x).attr("y2",$=>Lt(E($),C.range()[1],k).y)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",$=>Lt(E($),C.range()[0],k).x).attr("y1",$=>Lt(E($),C.range()[0],k).y).attr("x2",$=>Lt(E($),C.range()[1],k).x).attr("y2",$=>Lt(E($),C.range()[1],k).y)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-labels").attr("role",st.GROUP).selectAll("text").data(this.uniqueKeys).join(V=>V.append("text").text(H=>H).attr("opacity",0).attr("x",H=>Lt(E(H),C.range()[1]+h,k).x).attr("y",H=>Lt(E(H),C.range()[1]+h,k).y).style("text-anchor",H=>Lm(E(H)).textAnchor).style("dominant-baseline",H=>Lm(E(H)).dominantBaseline).call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",$=>Lt(E($),C.range()[1]+h,k).x).attr("y",$=>Lt(E($),C.range()[1]+h,k).y).end().finally(()=>{const $=x(o,"radar","alignment"),pt=this.getAlignmentXOffset($,n,this.getParent());n.attr("x",pt)})),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),A.appendOrSelect(n,"g.blobs").attr("role",st.GROUP).selectAll("path").data(this.groupedDataNormalized,V=>V.name).join(V=>V.append("path").attr("class",H=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:H.name,originalClassName:"blob"})).attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",H=>H.name).attr("opacity",0).attr("transform",t?()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`:`translate(${k.x}, ${k.y})`).style("fill",H=>I(H.name)).style("fill-opacity",Hn.opacity.selected).style("stroke",H=>I(H.name)).call(H=>{const $=H.transition().call(pt=>this.services.transitions.setupTransition({transition:pt,name:"radar_blobs_enter",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",`translate(${k.x}, ${k.y})`),$.attr("opacity",1).attr("d",pt=>T(pt.data))}),V=>(V.attr("class",H=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:H.name,originalClassName:"blob"})).style("fill",H=>I(H.name)).style("stroke",H=>I(H.name)),V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",$=>T($.data))),V),V=>V.call(H=>{const $=H.transition().call(pt=>this.services.transitions.setupTransition({transition:pt,name:"radar_blobs_exit",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`),$.attr("opacity",0).remove()})),A.appendOrSelect(n,"g.dots").attr("role",st.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(V=>x(V,d)!==null)).join(V=>V.append("circle").attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",H=>H[c]),V=>V,V=>V.remove()).attr("class",V=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:V[l],originalClassName:yr(V[u])})).attr("cx",V=>Lt(E(V[u]),C(V[d]),k).x).attr("cy",V=>Lt(E(V[u]),C(V[d]),k).y).attr("r",0).attr("opacity",0).style("fill",V=>I(V[l])),A.appendOrSelect(n,"g.x-axes-rect").attr("role",st.GROUP).selectAll("rect").data(this.uniqueKeys).join(V=>V.append("rect"),V=>V,V=>V.remove()).attr("x",k.x).attr("y",k.y-v/2).attr("width",C.range()[1]).attr("height",v).style("fill","red").style("fill-opacity",0).attr("transform",V=>`rotate(${Rm(E(V))}, ${k.x}, ${k.y})`),A.appendOrSelect(n,"g.y-labels").attr("role",st.GROUP).selectAll("text").data(be(G)).join(V=>V.append("text").attr("opacity",0).text(H=>H).attr("x",H=>Lt(-Math.PI/2,C(H),k).x+f).attr("y",H=>Lt(-Math.PI/2,C(H),k).y).style("text-anchor","start").style("dominant-baseline","middle").call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_update",animate:t})).text($=>$).attr("opacity",1).attr("x",$=>Lt(-Math.PI/2,C($),k).x+f).attr("y",$=>Lt(-Math.PI/2,C($),k).y)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=A.getSVGElementSize(n,{useBBox:!0}),{width:s}=A.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===It.CENTER?a=Math.floor((s-i.width)/2):t===It.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.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(w.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${yr(i)}`),o=t.parent.selectAll(`.dots circle.${yr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=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",Hn.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=D(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(w.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-${yr(i)}`),o=t.parent.selectAll(`.dots circle.${yr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.HIDE)})}}class Im extends Qc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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,c=>c[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(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r])).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,v;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),v=this.services.cartesianScales.getRangeValue(h[1]);else{const b=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,b)),v=this.services.cartesianScales.getRangeValue(c)}const m=Math.abs(v-g);if(m!==0&&m<2&&(h>0&&a===Nt.VERTICAL||h<0&&a===Nt.HORIZONTAL?v=g-2:v=g+2),!this.isOutsideZoomedDomain(f,p))return jt({x0:f,x1:p,y0:g,y1:v},a)}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.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(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.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(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class b$ extends Zt{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=A.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=A.appendOrSelect(t,"svg.chart-skeleton.DAII"),A.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class km extends lt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=Z.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?en.opacity.unselected:en.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",en.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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(p=>i.axes[p].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}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>x(p,0,s));this.areaGenerator=fl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>x(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s))).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>x(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",en.opacity.selected).attr("d",this.areaGenerator)}}class $m extends Qc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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",st.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:[Q.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const v=c[0]<0&&c[1]<=0;v&&a.length>1?this.services.cartesianScales.getOrientation()===Nt.VERTICAL?g+=c[1]===0?2:1:g-=1:v||(this.services.cartesianScales.getOrientation()===Nt.VERTICAL?g+=1:g-=1)}return jt({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",st.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(w.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=D(this);r.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(w.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(w.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.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=A.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Pm extends He{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=Z.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>x(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",st.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),v=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[v]:f[1]}});this.styleCircles(h,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,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],v=this.services.cartesianScales.getDomainIdentifier(u),m=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[v]:f,[m]: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(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const Ir=6;class E$ extends lt{constructor(){super(...arguments),this.type="tree",this.renderType=Z.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}=A.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=A.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),d={top:0,right:0,bottom:0,left:l>0?l+Ir:30-Ir},h=ni({name:o,children:a}),f=10,p=r/6,g=E=>{const M=h.descendants().reverse(),C=h.links();let G=h,I=h;h.eachBefore(N=>{N.x<G.x&&(G=N),N.x>I.x&&(I=N)});const T=I.x-G.x,L=n.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,G.x,r,T].join(" ")),R=_.selectAll("g").data(M,N=>N.id),k=this,O=R.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",N=>N.depth!==0&&N.children&&N.children.length>0?"clickable":null).on("mouseover",function(N,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOVER,{event:N,element:D(this),datum:B})}).on("click",function(N,B){B.depth!==0&&(B.children=B.children?null:B._children,g(B)),k.services.events.dispatchEvent(w.Tree.NODE_CLICK,{event:N,element:D(this),datum:B})}).on("mouseout",function(N,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOUT,{event:N,element:D(this),datum:B})});O.append("circle").attr("r",2.5).attr("class",N=>N._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",N=>N._children?-Ir:Ir).attr("text-anchor",N=>N._children?"end":"start").text(N=>N.data.name).clone(!0).attr("class","text-stroke").lower(),R.merge(O).transition(L).attr("transform",N=>`translate(${N.y},${N.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),R.exit().transition(L).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=S.selectAll("path").data(C,N=>N.target.id),P=U.enter().append("path").attr("d",()=>{const N={x:E.x0,y:E.y0};return b({source:N,target:N})});U.merge(P).transition(L).attr("d",b),U.exit().transition(L).remove().attr("d",()=>{const N={x:E.x,y:E.y};return b({source:N,target:N})}),h.eachBefore(N=>{N.x0=N.x,N.y0=N.y})},v=h.descendants(),m=v[v.length-1].depth,y=x(s,"tree","type")===ha.DENDROGRAM?fb().size([i,r-u-m*Ir-l]):tE().nodeSize([f,p]).size([i,r-u-m*Ir-l]),b=QS().x(E=>E.y).y(E=>E.x);h.x0=p/2,h.y0=0,h.descendants().forEach((E,M)=>{E.id=M,E._children=E.children}),y(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");g(h)}}var S$="#000000",_$="#ffffff",w$="#fcf4d6",O$="#fddc69",T$="#f1c21b",M$="#d2a106",C$="#b28600",A$="#8e6a00",D$="#684e00",L$="#483700",R$="#302400",I$="#1c1500",k$={10:w$,20:O$,30:T$,40:M$,50:C$,60:A$,70:D$,80:L$,90:R$,100:I$},$$="#fff2e8",P$="#ffd9be",N$="#ffb784",U$="#ff832b",B$="#eb6200",V$="#ba4e00",G$="#8a3800",H$="#5e2900",F$="#3e1a00",z$="#231000",W$={10:$$,20:P$,30:N$,40:U$,50:B$,60:V$,70:G$,80:H$,90:F$,100:z$},Y$="#fff1f1",q$="#ffd7d9",X$="#ffb3b8",j$="#ff8389",Z$="#fa4d56",K$="#da1e28",Q$="#a2191f",J$="#750e13",tP="#520408",eP="#2d0709",nP={10:Y$,20:q$,30:X$,40:j$,50:Z$,60:K$,70:Q$,80:J$,90:tP,100:eP},rP="#fff0f7",iP="#ffd6e8",sP="#ffafd2",aP="#ff7eb6",oP="#ee5396",lP="#d02670",cP="#9f1853",uP="#740937",hP="#510224",dP="#2a0a18",fP={10:rP,20:iP,30:sP,40:aP,50:oP,60:lP,70:cP,80:uP,90:hP,100:dP},pP="#f6f2ff",gP="#e8daff",mP="#d4bbff",vP="#be95ff",yP="#a56eff",xP="#8a3ffc",bP="#6929c4",EP="#491d8b",SP="#31135e",_P="#1c0f30",wP={10:pP,20:gP,30:mP,40:vP,50:yP,60:xP,70:bP,80:EP,90:SP,100:_P},OP="#edf5ff",TP="#d0e2ff",MP="#a6c8ff",CP="#78a9ff",AP="#4589ff",DP="#0f62fe",LP="#0043ce",RP="#002d9c",IP="#001d6c",kP="#001141",$P={10:OP,20:TP,30:MP,40:CP,50:AP,60:DP,70:LP,80:RP,90:IP,100:kP},PP="#e5f6ff",NP="#bae6ff",UP="#82cfff",BP="#33b1ff",VP="#1192e8",GP="#0072c3",HP="#00539a",FP="#003a6d",zP="#012749",WP="#061727",YP={10:PP,20:NP,30:UP,40:BP,50:VP,60:GP,70:HP,80:FP,90:zP,100:WP},qP="#d9fbfb",XP="#9ef0f0",jP="#3ddbd9",ZP="#08bdba",KP="#009d9a",QP="#007d79",JP="#005d5d",tN="#004144",eN="#022b30",nN="#081a1c",rN={10:qP,20:XP,30:jP,40:ZP,50:KP,60:QP,70:JP,80:tN,90:eN,100:nN},iN="#defbe6",sN="#a7f0ba",aN="#6fdc8c",oN="#42be65",lN="#24a148",cN="#198038",uN="#0e6027",hN="#044317",dN="#022d0d",fN="#071908",pN={10:iN,20:sN,30:aN,40:oN,50:lN,60:cN,70:uN,80:hN,90:dN,100:fN},gN="#f2f4f8",mN="#dde1e6",vN="#c1c7cd",yN="#a2a9b0",xN="#878d96",bN="#697077",EN="#4d5358",SN="#343a3f",_N="#21272a",wN="#121619",ON={10:gN,20:mN,30:vN,40:yN,50:xN,60:bN,70:EN,80:SN,90:_N,100:wN},TN="#f4f4f4",MN="#e0e0e0",CN="#c6c6c6",AN="#a8a8a8",DN="#8d8d8d",LN="#6f6f6f",RN="#525252",IN="#393939",kN="#262626",$N="#161616",PN={10:TN,20:MN,30:CN,40:AN,50:DN,60:LN,70:RN,80:IN,90:kN,100:$N},NN="#f7f3f2",UN="#e5e0df",BN="#cac5c4",VN="#ada8a8",GN="#8f8b8b",HN="#726e6e",FN="#565151",zN="#3c3838",WN="#272525",YN="#171414",qN={10:NN,20:UN,30:BN,40:VN,50:GN,60:HN,70:FN,80:zN,90:WN,100:YN},Nm={black:{100:S$},blue:$P,coolGray:ON,cyan:YP,gray:PN,green:pN,magenta:fP,orange:W$,purple:wP,red:nP,teal:rN,warmGray:qN,white:{0:_$},yellow:k$};const XN=e=>{if(!e)return null;for(const t of Object.keys(Nm)){const n=Nm[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Um=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=Fe(t);let r;if(n&&(r=XN(n?n.hex():null)),r==null){const i=no(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let jN=0;class ZN extends lt{constructor(){super(...arguments),this.type="treemap",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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}=A.getSVGElementSize(n,{useAttrs:!0}),l=ni({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,v)=>v.value-g.value),c=sE().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>jN++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const v=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${v}`}).append("use").attr("xlink:href",function(){const v=D(this.parentNode.parentNode).attr("data-uid"),m=`${i.style.prefix}-leaf-${v}`;return new URL(`#${m}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let v=g;for(;v.depth>1;)v=v.parent;const m=no(this.model.getFillColor(v.data.name));return[{text:g.data.name,color:m.l<.5?"white":"black"}]},g=>g).join(g=>{const v=g.append("text").text(m=>m.text).style("fill",Um).attr("x",7).attr("y",18);return s&&v.attr("clip-path",function(){const m=D(this.parentNode).attr("data-uid"),y=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${y}`,s)+""})`}),v},g=>g.text(v=>v.text).style("fill",Um),g=>g.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),Fe(s).darker(.7).toString()}),t.services.events.dispatchEvent(w.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(w.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.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(w.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}}var KN={value:function(){}};function Bm(){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 Ua(n)}function Ua(e){this._=e}function QN(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}})}Ua.prototype=Bm.prototype={constructor:Ua,on:function(e,t){var n=this._,r=QN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=JN(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]=Vm(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Vm(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 Ua(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 JN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Vm(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=KN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const tU=BI(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Bm},Symbol.toStringTag,{value:"Module"}))).dispatch,Jc=Math.PI/180,eU={archimedean:Hm,rectangular:dU},Gi=64,Ba=2048;var nU=function(){var e=[256,256],t=rU,n=iU,r=sU,i=Gm,s=Gm,a=aU,o=oU,l=Hm,c=[],u=1/0,d=tU("word","end"),h=null,f=Math.random,p={},g=pU;p.canvas=function(y){return arguments.length?(g=yn(y),p):g},p.start=function(){var y=v(g()),b=fU((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,M=[],C=c.map(function(I,T){return I.text=t.call(this,I,T),I.font=n.call(this,I,T),I.style=i.call(this,I,T),I.weight=s.call(this,I,T),I.rotate=a.call(this,I,T),I.size=~~r.call(this,I,T),I.padding=o.call(this,I,T),I}).sort(function(I,T){return T.size-I.size});return h&&clearInterval(h),h=setInterval(G,0),G(),p;function G(){for(var I=Date.now();Date.now()-I<u&&++E<_&&h;){var T=C[E];T.x=e[0]*(f()+.5)>>1,T.y=e[1]*(f()+.5)>>1,lU(y,T,C,E),T.hasText&&m(b,T,S)&&(M.push(T),d.call("word",p,T),S?uU(S,T):S=[{x:T.x+T.x0,y:T.y+T.y0},{x:T.x+T.x1,y:T.y+T.y1}],T.x-=e[0]>>1,T.y-=e[1]>>1)}E>=_&&(p.stop(),d.call("end",p,M,S))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const y of c)delete y.sprite;return p};function v(y){const b=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const S=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return y.width=(Gi<<5)/S,y.height=Ba/S,b.fillStyle=b.strokeStyle="red",{context:b,ratio:S}}function m(y,b,S){e[0],e[1];for(var _=b.x,E=b.y,M=Math.sqrt(e[0]*e[0]+e[1]*e[1]),C=l(e),G=f()<.5?1:-1,I=-G,T,L,R;(T=C(I+=G))&&(L=~~T[0],R=~~T[1],!(Math.min(Math.abs(L),Math.abs(R))>=M));)if(b.x=_+L,b.y=E+R,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!S||hU(b,S))&&!cU(b,y,e[0])){for(var k=b.sprite,O=b.width>>5,U=e[0]>>5,P=b.x-(O<<4),N=P&127,B=32-N,Y=b.y1-b.y0,X=(b.y+b.y0)*U+(P>>5),J,ct=0;ct<Y;ct++){J=0;for(var W=0;W<=O;W++)y[X+W]|=J<<B|(W<O?(J=k[ct*O+W])>>>N:0);X+=U}return!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=yn(y),p):n},p.fontStyle=function(y){return arguments.length?(i=yn(y),p):i},p.fontWeight=function(y){return arguments.length?(s=yn(y),p):s},p.rotate=function(y){return arguments.length?(a=yn(y),p):a},p.text=function(y){return arguments.length?(t=yn(y),p):t},p.spiral=function(y){return arguments.length?(l=eU[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=yn(y),p):r},p.padding=function(y){return arguments.length?(o=yn(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=d.on.apply(d,arguments);return y===d?p:y},p};function rU(e){return e.text}function iU(){return"serif"}function Gm(){return"normal"}function sU(e){return Math.sqrt(e.value)}function aU(){return(~~(random()*6)-3)*30}function oU(){return 1}function lU(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Gi<<5)/s,Ba/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;const T=i.measureText(t.text),L=-Math.floor(T.width/2);let R=(T.width+1)*s,k=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Jc),d=Math.cos(t.rotate*Jc),h=R*d,f=R*u,p=k*d,g=k*u;R=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,k=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else R=R+31>>5<<5;if(k>l&&(l=k),a+R>=Gi<<5&&(a=0,o+=l,l=0),o+k>=Ba)break;i.translate((a+(R>>1))/s,(o+(k>>1))/s),t.rotate&&i.rotate(t.rotate*Jc),i.fillText(t.text,L,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,L,0)),i.restore(),t.width=R,t.height=k,t.xoff=a,t.yoff=o,t.x1=R>>1,t.y1=k>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=R}for(var v=i.getImageData(0,0,(Gi<<5)/s,Ba/s).data,m=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,b=y>>5,S=t.y1-t.y0,_=0;_<S*b;_++)m[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,M=-1,C=0;C<S;C++){for(var _=0;_<y;_++){var G=b*C+(_>>5),I=v[(o+C)*(Gi<<5)+(a+_)<<2]?1<<31-_%32:0;m[G]|=I,E|=I}E?M=C:(t.y0++,S--,C--,o++)}t.y1=t.y0+M,t.sprite=m.slice(0,(t.y1-t.y0)*b)}}}function cU(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,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function uU(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 hU(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 Hm(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function dU(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 fU(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function pU(){return document.createElement("canvas")}function yn(e){return typeof e=="function"?e:function(){return e}}const gU=rm(nU);class mU extends lt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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:d}=A.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=gU().size([u,d]).words(i.map(function(p){const g=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:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=A.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const v=g.selectAll("text").data(p,y=>`${y[c]}-${y.text}`);v.exit().attr("opacity",0).remove(),v.enter().append("text").attr("opacity",0).merge(v).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.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=A.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?be(i):[1,1];return Oe().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=ua(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(w.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),r.services.events.dispatchEvent(w.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:[Q.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.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(w.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o})})}}class vU extends lt{constructor(){super(...arguments),this.type="geo",this.renderType=Z.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=A.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(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=s$(s,Object.values(l)),u=n$(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=Bx().projection(d);A.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=A.appendOrSelect(t,"defs");A.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",di()([[0,0],[0,10]]));const v=A.appendOrSelect(t,"g.missing-data");A.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case Ve.geoEqualEarth:t=ib();break;case Ve.geoAlbers:t=Kx();break;case Ve.geoConicEqualArea:t=Qh();break;case Ve.geoConicEquidistant:t=nb();break;case Ve.geoEquirectangular:t=tb();break;case Ve.geoMercator:t=Qx();break;case Ve.geoNaturalEarth1:t=sb();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",s=>this.model.getColorClassName({value:n[s.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(br.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.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(br.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(br.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(br.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.HIDE,{event:r,hoveredElement:s})})}}class xU extends Le{constructor(t,n){super(t,n),this.model=new Qk(this.services),this.model.setOptions(Ct(Et.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 Bi(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Ta(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new he(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new Tm(this.model,this.services,{chartType:"choropleth"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=bt.COLUMN_REVERSE,f={id:"spacer",components:[new ln(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new he(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new Wc(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,g,{direction:bt.COLUMN})]}getComponents(){const t=[new yU(this.model,this.services)];return this.getChartComponents(t)}}class bU extends Ge{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=tt({},t,this.getZoomOptions(t));dc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:tt(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:$t.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(["–",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}}class EU extends Le{constructor(t,n){super(t,n),this.model=new bU(this.services),this.model.setOptions(Ct(Et.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new c$(this.model,this.services)];return this.getChartComponents(t)}}const Fm={[le.LINE]:[Lr,He],[le.SCATTER]:[He],[le.AREA]:[bm,Lr,He],[le.STACKED_AREA]:[km,Lr,Pm,Na],[le.SIMPLE_BAR]:[Im],[le.GROUPED_BAR]:[Dm,Rr],[le.STACKED_BAR]:[$m,Na]};class SU extends re{constructor(t,n){super(t,n);const r=Ct(Et.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:le.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(Fm).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=`${kM(i.type)}Chart`;return a=tt({},Et[l],this.model.getOptions(),i.options),i.type===le.STACKED_AREA&&(o=!0),Fm[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=tt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Pf(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===le.STACKED_BAR||s.type===le.STACKED_AREA),r=[new ie(this.model,this.services),new de(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID}),...n?[]:[new mn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class _U extends Ge{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(s=>[s[r],s.value===null?"–":s.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class zm extends Le{constructor(t,n,r=!1){super(t,n),this.model=new _U(this.services),!r&&(this.model.setOptions(Ct(Et.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Mm(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}class wU extends zm{constructor(t,n){super(t,n,!0),this.model.setOptions(Ct(Et.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new h$(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.DONUT})];return this.getChartComponents(t)}}class OU extends Ge{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(s=>[s[r],s.value===null?"–":s.value.toLocaleString()])]}}class TU extends Le{constructor(t,n){super(t,n),this.model=new OU(this.services),this.model.setOptions(Ct(Et.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new d$(this.model,this.services)];return this.getChartComponents(t)}}class MU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Dm(this.model,this.services),new Rr(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class CU extends Wn{constructor(t){super(t),this.axisFlavor=Di.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")!==j.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==j.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==j.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==j.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=be(this.getDisplayData(),r=>r.value),n=Oe().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(Ce(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(Ce(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(Ce(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]=tn(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(tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ce(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(s=>[s[n.identifier]===null?"–":s[n.identifier],s[r.identifier]===null?"–":s[r.identifier].toLocaleString(),s.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!Ce(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=Jo().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=wm(this.getDisplayData(),l)}}class AU extends re{constructor(t,n){super(t,n),this.model=new CU(this.services),this.model.setOptions(Ct(Et.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 Bi(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Ta(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new he(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new Tm(this.model,this.services,{chartType:"heatmap"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=bt.COLUMN_REVERSE,f={id:"spacer",components:[new ln(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new he(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new xm(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,g,{direction:bt.COLUMN})]}getComponents(){const t=[new ie(this.model,this.services),new f$(this.model,this.services)];return this.getAxisChartComponents(t)}}class DU extends Wn{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[St(t,"bins.rangeLabel")||"Range",...r.map(s=>St(s,`0.${n}`))],...St(r,0).map((s,a)=>[`${St(s,"data.x0")} – ${St(s,"data.x1")}`,...r.map(o=>St(o[a],`data.${St(o[a],n)}`))])]}}class LU extends re{constructor(t,n){super(t,n),this.model=new DU(this.services),this.model.setOptions(Ct(Et.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new o$(this.model,this.services),new p$(this.model,this.services)];return this.getAxisChartComponents(t)}}class RU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new Lr(this.model,this.services),new He(this.model,this.services,{handleThresholds:!0}),new b$(this.model,this.services),new Rr(this.model,this.services)];return this.getAxisChartComponents(t)}}class IU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new g$(this.model,this.services),new He(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class kU extends Ge{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.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()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??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{const l=x(s,"total");o=l||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[r],c.value,(c.value/o*100).toFixed(2)+" %"])]}return a}}class $U extends Le{constructor(t,n){var i;super(t,n),this.model=new kU(this.services);const r=(i=n.options.meter)!=null&&i.proportional?tt(tn(Et.proportionalMeterChart),n.options):tt(tn(Et.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new l$(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG},{id:"spacer",components:[new ln(this.model,this.services,{size:8})],growth:nt.STRETCH}]:[],{id:"meter-graph",components:[new m$(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG}],r=[new he(this.model,this.services,n,{direction:bt.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:Z.HTML})}}class PU extends Wn{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(o=>o[r]);return[["Group",...s],...n.map(o=>[o.name,...s.map((l,c)=>x(o,"data",c,i)!==null?x(o,"data",c,i).toLocaleString():"–")])]}}class NU extends Le{constructor(t,n){super(t,n),this.model=new PU(this.services),this.model.setOptions(Ct(Et.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new x$(this.model,this.services)];return this.getChartComponents(t)}}class UU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new He(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class BU extends Ge{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"–"])}),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 VU extends Le{constructor(t,n){super(t,n),this.model=new BU(this.services),this.model.setOptions(Ct(Et.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new E$(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class GU extends Ge{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}}class HU extends Le{constructor(t,n){super(t,n),this.model=new GU(this.services),this.model.setOptions(Ct(Et.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new ZN(this.model,this.services)];return this.getChartComponents(t)}}class FU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Im(this.model,this.services),new Rr(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class zU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Na(this.model,this.services),new km(this.model,this.services),new Lr(this.model,this.services,{stacked:!0}),new Pm(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class WU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Na(this.model,this.services),new $m(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ}),new Rr(this.model,this.services)];return this.getAxisChartComponents(t)}}class YU extends Ge{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(o=>[o[i],o[s],o[r]])]}}class qU extends Le{constructor(t,n){super(t,n),this.model=new YU(this.services),this.model.setOptions(Ct(Et.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new mU(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}z.Alignments=It,z.AlluvialChart=Lk,z.AreaChart=Fk,z.AreaEvent=Jl,z.ArrowDirections=da,z.AxisEvent=Ql,z.AxisFlavor=Di,z.AxisPositions=F,z.AxisTitleOrientations=fa,z.BarEvent=rc,z.BoxplotChart=Yk,z.BoxplotEvent=ic,z.BubbleChart=Xk,z.BulletChart=Kk,z.CalloutDirections=Ti,z.CanvasZoomEvent=Kl,z.CartesianOrientations=Nt,z.ChartEvent=Yl,z.ChartTheme=hc,z.ChartTypes=le,z.CirclePackChart=EU,z.ColorClassNameTypes=Q,z.ColorLegendType=Ai,z.ComboChart=SU,z.DividerStatus=_r,z.DominantBaseline=Be,z.DonutChart=wU,z.ExperimentalChoroplethChart=xU,z.GaugeChart=TU,z.GaugeEvent=nc,z.GaugeTypes=Gn,z.GroupedBarChart=MU,z.HeatmapChart=AU,z.HistogramChart=LU,z.LayoutAlignItems=Vn,z.LayoutDirection=bt,z.LayoutGrowth=nt,z.LegendItemType=$t,z.LegendOrientations=Sr,z.LegendPositions=Er,z.LineChart=RU,z.LineEvent=ac,z.LollipopChart=IU,z.MeterChart=$U,z.ModalEvent=ql,z.ModelEvent=Xl,z.PieChart=zm,z.PieEvent=ec,z.Projection=Ve,z.RadarChart=NU,z.RadarEvent=oc,z.RenderTypes=Z,z.ScaleTypes=j,z.ScatterChart=UU,z.ScatterEvent=sc,z.SimpleBarChart=FU,z.Skeletons=kt,z.StackedAreaChart=zU,z.StackedBarChart=WU,z.Statuses=Mi,z.TextAnchor=Ue,z.ThresholdEvent=uc,z.TickRotations=Ci,z.ToolbarControlTypes=Mt,z.TooltipEvent=xr,z.TreeChart=VU,z.TreeEvent=lc,z.TreeTypes=ha,z.TreemapChart=HU,z.TreemapEvent=cc,z.TruncationTypes=ve,z.WordCloudChart=qU,z.WordCloudEvent=tc,z.ZoomBarTypes=Ae,z.ZoomDomainEvent=Zl,z.ZoombarEvent=jl,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|
|
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=[],d=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:St(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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,wr)}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,wr),n.stopPropagation()}t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function o$(e,t){const n=Vr(this._current,e);return r=>(this._current=n(r),t(this._current))}class Om extends lt{constructor(){super(...arguments),this.type="pie",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return wt.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(L=>L[a]>0),l=this.computeRadius();this.arc=hi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=hi().innerRadius(this.getInnerRadius()).outerRadius(l+wt.hoverArc.outerRadiusOffset);const u=GS().value(L=>L[a]).sort(x(i,"pie","sortFunction")).padAngle(wt.padAngle)(o),h=A.appendOrSelect(r,"g.slices").attr("role",st.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,L=>L.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",L=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:L.data[s],originalClassName:"slice"})).style("fill",L=>n.model.getFillColor(L.data[s])).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[a]}, ${ng(L.data[a],o,a)+"%"}`).attrTween("d",function(L){return o$.bind(this)(L,n.arc)});const g=i.pie.labels.enabled,v=g?u.filter(L=>L.data[a]>0):[],y=A.appendOrSelect(r,"g.labels").attr("role",st.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(v,L=>L.data[s]);y.exit().attr("opacity",0).remove();const b=y.enter().append("text").classed("pie-label",!0),S=[];b.merge(y).style("text-anchor","middle").text(L=>i.pie.labels.formatter?i.pie.labels.formatter(L):ng(L.data[a],o,a)+"%").datum(function(L){const R=l+7,k=(L.endAngle-L.startAngle)/2+L.startAngle,O=k/Math.PI*180,U=this.getComputedTextLength();return L.textOffsetX=U/2,L.textOffsetY=O>90&&O<270?10:0,L.xPosition=(L.textOffsetX+R)*Math.sin(k),L.yPosition=(L.textOffsetY+R)*-Math.cos(k),L}).attr("transform",function(L,R){const k=v.length,O=(L.endAngle-L.startAngle)*(180/Math.PI);if(R>=k-2&&O<wt.callout.minSliceDegree){let U,P;return L.index===k-1?(U=L.xPosition+wt.callout.offsetX+wt.callout.textMargin+L.textOffsetX,P=L.yPosition-wt.callout.offsetY,L.direction=Ti.RIGHT,S.push(L)):(U=L.xPosition-wt.callout.offsetX-L.textOffsetX-wt.callout.textMargin,P=L.yPosition-wt.callout.offsetY,L.direction=Ti.LEFT,S.push(L)),`translate(${U}, ${P})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(S);const _=x(i,"donut")?"donut":"pie",E=x(i,_,"alignment"),{width:M}=A.getSVGElementSize(this.getParent(),{useAttrs:!0}),C=g?wt.xOffset:0,G=g?wt.yOffset:0;let I=l+C;E===It.CENTER?I=M/2:E===It.RIGHT&&(I=M-l-wt.xOffset);let T=l+G;S.length>0&&(T+=wt.yOffsetCallout),r.attr("x",I+7).attr("y",T),this.addEventListeners()}renderCallouts(t){const n=A.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",st.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",st.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===Ti.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+wt.callout.offsetX,y:c-wt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-wt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-wt.callout.offsetX,y:c-wt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+wt.callout.horizontalLineLength),o}),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",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.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",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.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(w.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(w.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(w.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.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(w.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=A.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+wt.radiusOffset:i}}class l$ extends Om{constructor(){super(...arguments),this.type="donut",this.renderType=Z.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const r=A.appendOrSelect(this.getComponentContainer(),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=x(i,"donut","center","label");A.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!==""&&A.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=Iu:s=ae;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Tm="4,10 8,6 12,10",Mm="12,6 8,10 4,6";class c$ extends lt{constructor(){super(...arguments),this.type="gauge",this.renderType=Z.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return cp(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return x(t,"gauge","type")===Gn.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 da.UP:return Tm;case da.DOWN:return Mm;default:return t>0?Tm:Mm}}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,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=hi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=hi().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),A.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:[Q.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",y=>y),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=x(r,"gauge","alignment"),{width:v}=A.getSVGElementSize(this.getParent(),{useAttrs:!0});let m=d;g===It.CENTER?m=v/2:g===It.RIGHT&&(m=v-d),n.attr("x",m).attr("y",d),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 d=0;r===Gn.FULL&&!s?d=l(a):r===Gn.SEMI&&s&&(d=-(l(a)+c));const h=A.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=A.appendOrSelect(h,"g.gauge-value-number"),g=x(n,"gauge","numberFormatter"),v=p.selectAll("text.gauge-value-number").data([i]);v.enter().append("text").attr("class","gauge-value-number").merge(v).style("font-size",`${f}px`).attr("text-anchor","middle").text(M=>g(M));const{width:m}=A.getSVGElementSize(A.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),y=f/2,b=u?"%":"",S=A.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",m/2).text(b),{width:_,height:E}=A.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"),d=A.appendOrSelect(n,"g.gauge-numbers"),h=A.appendOrSelect(d,"g.gauge-delta").attr("transform",`translate(0, ${a(s)+c})`),f=A.appendOrSelect(h,"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:g}=A.getSVGElementSize(A.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),v=x(r,"gauge","deltaArrow","enabled"),m=h.selectAll("svg.gauge-delta-arrow").data(i!==null&&v?[i]:[]);m.enter().append("svg").merge(m).attr("class","gauge-delta-arrow").attr("x",-l(s)-g/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);A.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const b=x(r,"gauge","status");A.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",b!==null?`gauge-delta-arrow status--${b}`:"").attr("points",t.getArrow(i))}),m.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(w.Gauge.ARC_MOUSEOVER,{event:n,element:D(this),datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(w.Gauge.ARC_CLICK,{event:n,element:D(this),datum:r})}).on("mouseout",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=x(t,"gauge","type"),{width:r,height:i}=A.getSVGElementSize(this.parent,{useAttrs:!0});return n===Gn.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Cm extends Qc{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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=Oi(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",st.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Nt.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[i])).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,v=f+p,m=this.services.cartesianScales.getRangeAxisPosition({datum:h}),y=this.services.cartesianScales.getValueThroughAxisPosition(m,0),b=this.services.cartesianScales.getRangeValue(h),S=this.services.cartesianScales.getDomainValue(h)-p/2,_=S+p;if(!this.isOutsideZoomedDomain(S,_))return jt({x0:g,x1:v,y0:y,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.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(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.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(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].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 s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=si().domain(t).rangeRound([0,this.getGroupWidth()])}}class u$ extends lt{constructor(){super(...arguments),this.type="heatmap",this.renderType=Z.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="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${cn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${cn(l.range())},${c(r)})`),this.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n.event,hoveredElement:D(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(w.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(w.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(w.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(w.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(w.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(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[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",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value))).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[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=A.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);A.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),A.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),A.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),A.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!==_r.OFF&&(t===_r.AUTO&&Jp.minCellDividerDimension<=this.xBandwidth&&Jp.minCellDividerDimension<=this.yBandwidth||t===_r.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=St(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 d=D(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=Li(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i||"Total",value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:D(this),datum:u}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(w.Heatmap.HEATMAP_CLICK,{event:c,element:D(this),datum:u})}).on("mouseout",function(c,u){const h=D(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(w.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class h$ extends lt{constructor(){super(...arguments),this.type="histogram",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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=>St(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",st.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,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const d=St(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let v=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(v-g)>0&&Math.abs(v-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Nt.VERTICAL?v+=1:v-=1),jt({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",st.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(St(s,"data.x0")),l=parseFloat(St(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:St(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:s[n]})},{label:u,value:St(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("mouseout",function(){D(this).classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class d$ extends He{constructor(){super(...arguments),this.type="lollipop",this.renderType=Z.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]?nn.weight.unselected:nn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",nn.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?nn.opacity.unselected:nn.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",nn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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=m=>s.getDomainValue(m),u=m=>s.getRangeValue(m),d=s.getOrientation(),[h,f]=sn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),m=>`${m[i]}-${m[l]}`);p.exit().attr("opacity",0).remove();const v=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",m=>this.model.getColorClassName({classNameTypes:[Q.STROKE],dataGroupName:m[i],originalClassName:"line"})).transition().call(m=>this.services.transitions.setupTransition({transition:m,name:"lollipop-line-update-enter",animate:t})).style("stroke",m=>this.model.getFillColor(m[i],m[l],m)).attr("opacity",1);d===Nt.HORIZONTAL?v.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",m=>h(m)-r.points.radius):v.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",m=>f(m)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(w.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(w.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class f$ extends lt{constructor(){super(...arguments),this.type="meter",this.renderType=Z.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Gt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Gt.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}=A.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(x(i,"meter","proportional")===null)u=100;else{const b=x(i,"meter","proportional","total");u=b||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Oe().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=x(i,"meter","height");A.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Gt.height.proportional:Gt.height.default)),A.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Gt.height.proportional:Gt.height.default));const p=r.selectAll("rect.value").data(h),g=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?Gt.height.proportional:Gt.height.default)).attr("class",b=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:b[c],originalClassName:g})).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"meter-bar-update",animate:t})).attr("width",b=>b.value>u?d(u):b.width).style("fill",b=>n.model.getFillColor(b[c])).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",b=>b.value),p.exit().remove();const v=x(i,"meter","peak");let m=v;v!==null&&(v>u?m=u:v<a[0].value&&(m=a[0].value>u?u:a[0].value));const y=r.selectAll("line.peak").data(m==null?[]:[m]);y.enter().append("line").classed("peak",!0).merge(y).attr("y1",0).attr("y2",()=>f||(s?Gt.height.proportional:Gt.height.default)).transition().call(b=>this.services.transitions.setupTransition({transition:b,name:"peak-line-update",animate:t})).attr("x1",b=>d(b)).attr("x2",b=>d(b)).attr("role",st.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(w.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(w.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(w.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.Meter.METER_CLICK,{event:s,element:D(this),datum:a})}).on("mouseout",function(s,a){const o=D(this);r.services.events.dispatchEvent(w.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function Am(e){const t=p$(Dm(e),360);return vn(t,[0,10])||vn(t,[350,0])?{textAnchor:Ue.START,dominantBaseline:Be.MIDDLE}:vn(t,[10,80])?{textAnchor:Ue.START,dominantBaseline:Be.HANGING}:vn(t,[80,100])?{textAnchor:Ue.MIDDLE,dominantBaseline:Be.HANGING}:vn(t,[100,170])?{textAnchor:Ue.END,dominantBaseline:Be.HANGING}:vn(t,[170,190])?{textAnchor:Ue.END,dominantBaseline:Be.MIDDLE}:vn(t,[190,260])?{textAnchor:Ue.END,dominantBaseline:Be.BASELINE}:vn(t,[260,280])?{textAnchor:Ue.MIDDLE,dominantBaseline:Be.BASELINE}:{textAnchor:Ue.START,dominantBaseline:Be.BASELINE}}function p$(e,t){return(e%t+t)%t}function vn(e,[t,n]){return e>=t&&e<=n}function Dm(e){return e*(180/Math.PI)}function Lt(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 g$(e,t){return t*Math.sin(e-Math.PI/2)}class m$ extends lt{constructor(){super(...arguments),this.type="radar",this.renderType=Z.SVG,this.getLabelDimensions=t=>{const n=A.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=A.appendOrSelect(n,"text").text(t),{width:i,height:s}=A.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=_D(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return tt(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:tt(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?Hn.opacity.unselected:Hn.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?Hn.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",Hn.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer(),{width:r,height:i}=A.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:d}=x(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:v}=Hn;this.uniqueKeys=Array.from(new Set(s.map(V=>V[u]))),this.uniqueGroups=Array.from(new Set(s.map(V=>V[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),_=(Math.min(r,i)-y)/2;if(_<=0)return;const E=si().domain(this.fullDataNormalized.map(V=>V[u])).range([0,2*Math.PI].map(V=>V-Math.PI/2)),M=cn(this.fullDataNormalized.map(V=>V[d])),C=Oe().domain([M>=0?0:M,En(this.fullDataNormalized.map(V=>V[d]))]).range([g,_]).nice(p),G=C.ticks(p),I=V=>this.model.getFillColor(V),T=zS().angle(V=>E(V[u])+Math.PI/2).radius(V=>C(V[d])).curve(Kd),L=this.uniqueKeys.map(V=>{const H=this.getLabelDimensions(V).width,$=g$(E(V),_);return H+$}),k={x:En(L)+h,y:i/2},U=A.appendOrSelect(n,"g.y-axes").attr("role",st.GROUP).selectAll("path").data(G,V=>V),P=V=>this.uniqueKeys.map(H=>({[u]:H,[d]:V}));U.join(V=>V.append("path").attr("opacity",0).attr("transform",`translate(${k.x}, ${k.y})`).attr("fill","none").call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",$=>T(P($)))),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",$=>T(P($)))),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_exit",animate:t})).attr("d",$=>T(P($))).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-axes").attr("role",st.GROUP).selectAll("line").data(this.uniqueKeys,V=>V).join(V=>V.append("line").attr("opacity",0).attr("class",H=>`x-axis-${yr(H)}`).attr("stroke-dasharray","0").attr("x1",H=>Lt(E(H),0,k).x).attr("y1",H=>Lt(E(H),0,k).y).attr("x2",H=>Lt(E(H),0,k).x).attr("y2",H=>Lt(E(H),0,k).y).call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",$=>Lt(E($),C.range()[0],k).x).attr("y1",$=>Lt(E($),C.range()[0],k).y).attr("x2",$=>Lt(E($),C.range()[1],k).x).attr("y2",$=>Lt(E($),C.range()[1],k).y)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",$=>Lt(E($),C.range()[0],k).x).attr("y1",$=>Lt(E($),C.range()[0],k).y).attr("x2",$=>Lt(E($),C.range()[1],k).x).attr("y2",$=>Lt(E($),C.range()[1],k).y)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-labels").attr("role",st.GROUP).selectAll("text").data(this.uniqueKeys).join(V=>V.append("text").text(H=>H).attr("opacity",0).attr("x",H=>Lt(E(H),C.range()[1]+h,k).x).attr("y",H=>Lt(E(H),C.range()[1]+h,k).y).style("text-anchor",H=>Am(E(H)).textAnchor).style("dominant-baseline",H=>Am(E(H)).dominantBaseline).call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",$=>Lt(E($),C.range()[1]+h,k).x).attr("y",$=>Lt(E($),C.range()[1]+h,k).y).end().finally(()=>{const $=x(o,"radar","alignment"),pt=this.getAlignmentXOffset($,n,this.getParent());n.attr("x",pt)})),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),A.appendOrSelect(n,"g.blobs").attr("role",st.GROUP).selectAll("path").data(this.groupedDataNormalized,V=>V.name).join(V=>V.append("path").attr("class",H=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:H.name,originalClassName:"blob"})).attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",H=>H.name).attr("opacity",0).attr("transform",t?()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`:`translate(${k.x}, ${k.y})`).style("fill",H=>I(H.name)).style("fill-opacity",Hn.opacity.selected).style("stroke",H=>I(H.name)).call(H=>{const $=H.transition().call(pt=>this.services.transitions.setupTransition({transition:pt,name:"radar_blobs_enter",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",`translate(${k.x}, ${k.y})`),$.attr("opacity",1).attr("d",pt=>T(pt.data))}),V=>(V.attr("class",H=>this.model.getColorClassName({classNameTypes:[Q.FILL,Q.STROKE],dataGroupName:H.name,originalClassName:"blob"})).style("fill",H=>I(H.name)).style("stroke",H=>I(H.name)),V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",$=>T($.data))),V),V=>V.call(H=>{const $=H.transition().call(pt=>this.services.transitions.setupTransition({transition:pt,name:"radar_blobs_exit",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`),$.attr("opacity",0).remove()})),A.appendOrSelect(n,"g.dots").attr("role",st.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(V=>x(V,d)!==null)).join(V=>V.append("circle").attr("role",st.GRAPHICS_SYMBOL).attr("aria-label",H=>H[c]),V=>V,V=>V.remove()).attr("class",V=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:V[l],originalClassName:yr(V[u])})).attr("cx",V=>Lt(E(V[u]),C(V[d]),k).x).attr("cy",V=>Lt(E(V[u]),C(V[d]),k).y).attr("r",0).attr("opacity",0).style("fill",V=>I(V[l])),A.appendOrSelect(n,"g.x-axes-rect").attr("role",st.GROUP).selectAll("rect").data(this.uniqueKeys).join(V=>V.append("rect"),V=>V,V=>V.remove()).attr("x",k.x).attr("y",k.y-v/2).attr("width",C.range()[1]).attr("height",v).style("fill","red").style("fill-opacity",0).attr("transform",V=>`rotate(${Dm(E(V))}, ${k.x}, ${k.y})`),A.appendOrSelect(n,"g.y-labels").attr("role",st.GROUP).selectAll("text").data(be(G)).join(V=>V.append("text").attr("opacity",0).text(H=>H).attr("x",H=>Lt(-Math.PI/2,C(H),k).x+f).attr("y",H=>Lt(-Math.PI/2,C(H),k).y).style("text-anchor","start").style("dominant-baseline","middle").call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_update",animate:t})).text($=>$).attr("opacity",1).attr("x",$=>Lt(-Math.PI/2,C($),k).x+f).attr("y",$=>Lt(-Math.PI/2,C($),k).y)),V=>V.call(H=>H.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=A.getSVGElementSize(n,{useBBox:!0}),{width:s}=A.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===It.CENTER?a=Math.floor((s-i.width)/2):t===It.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.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(w.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${yr(i)}`),o=t.parent.selectAll(`.dots circle.${yr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=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",Hn.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u]),class:t.model.getColorClassName({classNameTypes:[Q.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=D(this);t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(w.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-${yr(i)}`),o=t.parent.selectAll(`.dots circle.${yr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(w.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(w.Tooltip.HIDE)})}}class Lm extends Qc{constructor(){super(...arguments),this.type="simple-bar",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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,c=>c[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(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[r])).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,v;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),v=this.services.cartesianScales.getRangeValue(h[1]);else{const b=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,b)),v=this.services.cartesianScales.getRangeValue(c)}const m=Math.abs(v-g);if(m!==0&&m<2&&(h>0&&a===Nt.VERTICAL||h<0&&a===Nt.HORIZONTAL?v=g-2:v=g+2),!this.isOutsideZoomedDomain(f,p))return jt({x0:f,x1:p,y0:g,y1:v},a)}).attr("opacity",1).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.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(w.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:n,element:D(this),datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.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(w.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class v$ extends Zt{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=A.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=A.appendOrSelect(t,"svg.chart-skeleton.DAII"),A.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Rm extends lt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=Z.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?en.opacity.unselected:en.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",en.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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(p=>i.axes[p].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}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>x(p,0,s));this.areaGenerator=fl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>x(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s))).attr("role",st.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>x(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",en.opacity.selected).attr("d",this.areaGenerator)}}class Im extends Qc{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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",st.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:[Q.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i])).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const v=c[0]<0&&c[1]<=0;v&&a.length>1?this.services.cartesianScales.getOrientation()===Nt.VERTICAL?g+=c[1]===0?2:1:g-=1:v||(this.services.cartesianScales.getOrientation()===Nt.VERTICAL?g+=1:g-=1)}return jt({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",st.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(w.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(w.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=D(this);r.services.events.dispatchEvent(w.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(w.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(w.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(w.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=A.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(w.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class km extends He{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=Z.SVG}render(t){if(!x(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>x(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",st.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),v=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[v]:f[1]}});this.styleCircles(h,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,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],v=this.services.cartesianScales.getDomainIdentifier(u),m=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[v]:f,[m]: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(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const Ir=6;class y$ extends lt{constructor(){super(...arguments),this.type="tree",this.renderType=Z.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}=A.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer();n.html("");const{width:r,height:i}=A.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),d={top:0,right:0,bottom:0,left:l>0?l+Ir:30-Ir},h=ni({name:o,children:a}),f=10,p=r/6,g=E=>{const M=h.descendants().reverse(),C=h.links();let G=h,I=h;h.eachBefore(N=>{N.x<G.x&&(G=N),N.x>I.x&&(I=N)});const T=I.x-G.x,L=n.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,G.x,r,T].join(" ")),R=_.selectAll("g").data(M,N=>N.id),k=this,O=R.enter().append("g").attr("transform",()=>`translate(${E.y0},${E.x0})`).attr("class",N=>N.depth!==0&&N.children&&N.children.length>0?"clickable":null).on("mouseover",function(N,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOVER,{event:N,element:D(this),datum:B})}).on("click",function(N,B){B.depth!==0&&(B.children=B.children?null:B._children,g(B)),k.services.events.dispatchEvent(w.Tree.NODE_CLICK,{event:N,element:D(this),datum:B})}).on("mouseout",function(N,B){k.services.events.dispatchEvent(w.Tree.NODE_MOUSEOUT,{event:N,element:D(this),datum:B})});O.append("circle").attr("r",2.5).attr("class",N=>N._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",N=>N._children?-Ir:Ir).attr("text-anchor",N=>N._children?"end":"start").text(N=>N.data.name).clone(!0).attr("class","text-stroke").lower(),R.merge(O).transition(L).attr("transform",N=>`translate(${N.y},${N.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),R.exit().transition(L).remove().attr("transform",()=>`translate(${E.y},${E.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const U=S.selectAll("path").data(C,N=>N.target.id),P=U.enter().append("path").attr("d",()=>{const N={x:E.x0,y:E.y0};return b({source:N,target:N})});U.merge(P).transition(L).attr("d",b),U.exit().transition(L).remove().attr("d",()=>{const N={x:E.x,y:E.y};return b({source:N,target:N})}),h.eachBefore(N=>{N.x0=N.x,N.y0=N.y})},v=h.descendants(),m=v[v.length-1].depth,y=x(s,"tree","type")===ha.DENDROGRAM?hb().size([i,r-u-m*Ir-l]):Qb().nodeSize([f,p]).size([i,r-u-m*Ir-l]),b=ZS().x(E=>E.y).y(E=>E.x);h.x0=p/2,h.y0=0,h.descendants().forEach((E,M)=>{E.id=M,E._children=E.children}),y(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const S=n.append("g").attr("class","links"),_=n.append("g").attr("class","nodes");g(h)}}var x$="#000000",b$="#ffffff",E$="#fcf4d6",S$="#fddc69",_$="#f1c21b",w$="#d2a106",O$="#b28600",T$="#8e6a00",M$="#684e00",C$="#483700",A$="#302400",D$="#1c1500",L$={10:E$,20:S$,30:_$,40:w$,50:O$,60:T$,70:M$,80:C$,90:A$,100:D$},R$="#fff2e8",I$="#ffd9be",k$="#ffb784",$$="#ff832b",P$="#eb6200",N$="#ba4e00",U$="#8a3800",B$="#5e2900",V$="#3e1a00",G$="#231000",H$={10:R$,20:I$,30:k$,40:$$,50:P$,60:N$,70:U$,80:B$,90:V$,100:G$},F$="#fff1f1",z$="#ffd7d9",W$="#ffb3b8",Y$="#ff8389",q$="#fa4d56",X$="#da1e28",j$="#a2191f",Z$="#750e13",K$="#520408",Q$="#2d0709",J$={10:F$,20:z$,30:W$,40:Y$,50:q$,60:X$,70:j$,80:Z$,90:K$,100:Q$},tP="#fff0f7",eP="#ffd6e8",nP="#ffafd2",rP="#ff7eb6",iP="#ee5396",sP="#d02670",aP="#9f1853",oP="#740937",lP="#510224",cP="#2a0a18",uP={10:tP,20:eP,30:nP,40:rP,50:iP,60:sP,70:aP,80:oP,90:lP,100:cP},hP="#f6f2ff",dP="#e8daff",fP="#d4bbff",pP="#be95ff",gP="#a56eff",mP="#8a3ffc",vP="#6929c4",yP="#491d8b",xP="#31135e",bP="#1c0f30",EP={10:hP,20:dP,30:fP,40:pP,50:gP,60:mP,70:vP,80:yP,90:xP,100:bP},SP="#edf5ff",_P="#d0e2ff",wP="#a6c8ff",OP="#78a9ff",TP="#4589ff",MP="#0f62fe",CP="#0043ce",AP="#002d9c",DP="#001d6c",LP="#001141",RP={10:SP,20:_P,30:wP,40:OP,50:TP,60:MP,70:CP,80:AP,90:DP,100:LP},IP="#e5f6ff",kP="#bae6ff",$P="#82cfff",PP="#33b1ff",NP="#1192e8",UP="#0072c3",BP="#00539a",VP="#003a6d",GP="#012749",HP="#061727",FP={10:IP,20:kP,30:$P,40:PP,50:NP,60:UP,70:BP,80:VP,90:GP,100:HP},zP="#d9fbfb",WP="#9ef0f0",YP="#3ddbd9",qP="#08bdba",XP="#009d9a",jP="#007d79",ZP="#005d5d",KP="#004144",QP="#022b30",JP="#081a1c",tN={10:zP,20:WP,30:YP,40:qP,50:XP,60:jP,70:ZP,80:KP,90:QP,100:JP},eN="#defbe6",nN="#a7f0ba",rN="#6fdc8c",iN="#42be65",sN="#24a148",aN="#198038",oN="#0e6027",lN="#044317",cN="#022d0d",uN="#071908",hN={10:eN,20:nN,30:rN,40:iN,50:sN,60:aN,70:oN,80:lN,90:cN,100:uN},dN="#f2f4f8",fN="#dde1e6",pN="#c1c7cd",gN="#a2a9b0",mN="#878d96",vN="#697077",yN="#4d5358",xN="#343a3f",bN="#21272a",EN="#121619",SN={10:dN,20:fN,30:pN,40:gN,50:mN,60:vN,70:yN,80:xN,90:bN,100:EN},_N="#f4f4f4",wN="#e0e0e0",ON="#c6c6c6",TN="#a8a8a8",MN="#8d8d8d",CN="#6f6f6f",AN="#525252",DN="#393939",LN="#262626",RN="#161616",IN={10:_N,20:wN,30:ON,40:TN,50:MN,60:CN,70:AN,80:DN,90:LN,100:RN},kN="#f7f3f2",$N="#e5e0df",PN="#cac5c4",NN="#ada8a8",UN="#8f8b8b",BN="#726e6e",VN="#565151",GN="#3c3838",HN="#272525",FN="#171414",zN={10:kN,20:$N,30:PN,40:NN,50:UN,60:BN,70:VN,80:GN,90:HN,100:FN},$m={black:{100:x$},blue:RP,coolGray:SN,cyan:FP,gray:IN,green:hN,magenta:uP,orange:H$,purple:EP,red:J$,teal:tN,warmGray:zN,white:{0:b$},yellow:L$};const WN=e=>{if(!e)return null;for(const t of Object.keys($m)){const n=$m[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Pm=function(){const e=D(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=Fe(t);let r;if(n&&(r=WN(n?n.hex():null)),r==null){const i=no(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let YN=0;class qN extends lt{constructor(){super(...arguments),this.type="treemap",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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}=A.getSVGElementSize(n,{useAttrs:!0}),l=ni({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,v)=>v.value-g.value),c=rE().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>YN++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const v=D(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${v}`}).append("use").attr("xlink:href",function(){const v=D(this.parentNode.parentNode).attr("data-uid"),m=`${i.style.prefix}-leaf-${v}`;return new URL(`#${m}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let v=g;for(;v.depth>1;)v=v.parent;const m=no(this.model.getFillColor(v.data.name));return[{text:g.data.name,color:m.l<.5?"white":"black"}]},g=>g).join(g=>{const v=g.append("text").text(m=>m.text).style("fill",Pm).attr("x",7).attr("y",18);return s&&v.attr("clip-path",function(){const m=D(this.parentNode).attr("data-uid"),y=`${i.style.prefix}-clip-${m}`;return`url(${new URL(`#${y}`,s)+""})`}),v},g=>g.text(v=>v.text).style("fill",Pm),g=>g.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),Fe(s).darker(.7).toString()}),t.services.events.dispatchEvent(w.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(w.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=D(this);t.services.events.dispatchEvent(w.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(w.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(w.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:i})})}}var XN={value:function(){}};function Nm(){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 Ua(n)}function Ua(e){this._=e}function jN(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}})}Ua.prototype=Nm.prototype={constructor:Ua,on:function(e,t){var n=this._,r=jN(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=ZN(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]=Um(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Um(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 Ua(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 ZN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Um(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=XN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const KN=UI(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Nm},Symbol.toStringTag,{value:"Module"}))).dispatch,Jc=Math.PI/180,QN={archimedean:Vm,rectangular:cU},Gi=64,Ba=2048;var JN=function(){var e=[256,256],t=tU,n=eU,r=nU,i=Bm,s=Bm,a=rU,o=iU,l=Vm,c=[],u=1/0,d=KN("word","end"),h=null,f=Math.random,p={},g=hU;p.canvas=function(y){return arguments.length?(g=yn(y),p):g},p.start=function(){var y=v(g()),b=uU((e[0]>>5)*e[1]),S=null,_=c.length,E=-1,M=[],C=c.map(function(I,T){return I.text=t.call(this,I,T),I.font=n.call(this,I,T),I.style=i.call(this,I,T),I.weight=s.call(this,I,T),I.rotate=a.call(this,I,T),I.size=~~r.call(this,I,T),I.padding=o.call(this,I,T),I}).sort(function(I,T){return T.size-I.size});return h&&clearInterval(h),h=setInterval(G,0),G(),p;function G(){for(var I=Date.now();Date.now()-I<u&&++E<_&&h;){var T=C[E];T.x=e[0]*(f()+.5)>>1,T.y=e[1]*(f()+.5)>>1,sU(y,T,C,E),T.hasText&&m(b,T,S)&&(M.push(T),d.call("word",p,T),S?oU(S,T):S=[{x:T.x+T.x0,y:T.y+T.y0},{x:T.x+T.x1,y:T.y+T.y1}],T.x-=e[0]>>1,T.y-=e[1]>>1)}E>=_&&(p.stop(),d.call("end",p,M,S))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const y of c)delete y.sprite;return p};function v(y){const b=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const S=Math.sqrt(b.getImageData(0,0,1,1).data.length>>2);return y.width=(Gi<<5)/S,y.height=Ba/S,b.fillStyle=b.strokeStyle="red",{context:b,ratio:S}}function m(y,b,S){e[0],e[1];for(var _=b.x,E=b.y,M=Math.sqrt(e[0]*e[0]+e[1]*e[1]),C=l(e),G=f()<.5?1:-1,I=-G,T,L,R;(T=C(I+=G))&&(L=~~T[0],R=~~T[1],!(Math.min(Math.abs(L),Math.abs(R))>=M));)if(b.x=_+L,b.y=E+R,!(b.x+b.x0<0||b.y+b.y0<0||b.x+b.x1>e[0]||b.y+b.y1>e[1])&&(!S||lU(b,S))&&!aU(b,y,e[0])){for(var k=b.sprite,O=b.width>>5,U=e[0]>>5,P=b.x-(O<<4),N=P&127,B=32-N,Y=b.y1-b.y0,X=(b.y+b.y0)*U+(P>>5),J,ct=0;ct<Y;ct++){J=0;for(var W=0;W<=O;W++)y[X+W]|=J<<B|(W<O?(J=k[ct*O+W])>>>N:0);X+=U}return!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=yn(y),p):n},p.fontStyle=function(y){return arguments.length?(i=yn(y),p):i},p.fontWeight=function(y){return arguments.length?(s=yn(y),p):s},p.rotate=function(y){return arguments.length?(a=yn(y),p):a},p.text=function(y){return arguments.length?(t=yn(y),p):t},p.spiral=function(y){return arguments.length?(l=QN[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=yn(y),p):r},p.padding=function(y){return arguments.length?(o=yn(y),p):o},p.random=function(y){return arguments.length?(f=y,p):f},p.on=function(){var y=d.on.apply(d,arguments);return y===d?p:y},p};function tU(e){return e.text}function eU(){return"serif"}function Bm(){return"normal"}function nU(e){return Math.sqrt(e.value)}function rU(){return(~~(random()*6)-3)*30}function iU(){return 1}function sU(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Gi<<5)/s,Ba/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;const T=i.measureText(t.text),L=-Math.floor(T.width/2);let R=(T.width+1)*s,k=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*Jc),d=Math.cos(t.rotate*Jc),h=R*d,f=R*u,p=k*d,g=k*u;R=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,k=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else R=R+31>>5<<5;if(k>l&&(l=k),a+R>=Gi<<5&&(a=0,o+=l,l=0),o+k>=Ba)break;i.translate((a+(R>>1))/s,(o+(k>>1))/s),t.rotate&&i.rotate(t.rotate*Jc),i.fillText(t.text,L,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,L,0)),i.restore(),t.width=R,t.height=k,t.xoff=a,t.yoff=o,t.x1=R>>1,t.y1=k>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=R}for(var v=i.getImageData(0,0,(Gi<<5)/s,Ba/s).data,m=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,b=y>>5,S=t.y1-t.y0,_=0;_<S*b;_++)m[_]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var E=0,M=-1,C=0;C<S;C++){for(var _=0;_<y;_++){var G=b*C+(_>>5),I=v[(o+C)*(Gi<<5)+(a+_)<<2]?1<<31-_%32:0;m[G]|=I,E|=I}E?M=C:(t.y0++,S--,C--,o++)}t.y1=t.y0+M,t.sprite=m.slice(0,(t.y1-t.y0)*b)}}}function aU(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,d=0;d<l;d++){u=0;for(var h=0;h<=i;h++)if((u<<o|(h<i?(u=r[d*i+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function oU(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 lU(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 Vm(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function cU(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 uU(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function hU(){return document.createElement("canvas")}function yn(e){return typeof e=="function"?e:function(){return e}}const dU=NI(JN);class fU extends lt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=Z.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(w.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(w.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:d}=A.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=dU().size([u,d]).words(i.map(function(p){const g=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:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=A.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const v=g.selectAll("text").data(p,y=>`${y[c]}-${y.text}`);v.exit().attr("opacity",0).remove(),v.enter().append("text").attr("opacity",0).merge(v).style("font-size",y=>`${y.size}px`).text(function(y){return y.text}).attr("class",y=>n.model.getColorClassName({classNameTypes:[Q.FILL],dataGroupName:y[c],originalClassName:`word ${y.size>32?"light":""}`})).style("fill",y=>n.model.getFillColor(y[c],y.text,y)).attr("text-anchor","middle").transition().call(y=>n.services.transitions.setupTransition({transition:y,name:"wordcloud-text-update-enter",animate:t})).attr("transform",y=>`translate(${y.x}, ${y.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=A.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?be(i):[1,1];return Oe().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=ua(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(w.WordCloud.WORD_MOUSEOVER,{event:s,element:D(this),datum:a}),r.services.events.dispatchEvent(w.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:[Q.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=D(this);r.services.events.dispatchEvent(w.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(w.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(w.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(w.Tooltip.HIDE,{hoveredElement:o})})}}class pU extends lt{constructor(){super(...arguments),this.type="geo",this.renderType=Z.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=A.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(m=>{typeof a[m].value=="number"?o[m]=a[m]:l[m]=a[m]});const c=n$(s,Object.values(l)),u=Jk(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=Nx().projection(d);A.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=A.appendOrSelect(t,"defs");A.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",di()([[0,0],[0,10]]));const v=A.appendOrSelect(t,"g.missing-data");A.appendOrSelect(v,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(x(this.getOptions(),"thematic","projection")){case Ve.geoEqualEarth:t=nb();break;case Ve.geoAlbers:t=jx();break;case Ve.geoConicEqualArea:t=Qh();break;case Ve.geoConicEquidistant:t=tb();break;case Ve.geoEquirectangular:t=Qx();break;case Ve.geoMercator:t=Zx();break;case Ve.geoNaturalEarth1:t=rb();break;default:throw new Error("Projection is not supported.")}return t}}class gU extends pU{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",s=>this.model.getColorClassName({value:n[s.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(br.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.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(br.CHOROPLETH_MOUSEMOVE,{event:r,element:D(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(br.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(br.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(xr.HIDE,{event:r,hoveredElement:s})})}}class mU extends Le{constructor(t,n){super(t,n),this.model=new jk(this.services),this.model.setOptions(Ct(Et.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 Bi(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Ta(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new he(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new wm(this.model,this.services,{chartType:"choropleth"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=bt.COLUMN_REVERSE,f={id:"spacer",components:[new ln(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new he(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new Wc(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,g,{direction:bt.COLUMN})]}getComponents(){const t=[new gU(this.model,this.services)];return this.getChartComponents(t)}}class vU extends Ge{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=tt({},t,this.getZoomOptions(t));dc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:tt(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:$t.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(["–",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}}class yU extends Le{constructor(t,n){super(t,n),this.model=new vU(this.services),this.model.setOptions(Ct(Et.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new a$(this.model,this.services)];return this.getChartComponents(t)}}const Gm={[le.LINE]:[Lr,He],[le.SCATTER]:[He],[le.AREA]:[ym,Lr,He],[le.STACKED_AREA]:[Rm,Lr,km,Na],[le.SIMPLE_BAR]:[Lm],[le.GROUPED_BAR]:[Cm,Rr],[le.STACKED_BAR]:[Im,Na]};class xU extends re{constructor(t,n){super(t,n);const r=Ct(Et.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:le.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(Gm).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=`${RM(i.type)}Chart`;return a=tt({},Et[l],this.model.getOptions(),i.options),i.type===le.STACKED_AREA&&(o=!0),Gm[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=tt({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return Pf(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===le.STACKED_BAR||s.type===le.STACKED_AREA),r=[new ie(this.model,this.services),new de(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID}),...n?[]:[new mn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class bU extends Ge{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(s=>[s[r],s.value===null?"–":s.value.toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Hm extends Le{constructor(t,n,r=!1){super(t,n),this.model=new bU(this.services),!r&&(this.model.setOptions(Ct(Et.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Om(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}class EU extends Hm{constructor(t,n){super(t,n,!0),this.model.setOptions(Ct(Et.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new l$(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.DONUT})];return this.getChartComponents(t)}}class SU extends Ge{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(s=>[s[r],s.value===null?"–":s.value.toLocaleString()])]}}class _U extends Le{constructor(t,n){super(t,n),this.model=new SU(this.services),this.model.setOptions(Ct(Et.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new c$(this.model,this.services)];return this.getChartComponents(t)}}class wU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Cm(this.model,this.services),new Rr(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class OU extends Wn{constructor(t){super(t),this.axisFlavor=Di.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")!==j.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==j.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==j.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==j.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=be(this.getDisplayData(),r=>r.value),n=Oe().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(Ce(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(Ce(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(Ce(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]=tn(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(tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){Ce(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(s=>[s[n.identifier]===null?"–":s[n.identifier],s[r.identifier]===null?"–":s[r.identifier].toLocaleString(),s.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!Ce(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=Jo().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=Sm(this.getDisplayData(),l)}}class TU extends re{constructor(t,n){super(t,n),this.model=new OU(this.services),this.model.setOptions(Ct(Et.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 Bi(this.model,this.services)],growth:nt.STRETCH},o={id:"toolbar",components:[new Ta(this.model,this.services)],growth:nt.PREFERRED},l={id:"header",components:[new he(this.model,this.services,[a,...i?[o]:[]],{direction:bt.ROW,alignItems:Vn.CENTER})],growth:nt.PREFERRED},c={id:"legend",components:[new wm(this.model,this.services,{chartType:"heatmap"})],growth:nt.PREFERRED,renderType:Z.SVG},u={id:"graph-frame",components:t,growth:nt.STRETCH,renderType:Z.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=bt.COLUMN_REVERSE,f={id:"spacer",components:[new ln(this.model,this.services,{size:15})],growth:nt.PREFERRED},p={id:"full-frame",components:[new he(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:nt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new ln(this.model,this.services,i?{size:15}:void 0)],growth:nt.PREFERRED};g.push(v)}return g.push(p),[new vm(this.model,this.services),new Ia(this.model,this.services),new he(this.model,this.services,g,{direction:bt.COLUMN})]}getComponents(){const t=[new ie(this.model,this.services),new u$(this.model,this.services)];return this.getAxisChartComponents(t)}}class MU extends Wn{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[St(t,"bins.rangeLabel")||"Range",...r.map(s=>St(s,`0.${n}`))],...St(r,0).map((s,a)=>[`${St(s,"data.x0")} – ${St(s,"data.x1")}`,...r.map(o=>St(o[a],`data.${St(o[a],n)}`))])]}}class CU extends re{constructor(t,n){super(t,n),this.model=new MU(this.services),this.model.setOptions(Ct(Et.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new i$(this.model,this.services),new h$(this.model,this.services)];return this.getAxisChartComponents(t)}}class AU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new Lr(this.model,this.services),new He(this.model,this.services,{handleThresholds:!0}),new v$(this.model,this.services),new Rr(this.model,this.services)];return this.getAxisChartComponents(t)}}class DU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new d$(this.model,this.services),new He(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class LU extends Ge{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.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()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??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{const l=x(s,"total");o=l||this.getMaximumDomain(t),a=[["Group","Value","Percentage of total"],...t.map(c=>[c[r],c.value,(c.value/o*100).toFixed(2)+" %"])]}return a}}class RU extends Le{constructor(t,n){var i;super(t,n),this.model=new LU(this.services);const r=(i=n.options.meter)!=null&&i.proportional?tt(tn(Et.proportionalMeterChart),n.options):tt(tn(Et.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...x(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new s$(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG},{id:"spacer",components:[new ln(this.model,this.services,{size:8})],growth:nt.STRETCH}]:[],{id:"meter-graph",components:[new f$(this.model,this.services)],growth:nt.STRETCH,renderType:Z.SVG}],r=[new he(this.model,this.services,n,{direction:bt.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:Z.HTML})}}class IU extends Wn{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(o=>o[r]);return[["Group",...s],...n.map(o=>[o.name,...s.map((l,c)=>x(o,"data",c,i)!==null?x(o,"data",c,i).toLocaleString():"–")])]}}class kU extends Le{constructor(t,n){super(t,n),this.model=new IU(this.services),this.model.setOptions(Ct(Et.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new m$(this.model,this.services)];return this.getChartComponents(t)}}class $U extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new mn(this.model,this.services),new He(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class PU extends Ge{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"–"])}),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 NU extends Le{constructor(t,n){super(t,n),this.model=new PU(this.services),this.model.setOptions(Ct(Et.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new y$(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class UU extends Ge{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}}class BU extends Le{constructor(t,n){super(t,n),this.model=new UU(this.services),this.model.setOptions(Ct(Et.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new qN(this.model,this.services)];return this.getChartComponents(t)}}class VU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Lm(this.model,this.services),new Rr(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class GU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Na(this.model,this.services),new Rm(this.model,this.services),new Lr(this.model,this.services,{stacked:!0}),new km(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new Zt(this.model,this.services,{skeleton:kt.GRID})];return this.getAxisChartComponents(t)}}class HU extends re{constructor(t,n){super(t,n),this.model.setOptions(Ct(Et.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new ie(this.model,this.services),new de(this.model,this.services),new Na(this.model,this.services),new Im(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.VERT_OR_HORIZ}),new Rr(this.model,this.services)];return this.getAxisChartComponents(t)}}class FU extends Ge{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(o=>[o[i],o[s],o[r]])]}}class zU extends Le{constructor(t,n){super(t,n),this.model=new FU(this.services),this.model.setOptions(Ct(Et.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new fU(this.model,this.services),new Zt(this.model,this.services,{skeleton:kt.PIE})];return this.getChartComponents(t)}}z.Alignments=It,z.AlluvialChart=Ck,z.AreaChart=Vk,z.AreaEvent=Jl,z.ArrowDirections=da,z.AxisEvent=Ql,z.AxisFlavor=Di,z.AxisPositions=F,z.AxisTitleOrientations=fa,z.BarEvent=rc,z.BoxplotChart=Fk,z.BoxplotEvent=ic,z.BubbleChart=Wk,z.BulletChart=Xk,z.CalloutDirections=Ti,z.CanvasZoomEvent=Kl,z.CartesianOrientations=Nt,z.ChartEvent=Yl,z.ChartTheme=hc,z.ChartTypes=le,z.CirclePackChart=yU,z.ColorClassNameTypes=Q,z.ColorLegendType=Ai,z.ComboChart=xU,z.DividerStatus=_r,z.DominantBaseline=Be,z.DonutChart=EU,z.ExperimentalChoroplethChart=mU,z.GaugeChart=_U,z.GaugeEvent=nc,z.GaugeTypes=Gn,z.GroupedBarChart=wU,z.HeatmapChart=TU,z.HistogramChart=CU,z.LayoutAlignItems=Vn,z.LayoutDirection=bt,z.LayoutGrowth=nt,z.LegendItemType=$t,z.LegendOrientations=Sr,z.LegendPositions=Er,z.LineChart=AU,z.LineEvent=ac,z.LollipopChart=DU,z.MeterChart=RU,z.ModalEvent=ql,z.ModelEvent=Xl,z.PieChart=Hm,z.PieEvent=ec,z.Projection=Ve,z.RadarChart=kU,z.RadarEvent=oc,z.RenderTypes=Z,z.ScaleTypes=j,z.ScatterChart=$U,z.ScatterEvent=sc,z.SimpleBarChart=VU,z.Skeletons=kt,z.StackedAreaChart=GU,z.StackedBarChart=HU,z.Statuses=Mi,z.TextAnchor=Ue,z.ThresholdEvent=uc,z.TickRotations=Ci,z.ToolbarControlTypes=Mt,z.TooltipEvent=xr,z.TreeChart=NU,z.TreeEvent=lc,z.TreeTypes=ha,z.TreemapChart=BU,z.TreemapEvent=cc,z.TruncationTypes=ve,z.WordCloudChart=zU,z.WordCloudEvent=tc,z.ZoomBarTypes=Ae,z.ZoomDomainEvent=Zl,z.ZoombarEvent=jl,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|
|
84
84
|
//# sourceMappingURL=bundle.umd.js.map
|