@carbon/charts 1.13.19 → 1.13.21

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{_baseEach-L1oeNjGL.mjs → _baseEach-hXZ_iCmx.mjs} +2 -2
  3. package/dist/{_baseEach-L1oeNjGL.mjs.map → _baseEach-hXZ_iCmx.mjs.map} +1 -1
  4. package/dist/{angle-utils-rmLYuzkJ.mjs → angle-utils-A-okg7PT.mjs} +2 -2
  5. package/dist/{angle-utils-rmLYuzkJ.mjs.map → angle-utils-A-okg7PT.mjs.map} +1 -1
  6. package/dist/{choropleth-RkB2BywS.mjs → choropleth-s-WBhiE4.mjs} +4 -4
  7. package/dist/{choropleth-RkB2BywS.mjs.map → choropleth-s-WBhiE4.mjs.map} +1 -1
  8. package/dist/{color-scale-utils-GLd1MML3.mjs → color-scale-utils-H9cC5d7N.mjs} +40 -40
  9. package/dist/{color-scale-utils-GLd1MML3.mjs.map → color-scale-utils-H9cC5d7N.mjs.map} +1 -1
  10. package/dist/components/index.mjs +4 -4
  11. package/dist/demo/index.mjs +5 -5
  12. package/dist/index.mjs +24 -24
  13. package/dist/interfaces/charts.d.ts +5 -1
  14. package/dist/interfaces/components.d.ts +13 -0
  15. package/dist/model/binned-charts.d.ts +1 -1
  16. package/dist/model/boxplot.d.ts +1 -1
  17. package/dist/model/circle-pack.d.ts +1 -1
  18. package/dist/model/index.mjs +3 -3
  19. package/dist/model/meter.d.ts +1 -2
  20. package/dist/model/model.d.ts +4 -0
  21. package/dist/model/radar.d.ts +1 -1
  22. package/dist/model/tree.d.ts +1 -1
  23. package/dist/model/treemap.d.ts +1 -1
  24. package/dist/services/index.mjs +3 -3
  25. package/dist/umd/bundle.umd.js +14 -14
  26. package/dist/umd/bundle.umd.js.map +1 -1
  27. package/dist/{wordcloud-XkAQGXwu.mjs → wordcloud-je962F3R.mjs} +354 -362
  28. package/dist/wordcloud-je962F3R.mjs.map +1 -0
  29. package/dist/{zoom-LC_awnen.mjs → zoom-_zg_D2pq.mjs} +132 -132
  30. package/dist/zoom-_zg_D2pq.mjs.map +1 -0
  31. package/package.json +2 -2
  32. package/dist/wordcloud-XkAQGXwu.mjs.map +0 -1
  33. package/dist/zoom-LC_awnen.mjs.map +0 -1
@@ -1,18 +1,18 @@
1
- (function(W,Re){typeof exports=="object"&&typeof module<"u"?Re(exports):typeof define=="function"&&define.amd?define(["exports"],Re):(W=typeof globalThis<"u"?globalThis:W||self,Re(W.Charts={}))})(this,function(W){"use strict";function Re(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function y0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Oo(e){let t,n,r;e.length!==2?(t=Re,n=(o,l)=>Re(e(o),l),r=(o,l)=>e(o)-l):(t=e===Re||e===y0?e:E0,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 E0(){return 0}function x0(e){return e===null?NaN:+e}function*b0(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 _0=Oo(Re).right;Oo(x0).center;const Mo=_0;function S0(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 Ie(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 Nn{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 th extends Map{constructor(t,n=O0){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(eh(this,t))}has(t){return super.has(eh(this,t))}set(t,n){return super.set(T0(this,t),n)}delete(t){return super.delete(w0(this,t))}}function eh({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function T0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function w0({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function O0(e){return e!==null&&typeof e=="object"?e.valueOf():e}function M0(e){return e}function A0(e=Re){if(e===Re)return nh;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 nh(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var C0=Array.prototype,D0=C0.slice;function Ao(e){return()=>e}const L0=Math.sqrt(50),R0=Math.sqrt(10),I0=Math.sqrt(2);function _s(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>=L0?10:s>=R0?5:s>=I0?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?_s(e,t,n*2):[o,l,c]}function Ss(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?_s(t,e,n):_s(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 pr(e,t,n){return t=+t,e=+e,n=+n,_s(e,t,n)[2]}function Co(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?pr(t,e,n):pr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function k0(e,t,n){let r;for(;;){const i=pr(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 P0(e){return Math.max(1,Math.ceil(Math.log(S0(e))/Math.LN2)+1)}function $0(){var e=M0,t=Ie,n=P0;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const E=h,_=+f;if(t===Ie&&([d,h]=k0(d,h,_)),f=Ss(d,h,_),f[0]<=d&&(l=pr(d,h,_)),f[f.length-1]>=h)if(E>=h&&t===Ie){const S=pr(d,h,_);isFinite(S)&&(S>0?h=(Math.floor(h/S)+1)*S:S<0&&(h=(Math.ceil(h*-S)+1)/-S))}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 E=Math.floor((d-o)*l);m[Math.min(p,E+(f[E]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&m[Mo(f,o,0,p)].push(i[s]);return m}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Ao(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Ao([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Ao(Array.isArray(i)?D0.call(i):i),r):n},r}function Un(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Mn(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function rh(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?nh:A0(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));rh(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(li(e,n,t),i(e[r],s)>0&&li(e,n,r);a<o;){for(li(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?li(e,n,o):(++o,li(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function li(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Do(e,t,n){if(e=Float64Array.from(b0(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Mn(e);if(t>=1)return Un(e);var r,i=(r-1)*t,s=Math.floor(i),a=Un(rh(e,s).subarray(0,s+1)),o=Mn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*N0(e){for(const t of e)yield*t}function ih(e){return Array.from(N0(e))}function U0(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function B0(e){return e}var Ts=1,ws=2,Lo=3,ci=4,sh=1e-6;function F0(e){return"translate("+e+",0)"}function H0(e){return"translate(0,"+e+")"}function G0(e){return t=>+e(t)}function V0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function z0(){return!this.__axis}function Os(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===Ts||e===ci?-1:1,u=e===ci||e===ws?"x":"y",d=e===Ts||e===Lo?F0:H0;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):B0),v=Math.max(s,0)+o,m=t.range(),y=+m[0]+l,E=+m[m.length-1]+l,_=(t.bandwidth?V0:G0)(t.copy(),l),S=f.selection?f.selection():f,b=S.selectAll(".domain").data([null]),M=S.selectAll(".tick").data(p,t).order(),D=M.exit(),G=M.enter().append("g").attr("class","tick"),I=M.select("line"),w=M.select("text");b=b.merge(b.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)),w=w.merge(G.append("text").attr("fill","currentColor").attr(u,c*v).attr("dy",e===Ts?"0em":e===Lo?"0.71em":"0.32em")),f!==S&&(b=b.transition(f),M=M.transition(f),I=I.transition(f),w=w.transition(f),D=D.transition(f).attr("opacity",sh).attr("transform",function(C){return isFinite(C=_(C))?d(C+l):this.getAttribute("transform")}),G.attr("opacity",sh).attr("transform",function(C){var R=this.parentNode.__axis;return d((R&&isFinite(R=R(C))?R:_(C))+l)})),D.remove(),b.attr("d",e===ci||e===ws?a?"M"+c*a+","+y+"H"+l+"V"+E+"H"+c*a:"M"+l+","+y+"V"+E:a?"M"+y+","+c*a+"V"+l+"H"+E+"V"+c*a:"M"+y+","+l+"H"+E),M.attr("opacity",1).attr("transform",function(C){return d(_(C)+l)}),I.attr(u+"2",c*s),w.attr(u,c*v).text(g),S.filter(z0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ws?"start":e===ci?"end":"middle"),S.each(function(){this.__axis=_})}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 W0(e){return Os(Ts,e)}function Y0(e){return Os(ws,e)}function Ro(e){return Os(Lo,e)}function ah(e){return Os(ci,e)}var q0={value:()=>{}};function Io(){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 Ms(n)}function Ms(e){this._=e}function X0(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ms.prototype=Io.prototype={constructor:Ms,on:function(e,t){var n=this._,r=X0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=j0(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]=oh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=oh(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 Ms(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 j0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function oh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=q0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ko="http://www.w3.org/1999/xhtml";const lh={svg:"http://www.w3.org/2000/svg",xhtml:ko,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function As(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),lh.hasOwnProperty(t)?{space:lh[t],local:e}:e}function Z0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ko&&t.documentElement.namespaceURI===ko?t.createElement(e):t.createElementNS(n,e)}}function K0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ch(e){var t=As(e);return(t.local?K0:Z0)(t)}function Q0(){}function Po(e){return e==null?Q0:function(){return this.querySelector(e)}}function J0(e){typeof e!="function"&&(e=Po(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 me(r,this._parents)}function ty(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ey(){return[]}function uh(e){return e==null?ey:function(){return this.querySelectorAll(e)}}function ny(e){return function(){return ty(e.apply(this,arguments))}}function ry(e){typeof e=="function"?e=ny(e):e=uh(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 me(r,i)}function hh(e){return function(){return this.matches(e)}}function dh(e){return function(t){return t.matches(e)}}var iy=Array.prototype.find;function sy(e){return function(){return iy.call(this.children,e)}}function ay(){return this.firstElementChild}function oy(e){return this.select(e==null?ay:sy(typeof e=="function"?e:dh(e)))}var ly=Array.prototype.filter;function cy(){return Array.from(this.children)}function uy(e){return function(){return ly.call(this.children,e)}}function hy(e){return this.selectAll(e==null?cy:uy(typeof e=="function"?e:dh(e)))}function dy(e){typeof e!="function"&&(e=hh(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 me(r,this._parents)}function fh(e){return new Array(e.length)}function fy(){return new me(this._enter||this._groups.map(fh),this._parents)}function Cs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Cs.prototype={constructor:Cs,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 py(e){return function(){return e}}function gy(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 Cs(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function my(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 Cs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function vy(e){return e.__data__}function yy(e,t){if(!arguments.length)return Array.from(this,vy);var n=t?my:gy,r=this._parents,i=this._groups;typeof e!="function"&&(e=py(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=Ey(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,E=0,_,S;y<p;++y)if(_=g[y]){for(y>=E&&(E=y+1);!(S=v[E])&&++E<p;);_._next=S||null}}return a=new me(a,r),a._enter=o,a._exit=l,a}function Ey(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xy(){return new me(this._exit||this._groups.map(fh),this._parents)}function by(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 _y(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 me(o,this._parents)}function Sy(){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 Ty(e){e||(e=wy);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 me(i,this._parents).order()}function wy(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Oy(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function My(){return Array.from(this)}function Ay(){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 Cy(){let e=0;for(const t of this)++e;return e}function Dy(){return!this.node()}function Ly(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 Ry(e){return function(){this.removeAttribute(e)}}function Iy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ky(e,t){return function(){this.setAttribute(e,t)}}function Py(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function $y(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ny(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Uy(e,t){var n=As(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?Iy:Ry:typeof t=="function"?n.local?Ny:$y:n.local?Py:ky)(n,t))}function ph(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function By(e){return function(){this.style.removeProperty(e)}}function Fy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Hy(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Gy(e,t,n){return arguments.length>1?this.each((t==null?By:typeof t=="function"?Hy:Fy)(e,t,n??"")):gr(this.node(),e)}function gr(e,t){return e.style.getPropertyValue(t)||ph(e).getComputedStyle(e,null).getPropertyValue(t)}function Vy(e){return function(){delete this[e]}}function zy(e,t){return function(){this[e]=t}}function Wy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Yy(e,t){return arguments.length>1?this.each((t==null?Vy:typeof t=="function"?Wy:zy)(e,t)):this.node()[e]}function gh(e){return e.trim().split(/^|\s+/)}function $o(e){return e.classList||new mh(e)}function mh(e){this._node=e,this._names=gh(e.getAttribute("class")||"")}mh.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 vh(e,t){for(var n=$o(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function yh(e,t){for(var n=$o(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function qy(e){return function(){vh(this,e)}}function Xy(e){return function(){yh(this,e)}}function jy(e,t){return function(){(t.apply(this,arguments)?vh:yh)(this,e)}}function Zy(e,t){var n=gh(e+"");if(arguments.length<2){for(var r=$o(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?jy:t?qy:Xy)(n,t))}function Ky(){this.textContent=""}function Qy(e){return function(){this.textContent=e}}function Jy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function t1(e){return arguments.length?this.each(e==null?Ky:(typeof e=="function"?Jy:Qy)(e)):this.node().textContent}function e1(){this.innerHTML=""}function n1(e){return function(){this.innerHTML=e}}function r1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function i1(e){return arguments.length?this.each(e==null?e1:(typeof e=="function"?r1:n1)(e)):this.node().innerHTML}function s1(){this.nextSibling&&this.parentNode.appendChild(this)}function a1(){return this.each(s1)}function o1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function l1(){return this.each(o1)}function c1(e){var t=typeof e=="function"?e:ch(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function u1(){return null}function h1(e,t){var n=typeof e=="function"?e:ch(e),r=t==null?u1:typeof t=="function"?t:Po(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function d1(){var e=this.parentNode;e&&e.removeChild(this)}function f1(){return this.each(d1)}function p1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function g1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function m1(e){return this.select(e?g1:p1)}function v1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function y1(e){return function(t){e.call(this,t,this.__data__)}}function E1(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 x1(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 b1(e,t,n){return function(){var r=this.__on,i,s=y1(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 _1(e,t,n){var r=E1(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?b1:x1,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function Eh(e,t,n){var r=ph(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 S1(e,t){return function(){return Eh(this,e,t)}}function T1(e,t){return function(){return Eh(this,e,t.apply(this,arguments))}}function w1(e,t){return this.each((typeof t=="function"?T1:S1)(e,t))}function*O1(){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 xh=[null];function me(e,t){this._groups=e,this._parents=t}function ui(){return new me([[document.documentElement]],xh)}function M1(){return this}me.prototype=ui.prototype={constructor:me,select:J0,selectAll:ry,selectChild:oy,selectChildren:hy,filter:dy,data:yy,enter:fy,exit:xy,join:by,merge:_y,selection:M1,order:Sy,sort:Ty,call:Oy,nodes:My,node:Ay,size:Cy,empty:Dy,each:Ly,attr:Uy,style:Gy,property:Yy,classed:Zy,text:t1,html:i1,raise:a1,lower:l1,append:c1,insert:h1,remove:f1,clone:m1,datum:v1,on:_1,dispatch:w1,[Symbol.iterator]:O1};function L(e){return typeof e=="string"?new me([[document.querySelector(e)]],[document.documentElement]):new me([[e]],xh)}function A1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Bn(e,t){if(e=A1(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 No={capture:!0,passive:!1};function Uo(e){e.preventDefault(),e.stopImmediatePropagation()}function C1(e){var t=e.document.documentElement,n=L(e).on("dragstart.drag",Uo,No);"onselectstart"in t?n.on("selectstart.drag",Uo,No):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function D1(e,t){var n=e.document.documentElement,r=L(e).on("dragstart.drag",null);t&&(r.on("click.drag",Uo,No),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 Bo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bh(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hi(){}var di=.7,Ds=1/di,mr="\\s*([+-]?\\d+)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",L1=/^#([0-9a-f]{3,8})$/,R1=new RegExp(`^rgb\\(${mr},${mr},${mr}\\)$`),I1=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),k1=new RegExp(`^rgba\\(${mr},${mr},${mr},${fi}\\)$`),P1=new RegExp(`^rgba\\(${qe},${qe},${qe},${fi}\\)$`),$1=new RegExp(`^hsl\\(${fi},${qe},${qe}\\)$`),N1=new RegExp(`^hsla\\(${fi},${qe},${qe},${fi}\\)$`),_h={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};Bo(hi,an,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Sh,formatHex:Sh,formatHex8:U1,formatHsl:B1,formatRgb:Th,toString:Th});function Sh(){return this.rgb().formatHex()}function U1(){return this.rgb().formatHex8()}function B1(){return Ch(this).formatHsl()}function Th(){return this.rgb().formatRgb()}function an(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=L1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wh(t):n===3?new le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ls(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ls(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=R1.exec(e))?new le(t[1],t[2],t[3],1):(t=I1.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=k1.exec(e))?Ls(t[1],t[2],t[3],t[4]):(t=P1.exec(e))?Ls(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=$1.exec(e))?Ah(t[1],t[2]/100,t[3]/100,1):(t=N1.exec(e))?Ah(t[1],t[2]/100,t[3]/100,t[4]):_h.hasOwnProperty(e)?wh(_h[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function wh(e){return new le(e>>16&255,e>>8&255,e&255,1)}function Ls(e,t,n,r){return r<=0&&(e=t=n=NaN),new le(e,t,n,r)}function F1(e){return e instanceof hi||(e=an(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Fo(e,t,n,r){return arguments.length===1?F1(e):new le(e,t,n,r??1)}function le(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Bo(le,Fo,bh(hi,{brighter(e){return e=e==null?Ds:Math.pow(Ds,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(Fn(this.r),Fn(this.g),Fn(this.b),Rs(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Oh,formatHex:Oh,formatHex8:H1,formatRgb:Mh,toString:Mh}));function Oh(){return`#${Hn(this.r)}${Hn(this.g)}${Hn(this.b)}`}function H1(){return`#${Hn(this.r)}${Hn(this.g)}${Hn(this.b)}${Hn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mh(){const e=Rs(this.opacity);return`${e===1?"rgb(":"rgba("}${Fn(this.r)}, ${Fn(this.g)}, ${Fn(this.b)}${e===1?")":`, ${e})`}`}function Rs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hn(e){return e=Fn(e),(e<16?"0":"")+e.toString(16)}function Ah(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ke(e,t,n,r)}function Ch(e){if(e instanceof ke)return new ke(e.h,e.s,e.l,e.opacity);if(e instanceof hi||(e=an(e)),!e)return new ke;if(e instanceof ke)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 ke(a,o,l,e.opacity)}function Ho(e,t,n,r){return arguments.length===1?Ch(e):new ke(e,t,n,r??1)}function ke(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Bo(ke,Ho,bh(hi,{brighter(e){return e=e==null?Ds:Math.pow(Ds,e),new ke(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new ke(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 le(Go(e>=240?e-240:e+120,i,r),Go(e,i,r),Go(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ke(Dh(this.h),Is(this.s),Is(this.l),Rs(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=Rs(this.opacity);return`${e===1?"hsl(":"hsla("}${Dh(this.h)}, ${Is(this.s)*100}%, ${Is(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Dh(e){return e=(e||0)%360,e<0?e+360:e}function Is(e){return Math.max(0,Math.min(1,e||0))}function Go(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 Vo=e=>()=>e;function G1(e,t){return function(n){return e+n*t}}function V1(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 z1(e){return(e=+e)==1?Lh:function(t,n){return n-t?V1(t,n,e):Vo(isNaN(t)?n:t)}}function Lh(e,t){var n=t-e;return n?G1(e,n):Vo(isNaN(e)?t:e)}const ks=function e(t){var n=z1(t);function r(i,s){var a=n((i=Fo(i)).r,(s=Fo(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Lh(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 W1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function Y1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function q1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=pi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function X1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ve(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function j1(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=pi(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var zo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wo=new RegExp(zo.source,"g");function Z1(e){return function(){return e}}function K1(e){return function(t){return e(t)+""}}function Rh(e,t){var n=zo.lastIndex=Wo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=zo.exec(e))&&(i=Wo.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:ve(r,i)})),n=Wo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?K1(l[0].x):Z1(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function pi(e,t){var n=typeof t,r;return t==null||n==="boolean"?Vo(t):(n==="number"?ve:n==="string"?(r=an(t))?(t=r,ks):Rh:t instanceof an?ks:t instanceof Date?X1:Y1(t)?W1:Array.isArray(t)?q1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?j1:ve)(e,t)}function Ih(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var kh=180/Math.PI,Yo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ph(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)*kh,skewX:Math.atan(l)*kh,scaleX:a,scaleY:o}}var Ps;function Q1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Yo:Ph(t.a,t.b,t.c,t.d,t.e,t.f)}function J1(e){return e==null||(Ps||(Ps=document.createElementNS("http://www.w3.org/2000/svg","g")),Ps.setAttribute("transform",e),!(e=Ps.transform.baseVal.consolidate()))?Yo:(e=e.matrix,Ph(e.a,e.b,e.c,e.d,e.e,e.f))}function $h(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:ve(c,d)},{i:g-2,x:ve(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:ve(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:ve(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:ve(c,d)},{i:g-2,x:ve(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 tE=$h(Q1,"px, ","px)","deg)"),eE=$h(J1,", ",")",")");function nE(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var vr=0,gi=0,mi=0,Nh=1e3,$s,vi,Ns=0,Gn=0,Us=0,yi=typeof performance=="object"&&performance.now?performance:Date,Uh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qo(){return Gn||(Uh(rE),Gn=yi.now()+Us)}function rE(){Gn=0}function Bs(){this._call=this._time=this._next=null}Bs.prototype=Bh.prototype={constructor:Bs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qo():+n)+(t==null?0:+t),!this._next&&vi!==this&&(vi?vi._next=this:$s=this,vi=this),this._call=e,this._time=n,Xo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xo())}};function Bh(e,t,n){var r=new Bs;return r.restart(e,t,n),r}function iE(){qo(),++vr;for(var e=$s,t;e;)(t=Gn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vr}function Fh(){Gn=(Ns=yi.now())+Us,vr=gi=0;try{iE()}finally{vr=0,aE(),Gn=0}}function sE(){var e=yi.now(),t=e-Ns;t>Nh&&(Us-=t,Ns=e)}function aE(){for(var e,t=$s,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$s=n);vi=e,Xo(r)}function Xo(e){if(!vr){gi&&(gi=clearTimeout(gi));var t=e-Gn;t>24?(e<1/0&&(gi=setTimeout(Fh,e-yi.now()-Us)),mi&&(mi=clearInterval(mi))):(mi||(Ns=yi.now(),mi=setInterval(sE,Nh)),vr=1,Uh(Fh))}}function Hh(e,t,n){var r=new Bs;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var oE=Io("start","end","cancel","interrupt"),lE=[],Gh=0,Vh=1,jo=2,Fs=3,zh=4,Zo=5,Hs=6;function Gs(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;cE(e,n,{name:t,index:r,group:i,on:oE,tween:lE,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Gh})}function Ko(e,t){var n=Pe(e,t);if(n.state>Gh)throw new Error("too late; already scheduled");return n}function Xe(e,t){var n=Pe(e,t);if(n.state>Fs)throw new Error("too late; already running");return n}function Pe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function cE(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bh(s,0,n.time);function s(c){n.state=Vh,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!==Vh)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Fs)return Hh(a);f.state===zh?(f.state=Hs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=Hs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Hh(function(){n.state===Fs&&(n.state=zh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=jo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===jo){for(n.state=Fs,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=f);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Zo,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Zo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Hs,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Qo(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>jo&&r.state<Zo,r.state=Hs,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function uE(e){return this.each(function(){Qo(this,e)})}function hE(e,t){var n,r;return function(){var i=Xe(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 dE(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Xe(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 fE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Pe(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?hE:dE)(n,e,t))}function Jo(e,t,n){var r=e._id;return e.each(function(){var i=Xe(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Pe(i,r).value[t]}}function Wh(e,t){var n;return(typeof t=="number"?ve:t instanceof an?ks:(n=an(t))?(t=n,ks):Rh)(e,t)}function pE(e){return function(){this.removeAttribute(e)}}function gE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mE(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 vE(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 yE(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 EE(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 xE(e,t){var n=As(e),r=n==="transform"?eE:Wh;return this.attrTween(e,typeof t=="function"?(n.local?EE:yE)(n,r,Jo(this,"attr."+e,t)):t==null?(n.local?gE:pE)(n):(n.local?vE:mE)(n,r,t))}function bE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function _E(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function SE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&_E(e,s)),n}return i._value=t,i}function TE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&bE(e,s)),n}return i._value=t,i}function wE(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=As(e);return this.tween(n,(r.local?SE:TE)(r,t))}function OE(e,t){return function(){Ko(this,e).delay=+t.apply(this,arguments)}}function ME(e,t){return t=+t,function(){Ko(this,e).delay=t}}function AE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?OE:ME)(t,e)):Pe(this.node(),t).delay}function CE(e,t){return function(){Xe(this,e).duration=+t.apply(this,arguments)}}function DE(e,t){return t=+t,function(){Xe(this,e).duration=t}}function LE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?CE:DE)(t,e)):Pe(this.node(),t).duration}function RE(e,t){if(typeof t!="function")throw new Error;return function(){Xe(this,e).ease=t}}function IE(e){var t=this._id;return arguments.length?this.each(RE(t,e)):Pe(this.node(),t).ease}function kE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xe(this,e).ease=n}}function PE(e){if(typeof e!="function")throw new Error;return this.each(kE(this._id,e))}function $E(e){typeof e!="function"&&(e=hh(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 on(r,this._parents,this._name,this._id)}function NE(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 on(a,this._parents,this._name,this._id)}function UE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function BE(e,t,n){var r,i,s=UE(t)?Ko:Xe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function FE(e,t){var n=this._id;return arguments.length<2?Pe(this.node(),n).on.on(e):this.each(BE(n,e,t))}function HE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function GE(){return this.on("end.remove",HE(this._id))}function VE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Po(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,Gs(c[h],t,n,h,c,Pe(u,n)));return new on(s,this._parents,t,n)}function zE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=uh(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=Pe(u,n),g=0,v=h.length;g<v;++g)(f=h[g])&&Gs(f,t,n,g,h,p);s.push(h),a.push(u)}return new on(s,a,t,n)}var WE=ui.prototype.constructor;function YE(){return new WE(this._groups,this._parents)}function qE(e,t){var n,r,i;return function(){var s=gr(this,e),a=(this.style.removeProperty(e),gr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Yh(e){return function(){this.style.removeProperty(e)}}function XE(e,t,n){var r,i=n+"",s;return function(){var a=gr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function jE(e,t,n){var r,i,s;return function(){var a=gr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),gr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function ZE(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=Xe(this,e),c=l.on,u=l.value[s]==null?o||(o=Yh(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function KE(e,t,n){var r=(e+="")=="transform"?tE:Wh;return t==null?this.styleTween(e,qE(e,r)).on("end.style."+e,Yh(e)):typeof t=="function"?this.styleTween(e,jE(e,r,Jo(this,"style."+e,t))).each(ZE(this._id,e)):this.styleTween(e,XE(e,r,t),n).on("end.style."+e,null)}function QE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function JE(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&QE(e,a,n)),r}return s._value=t,s}function tx(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,JE(e,t,n??""))}function ex(e){return function(){this.textContent=e}}function nx(e){return function(){var t=e(this);this.textContent=t??""}}function rx(e){return this.tween("text",typeof e=="function"?nx(Jo(this,"text",e)):ex(e==null?"":e+""))}function ix(e){return function(t){this.textContent=e.call(this,t)}}function sx(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&ix(i)),t}return r._value=e,r}function ax(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,sx(e))}function ox(){for(var e=this._name,t=this._id,n=qh(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Pe(l,t);Gs(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new on(r,this._parents,e,n)}function lx(){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=Xe(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 cx=0;function on(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qh(){return++cx}var ln=ui.prototype;on.prototype={constructor:on,select:VE,selectAll:zE,selectChild:ln.selectChild,selectChildren:ln.selectChildren,filter:$E,merge:NE,selection:YE,transition:ox,call:ln.call,nodes:ln.nodes,node:ln.node,size:ln.size,empty:ln.empty,each:ln.each,on:FE,attr:xE,attrTween:wE,style:KE,styleTween:tx,text:rx,textTween:ax,remove:GE,tween:fE,delay:AE,duration:LE,ease:IE,easeVarying:PE,end:lx,[Symbol.iterator]:ln[Symbol.iterator]};const ux=e=>+e;function Xh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hx={time:null,delay:0,duration:250,ease:Xh};function dx(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 fx(e){var t,n;e instanceof on?(t=e._id,e=e._name):(t=qh(),(n=hx).time=qo(),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])&&Gs(l,e,t,c,a,n||dx(l,t));return new on(r,this._parents,e,t)}ui.prototype.interrupt=uE,ui.prototype.transition=fx;const tl=e=>()=>e;function px(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 gx(e){e.stopImmediatePropagation()}function el(e){e.preventDefault(),e.stopImmediatePropagation()}var jh={name:"drag"},nl={name:"space"},yr={name:"handle"},Er={name:"center"};const{abs:Zh,max:Zt,min:Kt}=Math;function Kh(e){return[+e[0],+e[1]]}function Qh(e){return[Kh(e[0]),Kh(e[1])]}var Vs={name:"x",handles:["w","e"].map(zs),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]]}},rl={name:"y",handles:["n","s"].map(zs),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]]}},cn={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"},Jh={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},td={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},mx={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},vx={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function zs(e){return{type:e}}function yx(e){return!e.ctrlKey&&!e.button}function Ex(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function xx(){return navigator.maxTouchPoints||"ontouchstart"in this}function il(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function bx(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function ed(){return _x(Vs)}function _x(e){var t=Ex,n=yx,r=xx,i=!0,s=Io("start","brush","end"),a=6,o;function l(v){var m=v.property("__brush",g).selectAll(".overlay").data([zs("overlay")]);m.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",cn.overlay).merge(m).each(function(){var E=il(this).extent;L(this).attr("x",E[0][0]).attr("y",E[0][1]).attr("width",E[1][0]-E[0][0]).attr("height",E[1][1]-E[0][1])}),v.selectAll(".selection").data([zs("selection")]).enter().append("rect").attr("class","selection").attr("cursor",cn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=v.selectAll(".handle").data(e.handles,function(E){return E.type});y.exit().remove(),y.enter().append("rect").attr("class",function(E){return"handle handle--"+E.type}).attr("cursor",function(E){return cn[E.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(E){u(this,arguments).beforestart().start(E)}).on("interrupt.brush end.brush",function(E){u(this,arguments).end(E)}).tween("brush",function(){var E=this,_=E.__brush,S=u(E,arguments),b=_.selection,M=e.input(typeof m=="function"?m.apply(this,arguments):m,_.extent),D=pi(b,M);function G(I){_.selection=I===1&&M===null?null:D(I),c.call(E),S.brush()}return b!==null&&M!==null?G:G(1)}):v.each(function(){var E=this,_=arguments,S=E.__brush,b=e.input(typeof m=="function"?m.apply(E,_):m,S.extent),M=u(E,_).beforestart();Qo(E),S.selection=b===null?null:b,c.call(E),M.start(y).brush(y).end(y)})},l.clear=function(v,m){l.move(v,null,m)};function c(){var v=L(this),m=il(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 E=v.__brush.emitter;return E&&(!y||!E.clean)?E: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 E=L(this.that).datum();s.call(v,this.that,new px(v,{sourceEvent:m,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),E)}};function h(v){if(o&&!v.touches||!n.apply(this,arguments))return;var m=this,y=v.target.__data__.type,E=(i&&v.metaKey?y="overlay":y)==="selection"?jh:i&&v.altKey?Er:yr,_=e===rl?null:mx[y],S=e===Vs?null:vx[y],b=il(m),M=b.extent,D=b.selection,G=M[0][0],I,w,C=M[0][1],R,P,O=M[1][0],H,B,U=M[1][1],N,j,Y=0,it=0,et,q=_&&S&&i&&v.shiftKey,Q,pt,ot=Array.from(v.touches||[v],st=>{const Rt=st.identifier;return st=Bn(st,m),st.point0=st.slice(),st.identifier=Rt,st});Qo(m);var Tt=u(m,arguments,!0).beforestart();if(y==="overlay"){D&&(et=!0);const st=[ot[0],ot[1]||ot[0]];b.selection=D=[[I=e===rl?G:Kt(st[0][0],st[1][0]),R=e===Vs?C:Kt(st[0][1],st[1][1])],[H=e===rl?O:Zt(st[0][0],st[1][0]),N=e===Vs?U:Zt(st[0][1],st[1][1])]],ot.length>1&&mt(v)}else I=D[0][0],R=D[0][1],H=D[1][0],N=D[1][1];w=I,P=R,B=H,j=N;var Z=L(m).attr("pointer-events","none"),F=Z.selectAll(".overlay").attr("cursor",cn[y]);if(v.touches)Tt.moved=$,Tt.ended=gt;else{var V=L(v.view).on("mousemove.brush",$,!0).on("mouseup.brush",gt,!0);i&&V.on("keydown.brush",Ht,!0).on("keyup.brush",Gt,!0),C1(v.view)}c.call(m),Tt.start(v,E.name);function $(st){for(const Rt of st.changedTouches||[st])for(const ur of ot)ur.identifier===Rt.identifier&&(ur.cur=Bn(Rt,m));if(q&&!Q&&!pt&&ot.length===1){const Rt=ot[0];Zh(Rt.cur[0]-Rt[0])>Zh(Rt.cur[1]-Rt[1])?pt=!0:Q=!0}for(const Rt of ot)Rt.cur&&(Rt[0]=Rt.cur[0],Rt[1]=Rt.cur[1]);et=!0,el(st),mt(st)}function mt(st){const Rt=ot[0],ur=Rt.point0;var Le;switch(Y=Rt[0]-ur[0],it=Rt[1]-ur[1],E){case nl:case jh:{_&&(Y=Zt(G-I,Kt(O-H,Y)),w=I+Y,B=H+Y),S&&(it=Zt(C-R,Kt(U-N,it)),P=R+it,j=N+it);break}case yr:{ot[1]?(_&&(w=Zt(G,Kt(O,ot[0][0])),B=Zt(G,Kt(O,ot[1][0])),_=1),S&&(P=Zt(C,Kt(U,ot[0][1])),j=Zt(C,Kt(U,ot[1][1])),S=1)):(_<0?(Y=Zt(G-I,Kt(O-I,Y)),w=I+Y,B=H):_>0&&(Y=Zt(G-H,Kt(O-H,Y)),w=I,B=H+Y),S<0?(it=Zt(C-R,Kt(U-R,it)),P=R+it,j=N):S>0&&(it=Zt(C-N,Kt(U-N,it)),P=R,j=N+it));break}case Er:{_&&(w=Zt(G,Kt(O,I-Y*_)),B=Zt(G,Kt(O,H+Y*_))),S&&(P=Zt(C,Kt(U,R-it*S)),j=Zt(C,Kt(U,N+it*S)));break}}B<w&&(_*=-1,Le=I,I=H,H=Le,Le=w,w=B,B=Le,y in Jh&&F.attr("cursor",cn[y=Jh[y]])),j<P&&(S*=-1,Le=R,R=N,N=Le,Le=P,P=j,j=Le,y in td&&F.attr("cursor",cn[y=td[y]])),b.selection&&(D=b.selection),Q&&(w=D[0][0],B=D[1][0]),pt&&(P=D[0][1],j=D[1][1]),(D[0][0]!==w||D[0][1]!==P||D[1][0]!==B||D[1][1]!==j)&&(b.selection=[[w,P],[B,j]],c.call(m),Tt.brush(st,E.name))}function gt(st){if(gx(st),st.touches){if(st.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else D1(st.view,et),V.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Z.attr("pointer-events","all"),F.attr("cursor",cn.overlay),b.selection&&(D=b.selection),bx(D)&&(b.selection=null,c.call(m)),Tt.end(st,E.name)}function Ht(st){switch(st.keyCode){case 16:{q=_&&S;break}case 18:{E===yr&&(_&&(H=B-Y*_,I=w+Y*_),S&&(N=j-it*S,R=P+it*S),E=Er,mt(st));break}case 32:{(E===yr||E===Er)&&(_<0?H=B-Y:_>0&&(I=w-Y),S<0?N=j-it:S>0&&(R=P-it),E=nl,F.attr("cursor",cn.selection),mt(st));break}default:return}el(st)}function Gt(st){switch(st.keyCode){case 16:{q&&(Q=pt=q=!1,mt(st));break}case 18:{E===Er&&(_<0?H=B:_>0&&(I=w),S<0?N=j:S>0&&(R=P),E=yr,mt(st));break}case 32:{E===nl&&(st.altKey?(_&&(H=B-Y*_,I=w+Y*_),S&&(N=j-it*S,R=P+it*S),E=Er):(_<0?H=B:_>0&&(I=w),S<0?N=j:S>0&&(R=P),E=yr),F.attr("cursor",cn[y]),mt(st));break}default:return}el(st)}}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=Qh(t.apply(this,arguments)),v.dim=e,v}return l.extent=function(v){return arguments.length?(t=typeof v=="function"?v:tl(Qh(v)),l):t},l.filter=function(v){return arguments.length?(n=typeof v=="function"?v:tl(!!v),l):n},l.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:tl(!!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 sl=Math.PI,al=2*sl,Vn=1e-6,Sx=al-Vn;function nd(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Tx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nd;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 wx=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nd:Tx(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>Vn)if(!(Math.abs(d*l-c*u)>Vn)||!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),E=s*Math.tan((sl-Math.acos((g+h-v)/(2*m*y)))/2),_=E/y,S=E/m;Math.abs(_-1)>Vn&&this._append`L${t+_*u},${n+_*d}`,this._append`A${s},${s},0,0,${+(d*f>u*p)},${this._x1=t+S*l},${this._y1=n+S*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)>Vn||Math.abs(this._y1-u)>Vn)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%al+al),h>Sx?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>Vn&&this._append`A${r},${r},0,${+(h>=sl)},${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 Ox(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ws(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 xr(e){return e=Ws(Math.abs(e)),e?e[1]:NaN}function Mx(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 Ax(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Cx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ei(e){if(!(t=Cx.exec(e)))throw new Error("invalid format: "+e);var t;return new ol({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]})}Ei.prototype=ol.prototype;function ol(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+""}ol.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 Dx(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 rd;function Lx(e,t){var n=Ws(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(rd=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")+Ws(e,Math.max(0,t+s-1))[0]}function id(e,t){var n=Ws(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 sd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ox,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)=>id(e*100,t),r:id,s:Lx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ad(e){return e}var od=Array.prototype.map,ld=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rx(e){var t=e.grouping===void 0||e.thousands===void 0?ad:Mx(od.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?ad:Ax(od.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=Ei(d);var h=d.fill,f=d.align,p=d.sign,g=d.symbol,v=d.zero,m=d.width,y=d.comma,E=d.precision,_=d.trim,S=d.type;S==="n"?(y=!0,S="g"):sd[S]||(E===void 0&&(E=12),_=!0,S="g"),(v||h==="0"&&f==="=")&&(v=!0,h="0",f="=");var b=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",M=g==="$"?r:/[%p]/.test(S)?a:"",D=sd[S],G=/[defgprs%]/.test(S);E=E===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function I(w){var C=b,R=M,P,O,H;if(S==="c")R=D(w)+R,w="";else{w=+w;var B=w<0||1/w<0;if(w=isNaN(w)?l:D(Math.abs(w),E),_&&(w=Dx(w)),B&&+w==0&&p!=="+"&&(B=!1),C=(B?p==="("?p:o:p==="-"||p==="("?"":p)+C,R=(S==="s"?ld[8+rd/3]:"")+R+(B&&p==="("?")":""),G){for(P=-1,O=w.length;++P<O;)if(H=w.charCodeAt(P),48>H||H>57){R=(H===46?i+w.slice(P+1):w.slice(P))+R,w=w.slice(0,P);break}}}y&&!v&&(w=t(w,1/0));var U=C.length+w.length+R.length,N=U<m?new Array(m-U+1).join(h):"";switch(y&&v&&(w=t(N+w,N.length?m-R.length:1/0),N=""),f){case"<":w=C+w+R+N;break;case"=":w=C+N+w+R;break;case"^":w=N.slice(0,U=N.length>>1)+C+w+R+N.slice(U);break;default:w=N+C+w+R;break}return s(w)}return I.toString=function(){return d+""},I}function u(d,h){var f=c((d=Ei(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(xr(h)/3)))*3,g=Math.pow(10,-p),v=ld[8+p/3];return function(m){return f(g*m)+v}}return{format:c,formatPrefix:u}}var Ys,ll,cd;Ix({thousands:",",grouping:[3],currency:["$",""]});function Ix(e){return Ys=Rx(e),ll=Ys.format,cd=Ys.formatPrefix,Ys}function kx(e){return Math.max(0,-xr(Math.abs(e)))}function Px(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xr(t)/3)))*3-xr(Math.abs(e)))}function $x(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xr(t)-xr(e))+1}var xt=1e-6,ud=1e-12,dt=Math.PI,ce=dt/2,hd=dt/4,ye=dt*2,re=180/dt,$t=dt/180,bt=Math.abs,dd=Math.atan,zn=Math.atan2,St=Math.cos,Nx=Math.exp,Ux=Math.log,Et=Math.sin,An=Math.sign||function(e){return e>0?1:e<0?-1:0},$e=Math.sqrt,Bx=Math.tan;function Fx(e){return e>1?0:e<-1?dt:Math.acos(e)}function un(e){return e>1?ce:e<-1?-ce:Math.asin(e)}function Te(){}function qs(e,t){e&&pd.hasOwnProperty(e.type)&&pd[e.type](e,t)}var fd={Feature:function(e,t){qs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)qs(n[r].geometry,t)}},pd={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){cl(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)cl(n[r],t,0)},Polygon:function(e,t){gd(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)gd(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)qs(n[r],t)}};function cl(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 gd(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)cl(e[n],t,1);t.polygonEnd()}function br(e,t){e&&fd.hasOwnProperty(e.type)?fd[e.type](e,t):qs(e,t)}function ul(e){return[zn(e[1],e[0]),un(e[2])]}function _r(e){var t=e[0],n=e[1],r=St(n);return[r*St(t),r*Et(t),Et(n)]}function Xs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function js(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 hl(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Zs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function dl(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 fl(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 pl(e,t){return bt(e)>dt&&(e-=Math.round(e/ye)*ye),[e,t]}pl.invert=pl;function md(e,t,n){return(e%=ye)?t||n?fl(yd(e),Ed(t,n)):yd(e):t||n?Ed(t,n):pl}function vd(e){return function(t,n){return t+=e,bt(t)>dt&&(t-=Math.round(t/ye)*ye),[t,n]}}function yd(e){var t=vd(e);return t.invert=vd(-e),t}function Ed(e,t){var n=St(e),r=Et(e),i=St(t),s=Et(t);function a(o,l){var c=St(l),u=St(o)*c,d=Et(o)*c,h=Et(l),f=h*n+u*r;return[zn(d*i-f*s,u*n-h*r),un(f*i+d*s)]}return a.invert=function(o,l){var c=St(l),u=St(o)*c,d=Et(o)*c,h=Et(l),f=h*i-d*s;return[zn(d*i+h*s,u*n+f*r),un(f*n-u*r)]},a}function Hx(e){e=md(e[0]*$t,e[1]*$t,e.length>2?e[2]*$t:0);function t(n){return n=e(n[0]*$t,n[1]*$t),n[0]*=re,n[1]*=re,n}return t.invert=function(n){return n=e.invert(n[0]*$t,n[1]*$t),n[0]*=re,n[1]*=re,n},t}function Gx(e,t,n,r,i,s){if(n){var a=St(t),o=Et(t),l=r*n;i==null?(i=t+r*ye,s=t-l/2):(i=xd(a,i),s=xd(a,s),(r>0?i<s:i>s)&&(i+=r*ye));for(var c,u=i;r>0?u>s:u<s;u-=l)c=ul([a,-o*St(u),-o*Et(u)]),e.point(c[0],c[1])}}function xd(e,t){t=_r(t),t[0]-=e,dl(t);var n=Fx(-t[1]);return((-t[2]<0?-n:n)+ye-xt)%ye}function bd(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Te,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ks(e,t){return bt(e[0]-t[0])<xt&&bt(e[1]-t[1])<xt}function Qs(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 _d(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(Ks(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*xt}s.push(y=new Qs(v,p,null,!0)),a.push(y.o=new Qs(v,null,y,!1)),s.push(y=new Qs(m,p,null,!1)),a.push(y.o=new Qs(m,null,y,!0))}}),!!s.length){for(a.sort(t),Sd(s),Sd(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 Sd(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 gl(e){return bt(e[0])<=dt?e[0]:An(e[0])*((bt(e[0])+dt)%ye-dt)}function Vx(e,t){var n=gl(t),r=t[1],i=Et(r),s=[Et(n),-St(n),0],a=0,o=0,l=new Nn;i===1?r=ce+xt:i===-1&&(r=-ce-xt);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=gl(f),g=f[1]/2+hd,v=Et(g),m=St(g),y=0;y<h;++y,p=_,v=b,m=M,f=E){var E=d[y],_=gl(E),S=E[1]/2+hd,b=Et(S),M=St(S),D=_-p,G=D>=0?1:-1,I=G*D,w=I>dt,C=v*b;if(l.add(zn(C*G*Et(I),m*M+C*St(I))),a+=w?D+G*ye:D,w^p>=n^_>=n){var R=js(_r(f),_r(E));dl(R);var P=js(s,R);dl(P);var O=(w^D>=0?-1:1)*un(P[2]);(r>O||r===O&&(R[0]||R[1]))&&(o+=w^D>=0?1:-1)}}return(a<-xt||a<xt&&l<-ud)^o&1}function Td(e,t,n,r){return function(i){var s=t(i),a=bd(),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=E,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=g,h.lineEnd=v,u=ih(u);var _=Vx(c,r);u.length?(l||(i.polygonStart(),l=!0),_d(u,Wx,_,n,i)):_&&(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 E(){m(d[0][0],d[0][1]),o.lineEnd();var _=o.clean(),S=a.result(),b,M=S.length,D,G,I;if(d.pop(),c.push(d),d=null,!!M){if(_&1){if(G=S[0],(D=G.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),b=0;b<D;++b)i.point((I=G[b])[0],I[1]);i.lineEnd()}return}M>1&&_&2&&S.push(S.pop().concat(S.shift())),u.push(S.filter(zx))}}return h}}function zx(e){return e.length>1}function Wx(e,t){return((e=e.x)[0]<0?e[1]-ce-xt:ce-e[1])-((t=t.x)[0]<0?t[1]-ce-xt:ce-t[1])}const wd=Td(function(){return!0},Yx,Xx,[-dt,-ce]);function Yx(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?dt:-dt,l=bt(s-t);bt(l-dt)<xt?(e.point(t,n=(n+a)/2>0?ce:-ce),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=dt&&(bt(t-r)<xt&&(t-=r*xt),bt(s-o)<xt&&(s-=o*xt),n=qx(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 qx(e,t,n,r){var i,s,a=Et(e-n);return bt(a)>xt?dd((Et(t)*(s=St(r))*Et(n)-Et(r)*(i=St(t))*Et(e))/(i*s*a)):(t+r)/2}function Xx(e,t,n,r){var i;if(e==null)i=n*ce,r.point(-dt,i),r.point(0,i),r.point(dt,i),r.point(dt,0),r.point(dt,-i),r.point(0,-i),r.point(-dt,-i),r.point(-dt,0),r.point(-dt,i);else if(bt(e[0]-t[0])>xt){var s=e[0]<t[0]?dt:-dt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function jx(e){var t=St(e),n=6*$t,r=t>0,i=bt(t)>xt;function s(u,d,h,f){Gx(f,e,n,h,u,d)}function a(u,d){return St(u)*St(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],E,_=a(v,m),S=r?_?0:c(v,m):_?c(v+(v<0?dt:-dt),m):0;if(!d&&(p=f=_)&&u.lineStart(),_!==f&&(E=l(d,y),(!E||Ks(d,E)||Ks(y,E))&&(y[2]=1)),_!==f)g=0,_?(u.lineStart(),E=l(y,d),u.point(E[0],E[1])):(E=l(d,y),u.point(E[0],E[1],2),u.lineEnd()),d=E;else if(i&&d&&r^_){var b;!(S&h)&&(b=l(y,d,!0))&&(g=0,r?(u.lineStart(),u.point(b[0][0],b[0][1]),u.point(b[1][0],b[1][1]),u.lineEnd()):(u.point(b[1][0],b[1][1]),u.lineEnd(),u.lineStart(),u.point(b[0][0],b[0][1],3)))}_&&(!d||!Ks(d,y))&&u.point(y[0],y[1]),d=y,f=_,h=S},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return g|(p&&f)<<1}}}function l(u,d,h){var f=_r(u),p=_r(d),g=[1,0,0],v=js(f,p),m=Xs(v,v),y=v[0],E=m-y*y;if(!E)return!h&&u;var _=t*m/E,S=-t*y/E,b=js(g,v),M=Zs(g,_),D=Zs(v,S);hl(M,D);var G=b,I=Xs(M,G),w=Xs(G,G),C=I*I-w*(Xs(M,M)-1);if(!(C<0)){var R=$e(C),P=Zs(G,(-I-R)/w);if(hl(P,M),P=ul(P),!h)return P;var O=u[0],H=d[0],B=u[1],U=d[1],N;H<O&&(N=O,O=H,H=N);var j=H-O,Y=bt(j-dt)<xt,it=Y||j<xt;if(!Y&&U<B&&(N=B,B=U,U=N),it?Y?B+U>0^P[1]<(bt(P[0]-O)<xt?B:U):B<=P[1]&&P[1]<=U:j>dt^(O<=P[0]&&P[0]<=H)){var et=Zs(G,(-I+R)/w);return hl(et,M),[P,ul(et)]}}}function c(u,d){var h=r?e:dt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return Td(a,o,s,r?[0,-e]:[-dt,e-dt])}function Zx(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 xi=1e9,Js=-xi;function Kx(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 bt(c[0]-e)<xt?u>0?0:3:bt(c[0]-n)<xt?u>0?2:1:bt(c[1]-t)<xt?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=bd(),h,f,p,g,v,m,y,E,_,S,b,M={point:D,lineStart:C,lineEnd:R,polygonStart:I,polygonEnd:w};function D(O,H){i(O,H)&&u.point(O,H)}function G(){for(var O=0,H=0,B=f.length;H<B;++H)for(var U=f[H],N=1,j=U.length,Y=U[0],it,et,q=Y[0],Q=Y[1];N<j;++N)it=q,et=Q,Y=U[N],q=Y[0],Q=Y[1],et<=r?Q>r&&(q-it)*(r-et)>(Q-et)*(e-it)&&++O:Q<=r&&(q-it)*(r-et)<(Q-et)*(e-it)&&--O;return O}function I(){u=d,h=[],f=[],b=!0}function w(){var O=G(),H=b&&O,B=(h=ih(h)).length;(H||B)&&(c.polygonStart(),H&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),B&&_d(h,o,O,s,c),c.polygonEnd()),u=c,h=f=p=null}function C(){M.point=P,f&&f.push(p=[]),S=!0,_=!1,y=E=NaN}function R(){h&&(P(g,v),m&&_&&d.rejoin(),h.push(d.result())),M.point=D,_&&u.lineEnd()}function P(O,H){var B=i(O,H);if(f&&p.push([O,H]),S)g=O,v=H,m=B,S=!1,B&&(u.lineStart(),u.point(O,H));else if(B&&_)u.point(O,H);else{var U=[y=Math.max(Js,Math.min(xi,y)),E=Math.max(Js,Math.min(xi,E))],N=[O=Math.max(Js,Math.min(xi,O)),H=Math.max(Js,Math.min(xi,H))];Zx(U,N,e,t,n,r)?(_||(u.lineStart(),u.point(U[0],U[1])),u.point(N[0],N[1]),B||u.lineEnd(),b=!1):B&&(u.lineStart(),u.point(O,H),b=!1)}y=O,E=H,_=B}return M}}const ml=e=>e;var vl=new Nn,yl=new Nn,Od,Md,El,xl,Cn={point:Te,lineStart:Te,lineEnd:Te,polygonStart:function(){Cn.lineStart=Qx,Cn.lineEnd=tb},polygonEnd:function(){Cn.lineStart=Cn.lineEnd=Cn.point=Te,vl.add(bt(yl)),yl=new Nn},result:function(){var e=vl/2;return vl=new Nn,e}};function Qx(){Cn.point=Jx}function Jx(e,t){Cn.point=Ad,Od=El=e,Md=xl=t}function Ad(e,t){yl.add(xl*e-El*t),El=e,xl=t}function tb(){Ad(Od,Md)}const Cd=Cn;var Sr=1/0,ta=Sr,bi=-Sr,ea=bi,eb={point:nb,lineStart:Te,lineEnd:Te,polygonStart:Te,polygonEnd:Te,result:function(){var e=[[Sr,ta],[bi,ea]];return bi=ea=-(ta=Sr=1/0),e}};function nb(e,t){e<Sr&&(Sr=e),e>bi&&(bi=e),t<ta&&(ta=t),t>ea&&(ea=t)}const na=eb;var bl=0,_l=0,_i=0,ra=0,ia=0,Tr=0,Sl=0,Tl=0,Si=0,Dd,Ld,je,Ze,Ne={point:Wn,lineStart:Rd,lineEnd:Id,polygonStart:function(){Ne.lineStart=sb,Ne.lineEnd=ab},polygonEnd:function(){Ne.point=Wn,Ne.lineStart=Rd,Ne.lineEnd=Id},result:function(){var e=Si?[Sl/Si,Tl/Si]:Tr?[ra/Tr,ia/Tr]:_i?[bl/_i,_l/_i]:[NaN,NaN];return bl=_l=_i=ra=ia=Tr=Sl=Tl=Si=0,e}};function Wn(e,t){bl+=e,_l+=t,++_i}function Rd(){Ne.point=rb}function rb(e,t){Ne.point=ib,Wn(je=e,Ze=t)}function ib(e,t){var n=e-je,r=t-Ze,i=$e(n*n+r*r);ra+=i*(je+e)/2,ia+=i*(Ze+t)/2,Tr+=i,Wn(je=e,Ze=t)}function Id(){Ne.point=Wn}function sb(){Ne.point=ob}function ab(){kd(Dd,Ld)}function ob(e,t){Ne.point=kd,Wn(Dd=je=e,Ld=Ze=t)}function kd(e,t){var n=e-je,r=t-Ze,i=$e(n*n+r*r);ra+=i*(je+e)/2,ia+=i*(Ze+t)/2,Tr+=i,i=Ze*e-je*t,Sl+=i*(je+e),Tl+=i*(Ze+t),Si+=i*3,Wn(je=e,Ze=t)}const Pd=Ne;function $d(e){this._context=e}$d.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,ye);break}}},result:Te};var wl=new Nn,Ol,Nd,Ud,Ti,wi,sa={point:Te,lineStart:function(){sa.point=lb},lineEnd:function(){Ol&&Bd(Nd,Ud),sa.point=Te},polygonStart:function(){Ol=!0},polygonEnd:function(){Ol=null},result:function(){var e=+wl;return wl=new Nn,e}};function lb(e,t){sa.point=Bd,Nd=Ti=e,Ud=wi=t}function Bd(e,t){Ti-=e,wi-=t,wl.add($e(Ti*Ti+wi*wi)),Ti=e,wi=t}const Fd=sa;let Hd,aa,Gd,Vd;class zd{constructor(t){this._append=t==null?Wd:cb(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!==Gd||this._append!==aa){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`,Gd=r,aa=this._append,Vd=this._,this._=i}this._+=Vd;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Wd(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function cb(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Wd;if(t!==Hd){const n=10**t;Hd=t,aa=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 aa}function ub(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),br(o,i(s))),s.result()}return a.area=function(o){return br(o,i(Cd)),Cd.result()},a.measure=function(o){return br(o,i(Fd)),Fd.result()},a.bounds=function(o){return br(o,i(na)),na.result()},a.centroid=function(o){return br(o,i(Pd)),Pd.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,ml):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new zd(n)):new $d(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 zd(n)),a},a.projection(e).digits(n).context(t)}function Ml(e){return function(t){var n=new Al;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Al(){}Al.prototype={constructor:Al,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Cl(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),br(n,e.stream(na)),t(na.result()),r!=null&&e.clipExtent(r),e}function Yd(e,t,n){return Cl(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 hb(e,t,n){return Yd(e,[[0,0],t],n)}function db(e,t,n){return Cl(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 fb(e,t,n){return Cl(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 qd=16,pb=St(30*$t);function Xd(e,t){return+t?mb(e,t):gb(e)}function gb(e){return Ml({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function mb(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,E=m*m+y*y;if(E>4*t&&g--){var _=a+h,S=o+f,b=l+p,M=$e(_*_+S*S+b*b),D=un(b/=M),G=bt(bt(b)-1)<xt||bt(s-d)<xt?(s+d)/2:zn(S,_),I=e(G,D),w=I[0],C=I[1],R=w-r,P=C-i,O=y*R-m*P;(O*O/E>t||bt((m*R+y*P)/E-.5)>.3||a*h+o*f+l*p<pb)&&(n(r,i,s,a,o,l,w,C,G,_/=M,S/=M,b,g,v),v.point(w,C),n(w,C,G,_,S,b,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:_,polygonStart:function(){r.polygonStart(),v.lineStart=S},polygonEnd:function(){r.polygonEnd(),v.lineStart=y}};function m(D,G){D=e(D,G),r.point(D[0],D[1])}function y(){d=NaN,v.point=E,r.lineStart()}function E(D,G){var I=_r([D,G]),w=e(D,G);n(d,h,u,f,p,g,d=w[0],h=w[1],u=D,f=I[0],p=I[1],g=I[2],qd,r),r.point(d,h)}function _(){v.point=m,r.lineEnd()}function S(){y(),v.point=b,v.lineEnd=M}function b(D,G){E(i=D,G),s=d,a=h,o=f,l=p,c=g,v.point=E}function M(){n(d,h,u,f,p,g,s,a,i,o,l,c,qd,r),v.lineEnd=_,_()}return v}}var vb=Ml({point:function(e,t){this.stream.point(e*$t,t*$t)}});function yb(e){return Ml({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Eb(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 jd(e,t,n,r,i,s){if(!s)return Eb(e,t,n,r,i);var a=St(s),o=Et(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 oa(e){return Zd(function(){return e})()}function Zd(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=wd,v=null,m,y,E,_=ml,S=.5,b,M,D,G,I;function w(O){return D(O[0]*$t,O[1]*$t)}function C(O){return O=D.invert(O[0],O[1]),O&&[O[0]*re,O[1]*re]}w.stream=function(O){return G&&I===O?G:G=vb(yb(u)(g(b(_(I=O)))))},w.preclip=function(O){return arguments.length?(g=O,p=void 0,P()):g},w.postclip=function(O){return arguments.length?(_=O,v=m=y=E=null,P()):_},w.clipAngle=function(O){return arguments.length?(g=+O?jx(p=O*$t):(p=null,wd),P()):p*re},w.clipExtent=function(O){return arguments.length?(_=O==null?(v=m=y=E=null,ml):Kx(v=+O[0][0],m=+O[0][1],y=+O[1][0],E=+O[1][1]),P()):v==null?null:[[v,m],[y,E]]},w.scale=function(O){return arguments.length?(n=+O,R()):n},w.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],R()):[r,i]},w.center=function(O){return arguments.length?(s=O[0]%360*$t,a=O[1]%360*$t,R()):[s*re,a*re]},w.rotate=function(O){return arguments.length?(o=O[0]%360*$t,l=O[1]%360*$t,c=O.length>2?O[2]%360*$t:0,R()):[o*re,l*re,c*re]},w.angle=function(O){return arguments.length?(d=O%360*$t,R()):d*re},w.reflectX=function(O){return arguments.length?(h=O?-1:1,R()):h<0},w.reflectY=function(O){return arguments.length?(f=O?-1:1,R()):f<0},w.precision=function(O){return arguments.length?(b=Xd(M,S=O*O),P()):$e(S)},w.fitExtent=function(O,H){return Yd(w,O,H)},w.fitSize=function(O,H){return hb(w,O,H)},w.fitWidth=function(O,H){return db(w,O,H)},w.fitHeight=function(O,H){return fb(w,O,H)};function R(){var O=jd(n,0,0,h,f,d).apply(null,t(s,a)),H=jd(n,r-O[0],i-O[1],h,f,d);return u=md(o,l,c),M=fl(t,H),D=fl(u,M),b=Xd(M,S),P()}function P(){return G=I=null,w}return function(){return t=e.apply(this,arguments),w.invert=t.invert&&C,R()}}function Kd(e){var t=0,n=dt/3,r=Zd(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*$t,n=s[1]*$t):[t*re,n*re]},i}function xb(e){var t=St(e);function n(r,i){return[r*t,Et(i)/t]}return n.invert=function(r,i){return[r/t,un(i*t)]},n}function bb(e,t){var n=Et(e),r=(n+Et(t))/2;if(bt(r)<xt)return xb(e);var i=1+n*(2*r-n),s=$e(i)/r;function a(o,l){var c=$e(i-2*r*Et(l))/r;return[c*Et(o*=r),s-c*St(o)]}return a.invert=function(o,l){var c=s-l,u=zn(o,bt(c))*An(c);return c*r<0&&(u-=dt*An(o)*An(c)),[u/r,un((i-(o*o+c*c)*r*r)/(2*r))]},a}function Qd(){return Kd(bb).scale(155.424).center([0,33.6442])}function _b(){return Qd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Dl(e,t){return[e,Ux(Bx((ce+t)/2))]}Dl.invert=function(e,t){return[e,2*dd(Nx(t))-ce]};function Sb(){return Tb(Dl).scale(961/ye)}function Tb(e){var t=oa(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=dt*r(),h=t(Hx(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Dl?[[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 la(e,t){return[e,t]}la.invert=la;function wb(){return oa(la).scale(152.63)}function Ob(e,t){var n=St(e),r=e===t?Et(e):(n-St(t))/(t-e),i=n/r+e;if(bt(r)<xt)return la;function s(a,o){var l=i-o,c=r*a;return[l*Et(c),i-l*St(c)]}return s.invert=function(a,o){var l=i-o,c=zn(a,bt(l))*An(l);return l*r<0&&(c-=dt*An(a)*An(l)),[c/r,i-An(r)*$e(a*a+l*l)]},s}function Mb(){return Kd(Ob).scale(131.154).center([0,13.9389])}var Oi=1.340264,Mi=-.081106,Ai=893e-6,Ci=.003796,ca=$e(3)/2,Ab=12;function Jd(e,t){var n=un(ca*Et(t)),r=n*n,i=r*r*r;return[e*St(n)/(ca*(Oi+3*Mi*r+i*(7*Ai+9*Ci*r))),n*(Oi+Mi*r+i*(Ai+Ci*r))]}Jd.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<Ab&&(o=n*(Oi+Mi*r+i*(Ai+Ci*r))-t,l=Oi+3*Mi*r+i*(7*Ai+9*Ci*r),n-=a=o/l,r=n*n,i=r*r*r,!(bt(a)<ud));++s);return[ca*e*(Oi+3*Mi*r+i*(7*Ai+9*Ci*r))/St(n),un(Et(n)/ca)]};function Cb(){return oa(Jd).scale(177.158)}function tf(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)))]}tf.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(bt(i)>xt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Db(){return oa(tf).scale(175.295)}function Lb(e,t){return e.parent===t.parent?1:2}function Rb(e){return e.reduce(Ib,0)/e.length}function Ib(e,t){return e+t.x}function kb(e){return 1+e.reduce(Pb,0)}function Pb(e,t){return Math.max(e,t.y)}function $b(e){for(var t;t=e.children;)e=t[0];return e}function Nb(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Ub(){var e=Lb,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=Rb(f),h.y=kb(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=$b(s),c=Nb(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 Bb(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(Bb)}function Hb(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 Vb(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 zb(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Wb(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 Yb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function qb(e){for(var t=this,n=Xb(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 Xb(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 jb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Zb(){return Array.from(this)}function Kb(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Qb(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Jb(){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 Di(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=n_)):t===void 0&&(t=e_);for(var n=new Li(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 Li(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(i_)}function t_(){return Di(this).eachBefore(r_)}function e_(e){return e.children}function n_(e){return Array.isArray(e)?e[1]:null}function r_(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function i_(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Li(e){this.data=e,this.depth=this.height=0,this.parent=null}Li.prototype=Di.prototype={constructor:Li,count:Fb,each:Hb,eachAfter:Vb,eachBefore:Gb,find:zb,sum:Wb,sort:Yb,path:qb,ancestors:jb,descendants:Zb,leaves:Kb,links:Qb,copy:t_,[Symbol.iterator]:Jb};function s_(e){return e==null?null:ef(e)}function ef(e){if(typeof e!="function")throw new Error;return e}function Yn(){return 0}function wr(e){return function(){return e}}const a_=1664525,o_=1013904223,nf=4294967296;function l_(){let e=1;return()=>(e=(a_*e+o_)%nf)/nf}function c_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function u_(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 h_(e,t){for(var n=0,r=(e=u_(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&rf(a,s)?++n:(a=f_(i=d_(i,s)),n=0);return a}function d_(e,t){var n,r;if(Ll(t,e))return[t];for(n=0;n<e.length;++n)if(ua(t,e[n])&&Ll(Ri(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(ua(Ri(e[n],e[r]),t)&&ua(Ri(e[n],t),e[r])&&ua(Ri(e[r],t),e[n])&&Ll(sf(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function ua(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 rf(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 Ll(e,t){for(var n=0;n<t.length;++n)if(!rf(e,t[n]))return!1;return!0}function f_(e){switch(e.length){case 1:return p_(e[0]);case 2:return Ri(e[0],e[1]);case 3:return sf(e[0],e[1],e[2])}}function p_(e){return{x:e.x,y:e.y,r:e.r}}function Ri(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 sf(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,E=y-a*a-o*o+l*l,_=y-c*c-u*u+d*d,S=f*p-h*g,b=(p*_-g*E)/(S*2)-r,M=(g*v-p*m)/S,D=(f*E-h*_)/(S*2)-i,G=(h*m-f*v)/S,I=M*M+G*G-1,w=2*(s+b*M+D*G),C=b*b+D*D-s*s,R=-(Math.abs(I)>1e-6?(w+Math.sqrt(w*w-4*I*C))/(2*I):C/w);return{x:r+b+M*R,y:i+D+G*R,r:R}}function af(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 of(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 lf(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 ha(e){this._=e,this.next=null,this.previous=null}function g_(e,t){if(!(s=(e=c_(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;af(r,n,i=e[2]),n=new ha(n),r=new ha(r),i=new ha(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){af(n._,r._,i=e[l]),i=new ha(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(of(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(of(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=lf(n);(i=i.next)!==r;)(o=lf(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=h_(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function m_(e){return Math.sqrt(e.value)}function v_(){var e=null,t=1,n=1,r=Yn;function i(s){const a=l_();return s.x=t/2,s.y=n/2,e?s.eachBefore(cf(e)).eachAfter(Rl(r,.5,a)).eachBefore(uf(1)):s.eachBefore(cf(m_)).eachAfter(Rl(Yn,1,a)).eachAfter(Rl(r,s.r/Math.min(t,n),a)).eachBefore(uf(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=s_(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:wr(+s),i):r},i}function cf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Rl(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=g_(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function uf(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 y_(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 E_(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 x_(e,t){return e.parent===t.parent?1:2}function Il(e){var t=e.children;return t?t[0]:e.t}function kl(e){var t=e.children;return t?t[t.length-1]:e.t}function b_(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 __(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 S_(e,t,n){return e.a.parent===t.parent?e.a:n}function da(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}da.prototype=Object.create(Li.prototype);function T_(e){for(var t=new da(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 da(s[a],a)),i.parent=n;return(t.parent=new da(null,0)).children=[t],t}function w_(){var e=x_,t=1,n=1,r=null;function i(c){var u=T_(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){__(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,E=g.m,_;p=kl(p),h=Il(h),p&&h;)g=Il(g),f=kl(f),f.a=c,_=p.z+y-h.z-v+e(p._,h._),_>0&&(b_(S_(p,c,d),c,_),v+=_,m+=_),y+=p.m,v+=h.m,E+=g.m,m+=f.m;p&&!kl(f)&&(f.t=p,f.m+=y-m),h&&!Il(g)&&(g.t=h,g.m+=v-E,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 O_(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 M_=(1+Math.sqrt(5))/2;function A_(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,E,_,S,b;u<h;){f=i-n,p=s-r;do v=o[d++].value;while(!v&&d<h);for(m=y=v,S=Math.max(p/f,f/p)/(g*e),b=v*v*S,_=Math.max(y/b,b/m);d<h;++d){if(v+=c=o[d].value,c<m&&(m=c),c>y&&(y=c),b=v*v*S,E=Math.max(y/b,b/m),E>_){v-=c;break}_=E}a.push(l={value:v,dice:f<p,children:o.slice(u,d)}),l.dice?E_(l,n,r,i,g?r+=p*v/g:s):O_(l,n,r,g?n+=f*v/g:i,s),g-=v,u=d}return a}const C_=function e(t){function n(r,i,s,a,o){A_(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(M_);function D_(){var e=C_,t=!1,n=1,r=1,i=[0],s=Yn,a=Yn,o=Yn,l=Yn,c=Yn;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(y_),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=ef(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:wr(+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:wr(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:wr(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:wr(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:wr(+h),u):c},u}function Or(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const hf=Symbol("implicit");function fa(){var e=new th,t=[],n=[],r=hf;function i(s){let a=e.get(s);if(a===void 0){if(r!==hf)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 th;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 fa(t,n).unknown(r)},Or.apply(i,arguments),i}function Ii(){var e=fa().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=U0(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 Ii(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Or.apply(d(),arguments)}function L_(e){return function(){return e}}function R_(e){return+e}var df=[0,1];function Mr(e){return e}function Pl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:L_(isNaN(t)?NaN:.5)}function I_(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function k_(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Pl(i,r),s=n(a,s)):(r=Pl(r,i),s=n(s,a)),function(o){return s(r(o))}}function P_(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]=Pl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Mo(e,o,1,r)-1;return s[l](i[l](o))}}function $l(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ff(){var e=df,t=df,n=pi,r,i,s,a=Mr,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Mr&&(a=I_(e[0],e[h-1])),o=h>2?P_:k_,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),ve)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,R_),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=Ih,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Mr,u()):a!==Mr},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 pf(){return ff()(Mr,Mr)}function $_(e,t,n,r){var i=Co(e,t,n),s;switch(r=Ei(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Px(i,a))&&(r.precision=s),cd(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=$x(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=kx(i))&&(r.precision=s-(r.type==="%")*2);break}}return ll(r)}function gf(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ss(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return $_(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=pr(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 Ue(){var e=pf();return e.copy=function(){return $l(e,Ue())},Or.apply(e,arguments),gf(e)}function mf(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 vf(e){return Math.log(e)}function yf(e){return Math.exp(e)}function N_(e){return-Math.log(-e)}function U_(e){return-Math.exp(-e)}function B_(e){return isFinite(e)?+("1e"+e):e<0?0:e}function F_(e){return e===10?B_:e===Math.E?Math.exp:t=>Math.pow(e,t)}function H_(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 Ef(e){return(t,n)=>-e(-t,n)}function G_(e){const t=e(vf,yf),n=t.domain;let r=10,i,s;function a(){return i=H_(r),s=F_(r),n()[0]<0?(i=Ef(i),s=Ef(s),e(N_,U_)):e(vf,yf),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=Ss(c,u,v))}else m=Ss(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=Ei(l)).precision==null&&(l.trim=!0),l=ll(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(mf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function xf(){const e=G_(ff()).domain([1,10]);return e.copy=()=>$l(e,xf()).base(e.base()),Or.apply(e,arguments),e}function Nl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[Mo(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 Nl().domain([e,t]).range(i).unknown(s)},Or.apply(gf(a),arguments)}const Ul=new Date,Bl=new Date;function Vt(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=>Vt(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)=>(Ul.setTime(+s),Bl.setTime(+a),e(Ul),e(Bl),Math.floor(n(Ul,Bl))),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 pa=Vt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);pa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Vt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):pa),pa.range;const hn=1e3,we=hn*60,dn=we*60,fn=dn*24,Fl=fn*7,bf=fn*30,Hl=fn*365,Ar=Vt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*hn)},(e,t)=>(t-e)/hn,e=>e.getUTCSeconds());Ar.range;const Gl=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn)},(e,t)=>{e.setTime(+e+t*we)},(e,t)=>(t-e)/we,e=>e.getMinutes());Gl.range,Vt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*we)},(e,t)=>(t-e)/we,e=>e.getUTCMinutes()).range;const Vl=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn-e.getMinutes()*we)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getHours());Vl.range,Vt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getUTCHours()).range;const ki=Vt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*we)/fn,e=>e.getDate()-1);ki.range;const zl=Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fn,e=>e.getUTCDate()-1);zl.range,Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fn,e=>Math.floor(e/fn)).range;function qn(e){return Vt(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())*we)/Fl)}const ga=qn(0),ma=qn(1),V_=qn(2),z_=qn(3),Cr=qn(4),W_=qn(5),Y_=qn(6);ga.range,ma.range,V_.range,z_.range,Cr.range,W_.range,Y_.range;function Xn(e){return Vt(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)/Fl)}const _f=Xn(0),va=Xn(1),q_=Xn(2),X_=Xn(3),Dr=Xn(4),j_=Xn(5),Z_=Xn(6);_f.range,va.range,q_.range,X_.range,Dr.range,j_.range,Z_.range;const Wl=Vt(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());Wl.range,Vt(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 pn=Vt(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());pn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(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)}),pn.range;const jn=Vt(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());jn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(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)}),jn.range;function K_(e,t,n,r,i,s){const a=[[Ar,1,hn],[Ar,5,5*hn],[Ar,15,15*hn],[Ar,30,30*hn],[s,1,we],[s,5,5*we],[s,15,15*we],[s,30,30*we],[i,1,dn],[i,3,3*dn],[i,6,6*dn],[i,12,12*dn],[r,1,fn],[r,2,2*fn],[n,1,Fl],[t,1,bf],[t,3,3*bf],[e,1,Hl]];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=Oo(([,,v])=>v).right(a,h);if(f===a.length)return e.every(Co(c/Hl,u/Hl,d));if(f===0)return pa.every(Math.max(Co(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[Q_,J_]=K_(pn,Wl,ga,ki,Vl,Gl);function Yl(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 ql(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 Pi(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function tS(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=$i(i),u=Ni(i),d=$i(s),h=Ni(s),f=$i(a),p=Ni(a),g=$i(o),v=Ni(o),m=$i(l),y=Ni(l),E={a:B,A:U,b:N,B:j,c:null,d:Af,e:Af,f:SS,g:IS,G:PS,H:xS,I:bS,j:_S,L:Cf,m:TS,M:wS,p:Y,q:it,Q:Pf,s:$f,S:OS,u:MS,U:AS,V:CS,w:DS,W:LS,x:null,X:null,y:RS,Y:kS,Z:$S,"%":kf},_={a:et,A:q,b:Q,B:pt,c:null,d:Lf,e:Lf,f:FS,g:ZS,G:QS,H:NS,I:US,j:BS,L:Rf,m:HS,M:GS,p:ot,q:Tt,Q:Pf,s:$f,S:VS,u:zS,U:WS,V:YS,w:qS,W:XS,x:null,X:null,y:jS,Y:KS,Z:JS,"%":kf},S={a:I,A:w,b:C,B:R,c:P,d:Of,e:Of,f:mS,g:wf,G:Tf,H:Mf,I:Mf,j:dS,L:gS,m:hS,M:fS,p:G,q:uS,Q:yS,s:ES,S:pS,u:sS,U:aS,V:oS,w:iS,W:lS,x:O,X:H,y:wf,Y:Tf,Z:cS,"%":vS};E.x=b(n,E),E.X=b(r,E),E.c=b(t,E),_.x=b(n,_),_.X=b(r,_),_.c=b(t,_);function b(Z,F){return function(V){var $=[],mt=-1,gt=0,Ht=Z.length,Gt,st,Rt;for(V instanceof Date||(V=new Date(+V));++mt<Ht;)Z.charCodeAt(mt)===37&&($.push(Z.slice(gt,mt)),(st=Sf[Gt=Z.charAt(++mt)])!=null?Gt=Z.charAt(++mt):st=Gt==="e"?" ":"0",(Rt=F[Gt])&&(Gt=Rt(V,st)),$.push(Gt),gt=mt+1);return $.push(Z.slice(gt,mt)),$.join("")}}function M(Z,F){return function(V){var $=Pi(1900,void 0,1),mt=D($,Z,V+="",0),gt,Ht;if(mt!=V.length)return null;if("Q"in $)return new Date($.Q);if("s"in $)return new Date($.s*1e3+("L"in $?$.L:0));if(F&&!("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 $?(gt=ql(Pi($.y,0,1)),Ht=gt.getUTCDay(),gt=Ht>4||Ht===0?va.ceil(gt):va(gt),gt=zl.offset(gt,($.V-1)*7),$.y=gt.getUTCFullYear(),$.m=gt.getUTCMonth(),$.d=gt.getUTCDate()+($.w+6)%7):(gt=Yl(Pi($.y,0,1)),Ht=gt.getDay(),gt=Ht>4||Ht===0?ma.ceil(gt):ma(gt),gt=ki.offset(gt,($.V-1)*7),$.y=gt.getFullYear(),$.m=gt.getMonth(),$.d=gt.getDate()+($.w+6)%7)}else("W"in $||"U"in $)&&("w"in $||($.w="u"in $?$.u%7:"W"in $?1:0),Ht="Z"in $?ql(Pi($.y,0,1)).getUTCDay():Yl(Pi($.y,0,1)).getDay(),$.m=0,$.d="W"in $?($.w+6)%7+$.W*7-(Ht+5)%7:$.w+$.U*7-(Ht+6)%7);return"Z"in $?($.H+=$.Z/100|0,$.M+=$.Z%100,ql($)):Yl($)}}function D(Z,F,V,$){for(var mt=0,gt=F.length,Ht=V.length,Gt,st;mt<gt;){if($>=Ht)return-1;if(Gt=F.charCodeAt(mt++),Gt===37){if(Gt=F.charAt(mt++),st=S[Gt in Sf?F.charAt(mt++):Gt],!st||($=st(Z,V,$))<0)return-1}else if(Gt!=V.charCodeAt($++))return-1}return $}function G(Z,F,V){var $=c.exec(F.slice(V));return $?(Z.p=u.get($[0].toLowerCase()),V+$[0].length):-1}function I(Z,F,V){var $=f.exec(F.slice(V));return $?(Z.w=p.get($[0].toLowerCase()),V+$[0].length):-1}function w(Z,F,V){var $=d.exec(F.slice(V));return $?(Z.w=h.get($[0].toLowerCase()),V+$[0].length):-1}function C(Z,F,V){var $=m.exec(F.slice(V));return $?(Z.m=y.get($[0].toLowerCase()),V+$[0].length):-1}function R(Z,F,V){var $=g.exec(F.slice(V));return $?(Z.m=v.get($[0].toLowerCase()),V+$[0].length):-1}function P(Z,F,V){return D(Z,t,F,V)}function O(Z,F,V){return D(Z,n,F,V)}function H(Z,F,V){return D(Z,r,F,V)}function B(Z){return a[Z.getDay()]}function U(Z){return s[Z.getDay()]}function N(Z){return l[Z.getMonth()]}function j(Z){return o[Z.getMonth()]}function Y(Z){return i[+(Z.getHours()>=12)]}function it(Z){return 1+~~(Z.getMonth()/3)}function et(Z){return a[Z.getUTCDay()]}function q(Z){return s[Z.getUTCDay()]}function Q(Z){return l[Z.getUTCMonth()]}function pt(Z){return o[Z.getUTCMonth()]}function ot(Z){return i[+(Z.getUTCHours()>=12)]}function Tt(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var F=b(Z+="",E);return F.toString=function(){return Z},F},parse:function(Z){var F=M(Z+="",!1);return F.toString=function(){return Z},F},utcFormat:function(Z){var F=b(Z+="",_);return F.toString=function(){return Z},F},utcParse:function(Z){var F=M(Z+="",!0);return F.toString=function(){return Z},F}}}var Sf={"-":"",_:" ",0:"0"},Wt=/^\s*\d+/,eS=/^%/,nS=/[\\^$*+?|[\]().{}]/g;function vt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function rS(e){return e.replace(nS,"\\$&")}function $i(e){return new RegExp("^(?:"+e.map(rS).join("|")+")","i")}function Ni(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function iS(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function sS(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function aS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function oS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function lS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Tf(e,t,n){var r=Wt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function wf(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function cS(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 uS(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function hS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Of(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function dS(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Mf(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function fS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function pS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function gS(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function mS(e,t,n){var r=Wt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function vS(e,t,n){var r=eS.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function yS(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ES(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Af(e,t){return vt(e.getDate(),t,2)}function xS(e,t){return vt(e.getHours(),t,2)}function bS(e,t){return vt(e.getHours()%12||12,t,2)}function _S(e,t){return vt(1+ki.count(pn(e),e),t,3)}function Cf(e,t){return vt(e.getMilliseconds(),t,3)}function SS(e,t){return Cf(e,t)+"000"}function TS(e,t){return vt(e.getMonth()+1,t,2)}function wS(e,t){return vt(e.getMinutes(),t,2)}function OS(e,t){return vt(e.getSeconds(),t,2)}function MS(e){var t=e.getDay();return t===0?7:t}function AS(e,t){return vt(ga.count(pn(e)-1,e),t,2)}function Df(e){var t=e.getDay();return t>=4||t===0?Cr(e):Cr.ceil(e)}function CS(e,t){return e=Df(e),vt(Cr.count(pn(e),e)+(pn(e).getDay()===4),t,2)}function DS(e){return e.getDay()}function LS(e,t){return vt(ma.count(pn(e)-1,e),t,2)}function RS(e,t){return vt(e.getFullYear()%100,t,2)}function IS(e,t){return e=Df(e),vt(e.getFullYear()%100,t,2)}function kS(e,t){return vt(e.getFullYear()%1e4,t,4)}function PS(e,t){var n=e.getDay();return e=n>=4||n===0?Cr(e):Cr.ceil(e),vt(e.getFullYear()%1e4,t,4)}function $S(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function Lf(e,t){return vt(e.getUTCDate(),t,2)}function NS(e,t){return vt(e.getUTCHours(),t,2)}function US(e,t){return vt(e.getUTCHours()%12||12,t,2)}function BS(e,t){return vt(1+zl.count(jn(e),e),t,3)}function Rf(e,t){return vt(e.getUTCMilliseconds(),t,3)}function FS(e,t){return Rf(e,t)+"000"}function HS(e,t){return vt(e.getUTCMonth()+1,t,2)}function GS(e,t){return vt(e.getUTCMinutes(),t,2)}function VS(e,t){return vt(e.getUTCSeconds(),t,2)}function zS(e){var t=e.getUTCDay();return t===0?7:t}function WS(e,t){return vt(_f.count(jn(e)-1,e),t,2)}function If(e){var t=e.getUTCDay();return t>=4||t===0?Dr(e):Dr.ceil(e)}function YS(e,t){return e=If(e),vt(Dr.count(jn(e),e)+(jn(e).getUTCDay()===4),t,2)}function qS(e){return e.getUTCDay()}function XS(e,t){return vt(va.count(jn(e)-1,e),t,2)}function jS(e,t){return vt(e.getUTCFullYear()%100,t,2)}function ZS(e,t){return e=If(e),vt(e.getUTCFullYear()%100,t,2)}function KS(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function QS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Dr(e):Dr.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function JS(){return"+0000"}function kf(){return"%"}function Pf(e){return+e}function $f(e){return Math.floor(+e/1e3)}var Lr,Nf;tT({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 tT(e){return Lr=tS(e),Nf=Lr.format,Lr.parse,Lr.utcFormat,Lr.utcParse,Lr}function eT(e){return new Date(e)}function nT(e){return e instanceof Date?+e:+new Date(+e)}function Uf(e,t,n,r,i,s,a,o,l,c){var u=pf(),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"),E=c("%B"),_=c("%Y");function S(b){return(l(b)<b?f:o(b)<b?p:a(b)<b?g:s(b)<b?v:r(b)<b?i(b)<b?m:y:n(b)<b?E:_)(b)}return u.invert=function(b){return new Date(d(b))},u.domain=function(b){return arguments.length?h(Array.from(b,nT)):h().map(eT)},u.ticks=function(b){var M=h();return e(M[0],M[M.length-1],b??10)},u.tickFormat=function(b,M){return M==null?S:c(M)},u.nice=function(b){var M=h();return(!b||typeof b.range!="function")&&(b=t(M[0],M[M.length-1],b??10)),b?h(mf(M,b)):u},u.copy=function(){return $l(u,Uf(e,t,n,r,i,s,a,o,l,c))},u}function Bf(){return Or.apply(Uf(Q_,J_,pn,Wl,ga,ki,Vl,Gl,Ar,Nf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ht(e){return function(){return e}}const Ff=Math.abs,Qt=Math.atan2,Zn=Math.cos,rT=Math.max,Xl=Math.min,Ke=Math.sin,Rr=Math.sqrt,Jt=1e-12,Ui=Math.PI,ya=Ui/2,Ea=2*Ui;function iT(e){return e>1?0:e<-1?Ui:Math.acos(e)}function Hf(e){return e>=1?ya:e<=-1?-ya:Math.asin(e)}function xa(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 wx(t)}function sT(e){return e.innerRadius}function aT(e){return e.outerRadius}function oT(e){return e.startAngle}function lT(e){return e.endAngle}function cT(e){return e&&e.padAngle}function uT(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<Jt))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function ba(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Rr(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,E=g-f,_=y*y+E*E,S=i-s,b=h*g-p*f,M=(E<0?-1:1)*Rr(rT(0,S*S*_-b*b)),D=(b*E-y*M)/_,G=(-b*y-E*M)/_,I=(b*E+y*M)/_,w=(-b*y+E*M)/_,C=D-v,R=G-m,P=I-v,O=w-m;return C*C+R*R>P*P+O*O&&(D=I,G=w),{cx:D,cy:G,x01:-u,y01:-d,x11:D*(i/S-1),y11:G*(i/S-1)}}function Bi(){var e=sT,t=aT,n=ht(0),r=null,i=oT,s=lT,a=cT,o=null,l=xa(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-ya,g=s.apply(this,arguments)-ya,v=Ff(g-p),m=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>Jt))o.moveTo(0,0);else if(v>Ea-Jt)o.moveTo(f*Zn(p),f*Ke(p)),o.arc(0,0,f,p,g,!m),h>Jt&&(o.moveTo(h*Zn(g),h*Ke(g)),o.arc(0,0,h,g,p,m));else{var y=p,E=g,_=p,S=g,b=v,M=v,D=a.apply(this,arguments)/2,G=D>Jt&&(r?+r.apply(this,arguments):Rr(h*h+f*f)),I=Xl(Ff(f-h)/2,+n.apply(this,arguments)),w=I,C=I,R,P;if(G>Jt){var O=Hf(G/h*Ke(D)),H=Hf(G/f*Ke(D));(b-=O*2)>Jt?(O*=m?1:-1,_+=O,S-=O):(b=0,_=S=(p+g)/2),(M-=H*2)>Jt?(H*=m?1:-1,y+=H,E-=H):(M=0,y=E=(p+g)/2)}var B=f*Zn(y),U=f*Ke(y),N=h*Zn(S),j=h*Ke(S);if(I>Jt){var Y=f*Zn(E),it=f*Ke(E),et=h*Zn(_),q=h*Ke(_),Q;if(v<Ui)if(Q=uT(B,U,et,q,Y,it,N,j)){var pt=B-Q[0],ot=U-Q[1],Tt=Y-Q[0],Z=it-Q[1],F=1/Ke(iT((pt*Tt+ot*Z)/(Rr(pt*pt+ot*ot)*Rr(Tt*Tt+Z*Z)))/2),V=Rr(Q[0]*Q[0]+Q[1]*Q[1]);w=Xl(I,(h-V)/(F-1)),C=Xl(I,(f-V)/(F+1))}else w=C=0}M>Jt?C>Jt?(R=ba(et,q,B,U,f,C,m),P=ba(Y,it,N,j,f,C,m),o.moveTo(R.cx+R.x01,R.cy+R.y01),C<I?o.arc(R.cx,R.cy,C,Qt(R.y01,R.x01),Qt(P.y01,P.x01),!m):(o.arc(R.cx,R.cy,C,Qt(R.y01,R.x01),Qt(R.y11,R.x11),!m),o.arc(0,0,f,Qt(R.cy+R.y11,R.cx+R.x11),Qt(P.cy+P.y11,P.cx+P.x11),!m),o.arc(P.cx,P.cy,C,Qt(P.y11,P.x11),Qt(P.y01,P.x01),!m))):(o.moveTo(B,U),o.arc(0,0,f,y,E,!m)):o.moveTo(B,U),!(h>Jt)||!(b>Jt)?o.lineTo(N,j):w>Jt?(R=ba(N,j,Y,it,h,-w,m),P=ba(B,U,et,q,h,-w,m),o.lineTo(R.cx+R.x01,R.cy+R.y01),w<I?o.arc(R.cx,R.cy,w,Qt(R.y01,R.x01),Qt(P.y01,P.x01),!m):(o.arc(R.cx,R.cy,w,Qt(R.y01,R.x01),Qt(R.y11,R.x11),!m),o.arc(0,0,h,Qt(R.cy+R.y11,R.cx+R.x11),Qt(P.cy+P.y11,P.cx+P.x11),m),o.arc(P.cx,P.cy,w,Qt(P.y11,P.x11),Qt(P.y01,P.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[Zn(d)*u,Ke(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ht(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ht(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ht(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ht(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ht(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ht(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ht(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var hT=Array.prototype.slice;function _a(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gf(e){this._context=e}Gf.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 Sa(e){return new Gf(e)}function jl(e){return e[0]}function Zl(e){return e[1]}function Fi(e,t){var n=ht(!0),r=null,i=Sa,s=null,a=xa(o);e=typeof e=="function"?e:e===void 0?jl:ht(e),t=typeof t=="function"?t:t===void 0?Zl:ht(t);function o(l){var c,u=(l=_a(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:ht(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ht(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ht(!!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 Kl(e,t,n){var r=null,i=ht(!0),s=null,a=Sa,o=null,l=xa(c);e=typeof e=="function"?e:e===void 0?jl:ht(+e),t=typeof t=="function"?t:ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Zl:ht(+n);function c(d){var h,f,p,g=(d=_a(d)).length,v,m=!1,y,E=new Array(g),_=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(E[p],_[p]);o.lineEnd(),o.areaEnd()}m&&(E[h]=+e(v,h,d),_[h]=+t(v,h,d),o.point(r?+r(v,h,d):E[h],n?+n(v,h,d):_[h]))}if(y)return o=null,y+""||null}function u(){return Fi().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:ht(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:ht(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:ht(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:ht(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:ht(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:ht(+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:ht(!!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 dT(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function fT(e){return e}function pT(){var e=fT,t=dT,n=null,r=ht(0),i=ht(Ea),s=ht(0);function a(o){var l,c=(o=_a(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),g=+r.apply(this,arguments),v=Math.min(Ea,Math.max(-Ea,i.apply(this,arguments)-g)),m,y=Math.min(Math.abs(v)/c,s.apply(this,arguments)),E=y*(v<0?-1:1),_;for(l=0;l<c;++l)(_=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=_);for(t!=null?f.sort(function(S,b){return t(p[S],p[b])}):n!=null&&f.sort(function(S,b){return n(o[S],o[b])}),l=0,d=h?(v-c*E)/h:0;l<c;++l,g=m)u=f[l],_=p[u],m=g+(_>0?_*d:0)+E,p[u]={data:o[u],index:l,value:_,startAngle:g,endAngle:m,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ht(+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:ht(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ht(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ht(+o),a):s},a}var gT=zf(Sa);function Vf(e){this._curve=e}Vf.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 zf(e){function t(n){return new Vf(e(n))}return t._curve=e,t}function mT(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(zf(n)):t()._curve},e}function vT(){return mT(Fi().curve(gT))}class yT{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 ET(e){return new yT(e,!0)}function xT(e){return e.source}function bT(e){return e.target}function _T(e){let t=xT,n=bT,r=jl,i=Zl,s=null,a=null,o=xa(l);function l(){let c;const u=hT.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:ht(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ht(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function ST(){return _T(ET)}function Dn(){}function Ta(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 wa(e){this._context=e}wa.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:Ta(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:Ta(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TT(e){return new wa(e)}function Wf(e){this._context=e}Wf.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:Ta(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wT(e){return new Wf(e)}function Yf(e){this._context=e}Yf.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:Ta(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OT(e){return new Yf(e)}function qf(e,t){this._basis=new wa(e),this._beta=t}qf.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 MT=function e(t){function n(r){return t===1?new wa(r):new qf(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Oa(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 Ql(e,t){this._context=e,this._k=(1-t)/6}Ql.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:Oa(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:Oa(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 AT=function e(t){function n(r){return new Ql(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Jl(e,t){this._context=e,this._k=(1-t)/6}Jl.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:Oa(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 CT=function e(t){function n(r){return new Jl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function tc(e,t){this._context=e,this._k=(1-t)/6}tc.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:Oa(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 DT=function e(t){function n(r){return new tc(r,t)}return n.tension=function(r){return e(+r)},n}(0);function ec(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Jt){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>Jt){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 Xf(e,t){this._context=e,this._alpha=t}Xf.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:ec(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 LT=function e(t){function n(r){return t?new Xf(r,t):new Ql(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function jf(e,t){this._context=e,this._alpha=t}jf.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:ec(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 RT=function e(t){function n(r){return t?new jf(r,t):new Jl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Zf(e,t){this._context=e,this._alpha=t}Zf.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:ec(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 IT=function e(t){function n(r){return t?new Zf(r,t):new tc(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Kf(e){this._context=e}Kf.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 Qf(e){return new Kf(e)}function Jf(e){return e<0?-1:1}function tp(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(Jf(s)+Jf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function ep(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function nc(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 Ma(e){this._context=e}Ma.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:nc(this,this._t0,ep(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,nc(this,ep(this,n=tp(this,e,t)),n);break;default:nc(this,this._t0,n=tp(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function np(e){this._context=new rp(e)}(np.prototype=Object.create(Ma.prototype)).point=function(e,t){Ma.prototype.point.call(this,t,e)};function rp(e){this._context=e}rp.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 kT(e){return new Ma(e)}function PT(e){return new np(e)}function ip(e){this._context=e}ip.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=sp(e),i=sp(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 sp(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 $T(e){return new ip(e)}function Aa(e,t){this._context=e,this._t=t}Aa.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 NT(e){return new Aa(e,.5)}function UT(e){return new Aa(e,0)}function BT(e){return new Aa(e,1)}function ap(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 op(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function FT(e,t){return e[t]}function HT(e){const t=[];return t.key=e,t}function rc(){var e=ht([]),t=op,n=ap,r=FT;function i(s){var a=Array.from(e.apply(this,arguments),HT),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=_a(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:ht(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ht(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?op:typeof s=="function"?s:ht(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??ap,i):n},i}function GT(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 Hi(e,t,n){this.k=e,this.x=t,this.y=n}Hi.prototype={constructor:Hi,scale:function(e){return e===1?this:new Hi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Hi(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+")"}},Hi.prototype;var VT=typeof global=="object"&&global&&global.Object===Object&&global;const lp=VT;var zT=typeof self=="object"&&self&&self.Object===Object&&self,WT=lp||zT||Function("return this")();const Be=WT;var YT=Be.Symbol;const Oe=YT;var cp=Object.prototype,qT=cp.hasOwnProperty,XT=cp.toString,Gi=Oe?Oe.toStringTag:void 0;function jT(e){var t=qT.call(e,Gi),n=e[Gi];try{e[Gi]=void 0;var r=!0}catch{}var i=XT.call(e);return r&&(t?e[Gi]=n:delete e[Gi]),i}var ZT=Object.prototype,KT=ZT.toString;function QT(e){return KT.call(e)}var JT="[object Null]",tw="[object Undefined]",up=Oe?Oe.toStringTag:void 0;function Kn(e){return e==null?e===void 0?tw:JT:up&&up in Object(e)?jT(e):QT(e)}function Qe(e){return e!=null&&typeof e=="object"}var ew="[object Symbol]";function Ca(e){return typeof e=="symbol"||Qe(e)&&Kn(e)==ew}function hp(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 nw=Array.isArray;const qt=nw;var rw=1/0,dp=Oe?Oe.prototype:void 0,fp=dp?dp.toString:void 0;function pp(e){if(typeof e=="string")return e;if(qt(e))return hp(e,pp)+"";if(Ca(e))return fp?fp.call(e):"";var t=e+"";return t=="0"&&1/e==-rw?"-0":t}var iw=/\s/;function sw(e){for(var t=e.length;t--&&iw.test(e.charAt(t)););return t}var aw=/^\s+/;function ow(e){return e&&e.slice(0,sw(e)+1).replace(aw,"")}function Me(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gp=NaN,lw=/^[-+]0x[0-9a-f]+$/i,cw=/^0b[01]+$/i,uw=/^0o[0-7]+$/i,hw=parseInt;function Vi(e){if(typeof e=="number")return e;if(Ca(e))return gp;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=ow(e);var n=cw.test(e);return n||uw.test(e)?hw(e.slice(2),n?2:8):lw.test(e)?gp:+e}function ic(e){return e}var dw="[object AsyncFunction]",fw="[object Function]",pw="[object GeneratorFunction]",gw="[object Proxy]";function sc(e){if(!Me(e))return!1;var t=Kn(e);return t==fw||t==pw||t==dw||t==gw}var mw=Be["__core-js_shared__"];const ac=mw;var mp=function(){var e=/[^.]+$/.exec(ac&&ac.keys&&ac.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function vw(e){return!!mp&&mp in e}var yw=Function.prototype,Ew=yw.toString;function Qn(e){if(e!=null){try{return Ew.call(e)}catch{}try{return e+""}catch{}}return""}var xw=/[\\^$.*+?()[\]{}|]/g,bw=/^\[object .+?Constructor\]$/,_w=Function.prototype,Sw=Object.prototype,Tw=_w.toString,ww=Sw.hasOwnProperty,Ow=RegExp("^"+Tw.call(ww).replace(xw,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mw(e){if(!Me(e)||vw(e))return!1;var t=sc(e)?Ow:bw;return t.test(Qn(e))}function Aw(e,t){return e==null?void 0:e[t]}function Jn(e,t){var n=Aw(e,t);return Mw(n)?n:void 0}var Cw=Jn(Be,"WeakMap");const oc=Cw;var vp=Object.create,Dw=function(){function e(){}return function(t){if(!Me(t))return{};if(vp)return vp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Lw=Dw;function Rw(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 Iw(){}function yp(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var kw=800,Pw=16,$w=Date.now;function Nw(e){var t=0,n=0;return function(){var r=$w(),i=Pw-(r-n);if(n=r,i>0){if(++t>=kw)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Uw(e){return function(){return e}}var Bw=function(){try{var e=Jn(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Da=Bw;var Fw=Da?function(e,t){return Da(e,"toString",{configurable:!0,enumerable:!1,value:Uw(t),writable:!0})}:ic,Hw=Nw(Fw);const Gw=Hw;function Vw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function zw(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 Ww(e){return e!==e}function Yw(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function qw(e,t,n){return t===t?Yw(e,t,n):zw(e,Ww,n)}function Xw(e,t){var n=e==null?0:e.length;return!!n&&qw(e,t,0)>-1}var jw=9007199254740991,Zw=/^(?:0|[1-9]\d*)$/;function lc(e,t){var n=typeof e;return t=t??jw,!!t&&(n=="number"||n!="symbol"&&Zw.test(e))&&e>-1&&e%1==0&&e<t}function La(e,t,n){t=="__proto__"&&Da?Da(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function zi(e,t){return e===t||e!==e&&t!==t}var Kw=Object.prototype,Qw=Kw.hasOwnProperty;function Ep(e,t,n){var r=e[t];(!(Qw.call(e,t)&&zi(r,n))||n===void 0&&!(t in e))&&La(e,t,n)}function Wi(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?La(n,o,l):Ep(n,o,l)}return n}var xp=Math.max;function Jw(e,t,n){return t=xp(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=xp(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),Rw(e,this,o)}}function bp(e,t){return Gw(Jw(e,t,ic),e+"")}var tO=9007199254740991;function cc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=tO}function tr(e){return e!=null&&cc(e.length)&&!sc(e)}function _p(e,t,n){if(!Me(n))return!1;var r=typeof t;return(r=="number"?tr(n)&&lc(t,n.length):r=="string"&&t in n)?zi(n[t],e):!1}function eO(e){return bp(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&&_p(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 nO=Object.prototype;function Ra(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||nO;return e===n}function rO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var iO="[object Arguments]";function Sp(e){return Qe(e)&&Kn(e)==iO}var Tp=Object.prototype,sO=Tp.hasOwnProperty,aO=Tp.propertyIsEnumerable,oO=Sp(function(){return arguments}())?Sp:function(e){return Qe(e)&&sO.call(e,"callee")&&!aO.call(e,"callee")};const Ir=oO;function lO(){return!1}var wp=typeof W=="object"&&W&&!W.nodeType&&W,Op=wp&&typeof module=="object"&&module&&!module.nodeType&&module,cO=Op&&Op.exports===wp,Mp=cO?Be.Buffer:void 0,uO=Mp?Mp.isBuffer:void 0,hO=uO||lO;const kr=hO;var dO="[object Arguments]",fO="[object Array]",pO="[object Boolean]",gO="[object Date]",mO="[object Error]",vO="[object Function]",yO="[object Map]",EO="[object Number]",xO="[object Object]",bO="[object RegExp]",_O="[object Set]",SO="[object String]",TO="[object WeakMap]",wO="[object ArrayBuffer]",OO="[object DataView]",MO="[object Float32Array]",AO="[object Float64Array]",CO="[object Int8Array]",DO="[object Int16Array]",LO="[object Int32Array]",RO="[object Uint8Array]",IO="[object Uint8ClampedArray]",kO="[object Uint16Array]",PO="[object Uint32Array]",Lt={};Lt[MO]=Lt[AO]=Lt[CO]=Lt[DO]=Lt[LO]=Lt[RO]=Lt[IO]=Lt[kO]=Lt[PO]=!0,Lt[dO]=Lt[fO]=Lt[wO]=Lt[pO]=Lt[OO]=Lt[gO]=Lt[mO]=Lt[vO]=Lt[yO]=Lt[EO]=Lt[xO]=Lt[bO]=Lt[_O]=Lt[SO]=Lt[TO]=!1;function $O(e){return Qe(e)&&cc(e.length)&&!!Lt[Kn(e)]}function uc(e){return function(t){return e(t)}}var Ap=typeof W=="object"&&W&&!W.nodeType&&W,Yi=Ap&&typeof module=="object"&&module&&!module.nodeType&&module,NO=Yi&&Yi.exports===Ap,hc=NO&&lp.process,UO=function(){try{var e=Yi&&Yi.require&&Yi.require("util").types;return e||hc&&hc.binding&&hc.binding("util")}catch{}}();const Pr=UO;var Cp=Pr&&Pr.isTypedArray,BO=Cp?uc(Cp):$O;const Ia=BO;var FO=Object.prototype,HO=FO.hasOwnProperty;function Dp(e,t){var n=qt(e),r=!n&&Ir(e),i=!n&&!r&&kr(e),s=!n&&!r&&!i&&Ia(e),a=n||r||i||s,o=a?rO(e.length,String):[],l=o.length;for(var c in e)(t||HO.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||lc(c,l)))&&o.push(c);return o}function Lp(e,t){return function(n){return e(t(n))}}var GO=Lp(Object.keys,Object);const VO=GO;var zO=Object.prototype,WO=zO.hasOwnProperty;function Rp(e){if(!Ra(e))return VO(e);var t=[];for(var n in Object(e))WO.call(e,n)&&n!="constructor"&&t.push(n);return t}function qi(e){return tr(e)?Dp(e):Rp(e)}function YO(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var qO=Object.prototype,XO=qO.hasOwnProperty;function jO(e){if(!Me(e))return YO(e);var t=Ra(e),n=[];for(var r in e)r=="constructor"&&(t||!XO.call(e,r))||n.push(r);return n}function Xi(e){return tr(e)?Dp(e,!0):jO(e)}var ZO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,KO=/^\w*$/;function dc(e,t){if(qt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ca(e)?!0:KO.test(e)||!ZO.test(e)||t!=null&&e in Object(t)}var QO=Jn(Object,"create");const ji=QO;function JO(){this.__data__=ji?ji(null):{},this.size=0}function tM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var eM="__lodash_hash_undefined__",nM=Object.prototype,rM=nM.hasOwnProperty;function iM(e){var t=this.__data__;if(ji){var n=t[e];return n===eM?void 0:n}return rM.call(t,e)?t[e]:void 0}var sM=Object.prototype,aM=sM.hasOwnProperty;function oM(e){var t=this.__data__;return ji?t[e]!==void 0:aM.call(t,e)}var lM="__lodash_hash_undefined__";function cM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ji&&t===void 0?lM:t,this}function er(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])}}er.prototype.clear=JO,er.prototype.delete=tM,er.prototype.get=iM,er.prototype.has=oM,er.prototype.set=cM;function uM(){this.__data__=[],this.size=0}function ka(e,t){for(var n=e.length;n--;)if(zi(e[n][0],t))return n;return-1}var hM=Array.prototype,dM=hM.splice;function fM(e){var t=this.__data__,n=ka(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():dM.call(t,n,1),--this.size,!0}function pM(e){var t=this.__data__,n=ka(t,e);return n<0?void 0:t[n][1]}function gM(e){return ka(this.__data__,e)>-1}function mM(e,t){var n=this.__data__,r=ka(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function gn(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])}}gn.prototype.clear=uM,gn.prototype.delete=fM,gn.prototype.get=pM,gn.prototype.has=gM,gn.prototype.set=mM;var vM=Jn(Be,"Map");const Zi=vM;function yM(){this.size=0,this.__data__={hash:new er,map:new(Zi||gn),string:new er}}function EM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Pa(e,t){var n=e.__data__;return EM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function xM(e){var t=Pa(this,e).delete(e);return this.size-=t?1:0,t}function bM(e){return Pa(this,e).get(e)}function _M(e){return Pa(this,e).has(e)}function SM(e,t){var n=Pa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function mn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mn.prototype.clear=yM,mn.prototype.delete=xM,mn.prototype.get=bM,mn.prototype.has=_M,mn.prototype.set=SM;var TM="Expected a function";function fc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(TM);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(fc.Cache||mn),n}fc.Cache=mn;var wM=500;function OM(e){var t=fc(e,function(r){return n.size===wM&&n.clear(),r}),n=t.cache;return t}var MM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AM=/\\(\\)?/g,CM=OM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(MM,function(n,r,i,s){t.push(i?s.replace(AM,"$1"):r||n)}),t});const DM=CM;function Ki(e){return e==null?"":pp(e)}function Ip(e,t){return qt(e)?e:dc(e,t)?[e]:DM(Ki(e))}var LM=1/0;function $a(e){if(typeof e=="string"||Ca(e))return e;var t=e+"";return t=="0"&&1/e==-LM?"-0":t}function kp(e,t){t=Ip(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[$a(t[n++])];return n&&n==r?e:void 0}function Mt(e,t,n){var r=e==null?void 0:kp(e,t);return r===void 0?n:r}function pc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Pp=Oe?Oe.isConcatSpreadable:void 0;function RM(e){return qt(e)||Ir(e)||!!(Pp&&e&&e[Pp])}function Na(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=RM),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Na(o,t-1,n,r,i):pc(i,o):r||(i[i.length]=o)}return i}function $p(e){var t=e==null?0:e.length;return t?Na(e,1):[]}var IM=Lp(Object.getPrototypeOf,Object);const gc=IM;var kM="[object Object]",PM=Function.prototype,$M=Object.prototype,Np=PM.toString,NM=$M.hasOwnProperty,UM=Np.call(Object);function BM(e){if(!Qe(e)||Kn(e)!=kM)return!1;var t=gc(e);if(t===null)return!0;var n=NM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Np.call(n)==UM}function FM(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 HM(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:FM(e,t,n)}var GM="\\ud800-\\udfff",VM="\\u0300-\\u036f",zM="\\ufe20-\\ufe2f",WM="\\u20d0-\\u20ff",YM=VM+zM+WM,qM="\\ufe0e\\ufe0f",XM="\\u200d",jM=RegExp("["+XM+GM+YM+qM+"]");function Up(e){return jM.test(e)}function ZM(e){return e.split("")}var Bp="\\ud800-\\udfff",KM="\\u0300-\\u036f",QM="\\ufe20-\\ufe2f",JM="\\u20d0-\\u20ff",tA=KM+QM+JM,eA="\\ufe0e\\ufe0f",nA="["+Bp+"]",mc="["+tA+"]",vc="\\ud83c[\\udffb-\\udfff]",rA="(?:"+mc+"|"+vc+")",Fp="[^"+Bp+"]",Hp="(?:\\ud83c[\\udde6-\\uddff]){2}",Gp="[\\ud800-\\udbff][\\udc00-\\udfff]",iA="\\u200d",Vp=rA+"?",zp="["+eA+"]?",sA="(?:"+iA+"(?:"+[Fp,Hp,Gp].join("|")+")"+zp+Vp+")*",aA=zp+Vp+sA,oA="(?:"+[Fp+mc+"?",mc,Hp,Gp,nA].join("|")+")",lA=RegExp(vc+"(?="+vc+")|"+oA+aA,"g");function cA(e){return e.match(lA)||[]}function uA(e){return Up(e)?cA(e):ZM(e)}function hA(e){return function(t){t=Ki(t);var n=Up(t)?uA(t):void 0,r=n?n[0]:t.charAt(0),i=n?HM(n,1).join(""):t.slice(1);return r[e]()+i}}var dA=hA("toUpperCase");const fA=dA;function pA(e){return fA(Ki(e).toLowerCase())}function gA(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 mA(e){return function(t){return e==null?void 0:e[t]}}var vA={À:"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"},yA=mA(vA);const EA=yA;var xA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bA="\\u0300-\\u036f",_A="\\ufe20-\\ufe2f",SA="\\u20d0-\\u20ff",TA=bA+_A+SA,wA="["+TA+"]",OA=RegExp(wA,"g");function MA(e){return e=Ki(e),e&&e.replace(xA,EA).replace(OA,"")}var AA=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function CA(e){return e.match(AA)||[]}var DA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function LA(e){return DA.test(e)}var Wp="\\ud800-\\udfff",RA="\\u0300-\\u036f",IA="\\ufe20-\\ufe2f",kA="\\u20d0-\\u20ff",PA=RA+IA+kA,Yp="\\u2700-\\u27bf",qp="a-z\\xdf-\\xf6\\xf8-\\xff",$A="\\xac\\xb1\\xd7\\xf7",NA="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",UA="\\u2000-\\u206f",BA=" \\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",Xp="A-Z\\xc0-\\xd6\\xd8-\\xde",FA="\\ufe0e\\ufe0f",jp=$A+NA+UA+BA,Zp="['’]",Kp="["+jp+"]",HA="["+PA+"]",Qp="\\d+",GA="["+Yp+"]",Jp="["+qp+"]",tg="[^"+Wp+jp+Qp+Yp+qp+Xp+"]",VA="\\ud83c[\\udffb-\\udfff]",zA="(?:"+HA+"|"+VA+")",WA="[^"+Wp+"]",eg="(?:\\ud83c[\\udde6-\\uddff]){2}",ng="[\\ud800-\\udbff][\\udc00-\\udfff]",$r="["+Xp+"]",YA="\\u200d",rg="(?:"+Jp+"|"+tg+")",qA="(?:"+$r+"|"+tg+")",ig="(?:"+Zp+"(?:d|ll|m|re|s|t|ve))?",sg="(?:"+Zp+"(?:D|LL|M|RE|S|T|VE))?",ag=zA+"?",og="["+FA+"]?",XA="(?:"+YA+"(?:"+[WA,eg,ng].join("|")+")"+og+ag+")*",jA="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ZA="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",KA=og+ag+XA,QA="(?:"+[GA,eg,ng].join("|")+")"+KA,JA=RegExp([$r+"?"+Jp+"+"+ig+"(?="+[Kp,$r,"$"].join("|")+")",qA+"+"+sg+"(?="+[Kp,$r+rg,"$"].join("|")+")",$r+"?"+rg+"+"+ig,$r+"+"+sg,ZA,jA,Qp,QA].join("|"),"g");function tC(e){return e.match(JA)||[]}function eC(e,t,n){return e=Ki(e),t=n?void 0:t,t===void 0?LA(e)?tC(e):CA(e):e.match(t)||[]}var nC="['’]",rC=RegExp(nC,"g");function lg(e){return function(t){return gA(eC(MA(t).replace(rC,"")),e,"")}}var iC=lg(function(e,t,n){return t=t.toLowerCase(),e+(n?pA(t):t)});const sC=iC;function aC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function cg(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Vi(n),n=n===n?n:0),t!==void 0&&(t=Vi(t),t=t===t?t:0),aC(Vi(e),t,n)}function oC(){this.__data__=new gn,this.size=0}function lC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function cC(e){return this.__data__.get(e)}function uC(e){return this.__data__.has(e)}var hC=200;function dC(e,t){var n=this.__data__;if(n instanceof gn){var r=n.__data__;if(!Zi||r.length<hC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mn(r)}return n.set(e,t),this.size=n.size,this}function Fe(e){var t=this.__data__=new gn(e);this.size=t.size}Fe.prototype.clear=oC,Fe.prototype.delete=lC,Fe.prototype.get=cC,Fe.prototype.has=uC,Fe.prototype.set=dC;function fC(e,t){return e&&Wi(t,qi(t),e)}function pC(e,t){return e&&Wi(t,Xi(t),e)}var ug=typeof W=="object"&&W&&!W.nodeType&&W,hg=ug&&typeof module=="object"&&module&&!module.nodeType&&module,gC=hg&&hg.exports===ug,dg=gC?Be.Buffer:void 0,fg=dg?dg.allocUnsafe:void 0;function pg(e,t){if(t)return e.slice();var n=e.length,r=fg?fg(n):new e.constructor(n);return e.copy(r),r}function mC(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 gg(){return[]}var vC=Object.prototype,yC=vC.propertyIsEnumerable,mg=Object.getOwnPropertySymbols,EC=mg?function(e){return e==null?[]:(e=Object(e),mC(mg(e),function(t){return yC.call(e,t)}))}:gg;const yc=EC;function xC(e,t){return Wi(e,yc(e),t)}var bC=Object.getOwnPropertySymbols,_C=bC?function(e){for(var t=[];e;)pc(t,yc(e)),e=gc(e);return t}:gg;const vg=_C;function SC(e,t){return Wi(e,vg(e),t)}function yg(e,t,n){var r=t(e);return qt(e)?r:pc(r,n(e))}function Ec(e){return yg(e,qi,yc)}function TC(e){return yg(e,Xi,vg)}var wC=Jn(Be,"DataView");const xc=wC;var OC=Jn(Be,"Promise");const bc=OC;var MC=Jn(Be,"Set");const Nr=MC;var Eg="[object Map]",AC="[object Object]",xg="[object Promise]",bg="[object Set]",_g="[object WeakMap]",Sg="[object DataView]",CC=Qn(xc),DC=Qn(Zi),LC=Qn(bc),RC=Qn(Nr),IC=Qn(oc),nr=Kn;(xc&&nr(new xc(new ArrayBuffer(1)))!=Sg||Zi&&nr(new Zi)!=Eg||bc&&nr(bc.resolve())!=xg||Nr&&nr(new Nr)!=bg||oc&&nr(new oc)!=_g)&&(nr=function(e){var t=Kn(e),n=t==AC?e.constructor:void 0,r=n?Qn(n):"";if(r)switch(r){case CC:return Sg;case DC:return Eg;case LC:return xg;case RC:return bg;case IC:return _g}return t});const Ur=nr;var kC=Object.prototype,PC=kC.hasOwnProperty;function $C(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&PC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var NC=Be.Uint8Array;const Ua=NC;function _c(e){var t=new e.constructor(e.byteLength);return new Ua(t).set(new Ua(e)),t}function UC(e,t){var n=t?_c(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var BC=/\w*$/;function FC(e){var t=new e.constructor(e.source,BC.exec(e));return t.lastIndex=e.lastIndex,t}var Tg=Oe?Oe.prototype:void 0,wg=Tg?Tg.valueOf:void 0;function HC(e){return wg?Object(wg.call(e)):{}}function Og(e,t){var n=t?_c(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var GC="[object Boolean]",VC="[object Date]",zC="[object Map]",WC="[object Number]",YC="[object RegExp]",qC="[object Set]",XC="[object String]",jC="[object Symbol]",ZC="[object ArrayBuffer]",KC="[object DataView]",QC="[object Float32Array]",JC="[object Float64Array]",tD="[object Int8Array]",eD="[object Int16Array]",nD="[object Int32Array]",rD="[object Uint8Array]",iD="[object Uint8ClampedArray]",sD="[object Uint16Array]",aD="[object Uint32Array]";function oD(e,t,n){var r=e.constructor;switch(t){case ZC:return _c(e);case GC:case VC:return new r(+e);case KC:return UC(e,n);case QC:case JC:case tD:case eD:case nD:case rD:case iD:case sD:case aD:return Og(e,n);case zC:return new r;case WC:case XC:return new r(e);case YC:return FC(e);case qC:return new r;case jC:return HC(e)}}function Mg(e){return typeof e.constructor=="function"&&!Ra(e)?Lw(gc(e)):{}}var lD="[object Map]";function cD(e){return Qe(e)&&Ur(e)==lD}var Ag=Pr&&Pr.isMap,uD=Ag?uc(Ag):cD;const hD=uD;var dD="[object Set]";function fD(e){return Qe(e)&&Ur(e)==dD}var Cg=Pr&&Pr.isSet,pD=Cg?uc(Cg):fD;const gD=pD;var mD=1,vD=2,yD=4,Dg="[object Arguments]",ED="[object Array]",xD="[object Boolean]",bD="[object Date]",_D="[object Error]",Lg="[object Function]",SD="[object GeneratorFunction]",TD="[object Map]",wD="[object Number]",Rg="[object Object]",OD="[object RegExp]",MD="[object Set]",AD="[object String]",CD="[object Symbol]",DD="[object WeakMap]",LD="[object ArrayBuffer]",RD="[object DataView]",ID="[object Float32Array]",kD="[object Float64Array]",PD="[object Int8Array]",$D="[object Int16Array]",ND="[object Int32Array]",UD="[object Uint8Array]",BD="[object Uint8ClampedArray]",FD="[object Uint16Array]",HD="[object Uint32Array]",At={};At[Dg]=At[ED]=At[LD]=At[RD]=At[xD]=At[bD]=At[ID]=At[kD]=At[PD]=At[$D]=At[ND]=At[TD]=At[wD]=At[Rg]=At[OD]=At[MD]=At[AD]=At[CD]=At[UD]=At[BD]=At[FD]=At[HD]=!0,At[_D]=At[Lg]=At[DD]=!1;function Ba(e,t,n,r,i,s){var a,o=t&mD,l=t&vD,c=t&yD;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Me(e))return e;var u=qt(e);if(u){if(a=$C(e),!o)return yp(e,a)}else{var d=Ur(e),h=d==Lg||d==SD;if(kr(e))return pg(e,o);if(d==Rg||d==Dg||h&&!i){if(a=l||h?{}:Mg(e),!o)return l?SC(e,pC(a,e)):xC(e,fC(a,e))}else{if(!At[d])return i?e:{};a=oD(e,d,o)}}s||(s=new Fe);var f=s.get(e);if(f)return f;s.set(e,a),gD(e)?e.forEach(function(v){a.add(Ba(v,t,n,v,e,s))}):hD(e)&&e.forEach(function(v,m){a.set(m,Ba(v,t,n,m,e,s))});var p=c?l?TC:Ec:l?Xi:qi,g=u?void 0:p(e);return Vw(g||e,function(v,m){g&&(m=v,v=e[m]),Ep(a,m,Ba(v,t,n,m,e,s))}),a}var GD=1,VD=4;function vn(e){return Ba(e,GD|VD)}var zD="__lodash_hash_undefined__";function WD(e){return this.__data__.set(e,zD),this}function YD(e){return this.__data__.has(e)}function Qi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new mn;++t<n;)this.add(e[t])}Qi.prototype.add=Qi.prototype.push=WD,Qi.prototype.has=YD;function Ig(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 kg(e,t){return e.has(t)}var qD=1,XD=2;function Pg(e,t,n,r,i,s){var a=n&qD,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&XD?new Qi: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(!Ig(t,function(m,y){if(!kg(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 jD(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Sc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var ZD=1,KD=2,QD="[object Boolean]",JD="[object Date]",tL="[object Error]",eL="[object Map]",nL="[object Number]",rL="[object RegExp]",iL="[object Set]",sL="[object String]",aL="[object Symbol]",oL="[object ArrayBuffer]",lL="[object DataView]",$g=Oe?Oe.prototype:void 0,Tc=$g?$g.valueOf:void 0;function cL(e,t,n,r,i,s,a){switch(n){case lL:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case oL:return!(e.byteLength!=t.byteLength||!s(new Ua(e),new Ua(t)));case QD:case JD:case nL:return zi(+e,+t);case tL:return e.name==t.name&&e.message==t.message;case rL:case sL:return e==t+"";case eL:var o=jD;case iL:var l=r&ZD;if(o||(o=Sc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=KD,a.set(e,t);var u=Pg(o(e),o(t),r,i,s,a);return a.delete(e),u;case aL:if(Tc)return Tc.call(e)==Tc.call(t)}return!1}var uL=1,hL=Object.prototype,dL=hL.hasOwnProperty;function fL(e,t,n,r,i,s){var a=n&uL,o=Ec(e),l=o.length,c=Ec(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:dL.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 E=a?r(y,m,h,t,e,s):r(m,y,h,e,t,s);if(!(E===void 0?m===y||i(m,y,n,r,s):E)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var _=e.constructor,S=t.constructor;_!=S&&"constructor"in e&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof S=="function"&&S instanceof S)&&(g=!1)}return s.delete(e),s.delete(t),g}var pL=1,Ng="[object Arguments]",Ug="[object Array]",Fa="[object Object]",gL=Object.prototype,Bg=gL.hasOwnProperty;function mL(e,t,n,r,i,s){var a=qt(e),o=qt(t),l=a?Ug:Ur(e),c=o?Ug:Ur(t);l=l==Ng?Fa:l,c=c==Ng?Fa:c;var u=l==Fa,d=c==Fa,h=l==c;if(h&&kr(e)){if(!kr(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Fe),a||Ia(e)?Pg(e,t,n,r,i,s):cL(e,t,l,n,r,i,s);if(!(n&pL)){var f=u&&Bg.call(e,"__wrapped__"),p=d&&Bg.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return s||(s=new Fe),i(g,v,n,r,s)}}return h?(s||(s=new Fe),fL(e,t,n,r,i,s)):!1}function Ha(e,t,n,r,i){return e===t?!0:e==null||t==null||!Qe(e)&&!Qe(t)?e!==e&&t!==t:mL(e,t,n,r,Ha,i)}var vL=1,yL=2;function EL(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 Fe;if(r)var h=r(c,u,l,e,t,d);if(!(h===void 0?Ha(u,c,vL|yL,r,d):h))return!1}}return!0}function Fg(e){return e===e&&!Me(e)}function xL(e){for(var t=qi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Fg(i)]}return t}function Hg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function bL(e){var t=xL(e);return t.length==1&&t[0][2]?Hg(t[0][0],t[0][1]):function(n){return n===e||EL(n,e,t)}}function _L(e,t){return e!=null&&t in Object(e)}function SL(e,t,n){t=Ip(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=$a(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&&cc(i)&&lc(a,i)&&(qt(e)||Ir(e)))}function TL(e,t){return e!=null&&SL(e,t,_L)}var wL=1,OL=2;function ML(e,t){return dc(e)&&Fg(t)?Hg($a(e),t):function(n){var r=Mt(n,e);return r===void 0&&r===t?TL(n,e):Ha(t,r,wL|OL)}}function AL(e){return function(t){return t==null?void 0:t[e]}}function CL(e){return function(t){return kp(t,e)}}function DL(e){return dc(e)?AL($a(e)):CL(e)}function Ga(e){return typeof e=="function"?e:e==null?ic:typeof e=="object"?qt(e)?ML(e[0],e[1]):bL(e):DL(e)}function LL(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 RL(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 IL=RL();const Gg=IL;function kL(e,t){return e&&Gg(e,t,qi)}function PL(e,t){return function(n,r){if(n==null)return n;if(!tr(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 $L=PL(kL);const wc=$L;function NL(e,t,n,r){return wc(e,function(i,s,a){t(r,i,n(i),a)}),r}function UL(e,t){return function(n,r){var i=qt(n)?LL:NL,s=t?t():{};return i(n,e,Ga(r),s)}}var BL=function(){return Be.Date.now()};const Oc=BL;var FL="Expected a function",HL=Math.max,GL=Math.min;function Va(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(FL);t=Vi(t)||0,Me(n)&&(u=!!n.leading,d="maxWait"in n,s=d?HL(Vi(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(b){var M=r,D=i;return r=i=void 0,c=b,a=e.apply(D,M),a}function p(b){return c=b,o=setTimeout(m,t),u?f(b):a}function g(b){var M=b-l,D=b-c,G=t-M;return d?GL(G,s-D):G}function v(b){var M=b-l,D=b-c;return l===void 0||M>=t||M<0||d&&D>=s}function m(){var b=Oc();if(v(b))return y(b);o=setTimeout(m,g(b))}function y(b){return o=void 0,h&&r?f(b):(r=i=void 0,a)}function E(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function _(){return o===void 0?a:y(Oc())}function S(){var b=Oc(),M=v(b);if(r=arguments,i=this,l=b,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 S.cancel=E,S.flush=_,S}function Mc(e,t,n){(n!==void 0&&!zi(e[t],n)||n===void 0&&!(t in e))&&La(e,t,n)}function Ac(e){return Qe(e)&&tr(e)}function Cc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function VL(e){return Wi(e,Xi(e))}function zL(e,t,n,r,i,s,a){var o=Cc(e,n),l=Cc(t,n),c=a.get(l);if(c){Mc(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=qt(l),f=!h&&kr(l),p=!h&&!f&&Ia(l);u=l,h||f||p?qt(o)?u=o:Ac(o)?u=yp(o):f?(d=!1,u=pg(l,!0)):p?(d=!1,u=Og(l,!0)):u=[]:BM(l)||Ir(l)?(u=o,Ir(o)?u=VL(o):(!Me(o)||sc(o))&&(u=Mg(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),Mc(e,n,u)}function Vg(e,t,n,r,i){e!==t&&Gg(t,function(s,a){if(i||(i=new Fe),Me(s))zL(e,t,a,n,Vg,r,i);else{var o=r?r(Cc(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),Mc(e,a,o)}},Xi)}function WL(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 YL(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function qL(e,t){var n=-1,r=tr(e)?Array(e.length):[];return wc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function XL(e,t){var n=qt(e)?hp:qL;return n(e,Ga(t))}var jL=1/0;function ZL(e,t){return Na(XL(e,t),jL)}function KL(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 QL=Object.prototype,JL=QL.hasOwnProperty,tR=UL(function(e,t,n){JL.call(e,n)?e[n].push(t):La(e,n,[t])});const eR=tR;var nR="[object Map]",rR="[object Set]",iR=Object.prototype,sR=iR.hasOwnProperty;function He(e){if(e==null)return!0;if(tr(e)&&(qt(e)||typeof e=="string"||typeof e.splice=="function"||kr(e)||Ia(e)||Ir(e)))return!e.length;var t=Ur(e);if(t==nR||t==rR)return!e.size;if(Ra(e))return!Rp(e).length;for(var n in e)if(sR.call(e,n))return!1;return!0}function zg(e,t){return Ha(e,t)}var aR=lg(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Br=aR;var oR=eO(function(e,t,n){Vg(e,t,n)});const at=oR;function lR(e,t){var n;return wc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function cR(e,t,n){var r=qt(e)?Ig:lR;return n&&_p(e,t,n)&&(t=void 0),r(e,Ga(t))}var uR=1/0,hR=Nr&&1/Sc(new Nr([,-0]))[1]==uR?function(e){return new Nr(e)}:Iw;const dR=hR;var fR=200;function Wg(e,t,n){var r=-1,i=Xw,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=WL;else if(s>=fR){var c=t?null:dR(e);if(c)return Sc(c);a=!1,i=kg,l=new Qi}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 pR=bp(function(e){var t=YL(e);return Ac(t)&&(t=void 0),Wg(Na(e,1,Ac,!0),Ga(t))});const gR=pR;function Ji(e){return e&&e.length?Wg(e):[]}var Dc=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Dc||{}),Lc=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Lc||{}),Rc=(e=>(e.UPDATE="model-update",e))(Rc||{}),Yg=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(Yg||{}),Ic=(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))(Ic||{}),kc=(e=>(e.CHANGE="zoom-domain-change",e))(kc||{}),Pc=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Pc||{}),$c=(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))($c||{}),Nc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Nc||{}),Uc=(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))(Uc||{}),Bc=(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))(Bc||{}),Fc=(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))(Fc||{}),Hc=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Hc||{}),Gc=(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))(Gc||{}),Vc=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Vc||{}),zc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(zc||{}),Wc=(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))(Wc||{}),Yc=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Yc||{}),qc=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(qc||{}),Fr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Fr||{}),Xc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Xc||{}),qg=(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))(qg||{}),Xg=(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))(Xg||{}),jg=(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))(jg||{}),Zg=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Zg||{}),Kg=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Kg||{}),Hr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Hr||{});const T=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:jg,Area:Nc,Axis:$c,Bar:Hc,Boxplot:Gc,CanvasZoom:Pc,Chart:Dc,Choropleth:Hr,CirclePack:Xg,Gauge:Fc,Heatmap:Kg,Legend:qg,Line:zc,Meter:Zg,Modal:Lc,Model:Rc,Pie:Bc,Radar:Wc,Scatter:Vc,Threshold:Xc,Toolbar:Yg,Tooltip:Fr,Tree:Yc,Treemap:qc,WordCloud:Uc,ZoomBar:Ic,ZoomDomain:kc},Symbol.toStringTag,{value:"Module"}));var tt=(e=>(e.HTML="html",e.SVG="svg",e))(tt||{}),jc=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(jc||{}),rt=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(rt||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),Ge=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ge||{}),Ae=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ae||{}),zt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(zt||{}),K=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(K||{}),Gr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Gr||{}),Ut=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Ut||{}),Vr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Vr||{}),za=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(za||{}),wt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(wt||{}),lt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(lt||{}),rr=(e=>(e.CENTER="center",e))(rr||{}),ts=(e=>(e.LEFT="left",e.RIGHT="right",e))(ts||{}),Bt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Bt||{}),Je=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Je||{}),tn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(tn||{}),ir=(e=>(e.SEMI="semi",e.FULL="full",e))(ir||{}),Wa=(e=>(e.UP="up",e.DOWN="down",e))(Wa||{}),es=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(es||{}),ns=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(ns||{}),Ee=(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))(Ee||{}),It=(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))(It||{}),Ya=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ya||{}),Ft=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Ft||{}),rs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(rs||{}),zr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(zr||{}),is=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(is||{}),en=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(en||{});const ue="cds",yn={opacity:{unselected:.05,selected:.4}},Ln={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Wr={duration:1e3,ease:Xh,zoomLevel:3},Yr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},Qg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ce={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},mR={defaultBins:10},Pt={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}},En={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Xt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Ct={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}},sr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Ve={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Jg={minCellDividerDimension:16,chartPadding:.5},tm={default:{size:24}},vR={horizontalOffset:10},em={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}},xe={height:{[Ge.GRAPH_VIEW]:32,[Ge.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},yR=[{type:Ft.RADIUS,name:"Radius"},{type:Ft.AREA,name:"Poor area"},{type:Ft.AREA,name:"Satisfactory area"},{type:Ft.AREA,name:"Great area"},{type:Ft.QUARTILE,name:"Quartiles"}];function ER(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=Bn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function kt(e,t){var i;const n=vn(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://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format");const o=a.mapsTo;if(o==null){const l=a.scaleType;l==null?a.mapsTo="value":l===K.TIME?a.mapsTo="date":l===K.LABELS&&(a.mapsTo="key")}}else delete n.axes[s];return Kc(n,t),at(n,t)}function xn(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 ss(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 Zc(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function as(e,t,n){if(n>e.length)return e;if(t===Ae.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ae.FRONT_LINE)return"..."+e.substr(-n);if(t===Ae.END_LINE)return e.substr(0,n)+"..."}function Kc(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=yR.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=gR(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},nm=(e,t)=>t===zt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ie=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=nm(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function bn(e,t,n){return n===zt.VERTICAL?[e,t]:[t,e]}function Qc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function os(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}function ls(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?bR(o,d=>d.test(a)):xR(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function xR(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bR(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _R(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}function yt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let SR={};function qa(){return SR}function cs(e,t){var o,l,c,u;const n=qa(),r=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=yt(e),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}const TR={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"}},wR=(e,t,n)=>{let r;const i=TR[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},OR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},MR=(e,t,n,r)=>OR[e],AR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},CR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DR={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"]},LR={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"]},RR={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"}},IR={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"}},kR={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:os({values:AR,defaultWidth:"wide"}),quarter:os({values:CR,defaultWidth:"wide",argumentCallback:e=>e-1}),month:os({values:DR,defaultWidth:"wide"}),day:os({values:LR,defaultWidth:"wide"}),dayPeriod:os({values:RR,defaultWidth:"wide",formattingValues:IR,defaultFormattingWidth:"wide"})},PR=/^(\d+)(th|st|nd|rd)?/i,$R=/\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},UR={any:[/^b/i,/^(a|c)/i]},BR={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},FR={any:[/1/i,/2/i,/3/i,/4/i]},HR={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},GR={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]},VR={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},zR={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]},WR={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},YR={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}},qR={ordinalNumber:_R({matchPattern:PR,parsePattern:$R,valueCallback:e=>parseInt(e,10)}),era:ls({matchPatterns:NR,defaultMatchWidth:"wide",parsePatterns:UR,defaultParseWidth:"any"}),quarter:ls({matchPatterns:BR,defaultMatchWidth:"wide",parsePatterns:FR,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ls({matchPatterns:HR,defaultMatchWidth:"wide",parsePatterns:GR,defaultParseWidth:"any"}),day:ls({matchPatterns:VR,defaultMatchWidth:"wide",parsePatterns:zR,defaultParseWidth:"any"}),dayPeriod:ls({matchPatterns:WR,defaultMatchWidth:"any",parsePatterns:YR,defaultParseWidth:"any"})},XR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},jR={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ZR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},KR={date:Qc({formats:XR,defaultWidth:"full"}),time:Qc({formats:jR,defaultWidth:"full"}),dateTime:Qc({formats:ZR,defaultWidth:"full"})},rm={code:"en-US",formatDistance:wR,formatLong:KR,formatRelative:MR,localize:kR,match:qR,options:{weekStartsOn:0,firstWeekContainsDate:1}},qr={type:Ae.END_LINE,threshold:16,numCharacter:14},QR={enabled:!0,position:Gr.BOTTOM,clickable:!0,truncation:qr,alignment:Ut.LEFT,order:null,additionalItems:[]},JR={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},tI={enabled:!0},im={enabled:!0,showTotal:!0,truncation:qr,groupLabel:"Group"},sm={top:{visible:!0,includeZero:!0,truncation:qr},bottom:{visible:!0,includeZero:!0,truncation:qr},left:{visible:!0,includeZero:!0,truncation:qr},right:{visible:!0,includeZero:!0,truncation:qr}},Xa={addSpaceOnEdges:1,showDayName:!1,localeObject:rm,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"}}},eI=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),te={width:null,height:null,resizable:!0,theme:jc.WHITE,tooltip:im,legend:QR,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:It.SHOW_AS_DATATABLE},...eI?[{type:It.MAKE_FULLSCREEN}]:[],{type:It.EXPORT_CSV},{type:It.EXPORT_PNG},{type:It.EXPORT_JPG}]}},am=at({},te,{thematic:{projection:en.geoNaturalEarth1}}),us=at({},te,{axes:sm,timeScale:Xa,grid:JR,ruler:tI,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ge.GRAPH_VIEW}}}),ar=at({},us,{bars:{maxWidth:16,spacingFactor:.25},timeScale:at(Xa,{addSpaceOnEdges:1})}),nI=at({},ar,{}),rI=at({},ar,{}),iI=at({},ar,{bars:at({},ar.bars,{dividerSize:1.5})}),sI=at({},ar,{}),Jc=at({},us,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),aI=Jc,om=at({},Jc,{points:{radius:3,filled:!1,enabled:!0}}),lm=at({},om,{timeScale:at(Xa,{addSpaceOnEdges:0})}),oI=lm,lI=at({},us,{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:Ft.RADIUS,name:"Radius"}]}}),cI=at({},us,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Ft.AREA,name:"Poor area"},{type:Ft.AREA,name:"Satisfactory area"},{type:Ft.AREA,name:"Great area"},{type:Ft.QUARTILE,name:"Quartiles"}]}}),uI=at({},ar,{bars:{dividerSize:1.5},timeScale:at(Xa,{addSpaceOnEdges:0})}),hI=at({},te,{tooltip:at({},im,{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"}}),cm=at({},te,{pie:{labels:{formatter:null,enabled:!0},alignment:Ut.LEFT,sortFunction:null,valueMapsTo:"value"}}),dI=at({},te,{legend:{enabled:!1},gauge:{type:ir.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:Ut.LEFT}}),fI=at({},cm,{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:Ut.LEFT}}),um=at({},te,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),pI=at({},um,{legend:{enabled:!0}}),gI=at({},te,{radar:{axes:{angle:"key",value:"value"},alignment:Ut.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),mI=at({},ar,{comboChartTypes:[]}),vI=at({tree:{type:za.TREE}},te,{}),yI=at({},te,{data:at(te.data,{groupMapsTo:"name"})}),EI=at({},te,Yr,{data:at(te.data,{groupMapsTo:"name"})}),xI=at({},te,{alluvial:{data:at(te.data,{groupMapsTo:"source"}),nodeAlignment:Ut.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),bI=at({},te,{axes:sm,heatmap:{divider:{state:zr.AUTO},colorLegend:{type:"linear"}}}),_I=at({},am,{choropleth:{colorLegend:{type:"linear"}}}),Ot={alluvialChart:xI,areaChart:lm,axisChart:us,boxplotChart:sI,bubbleChart:lI,bulletChart:cI,chart:te,circlePackChart:EI,choroplethChart:_I,comboChart:mI,donutChart:fI,gaugeChart:dI,groupedBarChart:rI,heatmapChart:bI,histogramChart:uI,lineChart:om,lollipopChart:aI,meterChart:um,pieChart:cm,proportionalMeterChart:pI,radarChart:gI,scatterChart:Jc,simpleBarChart:nI,stackedAreaChart:oI,stackedBarChart:iI,thematicChart:am,treeChart:vI,treemapChart:yI,wordCloudChart:hI};function SI(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function TI(e){if(!SI(e)&&typeof e!="number")return!1;const t=yt(e);return!isNaN(Number(t))}const hm=6048e5,wI=864e5,dm=6e4,fm=36e5;function pm(e){const t=yt(e);return t.setHours(0,0,0,0),t}function gm(e){const 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 mm(e,t){const n=pm(e),r=pm(t),i=n.getTime()-gm(n),s=r.getTime()-gm(r);return Math.round((i-s)/wI)}function ze(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function OI(e){const t=yt(e),n=ze(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function MI(e){const t=yt(e);return mm(t,OI(t))+1}function ja(e){return cs(e,{weekStartsOn:1})}function vm(e){const t=yt(e),n=t.getFullYear(),r=ze(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=ja(r),s=ze(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=ja(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function AI(e){const t=vm(e),n=ze(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ja(n)}function CI(e){const t=yt(e),n=ja(t).getTime()-AI(t).getTime();return Math.round(n/hm)+1}function ym(e,t){var u,d,h,f;const n=yt(e),r=n.getFullYear(),i=qa(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,a=ze(e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=cs(a,t),l=ze(e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=cs(l,t);return n.getTime()>=o.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function DI(e,t){var o,l,c,u;const n=qa(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=ym(e,t),s=ze(e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),cs(s,t)}function LI(e,t){const n=yt(e),r=cs(n,t).getTime()-DI(n,t).getTime();return Math.round(r/hm)+1}function _t(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Rn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return _t(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):_t(n+1,2)},d(e,t){return _t(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return _t(e.getHours()%12||12,t.length)},H(e,t){return _t(e.getHours(),t.length)},m(e,t){return _t(e.getMinutes(),t.length)},s(e,t){return _t(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.floor(r*Math.pow(10,n-3));return _t(i,t.length)}},Xr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},RI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Rn.y(e,t)},Y:function(e,t,n,r){const i=ym(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return _t(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):_t(s,t.length)},R:function(e,t){const n=vm(e);return _t(n,t.length)},u:function(e,t){const n=e.getFullYear();return _t(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return _t(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return _t(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Rn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return _t(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=LI(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):_t(i,t.length)},I:function(e,t,n){const r=CI(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):_t(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Rn.d(e,t)},D:function(e,t,n){const r=MI(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):_t(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return _t(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return _t(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return _t(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Xr.noon:r===0?i=Xr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Xr.evening:r>=12?i=Xr.afternoon:r>=4?i=Xr.morning:i=Xr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Rn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Rn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):_t(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):_t(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Rn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Rn.s(e,t)},S:function(e,t){return Rn.S(e,t)},X:function(e,t,n,r){const s=(r._originalDate||e).getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return xm(s);case"XXXX":case"XX":return or(s);case"XXXXX":case"XXX":default:return or(s,":")}},x:function(e,t,n,r){const s=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return xm(s);case"xxxx":case"xx":return or(s);case"xxxxx":case"xxx":default:return or(s,":")}},O:function(e,t,n,r){const s=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Em(s,":");case"OOOO":default:return"GMT"+or(s,":")}},z:function(e,t,n,r){const s=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Em(s,":");case"zzzz":default:return"GMT"+or(s,":")}},t:function(e,t,n,r){const i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return _t(s,t.length)},T:function(e,t,n,r){const s=(r._originalDate||e).getTime();return _t(s,t.length)}};function Em(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+_t(s,2)}function xm(e,t){return e%60===0?(e>0?"-":"+")+_t(Math.abs(e)/60,2):or(e,t)}function or(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=_t(Math.floor(r/60),2),s=_t(r%60,2);return n+i+t+s}const bm=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},_m=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},II={p:_m,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return bm(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",bm(r,t)).replace("{{time}}",_m(i,t))}},kI=["D","DD"],PI=["YY","YYYY"];function $I(e){return kI.indexOf(e)!==-1}function NI(e){return PI.indexOf(e)!==-1}function Sm(e,t,n){if(e==="YYYY")throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${t}\`) for formatting years to the input \`${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 \`${t}\`) for formatting years to the input \`${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 \`${t}\`) for formatting days of the month to the input \`${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 \`${t}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const UI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,BI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,FI=/^'([^]*?)'?$/,HI=/''/g,GI=/[a-zA-Z]/;function jr(e,t,n){var u,d,h,f,p,g,v,m;const r=qa(),i=(n==null?void 0:n.locale)??r.locale??rm,s=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((f=(h=r.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((m=(v=r.locale)==null?void 0:v.options)==null?void 0:m.weekStartsOn)??0,o=yt(e);if(!TI(o))throw new RangeError("Invalid time value");const l={firstWeekContainsDate:s,weekStartsOn:a,locale:i,_originalDate:o};return t.match(BI).map(function(y){const E=y[0];if(E==="p"||E==="P"){const _=II[E];return _(y,i.formatLong)}return y}).join("").match(UI).map(function(y){if(y==="''")return"'";const E=y[0];if(E==="'")return VI(y);const _=RI[E];if(_)return!(n!=null&&n.useAdditionalWeekYearTokens)&&NI(y)&&Sm(y,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&$I(y)&&Sm(y,t,String(e)),_(o,y,i.localize,l);if(E.match(GI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return y}).join("")}function VI(e){const t=e.match(FI);return t?t[1].replace(HI,"'"):e}var Tm=(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))(Tm||{});const tu=[["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 wm(e,t,n,r,i){const s=t===0,a=Number(jr(new Date(e),"c"))===2,o=Number(jr(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ka(e)||hs(e,l)||In(e);case"minute":return s||Ka(e)||hs(e,l)||In(e);case"30minutes":return s||Ka(e)||hs(e,l)||In(e);case"hourly":return s||Ka(e)||hs(e,l)||In(e);case"daily":return i?s||a||In(e):s||hs(e,l)||In(e);case"weekly":return s||a||In(e);case"monthly":return s||In(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function eu(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=wm(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 jr(o,d,{locale:h})}function Za(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function zI(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function WI(e){const t=tu.reduce((n,[,r],i)=>{const s=tu[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return tu[t][0]}function nu(e,t){if(Tm[t])return t;if(e.length===1)return"15seconds";const n=zI(e),r=Mn(n);return WI(r)}function Ka(e){const{s:t,m:n,H:r}=Za(e);return r===0&&n===0&&t===0}function hs(e,t){const n=Za(e).M,r=Za(t).M;return n!==r}function In(e){const{M:t,d:n,s:r,m:i,H:s}=Za(e);return t===1&&n===1&&s===0&&i===0&&r===0}function Om(e){return e===void 0?"":e.toISOString()}function YI(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class nn{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===K.LINEAR||c===K.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===K.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}=Pt.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(vn(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}=Pt.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 eR(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=mR.defaultBins}=s,l=Array.isArray(o),c=$0().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 rc().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=Ji(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?Om(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===K.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===K.LOG||o===K.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?Om(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=KL(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?rc().offset(GT):rc()).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();Kc(n,t),this.set({options:at(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(T.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Pt.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(T.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://charts.carbondesignsystem.com/?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 n=this.getTabularDataArray().map(a=>a.map(o=>`"${(o==="&ndash;"?"–":o).split(/[,;'"`]/).map(u=>YI(u)).join("")}"`)).map(a=>a.join(",")).join(`
2
- `),r=this.getOptions();let i="myChart";const s=x(r,"fileDownload","fileName");typeof s=="function"?i=s("csv"):typeof s=="string"&&(i=s),this.services.files.downloadCSV(n,`${i}.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}=Pt.items.status,s=this.getOptions(),a=Ji(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=Qg.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=fa().range(o).domain(this.allDataGroups)}}function qI(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 XI=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function _n(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Qa(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function jI(e){const t=Qa(e,"border-left-width"),n=Qa(e,"border-right-width");return e.clientWidth+t+n}function ZI(e){const t=Qa(e,"border-top-width"),n=Qa(e,"border-bottom-width");return e.clientHeight+t+n}function Mm(e,t={}){const n=t.width||jI(e),r=t.height||ZI(e);return{width:n,height:r}}function KI(){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 be=16384;function QI(e){(e.width>be||e.height>be)&&(e.width>be&&e.height>be?e.width>e.height?(e.height*=be/e.width,e.width=be):(e.width*=be/e.height,e.height=be):e.width>be?(e.height*=be/e.width,e.width=be):(e.width*=be/e.height,e.height=be))}function Ja(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 JI(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function tk(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),JI(i)}const he=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||he(n,t)};function ek(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function nk(e){return _n(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function rk(e,t,n){const r=`.${e}:${t}`,i=n.cssText?ek(n):nk(n);return document.createTextNode(`${r}{${i}}`)}function Am(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=XI();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(rk(s,n,r)),t.appendChild(a)}function ik(e,t){Am(e,t,":before"),Am(e,t,":after")}const Cm="application/font-woff",Dm="image/jpeg",sk={woff:Cm,woff2:Cm,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Dm,jpeg:Dm,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ak(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ru(e){const t=ak(e).toLowerCase();return sk[t]||""}function ok(e){return e.split(/,/)[1]}function iu(e){return e.search(/^(data:)/)!==-1}function Lm(e,t){return`data:${t};base64,${e}`}async function Rm(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 su={};function lk(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 au(e,t,n){const r=lk(e,t,n.includeQueryParams);if(su[r]!=null)return su[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Rm(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),ok(o)));i=Lm(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 su[r]=i,i}async function ck(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ja(t)}async function uk(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 Ja(o)}const n=e.poster,r=ru(n),i=await au(n,r,t);return Ja(i)}async function hk(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await to(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function dk(e,t){return he(e,HTMLCanvasElement)?ck(e):he(e,HTMLVideoElement)?uk(e,t):he(e,HTMLIFrameElement)?hk(e):e.cloneNode(!1)}const fk=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function pk(e,t,n){var r,i;let s=[];return fk(e)&&e.assignedNodes?s=_n(e.assignedNodes()):he(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=_n(e.contentDocument.body.childNodes):s=_n(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||he(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>to(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function gk(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):_n(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`),he(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 mk(e,t){he(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),he(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function vk(e,t){if(he(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function yk(e,t){return he(t,Element)&&(gk(e,t),ik(e,t),mk(e,t),vk(e,t)),t}async function Ek(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 to(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 to(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>dk(r,t)).then(r=>pk(e,r,t)).then(r=>yk(e,r)).then(r=>Ek(r,t))}const Im=/url\((['"]?)([^'"]+?)\1\)/g,xk=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,bk=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function _k(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Sk(e){const t=[];return e.replace(Im,(n,r,i)=>(t.push(i),n)),t.filter(n=>!iu(n))}async function Tk(e,t,n,r,i){try{const s=n?qI(t,n):t,a=ru(t);let o;if(i){const l=await i(s);o=Lm(l,a)}else o=await au(s,a,r);return e.replace(_k(t),`$1${o}$3`)}catch{}return e}function wk(e,{preferredFontFormat:t}){return t?e.replace(bk,n=>{for(;;){const[r,,i]=xk.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function km(e){return e.search(Im)!==-1}async function Pm(e,t,n){if(!km(e))return e;const r=wk(e,n);return Sk(r).reduce((s,a)=>s.then(o=>Tk(o,a,t,n)),Promise.resolve(r))}async function eo(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Pm(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function Ok(e,t){await eo("background",e,t)||await eo("background-image",e,t),await eo("mask",e,t)||await eo("mask-image",e,t)}async function Mk(e,t){const n=he(e,HTMLImageElement);if(!(n&&!iu(e.src))&&!(he(e,SVGImageElement)&&!iu(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await au(r,ru(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 Ak(e,t){const r=_n(e.childNodes).map(i=>$m(i,t));await Promise.all(r).then(()=>e)}async function $m(e,t){he(e,Element)&&(await Ok(e,t),await Mk(e,t),await Ak(e,t))}function Ck(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 Nm={};async function Um(e){let t=Nm[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Nm[e]=t,t}async function Bm(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),Rm(o,t.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>n)}function Fm(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 Dk(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{_n(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Um(l).then(u=>Bm(u,t)).then(u=>Fm(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(Um(i.href).then(o=>Bm(o,t)).then(o=>Fm(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{_n(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function Lk(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>km(t.style.getPropertyValue("src")))}async function Rk(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=_n(e.ownerDocument.styleSheets),r=await Dk(n,t);return Lk(r)}async function Ik(e,t){const n=await Rk(e,t);return(await Promise.all(n.map(i=>{const s=i.parentStyleSheet?i.parentStyleSheet.href:null;return Pm(i.cssText,s,t)}))).join(`
3
- `)}async function kk(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Ik(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 Pk(e,t={}){const{width:n,height:r}=Mm(e,t),i=await to(e,t,!0);return await kk(i,t),await $m(i,t),Ck(i,t),await tk(i,n,r)}async function Hm(e,t={}){const{width:n,height:r}=Mm(e,t),i=await Pk(e,t),s=await Ja(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||KI(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||QI(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 $k(e,t={}){return(await Hm(e,t)).toDataURL()}async function Nk(e,t={}){return(await Hm(e,t)).toDataURL("image/jpeg",t.quality||1)}class Sn{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const Uk="DONT_STYLE_ME_css_styles_verifier";class A extends Sn{constructor(t,n){super(t,n)}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=L(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.initializeID(),this.styleHolderElement(),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=L(this.getHolder()).append("div").classed(`${ue}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",Uk),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),L(this.getHolder()).classed(`${ue}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=L(r);i.classed("filled",!0),Nk(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=x(n,"fileDownload","fileName");typeof o=="function"?a=o("jpg"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=L(r);i.classed("filled",!0),$k(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=x(n,"fileDownload","fileName");typeof o=="function"?a=o("png"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}toggleFullscreen(){const t=this.getHolder();L(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=L(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=A.getSVGElementSize(L(this.mainContainer),{useBBox:!0}),n=L(this.mainContainer).attr("class"),r=L(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(A.getSVGElementSize(L(s),{useBBox:!0}).height)}),i<=t?L(this.mainContainer).attr("height",i):L(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&L(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Va(()=>{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(T.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}}class ft{constructor(t,n,r){if(this.type="",this.renderType=tt.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(L(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(`${ue}--${i}--${this.type}`,!0),n&&n.classed(`${ue}--${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===tt.SVG?"svg":"div"}${r}.${ue}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const o=L(`#${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?at({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:Gm,setPrototypeOf:Vm,isFrozen:Bk,getPrototypeOf:Fk,getOwnPropertyDescriptor:zm}=Object;let{freeze:se,seal:We,create:Wm}=Object,{apply:ou,construct:lu}=typeof Reflect<"u"&&Reflect;se||(se=function(t){return t}),We||(We=function(t){return t}),ou||(ou=function(t,n,r){return t.apply(n,r)}),lu||(lu=function(t,n){return new t(...n)});const no=De(Array.prototype.forEach),Ym=De(Array.prototype.pop),ds=De(Array.prototype.push),ro=De(String.prototype.toLowerCase),cu=De(String.prototype.toString),Hk=De(String.prototype.match),fs=De(String.prototype.replace),Gk=De(String.prototype.indexOf),Vk=De(String.prototype.trim),_e=De(RegExp.prototype.test),ps=zk(TypeError);function De(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return ou(e,t,r)}}function zk(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return lu(e,n)}}function ut(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ro;Vm&&Vm(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(Bk(t)||(t[r]=s),i=s)}e[i]=!0}return e}function Zr(e){const t=Wm(null);for(const[n,r]of Gm(e))zm(e,n)!==void 0&&(t[n]=r);return t}function io(e,t){for(;e!==null;){const r=zm(e,t);if(r){if(r.get)return De(r.get);if(typeof r.value=="function")return De(r.value)}e=Fk(e)}function n(r){return console.warn("fallback value for",r),null}return n}const qm=se(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uu=se(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),hu=se(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Wk=se(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),du=se(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Yk=se(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Xm=se(["#text"]),jm=se(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),fu=se(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Zm=se(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),so=se(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),qk=We(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Xk=We(/<%[\w\W]*|[\w\W]*%>/gm),jk=We(/\${[\w\W]*}/gm),Zk=We(/^data-[\-\w.\u00B7-\uFFFF]/),Kk=We(/^aria-[\-\w]+$/),Km=We(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qk=We(/^(?:\w+script|data):/i),Jk=We(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qm=We(/^html$/i);var Jm=Object.freeze({__proto__:null,MUSTACHE_EXPR:qk,ERB_EXPR:Xk,TMPLIT_EXPR:jk,DATA_ATTR:Zk,ARIA_ATTR:Kk,IS_ALLOWED_URI:Km,IS_SCRIPT_OR_DATA:Qk,ATTR_WHITESPACE:Jk,DOCTYPE_NAME:Qm});const t2=function(){return typeof window>"u"?null:window},e2=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function tv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t2();const t=nt=>tv(nt);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=e,p=l.prototype,g=io(p,"cloneNode"),v=io(p,"nextSibling"),m=io(p,"childNodes"),y=io(p,"parentNode");if(typeof a=="function"){const nt=n.createElement("template");nt.content&&nt.content.ownerDocument&&(n=nt.content.ownerDocument)}let E,_="";const{implementation:S,createNodeIterator:b,createDocumentFragment:M,getElementsByTagName:D}=n,{importNode:G}=r;let I={};t.isSupported=typeof Gm=="function"&&typeof y=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:w,ERB_EXPR:C,TMPLIT_EXPR:R,DATA_ATTR:P,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:B}=Jm;let{IS_ALLOWED_URI:U}=Jm,N=null;const j=ut({},[...qm,...uu,...hu,...du,...Xm]);let Y=null;const it=ut({},[...jm,...fu,...Zm,...so]);let et=Object.seal(Wm(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,Q=null,pt=!0,ot=!0,Tt=!1,Z=!0,F=!1,V=!1,$=!1,mt=!1,gt=!1,Ht=!1,Gt=!1,st=!0,Rt=!1;const ur="user-content-";let Le=!0,xs=!1,ii={},si=null;const n0=ut({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let r0=null;const i0=ut({},["audio","video","img","source","image","track"]);let Xu=null;const s0=ut({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),So="http://www.w3.org/1998/Math/MathML",To="http://www.w3.org/2000/svg",wn="http://www.w3.org/1999/xhtml";let ai=wn,ju=!1,Zu=null;const vF=ut({},[So,To,wn],cu);let hr=null;const yF=["application/xhtml+xml","text/html"],EF="text/html";let Yt=null,oi=null;const xF=n.createElement("form"),a0=function(k){return k instanceof RegExp||k instanceof Function},Ku=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(oi&&oi===k)){if((!k||typeof k!="object")&&(k={}),k=Zr(k),hr=yF.indexOf(k.PARSER_MEDIA_TYPE)===-1?hr=EF:hr=k.PARSER_MEDIA_TYPE,Yt=hr==="application/xhtml+xml"?cu:ro,N="ALLOWED_TAGS"in k?ut({},k.ALLOWED_TAGS,Yt):j,Y="ALLOWED_ATTR"in k?ut({},k.ALLOWED_ATTR,Yt):it,Zu="ALLOWED_NAMESPACES"in k?ut({},k.ALLOWED_NAMESPACES,cu):vF,Xu="ADD_URI_SAFE_ATTR"in k?ut(Zr(s0),k.ADD_URI_SAFE_ATTR,Yt):s0,r0="ADD_DATA_URI_TAGS"in k?ut(Zr(i0),k.ADD_DATA_URI_TAGS,Yt):i0,si="FORBID_CONTENTS"in k?ut({},k.FORBID_CONTENTS,Yt):n0,q="FORBID_TAGS"in k?ut({},k.FORBID_TAGS,Yt):{},Q="FORBID_ATTR"in k?ut({},k.FORBID_ATTR,Yt):{},ii="USE_PROFILES"in k?k.USE_PROFILES:!1,pt=k.ALLOW_ARIA_ATTR!==!1,ot=k.ALLOW_DATA_ATTR!==!1,Tt=k.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,F=k.SAFE_FOR_TEMPLATES||!1,V=k.WHOLE_DOCUMENT||!1,gt=k.RETURN_DOM||!1,Ht=k.RETURN_DOM_FRAGMENT||!1,Gt=k.RETURN_TRUSTED_TYPE||!1,mt=k.FORCE_BODY||!1,st=k.SANITIZE_DOM!==!1,Rt=k.SANITIZE_NAMED_PROPS||!1,Le=k.KEEP_CONTENT!==!1,xs=k.IN_PLACE||!1,U=k.ALLOWED_URI_REGEXP||Km,ai=k.NAMESPACE||wn,et=k.CUSTOM_ELEMENT_HANDLING||{},k.CUSTOM_ELEMENT_HANDLING&&a0(k.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(et.tagNameCheck=k.CUSTOM_ELEMENT_HANDLING.tagNameCheck),k.CUSTOM_ELEMENT_HANDLING&&a0(k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(et.attributeNameCheck=k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),F&&(ot=!1),Ht&&(gt=!0),ii&&(N=ut({},[...Xm]),Y=[],ii.html===!0&&(ut(N,qm),ut(Y,jm)),ii.svg===!0&&(ut(N,uu),ut(Y,fu),ut(Y,so)),ii.svgFilters===!0&&(ut(N,hu),ut(Y,fu),ut(Y,so)),ii.mathMl===!0&&(ut(N,du),ut(Y,Zm),ut(Y,so))),k.ADD_TAGS&&(N===j&&(N=Zr(N)),ut(N,k.ADD_TAGS,Yt)),k.ADD_ATTR&&(Y===it&&(Y=Zr(Y)),ut(Y,k.ADD_ATTR,Yt)),k.ADD_URI_SAFE_ATTR&&ut(Xu,k.ADD_URI_SAFE_ATTR,Yt),k.FORBID_CONTENTS&&(si===n0&&(si=Zr(si)),ut(si,k.FORBID_CONTENTS,Yt)),Le&&(N["#text"]=!0),V&&ut(N,["html","head","body"]),N.table&&(ut(N,["tbody"]),delete q.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw ps('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ps('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=k.TRUSTED_TYPES_POLICY,_=E.createHTML("")}else E===void 0&&(E=e2(f,i)),E!==null&&typeof _=="string"&&(_=E.createHTML(""));se&&se(k),oi=k}},o0=ut({},["mi","mo","mn","ms","mtext"]),l0=ut({},["foreignobject","desc","title","annotation-xml"]),bF=ut({},["title","style","font","a","script"]),wo=ut({},uu);ut(wo,hu),ut(wo,Wk);const Qu=ut({},du);ut(Qu,Yk);const _F=function(k){let X=y(k);(!X||!X.tagName)&&(X={namespaceURI:ai,tagName:"template"});const J=ro(k.tagName),Dt=ro(X.tagName);return Zu[k.namespaceURI]?k.namespaceURI===To?X.namespaceURI===wn?J==="svg":X.namespaceURI===So?J==="svg"&&(Dt==="annotation-xml"||o0[Dt]):!!wo[J]:k.namespaceURI===So?X.namespaceURI===wn?J==="math":X.namespaceURI===To?J==="math"&&l0[Dt]:!!Qu[J]:k.namespaceURI===wn?X.namespaceURI===To&&!l0[Dt]||X.namespaceURI===So&&!o0[Dt]?!1:!Qu[J]&&(bF[J]||!wo[J]):!!(hr==="application/xhtml+xml"&&Zu[k.namespaceURI]):!1},dr=function(k){ds(t.removed,{element:k});try{k.parentNode.removeChild(k)}catch{k.remove()}},Ju=function(k,X){try{ds(t.removed,{attribute:X.getAttributeNode(k),from:X})}catch{ds(t.removed,{attribute:null,from:X})}if(X.removeAttribute(k),k==="is"&&!Y[k])if(gt||Ht)try{dr(X)}catch{}else try{X.setAttribute(k,"")}catch{}},c0=function(k){let X=null,J=null;if(mt)k="<remove></remove>"+k;else{const ne=Hk(k,/^[\r\n\t ]+/);J=ne&&ne[0]}hr==="application/xhtml+xml"&&ai===wn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const Dt=E?E.createHTML(k):k;if(ai===wn)try{X=new h().parseFromString(Dt,hr)}catch{}if(!X||!X.documentElement){X=S.createDocument(ai,"template",null);try{X.documentElement.innerHTML=ju?_:Dt}catch{}}const ee=X.body||X.documentElement;return k&&J&&ee.insertBefore(n.createTextNode(J),ee.childNodes[0]||null),ai===wn?D.call(X,V?"html":"body")[0]:V?X.documentElement:ee},u0=function(k){return b.call(k.ownerDocument||k,k,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null)},SF=function(k){return k instanceof d&&(typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||!(k.attributes instanceof u)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function")},h0=function(k){return typeof o=="function"&&k instanceof o},On=function(k,X,J){I[k]&&no(I[k],Dt=>{Dt.call(t,X,J,oi)})},d0=function(k){let X=null;if(On("beforeSanitizeElements",k,null),SF(k))return dr(k),!0;const J=Yt(k.nodeName);if(On("uponSanitizeElement",k,{tagName:J,allowedTags:N}),k.hasChildNodes()&&!h0(k.firstElementChild)&&_e(/<[/\w]/g,k.innerHTML)&&_e(/<[/\w]/g,k.textContent))return dr(k),!0;if(!N[J]||q[J]){if(!q[J]&&p0(J)&&(et.tagNameCheck instanceof RegExp&&_e(et.tagNameCheck,J)||et.tagNameCheck instanceof Function&&et.tagNameCheck(J)))return!1;if(Le&&!si[J]){const Dt=y(k)||k.parentNode,ee=m(k)||k.childNodes;if(ee&&Dt){const ne=ee.length;for(let pe=ne-1;pe>=0;--pe)Dt.insertBefore(g(ee[pe],!0),v(k))}}return dr(k),!0}return k instanceof l&&!_F(k)||(J==="noscript"||J==="noembed"||J==="noframes")&&_e(/<\/no(script|embed|frames)/i,k.innerHTML)?(dr(k),!0):(F&&k.nodeType===3&&(X=k.textContent,no([w,C,R],Dt=>{X=fs(X,Dt," ")}),k.textContent!==X&&(ds(t.removed,{element:k.cloneNode()}),k.textContent=X)),On("afterSanitizeElements",k,null),!1)},f0=function(k,X,J){if(st&&(X==="id"||X==="name")&&(J in n||J in xF))return!1;if(!(ot&&!Q[X]&&_e(P,X))){if(!(pt&&_e(O,X))){if(!Y[X]||Q[X]){if(!(p0(k)&&(et.tagNameCheck instanceof RegExp&&_e(et.tagNameCheck,k)||et.tagNameCheck instanceof Function&&et.tagNameCheck(k))&&(et.attributeNameCheck instanceof RegExp&&_e(et.attributeNameCheck,X)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(X))||X==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&_e(et.tagNameCheck,J)||et.tagNameCheck instanceof Function&&et.tagNameCheck(J))))return!1}else if(!Xu[X]){if(!_e(U,fs(J,B,""))){if(!((X==="src"||X==="xlink:href"||X==="href")&&k!=="script"&&Gk(J,"data:")===0&&r0[k])){if(!(Tt&&!_e(H,fs(J,B,"")))){if(J)return!1}}}}}}return!0},p0=function(k){return k.indexOf("-")>0},g0=function(k){On("beforeSanitizeAttributes",k,null);const{attributes:X}=k;if(!X)return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y};let Dt=X.length;for(;Dt--;){const ee=X[Dt],{name:ne,namespaceURI:pe,value:fr}=ee,bs=Yt(ne);let ge=ne==="value"?fr:Vk(fr);if(J.attrName=bs,J.attrValue=ge,J.keepAttr=!0,J.forceKeepAttr=void 0,On("uponSanitizeAttribute",k,J),ge=J.attrValue,J.forceKeepAttr||(Ju(ne,k),!J.keepAttr))continue;if(!Z&&_e(/\/>/i,ge)){Ju(ne,k);continue}F&&no([w,C,R],v0=>{ge=fs(ge,v0," ")});const m0=Yt(k.nodeName);if(f0(m0,bs,ge)){if(Rt&&(bs==="id"||bs==="name")&&(Ju(ne,k),ge=ur+ge),E&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!pe)switch(f.getAttributeType(m0,bs)){case"TrustedHTML":{ge=E.createHTML(ge);break}case"TrustedScriptURL":{ge=E.createScriptURL(ge);break}}try{pe?k.setAttributeNS(pe,ne,ge):k.setAttribute(ne,ge),Ym(t.removed)}catch{}}}On("afterSanitizeAttributes",k,null)},TF=function nt(k){let X=null;const J=u0(k);for(On("beforeSanitizeShadowDOM",k,null);X=J.nextNode();)On("uponSanitizeShadowNode",X,null),!d0(X)&&(X.content instanceof s&&nt(X.content),g0(X));On("afterSanitizeShadowDOM",k,null)};return t.sanitize=function(nt){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=null,J=null,Dt=null,ee=null;if(ju=!nt,ju&&(nt="<!-->"),typeof nt!="string"&&!h0(nt))if(typeof nt.toString=="function"){if(nt=nt.toString(),typeof nt!="string")throw ps("dirty is not a string, aborting")}else throw ps("toString is not a function");if(!t.isSupported)return nt;if($||Ku(k),t.removed=[],typeof nt=="string"&&(xs=!1),xs){if(nt.nodeName){const fr=Yt(nt.nodeName);if(!N[fr]||q[fr])throw ps("root node is forbidden and cannot be sanitized in-place")}}else if(nt instanceof o)X=c0("<!---->"),J=X.ownerDocument.importNode(nt,!0),J.nodeType===1&&J.nodeName==="BODY"||J.nodeName==="HTML"?X=J:X.appendChild(J);else{if(!gt&&!F&&!V&&nt.indexOf("<")===-1)return E&&Gt?E.createHTML(nt):nt;if(X=c0(nt),!X)return gt?null:Gt?_:""}X&&mt&&dr(X.firstChild);const ne=u0(xs?nt:X);for(;Dt=ne.nextNode();)d0(Dt)||(Dt.content instanceof s&&TF(Dt.content),g0(Dt));if(xs)return nt;if(gt){if(Ht)for(ee=M.call(X.ownerDocument);X.firstChild;)ee.appendChild(X.firstChild);else ee=X;return(Y.shadowroot||Y.shadowrootmode)&&(ee=G.call(r,ee,!0)),ee}let pe=V?X.outerHTML:X.innerHTML;return V&&N["!doctype"]&&X.ownerDocument&&X.ownerDocument.doctype&&X.ownerDocument.doctype.name&&_e(Qm,X.ownerDocument.doctype.name)&&(pe="<!DOCTYPE "+X.ownerDocument.doctype.name+`>
4
- `+pe),F&&no([w,C,R],fr=>{pe=fs(pe,fr," ")}),E&&Gt?E.createHTML(pe):pe},t.setConfig=function(){let nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ku(nt),$=!0},t.clearConfig=function(){oi=null,$=!1},t.isValidAttribute=function(nt,k,X){oi||Ku({});const J=Yt(nt),Dt=Yt(k);return f0(J,Dt,X)},t.addHook=function(nt,k){typeof k=="function"&&(I[nt]=I[nt]||[],ds(I[nt],k))},t.removeHook=function(nt){if(I[nt])return Ym(I[nt])},t.removeHooks=function(nt){I[nt]&&(I[nt]=[])},t.removeAllHooks=function(){I={}},t}var pu=tv();const ao=e=>pu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),n2=e=>pu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),rn=e=>pu.sanitize(e,{ALLOWED_TAGS:[]}),bo=class bo extends ft{constructor(){super(...arguments),this.type="toolbar",this.renderType=tt.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(T.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(T.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"),l=this;o.merge(a).classed("disabled",c=>c.shouldBeDisabled()).attr("aria-disabled",c=>c.shouldBeDisabled()).attr("aria-label",c=>c.title).html(c=>`
1
+ (function(W,Re){typeof exports=="object"&&typeof module<"u"?Re(exports):typeof define=="function"&&define.amd?define(["exports"],Re):(W=typeof globalThis<"u"?globalThis:W||self,Re(W.Charts={}))})(this,function(W){"use strict";function Re(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function y0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Oo(e){let t,n,r;e.length!==2?(t=Re,n=(o,l)=>Re(e(o),l),r=(o,l)=>e(o)-l):(t=e===Re||e===y0?e:E0,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 E0(){return 0}function x0(e){return e===null?NaN:+e}function*b0(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 _0=Oo(Re).right;Oo(x0).center;const Mo=_0;function S0(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 Ie(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 Nn{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 th extends Map{constructor(t,n=O0){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(eh(this,t))}has(t){return super.has(eh(this,t))}set(t,n){return super.set(T0(this,t),n)}delete(t){return super.delete(w0(this,t))}}function eh({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function T0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function w0({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function O0(e){return e!==null&&typeof e=="object"?e.valueOf():e}function M0(e){return e}function A0(e=Re){if(e===Re)return nh;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 nh(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var C0=Array.prototype,D0=C0.slice;function Ao(e){return()=>e}const L0=Math.sqrt(50),R0=Math.sqrt(10),I0=Math.sqrt(2);function _s(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>=L0?10:s>=R0?5:s>=I0?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?_s(e,t,n*2):[o,l,c]}function Ss(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?_s(t,e,n):_s(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 pr(e,t,n){return t=+t,e=+e,n=+n,_s(e,t,n)[2]}function Co(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?pr(t,e,n):pr(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function k0(e,t,n){let r;for(;;){const i=pr(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 P0(e){return Math.max(1,Math.ceil(Math.log(S0(e))/Math.LN2)+1)}function $0(){var e=M0,t=Ie,n=P0;function r(i){Array.isArray(i)||(i=Array.from(i));var s,a=i.length,o,l,c=new Array(a);for(s=0;s<a;++s)c[s]=e(i[s],s,i);var u=t(c),d=u[0],h=u[1],f=n(c,d,h);if(!Array.isArray(f)){const E=h,_=+f;if(t===Ie&&([d,h]=k0(d,h,_)),f=Ss(d,h,_),f[0]<=d&&(l=pr(d,h,_)),f[f.length-1]>=h)if(E>=h&&t===Ie){const S=pr(d,h,_);isFinite(S)&&(S>0?h=(Math.floor(h/S)+1)*S:S<0&&(h=(Math.ceil(h*-S)+1)/-S))}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 E=Math.floor((d-o)*l);m[Math.min(p,E+(f[E]<=o))].push(i[s])}}}else for(s=0;s<a;++s)(o=c[s])!=null&&d<=o&&o<=h&&m[Mo(f,o,0,p)].push(i[s]);return m}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Ao(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Ao([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Ao(Array.isArray(i)?D0.call(i):i),r):n},r}function Un(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function Mn(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function rh(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?nh:A0(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));rh(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(li(e,n,t),i(e[r],s)>0&&li(e,n,r);a<o;){for(li(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?li(e,n,o):(++o,li(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function li(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Do(e,t,n){if(e=Float64Array.from(b0(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Mn(e);if(t>=1)return Un(e);var r,i=(r-1)*t,s=Math.floor(i),a=Un(rh(e,s).subarray(0,s+1)),o=Mn(e.subarray(s+1));return a+(o-a)*(i-s)}}function*N0(e){for(const t of e)yield*t}function ih(e){return Array.from(N0(e))}function U0(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function B0(e){return e}var Ts=1,ws=2,Lo=3,ci=4,sh=1e-6;function F0(e){return"translate("+e+",0)"}function H0(e){return"translate(0,"+e+")"}function G0(e){return t=>+e(t)}function V0(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function z0(){return!this.__axis}function Os(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===Ts||e===ci?-1:1,u=e===ci||e===ws?"x":"y",d=e===Ts||e===Lo?F0:H0;function h(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):B0),v=Math.max(s,0)+o,m=t.range(),y=+m[0]+l,E=+m[m.length-1]+l,_=(t.bandwidth?V0:G0)(t.copy(),l),S=f.selection?f.selection():f,b=S.selectAll(".domain").data([null]),M=S.selectAll(".tick").data(p,t).order(),D=M.exit(),G=M.enter().append("g").attr("class","tick"),I=M.select("line"),w=M.select("text");b=b.merge(b.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)),w=w.merge(G.append("text").attr("fill","currentColor").attr(u,c*v).attr("dy",e===Ts?"0em":e===Lo?"0.71em":"0.32em")),f!==S&&(b=b.transition(f),M=M.transition(f),I=I.transition(f),w=w.transition(f),D=D.transition(f).attr("opacity",sh).attr("transform",function(C){return isFinite(C=_(C))?d(C+l):this.getAttribute("transform")}),G.attr("opacity",sh).attr("transform",function(C){var R=this.parentNode.__axis;return d((R&&isFinite(R=R(C))?R:_(C))+l)})),D.remove(),b.attr("d",e===ci||e===ws?a?"M"+c*a+","+y+"H"+l+"V"+E+"H"+c*a:"M"+l+","+y+"V"+E:a?"M"+y+","+c*a+"V"+l+"H"+E+"V"+c*a:"M"+y+","+l+"H"+E),M.attr("opacity",1).attr("transform",function(C){return d(_(C)+l)}),I.attr(u+"2",c*s),w.attr(u,c*v).text(g),S.filter(z0).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===ws?"start":e===ci?"end":"middle"),S.each(function(){this.__axis=_})}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 W0(e){return Os(Ts,e)}function Y0(e){return Os(ws,e)}function Ro(e){return Os(Lo,e)}function ah(e){return Os(ci,e)}var q0={value:()=>{}};function Io(){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 Ms(n)}function Ms(e){this._=e}function X0(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ms.prototype=Io.prototype={constructor:Ms,on:function(e,t){var n=this._,r=X0(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=j0(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]=oh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=oh(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 Ms(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 j0(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function oh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=q0,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ko="http://www.w3.org/1999/xhtml";const lh={svg:"http://www.w3.org/2000/svg",xhtml:ko,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function As(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),lh.hasOwnProperty(t)?{space:lh[t],local:e}:e}function Z0(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ko&&t.documentElement.namespaceURI===ko?t.createElement(e):t.createElementNS(n,e)}}function K0(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ch(e){var t=As(e);return(t.local?K0:Z0)(t)}function Q0(){}function Po(e){return e==null?Q0:function(){return this.querySelector(e)}}function J0(e){typeof e!="function"&&(e=Po(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 me(r,this._parents)}function ty(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ey(){return[]}function uh(e){return e==null?ey:function(){return this.querySelectorAll(e)}}function ny(e){return function(){return ty(e.apply(this,arguments))}}function ry(e){typeof e=="function"?e=ny(e):e=uh(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 me(r,i)}function hh(e){return function(){return this.matches(e)}}function dh(e){return function(t){return t.matches(e)}}var iy=Array.prototype.find;function sy(e){return function(){return iy.call(this.children,e)}}function ay(){return this.firstElementChild}function oy(e){return this.select(e==null?ay:sy(typeof e=="function"?e:dh(e)))}var ly=Array.prototype.filter;function cy(){return Array.from(this.children)}function uy(e){return function(){return ly.call(this.children,e)}}function hy(e){return this.selectAll(e==null?cy:uy(typeof e=="function"?e:dh(e)))}function dy(e){typeof e!="function"&&(e=hh(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 me(r,this._parents)}function fh(e){return new Array(e.length)}function fy(){return new me(this._enter||this._groups.map(fh),this._parents)}function Cs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Cs.prototype={constructor:Cs,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 py(e){return function(){return e}}function gy(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 Cs(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function my(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 Cs(e,s[o]);for(o=0;o<u;++o)(l=t[o])&&c.get(h[o])===l&&(i[o]=l)}function vy(e){return e.__data__}function yy(e,t){if(!arguments.length)return Array.from(this,vy);var n=t?my:gy,r=this._parents,i=this._groups;typeof e!="function"&&(e=py(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=Ey(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,E=0,_,S;y<p;++y)if(_=g[y]){for(y>=E&&(E=y+1);!(S=v[E])&&++E<p;);_._next=S||null}}return a=new me(a,r),a._enter=o,a._exit=l,a}function Ey(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xy(){return new me(this._exit||this._groups.map(fh),this._parents)}function by(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 _y(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 me(o,this._parents)}function Sy(){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 Ty(e){e||(e=wy);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 me(i,this._parents).order()}function wy(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Oy(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function My(){return Array.from(this)}function Ay(){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 Cy(){let e=0;for(const t of this)++e;return e}function Dy(){return!this.node()}function Ly(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 Ry(e){return function(){this.removeAttribute(e)}}function Iy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ky(e,t){return function(){this.setAttribute(e,t)}}function Py(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function $y(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ny(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Uy(e,t){var n=As(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?Iy:Ry:typeof t=="function"?n.local?Ny:$y:n.local?Py:ky)(n,t))}function ph(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function By(e){return function(){this.style.removeProperty(e)}}function Fy(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Hy(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Gy(e,t,n){return arguments.length>1?this.each((t==null?By:typeof t=="function"?Hy:Fy)(e,t,n??"")):gr(this.node(),e)}function gr(e,t){return e.style.getPropertyValue(t)||ph(e).getComputedStyle(e,null).getPropertyValue(t)}function Vy(e){return function(){delete this[e]}}function zy(e,t){return function(){this[e]=t}}function Wy(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Yy(e,t){return arguments.length>1?this.each((t==null?Vy:typeof t=="function"?Wy:zy)(e,t)):this.node()[e]}function gh(e){return e.trim().split(/^|\s+/)}function $o(e){return e.classList||new mh(e)}function mh(e){this._node=e,this._names=gh(e.getAttribute("class")||"")}mh.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 vh(e,t){for(var n=$o(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function yh(e,t){for(var n=$o(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function qy(e){return function(){vh(this,e)}}function Xy(e){return function(){yh(this,e)}}function jy(e,t){return function(){(t.apply(this,arguments)?vh:yh)(this,e)}}function Zy(e,t){var n=gh(e+"");if(arguments.length<2){for(var r=$o(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?jy:t?qy:Xy)(n,t))}function Ky(){this.textContent=""}function Qy(e){return function(){this.textContent=e}}function Jy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function t1(e){return arguments.length?this.each(e==null?Ky:(typeof e=="function"?Jy:Qy)(e)):this.node().textContent}function e1(){this.innerHTML=""}function n1(e){return function(){this.innerHTML=e}}function r1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function i1(e){return arguments.length?this.each(e==null?e1:(typeof e=="function"?r1:n1)(e)):this.node().innerHTML}function s1(){this.nextSibling&&this.parentNode.appendChild(this)}function a1(){return this.each(s1)}function o1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function l1(){return this.each(o1)}function c1(e){var t=typeof e=="function"?e:ch(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function u1(){return null}function h1(e,t){var n=typeof e=="function"?e:ch(e),r=t==null?u1:typeof t=="function"?t:Po(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function d1(){var e=this.parentNode;e&&e.removeChild(this)}function f1(){return this.each(d1)}function p1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function g1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function m1(e){return this.select(e?g1:p1)}function v1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function y1(e){return function(t){e.call(this,t,this.__data__)}}function E1(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 x1(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 b1(e,t,n){return function(){var r=this.__on,i,s=y1(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 _1(e,t,n){var r=E1(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?b1:x1,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function Eh(e,t,n){var r=ph(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 S1(e,t){return function(){return Eh(this,e,t)}}function T1(e,t){return function(){return Eh(this,e,t.apply(this,arguments))}}function w1(e,t){return this.each((typeof t=="function"?T1:S1)(e,t))}function*O1(){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 xh=[null];function me(e,t){this._groups=e,this._parents=t}function ui(){return new me([[document.documentElement]],xh)}function M1(){return this}me.prototype=ui.prototype={constructor:me,select:J0,selectAll:ry,selectChild:oy,selectChildren:hy,filter:dy,data:yy,enter:fy,exit:xy,join:by,merge:_y,selection:M1,order:Sy,sort:Ty,call:Oy,nodes:My,node:Ay,size:Cy,empty:Dy,each:Ly,attr:Uy,style:Gy,property:Yy,classed:Zy,text:t1,html:i1,raise:a1,lower:l1,append:c1,insert:h1,remove:f1,clone:m1,datum:v1,on:_1,dispatch:w1,[Symbol.iterator]:O1};function L(e){return typeof e=="string"?new me([[document.querySelector(e)]],[document.documentElement]):new me([[e]],xh)}function A1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Bn(e,t){if(e=A1(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 No={capture:!0,passive:!1};function Uo(e){e.preventDefault(),e.stopImmediatePropagation()}function C1(e){var t=e.document.documentElement,n=L(e).on("dragstart.drag",Uo,No);"onselectstart"in t?n.on("selectstart.drag",Uo,No):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function D1(e,t){var n=e.document.documentElement,r=L(e).on("dragstart.drag",null);t&&(r.on("click.drag",Uo,No),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 Bo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bh(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hi(){}var di=.7,Ds=1/di,mr="\\s*([+-]?\\d+)\\s*",fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",L1=/^#([0-9a-f]{3,8})$/,R1=new RegExp(`^rgb\\(${mr},${mr},${mr}\\)$`),I1=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),k1=new RegExp(`^rgba\\(${mr},${mr},${mr},${fi}\\)$`),P1=new RegExp(`^rgba\\(${qe},${qe},${qe},${fi}\\)$`),$1=new RegExp(`^hsl\\(${fi},${qe},${qe}\\)$`),N1=new RegExp(`^hsla\\(${fi},${qe},${qe},${fi}\\)$`),_h={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};Bo(hi,an,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Sh,formatHex:Sh,formatHex8:U1,formatHsl:B1,formatRgb:Th,toString:Th});function Sh(){return this.rgb().formatHex()}function U1(){return this.rgb().formatHex8()}function B1(){return Ch(this).formatHsl()}function Th(){return this.rgb().formatRgb()}function an(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=L1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wh(t):n===3?new le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ls(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ls(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=R1.exec(e))?new le(t[1],t[2],t[3],1):(t=I1.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=k1.exec(e))?Ls(t[1],t[2],t[3],t[4]):(t=P1.exec(e))?Ls(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=$1.exec(e))?Ah(t[1],t[2]/100,t[3]/100,1):(t=N1.exec(e))?Ah(t[1],t[2]/100,t[3]/100,t[4]):_h.hasOwnProperty(e)?wh(_h[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function wh(e){return new le(e>>16&255,e>>8&255,e&255,1)}function Ls(e,t,n,r){return r<=0&&(e=t=n=NaN),new le(e,t,n,r)}function F1(e){return e instanceof hi||(e=an(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Fo(e,t,n,r){return arguments.length===1?F1(e):new le(e,t,n,r??1)}function le(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Bo(le,Fo,bh(hi,{brighter(e){return e=e==null?Ds:Math.pow(Ds,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(Fn(this.r),Fn(this.g),Fn(this.b),Rs(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Oh,formatHex:Oh,formatHex8:H1,formatRgb:Mh,toString:Mh}));function Oh(){return`#${Hn(this.r)}${Hn(this.g)}${Hn(this.b)}`}function H1(){return`#${Hn(this.r)}${Hn(this.g)}${Hn(this.b)}${Hn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mh(){const e=Rs(this.opacity);return`${e===1?"rgb(":"rgba("}${Fn(this.r)}, ${Fn(this.g)}, ${Fn(this.b)}${e===1?")":`, ${e})`}`}function Rs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Hn(e){return e=Fn(e),(e<16?"0":"")+e.toString(16)}function Ah(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ke(e,t,n,r)}function Ch(e){if(e instanceof ke)return new ke(e.h,e.s,e.l,e.opacity);if(e instanceof hi||(e=an(e)),!e)return new ke;if(e instanceof ke)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 ke(a,o,l,e.opacity)}function Ho(e,t,n,r){return arguments.length===1?Ch(e):new ke(e,t,n,r??1)}function ke(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Bo(ke,Ho,bh(hi,{brighter(e){return e=e==null?Ds:Math.pow(Ds,e),new ke(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?di:Math.pow(di,e),new ke(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 le(Go(e>=240?e-240:e+120,i,r),Go(e,i,r),Go(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ke(Dh(this.h),Is(this.s),Is(this.l),Rs(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=Rs(this.opacity);return`${e===1?"hsl(":"hsla("}${Dh(this.h)}, ${Is(this.s)*100}%, ${Is(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Dh(e){return e=(e||0)%360,e<0?e+360:e}function Is(e){return Math.max(0,Math.min(1,e||0))}function Go(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 Vo=e=>()=>e;function G1(e,t){return function(n){return e+n*t}}function V1(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 z1(e){return(e=+e)==1?Lh:function(t,n){return n-t?V1(t,n,e):Vo(isNaN(t)?n:t)}}function Lh(e,t){var n=t-e;return n?G1(e,n):Vo(isNaN(e)?t:e)}const ks=function e(t){var n=z1(t);function r(i,s){var a=n((i=Fo(i)).r,(s=Fo(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Lh(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 W1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function Y1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function q1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=pi(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function X1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ve(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function j1(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=pi(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var zo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wo=new RegExp(zo.source,"g");function Z1(e){return function(){return e}}function K1(e){return function(t){return e(t)+""}}function Rh(e,t){var n=zo.lastIndex=Wo.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=zo.exec(e))&&(i=Wo.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:ve(r,i)})),n=Wo.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?K1(l[0].x):Z1(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)o[(d=l[u]).i]=d.x(c);return o.join("")})}function pi(e,t){var n=typeof t,r;return t==null||n==="boolean"?Vo(t):(n==="number"?ve:n==="string"?(r=an(t))?(t=r,ks):Rh:t instanceof an?ks:t instanceof Date?X1:Y1(t)?W1:Array.isArray(t)?q1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?j1:ve)(e,t)}function Ih(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var kh=180/Math.PI,Yo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ph(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)*kh,skewX:Math.atan(l)*kh,scaleX:a,scaleY:o}}var Ps;function Q1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Yo:Ph(t.a,t.b,t.c,t.d,t.e,t.f)}function J1(e){return e==null||(Ps||(Ps=document.createElementNS("http://www.w3.org/2000/svg","g")),Ps.setAttribute("transform",e),!(e=Ps.transform.baseVal.consolidate()))?Yo:(e=e.matrix,Ph(e.a,e.b,e.c,e.d,e.e,e.f))}function $h(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:ve(c,d)},{i:g-2,x:ve(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:ve(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:ve(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:ve(c,d)},{i:g-2,x:ve(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 tE=$h(Q1,"px, ","px)","deg)"),eE=$h(J1,", ",")",")");function nE(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var vr=0,gi=0,mi=0,Nh=1e3,$s,vi,Ns=0,Gn=0,Us=0,yi=typeof performance=="object"&&performance.now?performance:Date,Uh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qo(){return Gn||(Uh(rE),Gn=yi.now()+Us)}function rE(){Gn=0}function Bs(){this._call=this._time=this._next=null}Bs.prototype=Bh.prototype={constructor:Bs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qo():+n)+(t==null?0:+t),!this._next&&vi!==this&&(vi?vi._next=this:$s=this,vi=this),this._call=e,this._time=n,Xo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xo())}};function Bh(e,t,n){var r=new Bs;return r.restart(e,t,n),r}function iE(){qo(),++vr;for(var e=$s,t;e;)(t=Gn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vr}function Fh(){Gn=(Ns=yi.now())+Us,vr=gi=0;try{iE()}finally{vr=0,aE(),Gn=0}}function sE(){var e=yi.now(),t=e-Ns;t>Nh&&(Us-=t,Ns=e)}function aE(){for(var e,t=$s,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$s=n);vi=e,Xo(r)}function Xo(e){if(!vr){gi&&(gi=clearTimeout(gi));var t=e-Gn;t>24?(e<1/0&&(gi=setTimeout(Fh,e-yi.now()-Us)),mi&&(mi=clearInterval(mi))):(mi||(Ns=yi.now(),mi=setInterval(sE,Nh)),vr=1,Uh(Fh))}}function Hh(e,t,n){var r=new Bs;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var oE=Io("start","end","cancel","interrupt"),lE=[],Gh=0,Vh=1,jo=2,Fs=3,zh=4,Zo=5,Hs=6;function Gs(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;cE(e,n,{name:t,index:r,group:i,on:oE,tween:lE,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Gh})}function Ko(e,t){var n=Pe(e,t);if(n.state>Gh)throw new Error("too late; already scheduled");return n}function Xe(e,t){var n=Pe(e,t);if(n.state>Fs)throw new Error("too late; already running");return n}function Pe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function cE(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bh(s,0,n.time);function s(c){n.state=Vh,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!==Vh)return l();for(u in r)if(f=r[u],f.name===n.name){if(f.state===Fs)return Hh(a);f.state===zh?(f.state=Hs,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=Hs,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(Hh(function(){n.state===Fs&&(n.state=zh,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=jo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===jo){for(n.state=Fs,i=new Array(h=n.tween.length),u=0,d=-1;u<h;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=f);i.length=d+1}}function o(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Zo,1),d=-1,h=i.length;++d<h;)i[d].call(e,u);n.state===Zo&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Hs,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Qo(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>jo&&r.state<Zo,r.state=Hs,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function uE(e){return this.each(function(){Qo(this,e)})}function hE(e,t){var n,r;return function(){var i=Xe(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 dE(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Xe(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 fE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Pe(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?hE:dE)(n,e,t))}function Jo(e,t,n){var r=e._id;return e.each(function(){var i=Xe(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Pe(i,r).value[t]}}function Wh(e,t){var n;return(typeof t=="number"?ve:t instanceof an?ks:(n=an(t))?(t=n,ks):Rh)(e,t)}function pE(e){return function(){this.removeAttribute(e)}}function gE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mE(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 vE(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 yE(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 EE(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 xE(e,t){var n=As(e),r=n==="transform"?eE:Wh;return this.attrTween(e,typeof t=="function"?(n.local?EE:yE)(n,r,Jo(this,"attr."+e,t)):t==null?(n.local?gE:pE)(n):(n.local?vE:mE)(n,r,t))}function bE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function _E(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function SE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&_E(e,s)),n}return i._value=t,i}function TE(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&bE(e,s)),n}return i._value=t,i}function wE(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=As(e);return this.tween(n,(r.local?SE:TE)(r,t))}function OE(e,t){return function(){Ko(this,e).delay=+t.apply(this,arguments)}}function ME(e,t){return t=+t,function(){Ko(this,e).delay=t}}function AE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?OE:ME)(t,e)):Pe(this.node(),t).delay}function CE(e,t){return function(){Xe(this,e).duration=+t.apply(this,arguments)}}function DE(e,t){return t=+t,function(){Xe(this,e).duration=t}}function LE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?CE:DE)(t,e)):Pe(this.node(),t).duration}function RE(e,t){if(typeof t!="function")throw new Error;return function(){Xe(this,e).ease=t}}function IE(e){var t=this._id;return arguments.length?this.each(RE(t,e)):Pe(this.node(),t).ease}function kE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xe(this,e).ease=n}}function PE(e){if(typeof e!="function")throw new Error;return this.each(kE(this._id,e))}function $E(e){typeof e!="function"&&(e=hh(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 on(r,this._parents,this._name,this._id)}function NE(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 on(a,this._parents,this._name,this._id)}function UE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function BE(e,t,n){var r,i,s=UE(t)?Ko:Xe;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function FE(e,t){var n=this._id;return arguments.length<2?Pe(this.node(),n).on.on(e):this.each(BE(n,e,t))}function HE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function GE(){return this.on("end.remove",HE(this._id))}function VE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Po(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,Gs(c[h],t,n,h,c,Pe(u,n)));return new on(s,this._parents,t,n)}function zE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=uh(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=Pe(u,n),g=0,v=h.length;g<v;++g)(f=h[g])&&Gs(f,t,n,g,h,p);s.push(h),a.push(u)}return new on(s,a,t,n)}var WE=ui.prototype.constructor;function YE(){return new WE(this._groups,this._parents)}function qE(e,t){var n,r,i;return function(){var s=gr(this,e),a=(this.style.removeProperty(e),gr(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function Yh(e){return function(){this.style.removeProperty(e)}}function XE(e,t,n){var r,i=n+"",s;return function(){var a=gr(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function jE(e,t,n){var r,i,s;return function(){var a=gr(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),gr(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function ZE(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=Xe(this,e),c=l.on,u=l.value[s]==null?o||(o=Yh(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(a,i=u),l.on=r}}function KE(e,t,n){var r=(e+="")=="transform"?tE:Wh;return t==null?this.styleTween(e,qE(e,r)).on("end.style."+e,Yh(e)):typeof t=="function"?this.styleTween(e,jE(e,r,Jo(this,"style."+e,t))).each(ZE(this._id,e)):this.styleTween(e,XE(e,r,t),n).on("end.style."+e,null)}function QE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function JE(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&QE(e,a,n)),r}return s._value=t,s}function tx(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,JE(e,t,n??""))}function ex(e){return function(){this.textContent=e}}function nx(e){return function(){var t=e(this);this.textContent=t??""}}function rx(e){return this.tween("text",typeof e=="function"?nx(Jo(this,"text",e)):ex(e==null?"":e+""))}function ix(e){return function(t){this.textContent=e.call(this,t)}}function sx(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&ix(i)),t}return r._value=e,r}function ax(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,sx(e))}function ox(){for(var e=this._name,t=this._id,n=qh(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var u=Pe(l,t);Gs(l,e,n,c,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new on(r,this._parents,e,n)}function lx(){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=Xe(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 cx=0;function on(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qh(){return++cx}var ln=ui.prototype;on.prototype={constructor:on,select:VE,selectAll:zE,selectChild:ln.selectChild,selectChildren:ln.selectChildren,filter:$E,merge:NE,selection:YE,transition:ox,call:ln.call,nodes:ln.nodes,node:ln.node,size:ln.size,empty:ln.empty,each:ln.each,on:FE,attr:xE,attrTween:wE,style:KE,styleTween:tx,text:rx,textTween:ax,remove:GE,tween:fE,delay:AE,duration:LE,ease:IE,easeVarying:PE,end:lx,[Symbol.iterator]:ln[Symbol.iterator]};const ux=e=>+e;function Xh(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var hx={time:null,delay:0,duration:250,ease:Xh};function dx(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 fx(e){var t,n;e instanceof on?(t=e._id,e=e._name):(t=qh(),(n=hx).time=qo(),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])&&Gs(l,e,t,c,a,n||dx(l,t));return new on(r,this._parents,e,t)}ui.prototype.interrupt=uE,ui.prototype.transition=fx;const tl=e=>()=>e;function px(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 gx(e){e.stopImmediatePropagation()}function el(e){e.preventDefault(),e.stopImmediatePropagation()}var jh={name:"drag"},nl={name:"space"},yr={name:"handle"},Er={name:"center"};const{abs:Zh,max:Zt,min:Kt}=Math;function Kh(e){return[+e[0],+e[1]]}function Qh(e){return[Kh(e[0]),Kh(e[1])]}var Vs={name:"x",handles:["w","e"].map(zs),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]]}},rl={name:"y",handles:["n","s"].map(zs),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]]}},cn={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"},Jh={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},td={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},mx={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},vx={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function zs(e){return{type:e}}function yx(e){return!e.ctrlKey&&!e.button}function Ex(){var e=this.ownerSVGElement||this;return e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]}function xx(){return navigator.maxTouchPoints||"ontouchstart"in this}function il(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function bx(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function ed(){return _x(Vs)}function _x(e){var t=Ex,n=yx,r=xx,i=!0,s=Io("start","brush","end"),a=6,o;function l(v){var m=v.property("__brush",g).selectAll(".overlay").data([zs("overlay")]);m.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",cn.overlay).merge(m).each(function(){var E=il(this).extent;L(this).attr("x",E[0][0]).attr("y",E[0][1]).attr("width",E[1][0]-E[0][0]).attr("height",E[1][1]-E[0][1])}),v.selectAll(".selection").data([zs("selection")]).enter().append("rect").attr("class","selection").attr("cursor",cn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var y=v.selectAll(".handle").data(e.handles,function(E){return E.type});y.exit().remove(),y.enter().append("rect").attr("class",function(E){return"handle handle--"+E.type}).attr("cursor",function(E){return cn[E.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(E){u(this,arguments).beforestart().start(E)}).on("interrupt.brush end.brush",function(E){u(this,arguments).end(E)}).tween("brush",function(){var E=this,_=E.__brush,S=u(E,arguments),b=_.selection,M=e.input(typeof m=="function"?m.apply(this,arguments):m,_.extent),D=pi(b,M);function G(I){_.selection=I===1&&M===null?null:D(I),c.call(E),S.brush()}return b!==null&&M!==null?G:G(1)}):v.each(function(){var E=this,_=arguments,S=E.__brush,b=e.input(typeof m=="function"?m.apply(E,_):m,S.extent),M=u(E,_).beforestart();Qo(E),S.selection=b===null?null:b,c.call(E),M.start(y).brush(y).end(y)})},l.clear=function(v,m){l.move(v,null,m)};function c(){var v=L(this),m=il(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 E=v.__brush.emitter;return E&&(!y||!E.clean)?E: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 E=L(this.that).datum();s.call(v,this.that,new px(v,{sourceEvent:m,target:l,selection:e.output(this.state.selection),mode:y,dispatch:s}),E)}};function h(v){if(o&&!v.touches||!n.apply(this,arguments))return;var m=this,y=v.target.__data__.type,E=(i&&v.metaKey?y="overlay":y)==="selection"?jh:i&&v.altKey?Er:yr,_=e===rl?null:mx[y],S=e===Vs?null:vx[y],b=il(m),M=b.extent,D=b.selection,G=M[0][0],I,w,C=M[0][1],R,P,O=M[1][0],H,B,U=M[1][1],N,j,Y=0,it=0,et,q=_&&S&&i&&v.shiftKey,Q,pt,ot=Array.from(v.touches||[v],st=>{const Rt=st.identifier;return st=Bn(st,m),st.point0=st.slice(),st.identifier=Rt,st});Qo(m);var Tt=u(m,arguments,!0).beforestart();if(y==="overlay"){D&&(et=!0);const st=[ot[0],ot[1]||ot[0]];b.selection=D=[[I=e===rl?G:Kt(st[0][0],st[1][0]),R=e===Vs?C:Kt(st[0][1],st[1][1])],[H=e===rl?O:Zt(st[0][0],st[1][0]),N=e===Vs?U:Zt(st[0][1],st[1][1])]],ot.length>1&&mt(v)}else I=D[0][0],R=D[0][1],H=D[1][0],N=D[1][1];w=I,P=R,B=H,j=N;var Z=L(m).attr("pointer-events","none"),F=Z.selectAll(".overlay").attr("cursor",cn[y]);if(v.touches)Tt.moved=$,Tt.ended=gt;else{var V=L(v.view).on("mousemove.brush",$,!0).on("mouseup.brush",gt,!0);i&&V.on("keydown.brush",Ht,!0).on("keyup.brush",Gt,!0),C1(v.view)}c.call(m),Tt.start(v,E.name);function $(st){for(const Rt of st.changedTouches||[st])for(const ur of ot)ur.identifier===Rt.identifier&&(ur.cur=Bn(Rt,m));if(q&&!Q&&!pt&&ot.length===1){const Rt=ot[0];Zh(Rt.cur[0]-Rt[0])>Zh(Rt.cur[1]-Rt[1])?pt=!0:Q=!0}for(const Rt of ot)Rt.cur&&(Rt[0]=Rt.cur[0],Rt[1]=Rt.cur[1]);et=!0,el(st),mt(st)}function mt(st){const Rt=ot[0],ur=Rt.point0;var Le;switch(Y=Rt[0]-ur[0],it=Rt[1]-ur[1],E){case nl:case jh:{_&&(Y=Zt(G-I,Kt(O-H,Y)),w=I+Y,B=H+Y),S&&(it=Zt(C-R,Kt(U-N,it)),P=R+it,j=N+it);break}case yr:{ot[1]?(_&&(w=Zt(G,Kt(O,ot[0][0])),B=Zt(G,Kt(O,ot[1][0])),_=1),S&&(P=Zt(C,Kt(U,ot[0][1])),j=Zt(C,Kt(U,ot[1][1])),S=1)):(_<0?(Y=Zt(G-I,Kt(O-I,Y)),w=I+Y,B=H):_>0&&(Y=Zt(G-H,Kt(O-H,Y)),w=I,B=H+Y),S<0?(it=Zt(C-R,Kt(U-R,it)),P=R+it,j=N):S>0&&(it=Zt(C-N,Kt(U-N,it)),P=R,j=N+it));break}case Er:{_&&(w=Zt(G,Kt(O,I-Y*_)),B=Zt(G,Kt(O,H+Y*_))),S&&(P=Zt(C,Kt(U,R-it*S)),j=Zt(C,Kt(U,N+it*S)));break}}B<w&&(_*=-1,Le=I,I=H,H=Le,Le=w,w=B,B=Le,y in Jh&&F.attr("cursor",cn[y=Jh[y]])),j<P&&(S*=-1,Le=R,R=N,N=Le,Le=P,P=j,j=Le,y in td&&F.attr("cursor",cn[y=td[y]])),b.selection&&(D=b.selection),Q&&(w=D[0][0],B=D[1][0]),pt&&(P=D[0][1],j=D[1][1]),(D[0][0]!==w||D[0][1]!==P||D[1][0]!==B||D[1][1]!==j)&&(b.selection=[[w,P],[B,j]],c.call(m),Tt.brush(st,E.name))}function gt(st){if(gx(st),st.touches){if(st.touches.length)return;o&&clearTimeout(o),o=setTimeout(function(){o=null},500)}else D1(st.view,et),V.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);Z.attr("pointer-events","all"),F.attr("cursor",cn.overlay),b.selection&&(D=b.selection),bx(D)&&(b.selection=null,c.call(m)),Tt.end(st,E.name)}function Ht(st){switch(st.keyCode){case 16:{q=_&&S;break}case 18:{E===yr&&(_&&(H=B-Y*_,I=w+Y*_),S&&(N=j-it*S,R=P+it*S),E=Er,mt(st));break}case 32:{(E===yr||E===Er)&&(_<0?H=B-Y:_>0&&(I=w-Y),S<0?N=j-it:S>0&&(R=P-it),E=nl,F.attr("cursor",cn.selection),mt(st));break}default:return}el(st)}function Gt(st){switch(st.keyCode){case 16:{q&&(Q=pt=q=!1,mt(st));break}case 18:{E===Er&&(_<0?H=B:_>0&&(I=w),S<0?N=j:S>0&&(R=P),E=yr,mt(st));break}case 32:{E===nl&&(st.altKey?(_&&(H=B-Y*_,I=w+Y*_),S&&(N=j-it*S,R=P+it*S),E=Er):(_<0?H=B:_>0&&(I=w),S<0?N=j:S>0&&(R=P),E=yr),F.attr("cursor",cn[y]),mt(st));break}default:return}el(st)}}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=Qh(t.apply(this,arguments)),v.dim=e,v}return l.extent=function(v){return arguments.length?(t=typeof v=="function"?v:tl(Qh(v)),l):t},l.filter=function(v){return arguments.length?(n=typeof v=="function"?v:tl(!!v),l):n},l.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:tl(!!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 sl=Math.PI,al=2*sl,Vn=1e-6,Sx=al-Vn;function nd(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Tx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return nd;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 wx=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?nd:Tx(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>Vn)if(!(Math.abs(d*l-c*u)>Vn)||!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),E=s*Math.tan((sl-Math.acos((g+h-v)/(2*m*y)))/2),_=E/y,S=E/m;Math.abs(_-1)>Vn&&this._append`L${t+_*u},${n+_*d}`,this._append`A${s},${s},0,0,${+(d*f>u*p)},${this._x1=t+S*l},${this._y1=n+S*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)>Vn||Math.abs(this._y1-u)>Vn)&&this._append`L${c},${u}`,r&&(h<0&&(h=h%al+al),h>Sx?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>Vn&&this._append`A${r},${r},0,${+(h>=sl)},${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 Ox(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ws(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 xr(e){return e=Ws(Math.abs(e)),e?e[1]:NaN}function Mx(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 Ax(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Cx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ei(e){if(!(t=Cx.exec(e)))throw new Error("invalid format: "+e);var t;return new ol({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]})}Ei.prototype=ol.prototype;function ol(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+""}ol.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 Dx(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 rd;function Lx(e,t){var n=Ws(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(rd=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")+Ws(e,Math.max(0,t+s-1))[0]}function id(e,t){var n=Ws(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 sd={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ox,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)=>id(e*100,t),r:id,s:Lx,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ad(e){return e}var od=Array.prototype.map,ld=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rx(e){var t=e.grouping===void 0||e.thousands===void 0?ad:Mx(od.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?ad:Ax(od.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=Ei(d);var h=d.fill,f=d.align,p=d.sign,g=d.symbol,v=d.zero,m=d.width,y=d.comma,E=d.precision,_=d.trim,S=d.type;S==="n"?(y=!0,S="g"):sd[S]||(E===void 0&&(E=12),_=!0,S="g"),(v||h==="0"&&f==="=")&&(v=!0,h="0",f="=");var b=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",M=g==="$"?r:/[%p]/.test(S)?a:"",D=sd[S],G=/[defgprs%]/.test(S);E=E===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function I(w){var C=b,R=M,P,O,H;if(S==="c")R=D(w)+R,w="";else{w=+w;var B=w<0||1/w<0;if(w=isNaN(w)?l:D(Math.abs(w),E),_&&(w=Dx(w)),B&&+w==0&&p!=="+"&&(B=!1),C=(B?p==="("?p:o:p==="-"||p==="("?"":p)+C,R=(S==="s"?ld[8+rd/3]:"")+R+(B&&p==="("?")":""),G){for(P=-1,O=w.length;++P<O;)if(H=w.charCodeAt(P),48>H||H>57){R=(H===46?i+w.slice(P+1):w.slice(P))+R,w=w.slice(0,P);break}}}y&&!v&&(w=t(w,1/0));var U=C.length+w.length+R.length,N=U<m?new Array(m-U+1).join(h):"";switch(y&&v&&(w=t(N+w,N.length?m-R.length:1/0),N=""),f){case"<":w=C+w+R+N;break;case"=":w=C+N+w+R;break;case"^":w=N.slice(0,U=N.length>>1)+C+w+R+N.slice(U);break;default:w=N+C+w+R;break}return s(w)}return I.toString=function(){return d+""},I}function u(d,h){var f=c((d=Ei(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(xr(h)/3)))*3,g=Math.pow(10,-p),v=ld[8+p/3];return function(m){return f(g*m)+v}}return{format:c,formatPrefix:u}}var Ys,ll,cd;Ix({thousands:",",grouping:[3],currency:["$",""]});function Ix(e){return Ys=Rx(e),ll=Ys.format,cd=Ys.formatPrefix,Ys}function kx(e){return Math.max(0,-xr(Math.abs(e)))}function Px(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xr(t)/3)))*3-xr(Math.abs(e)))}function $x(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,xr(t)-xr(e))+1}var xt=1e-6,ud=1e-12,dt=Math.PI,ce=dt/2,hd=dt/4,ye=dt*2,re=180/dt,$t=dt/180,bt=Math.abs,dd=Math.atan,zn=Math.atan2,St=Math.cos,Nx=Math.exp,Ux=Math.log,Et=Math.sin,An=Math.sign||function(e){return e>0?1:e<0?-1:0},$e=Math.sqrt,Bx=Math.tan;function Fx(e){return e>1?0:e<-1?dt:Math.acos(e)}function un(e){return e>1?ce:e<-1?-ce:Math.asin(e)}function Te(){}function qs(e,t){e&&pd.hasOwnProperty(e.type)&&pd[e.type](e,t)}var fd={Feature:function(e,t){qs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)qs(n[r].geometry,t)}},pd={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){cl(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)cl(n[r],t,0)},Polygon:function(e,t){gd(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)gd(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)qs(n[r],t)}};function cl(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 gd(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)cl(e[n],t,1);t.polygonEnd()}function br(e,t){e&&fd.hasOwnProperty(e.type)?fd[e.type](e,t):qs(e,t)}function ul(e){return[zn(e[1],e[0]),un(e[2])]}function _r(e){var t=e[0],n=e[1],r=St(n);return[r*St(t),r*Et(t),Et(n)]}function Xs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function js(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 hl(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Zs(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function dl(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 fl(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 pl(e,t){return bt(e)>dt&&(e-=Math.round(e/ye)*ye),[e,t]}pl.invert=pl;function md(e,t,n){return(e%=ye)?t||n?fl(yd(e),Ed(t,n)):yd(e):t||n?Ed(t,n):pl}function vd(e){return function(t,n){return t+=e,bt(t)>dt&&(t-=Math.round(t/ye)*ye),[t,n]}}function yd(e){var t=vd(e);return t.invert=vd(-e),t}function Ed(e,t){var n=St(e),r=Et(e),i=St(t),s=Et(t);function a(o,l){var c=St(l),u=St(o)*c,d=Et(o)*c,h=Et(l),f=h*n+u*r;return[zn(d*i-f*s,u*n-h*r),un(f*i+d*s)]}return a.invert=function(o,l){var c=St(l),u=St(o)*c,d=Et(o)*c,h=Et(l),f=h*i-d*s;return[zn(d*i+h*s,u*n+f*r),un(f*n-u*r)]},a}function Hx(e){e=md(e[0]*$t,e[1]*$t,e.length>2?e[2]*$t:0);function t(n){return n=e(n[0]*$t,n[1]*$t),n[0]*=re,n[1]*=re,n}return t.invert=function(n){return n=e.invert(n[0]*$t,n[1]*$t),n[0]*=re,n[1]*=re,n},t}function Gx(e,t,n,r,i,s){if(n){var a=St(t),o=Et(t),l=r*n;i==null?(i=t+r*ye,s=t-l/2):(i=xd(a,i),s=xd(a,s),(r>0?i<s:i>s)&&(i+=r*ye));for(var c,u=i;r>0?u>s:u<s;u-=l)c=ul([a,-o*St(u),-o*Et(u)]),e.point(c[0],c[1])}}function xd(e,t){t=_r(t),t[0]-=e,dl(t);var n=Fx(-t[1]);return((-t[2]<0?-n:n)+ye-xt)%ye}function bd(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Te,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ks(e,t){return bt(e[0]-t[0])<xt&&bt(e[1]-t[1])<xt}function Qs(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 _d(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(Ks(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*xt}s.push(y=new Qs(v,p,null,!0)),a.push(y.o=new Qs(v,null,y,!1)),s.push(y=new Qs(m,p,null,!1)),a.push(y.o=new Qs(m,null,y,!0))}}),!!s.length){for(a.sort(t),Sd(s),Sd(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 Sd(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 gl(e){return bt(e[0])<=dt?e[0]:An(e[0])*((bt(e[0])+dt)%ye-dt)}function Vx(e,t){var n=gl(t),r=t[1],i=Et(r),s=[Et(n),-St(n),0],a=0,o=0,l=new Nn;i===1?r=ce+xt:i===-1&&(r=-ce-xt);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=gl(f),g=f[1]/2+hd,v=Et(g),m=St(g),y=0;y<h;++y,p=_,v=b,m=M,f=E){var E=d[y],_=gl(E),S=E[1]/2+hd,b=Et(S),M=St(S),D=_-p,G=D>=0?1:-1,I=G*D,w=I>dt,C=v*b;if(l.add(zn(C*G*Et(I),m*M+C*St(I))),a+=w?D+G*ye:D,w^p>=n^_>=n){var R=js(_r(f),_r(E));dl(R);var P=js(s,R);dl(P);var O=(w^D>=0?-1:1)*un(P[2]);(r>O||r===O&&(R[0]||R[1]))&&(o+=w^D>=0?1:-1)}}return(a<-xt||a<xt&&l<-ud)^o&1}function Td(e,t,n,r){return function(i){var s=t(i),a=bd(),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=E,u=[],c=[]},polygonEnd:function(){h.point=f,h.lineStart=g,h.lineEnd=v,u=ih(u);var _=Vx(c,r);u.length?(l||(i.polygonStart(),l=!0),_d(u,Wx,_,n,i)):_&&(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 E(){m(d[0][0],d[0][1]),o.lineEnd();var _=o.clean(),S=a.result(),b,M=S.length,D,G,I;if(d.pop(),c.push(d),d=null,!!M){if(_&1){if(G=S[0],(D=G.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),b=0;b<D;++b)i.point((I=G[b])[0],I[1]);i.lineEnd()}return}M>1&&_&2&&S.push(S.pop().concat(S.shift())),u.push(S.filter(zx))}}return h}}function zx(e){return e.length>1}function Wx(e,t){return((e=e.x)[0]<0?e[1]-ce-xt:ce-e[1])-((t=t.x)[0]<0?t[1]-ce-xt:ce-t[1])}const wd=Td(function(){return!0},Yx,Xx,[-dt,-ce]);function Yx(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,a){var o=s>0?dt:-dt,l=bt(s-t);bt(l-dt)<xt?(e.point(t,n=(n+a)/2>0?ce:-ce),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(o,n),e.point(s,n),i=0):r!==o&&l>=dt&&(bt(t-r)<xt&&(t-=r*xt),bt(s-o)<xt&&(s-=o*xt),n=qx(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 qx(e,t,n,r){var i,s,a=Et(e-n);return bt(a)>xt?dd((Et(t)*(s=St(r))*Et(n)-Et(r)*(i=St(t))*Et(e))/(i*s*a)):(t+r)/2}function Xx(e,t,n,r){var i;if(e==null)i=n*ce,r.point(-dt,i),r.point(0,i),r.point(dt,i),r.point(dt,0),r.point(dt,-i),r.point(0,-i),r.point(-dt,-i),r.point(-dt,0),r.point(-dt,i);else if(bt(e[0]-t[0])>xt){var s=e[0]<t[0]?dt:-dt;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function jx(e){var t=St(e),n=6*$t,r=t>0,i=bt(t)>xt;function s(u,d,h,f){Gx(f,e,n,h,u,d)}function a(u,d){return St(u)*St(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],E,_=a(v,m),S=r?_?0:c(v,m):_?c(v+(v<0?dt:-dt),m):0;if(!d&&(p=f=_)&&u.lineStart(),_!==f&&(E=l(d,y),(!E||Ks(d,E)||Ks(y,E))&&(y[2]=1)),_!==f)g=0,_?(u.lineStart(),E=l(y,d),u.point(E[0],E[1])):(E=l(d,y),u.point(E[0],E[1],2),u.lineEnd()),d=E;else if(i&&d&&r^_){var b;!(S&h)&&(b=l(y,d,!0))&&(g=0,r?(u.lineStart(),u.point(b[0][0],b[0][1]),u.point(b[1][0],b[1][1]),u.lineEnd()):(u.point(b[1][0],b[1][1]),u.lineEnd(),u.lineStart(),u.point(b[0][0],b[0][1],3)))}_&&(!d||!Ks(d,y))&&u.point(y[0],y[1]),d=y,f=_,h=S},lineEnd:function(){f&&u.lineEnd(),d=null},clean:function(){return g|(p&&f)<<1}}}function l(u,d,h){var f=_r(u),p=_r(d),g=[1,0,0],v=js(f,p),m=Xs(v,v),y=v[0],E=m-y*y;if(!E)return!h&&u;var _=t*m/E,S=-t*y/E,b=js(g,v),M=Zs(g,_),D=Zs(v,S);hl(M,D);var G=b,I=Xs(M,G),w=Xs(G,G),C=I*I-w*(Xs(M,M)-1);if(!(C<0)){var R=$e(C),P=Zs(G,(-I-R)/w);if(hl(P,M),P=ul(P),!h)return P;var O=u[0],H=d[0],B=u[1],U=d[1],N;H<O&&(N=O,O=H,H=N);var j=H-O,Y=bt(j-dt)<xt,it=Y||j<xt;if(!Y&&U<B&&(N=B,B=U,U=N),it?Y?B+U>0^P[1]<(bt(P[0]-O)<xt?B:U):B<=P[1]&&P[1]<=U:j>dt^(O<=P[0]&&P[0]<=H)){var et=Zs(G,(-I+R)/w);return hl(et,M),[P,ul(et)]}}}function c(u,d){var h=r?e:dt-e,f=0;return u<-h?f|=1:u>h&&(f|=2),d<-h?f|=4:d>h&&(f|=8),f}return Td(a,o,s,r?[0,-e]:[-dt,e-dt])}function Zx(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 xi=1e9,Js=-xi;function Kx(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 bt(c[0]-e)<xt?u>0?0:3:bt(c[0]-n)<xt?u>0?2:1:bt(c[1]-t)<xt?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=bd(),h,f,p,g,v,m,y,E,_,S,b,M={point:D,lineStart:C,lineEnd:R,polygonStart:I,polygonEnd:w};function D(O,H){i(O,H)&&u.point(O,H)}function G(){for(var O=0,H=0,B=f.length;H<B;++H)for(var U=f[H],N=1,j=U.length,Y=U[0],it,et,q=Y[0],Q=Y[1];N<j;++N)it=q,et=Q,Y=U[N],q=Y[0],Q=Y[1],et<=r?Q>r&&(q-it)*(r-et)>(Q-et)*(e-it)&&++O:Q<=r&&(q-it)*(r-et)<(Q-et)*(e-it)&&--O;return O}function I(){u=d,h=[],f=[],b=!0}function w(){var O=G(),H=b&&O,B=(h=ih(h)).length;(H||B)&&(c.polygonStart(),H&&(c.lineStart(),s(null,null,1,c),c.lineEnd()),B&&_d(h,o,O,s,c),c.polygonEnd()),u=c,h=f=p=null}function C(){M.point=P,f&&f.push(p=[]),S=!0,_=!1,y=E=NaN}function R(){h&&(P(g,v),m&&_&&d.rejoin(),h.push(d.result())),M.point=D,_&&u.lineEnd()}function P(O,H){var B=i(O,H);if(f&&p.push([O,H]),S)g=O,v=H,m=B,S=!1,B&&(u.lineStart(),u.point(O,H));else if(B&&_)u.point(O,H);else{var U=[y=Math.max(Js,Math.min(xi,y)),E=Math.max(Js,Math.min(xi,E))],N=[O=Math.max(Js,Math.min(xi,O)),H=Math.max(Js,Math.min(xi,H))];Zx(U,N,e,t,n,r)?(_||(u.lineStart(),u.point(U[0],U[1])),u.point(N[0],N[1]),B||u.lineEnd(),b=!1):B&&(u.lineStart(),u.point(O,H),b=!1)}y=O,E=H,_=B}return M}}const ml=e=>e;var vl=new Nn,yl=new Nn,Od,Md,El,xl,Cn={point:Te,lineStart:Te,lineEnd:Te,polygonStart:function(){Cn.lineStart=Qx,Cn.lineEnd=tb},polygonEnd:function(){Cn.lineStart=Cn.lineEnd=Cn.point=Te,vl.add(bt(yl)),yl=new Nn},result:function(){var e=vl/2;return vl=new Nn,e}};function Qx(){Cn.point=Jx}function Jx(e,t){Cn.point=Ad,Od=El=e,Md=xl=t}function Ad(e,t){yl.add(xl*e-El*t),El=e,xl=t}function tb(){Ad(Od,Md)}const Cd=Cn;var Sr=1/0,ta=Sr,bi=-Sr,ea=bi,eb={point:nb,lineStart:Te,lineEnd:Te,polygonStart:Te,polygonEnd:Te,result:function(){var e=[[Sr,ta],[bi,ea]];return bi=ea=-(ta=Sr=1/0),e}};function nb(e,t){e<Sr&&(Sr=e),e>bi&&(bi=e),t<ta&&(ta=t),t>ea&&(ea=t)}const na=eb;var bl=0,_l=0,_i=0,ra=0,ia=0,Tr=0,Sl=0,Tl=0,Si=0,Dd,Ld,je,Ze,Ne={point:Wn,lineStart:Rd,lineEnd:Id,polygonStart:function(){Ne.lineStart=sb,Ne.lineEnd=ab},polygonEnd:function(){Ne.point=Wn,Ne.lineStart=Rd,Ne.lineEnd=Id},result:function(){var e=Si?[Sl/Si,Tl/Si]:Tr?[ra/Tr,ia/Tr]:_i?[bl/_i,_l/_i]:[NaN,NaN];return bl=_l=_i=ra=ia=Tr=Sl=Tl=Si=0,e}};function Wn(e,t){bl+=e,_l+=t,++_i}function Rd(){Ne.point=rb}function rb(e,t){Ne.point=ib,Wn(je=e,Ze=t)}function ib(e,t){var n=e-je,r=t-Ze,i=$e(n*n+r*r);ra+=i*(je+e)/2,ia+=i*(Ze+t)/2,Tr+=i,Wn(je=e,Ze=t)}function Id(){Ne.point=Wn}function sb(){Ne.point=ob}function ab(){kd(Dd,Ld)}function ob(e,t){Ne.point=kd,Wn(Dd=je=e,Ld=Ze=t)}function kd(e,t){var n=e-je,r=t-Ze,i=$e(n*n+r*r);ra+=i*(je+e)/2,ia+=i*(Ze+t)/2,Tr+=i,i=Ze*e-je*t,Sl+=i*(je+e),Tl+=i*(Ze+t),Si+=i*3,Wn(je=e,Ze=t)}const Pd=Ne;function $d(e){this._context=e}$d.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,ye);break}}},result:Te};var wl=new Nn,Ol,Nd,Ud,Ti,wi,sa={point:Te,lineStart:function(){sa.point=lb},lineEnd:function(){Ol&&Bd(Nd,Ud),sa.point=Te},polygonStart:function(){Ol=!0},polygonEnd:function(){Ol=null},result:function(){var e=+wl;return wl=new Nn,e}};function lb(e,t){sa.point=Bd,Nd=Ti=e,Ud=wi=t}function Bd(e,t){Ti-=e,wi-=t,wl.add($e(Ti*Ti+wi*wi)),Ti=e,wi=t}const Fd=sa;let Hd,aa,Gd,Vd;class zd{constructor(t){this._append=t==null?Wd:cb(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!==Gd||this._append!==aa){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`,Gd=r,aa=this._append,Vd=this._,this._=i}this._+=Vd;break}}}result(){const t=this._;return this._="",t.length?t:null}}function Wd(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function cb(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Wd;if(t!==Hd){const n=10**t;Hd=t,aa=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 aa}function ub(e,t){let n=3,r=4.5,i,s;function a(o){return o&&(typeof r=="function"&&s.pointRadius(+r.apply(this,arguments)),br(o,i(s))),s.result()}return a.area=function(o){return br(o,i(Cd)),Cd.result()},a.measure=function(o){return br(o,i(Fd)),Fd.result()},a.bounds=function(o){return br(o,i(na)),na.result()},a.centroid=function(o){return br(o,i(Pd)),Pd.result()},a.projection=function(o){return arguments.length?(i=o==null?(e=null,ml):(e=o).stream,a):e},a.context=function(o){return arguments.length?(s=o==null?(t=null,new zd(n)):new $d(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 zd(n)),a},a.projection(e).digits(n).context(t)}function Ml(e){return function(t){var n=new Al;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Al(){}Al.prototype={constructor:Al,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Cl(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),br(n,e.stream(na)),t(na.result()),r!=null&&e.clipExtent(r),e}function Yd(e,t,n){return Cl(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 hb(e,t,n){return Yd(e,[[0,0],t],n)}function db(e,t,n){return Cl(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 fb(e,t,n){return Cl(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 qd=16,pb=St(30*$t);function Xd(e,t){return+t?mb(e,t):gb(e)}function gb(e){return Ml({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function mb(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,E=m*m+y*y;if(E>4*t&&g--){var _=a+h,S=o+f,b=l+p,M=$e(_*_+S*S+b*b),D=un(b/=M),G=bt(bt(b)-1)<xt||bt(s-d)<xt?(s+d)/2:zn(S,_),I=e(G,D),w=I[0],C=I[1],R=w-r,P=C-i,O=y*R-m*P;(O*O/E>t||bt((m*R+y*P)/E-.5)>.3||a*h+o*f+l*p<pb)&&(n(r,i,s,a,o,l,w,C,G,_/=M,S/=M,b,g,v),v.point(w,C),n(w,C,G,_,S,b,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:_,polygonStart:function(){r.polygonStart(),v.lineStart=S},polygonEnd:function(){r.polygonEnd(),v.lineStart=y}};function m(D,G){D=e(D,G),r.point(D[0],D[1])}function y(){d=NaN,v.point=E,r.lineStart()}function E(D,G){var I=_r([D,G]),w=e(D,G);n(d,h,u,f,p,g,d=w[0],h=w[1],u=D,f=I[0],p=I[1],g=I[2],qd,r),r.point(d,h)}function _(){v.point=m,r.lineEnd()}function S(){y(),v.point=b,v.lineEnd=M}function b(D,G){E(i=D,G),s=d,a=h,o=f,l=p,c=g,v.point=E}function M(){n(d,h,u,f,p,g,s,a,i,o,l,c,qd,r),v.lineEnd=_,_()}return v}}var vb=Ml({point:function(e,t){this.stream.point(e*$t,t*$t)}});function yb(e){return Ml({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Eb(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 jd(e,t,n,r,i,s){if(!s)return Eb(e,t,n,r,i);var a=St(s),o=Et(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 oa(e){return Zd(function(){return e})()}function Zd(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=wd,v=null,m,y,E,_=ml,S=.5,b,M,D,G,I;function w(O){return D(O[0]*$t,O[1]*$t)}function C(O){return O=D.invert(O[0],O[1]),O&&[O[0]*re,O[1]*re]}w.stream=function(O){return G&&I===O?G:G=vb(yb(u)(g(b(_(I=O)))))},w.preclip=function(O){return arguments.length?(g=O,p=void 0,P()):g},w.postclip=function(O){return arguments.length?(_=O,v=m=y=E=null,P()):_},w.clipAngle=function(O){return arguments.length?(g=+O?jx(p=O*$t):(p=null,wd),P()):p*re},w.clipExtent=function(O){return arguments.length?(_=O==null?(v=m=y=E=null,ml):Kx(v=+O[0][0],m=+O[0][1],y=+O[1][0],E=+O[1][1]),P()):v==null?null:[[v,m],[y,E]]},w.scale=function(O){return arguments.length?(n=+O,R()):n},w.translate=function(O){return arguments.length?(r=+O[0],i=+O[1],R()):[r,i]},w.center=function(O){return arguments.length?(s=O[0]%360*$t,a=O[1]%360*$t,R()):[s*re,a*re]},w.rotate=function(O){return arguments.length?(o=O[0]%360*$t,l=O[1]%360*$t,c=O.length>2?O[2]%360*$t:0,R()):[o*re,l*re,c*re]},w.angle=function(O){return arguments.length?(d=O%360*$t,R()):d*re},w.reflectX=function(O){return arguments.length?(h=O?-1:1,R()):h<0},w.reflectY=function(O){return arguments.length?(f=O?-1:1,R()):f<0},w.precision=function(O){return arguments.length?(b=Xd(M,S=O*O),P()):$e(S)},w.fitExtent=function(O,H){return Yd(w,O,H)},w.fitSize=function(O,H){return hb(w,O,H)},w.fitWidth=function(O,H){return db(w,O,H)},w.fitHeight=function(O,H){return fb(w,O,H)};function R(){var O=jd(n,0,0,h,f,d).apply(null,t(s,a)),H=jd(n,r-O[0],i-O[1],h,f,d);return u=md(o,l,c),M=fl(t,H),D=fl(u,M),b=Xd(M,S),P()}function P(){return G=I=null,w}return function(){return t=e.apply(this,arguments),w.invert=t.invert&&C,R()}}function Kd(e){var t=0,n=dt/3,r=Zd(e),i=r(t,n);return i.parallels=function(s){return arguments.length?r(t=s[0]*$t,n=s[1]*$t):[t*re,n*re]},i}function xb(e){var t=St(e);function n(r,i){return[r*t,Et(i)/t]}return n.invert=function(r,i){return[r/t,un(i*t)]},n}function bb(e,t){var n=Et(e),r=(n+Et(t))/2;if(bt(r)<xt)return xb(e);var i=1+n*(2*r-n),s=$e(i)/r;function a(o,l){var c=$e(i-2*r*Et(l))/r;return[c*Et(o*=r),s-c*St(o)]}return a.invert=function(o,l){var c=s-l,u=zn(o,bt(c))*An(c);return c*r<0&&(u-=dt*An(o)*An(c)),[u/r,un((i-(o*o+c*c)*r*r)/(2*r))]},a}function Qd(){return Kd(bb).scale(155.424).center([0,33.6442])}function _b(){return Qd().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Dl(e,t){return[e,Ux(Bx((ce+t)/2))]}Dl.invert=function(e,t){return[e,2*dd(Nx(t))-ce]};function Sb(){return Tb(Dl).scale(961/ye)}function Tb(e){var t=oa(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=dt*r(),h=t(Hx(t.rotate()).invert([0,0]));return s(a==null?[[h[0]-d,h[1]-d],[h[0]+d,h[1]+d]]:e===Dl?[[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 la(e,t){return[e,t]}la.invert=la;function wb(){return oa(la).scale(152.63)}function Ob(e,t){var n=St(e),r=e===t?Et(e):(n-St(t))/(t-e),i=n/r+e;if(bt(r)<xt)return la;function s(a,o){var l=i-o,c=r*a;return[l*Et(c),i-l*St(c)]}return s.invert=function(a,o){var l=i-o,c=zn(a,bt(l))*An(l);return l*r<0&&(c-=dt*An(a)*An(l)),[c/r,i-An(r)*$e(a*a+l*l)]},s}function Mb(){return Kd(Ob).scale(131.154).center([0,13.9389])}var Oi=1.340264,Mi=-.081106,Ai=893e-6,Ci=.003796,ca=$e(3)/2,Ab=12;function Jd(e,t){var n=un(ca*Et(t)),r=n*n,i=r*r*r;return[e*St(n)/(ca*(Oi+3*Mi*r+i*(7*Ai+9*Ci*r))),n*(Oi+Mi*r+i*(Ai+Ci*r))]}Jd.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,s=0,a,o,l;s<Ab&&(o=n*(Oi+Mi*r+i*(Ai+Ci*r))-t,l=Oi+3*Mi*r+i*(7*Ai+9*Ci*r),n-=a=o/l,r=n*n,i=r*r*r,!(bt(a)<ud));++s);return[ca*e*(Oi+3*Mi*r+i*(7*Ai+9*Ci*r))/St(n),un(Et(n)/ca)]};function Cb(){return oa(Jd).scale(177.158)}function tf(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)))]}tf.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(bt(i)>xt&&--r>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function Db(){return oa(tf).scale(175.295)}function Lb(e,t){return e.parent===t.parent?1:2}function Rb(e){return e.reduce(Ib,0)/e.length}function Ib(e,t){return e+t.x}function kb(e){return 1+e.reduce(Pb,0)}function Pb(e,t){return Math.max(e,t.y)}function $b(e){for(var t;t=e.children;)e=t[0];return e}function Nb(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Ub(){var e=Lb,t=1,n=1,r=!1;function i(s){var a,o=0;s.eachAfter(function(h){var f=h.children;f?(h.x=Rb(f),h.y=kb(f)):(h.x=a?o+=e(h,a):0,h.y=0,a=h)});var l=$b(s),c=Nb(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 Bb(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(Bb)}function Hb(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 Vb(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 zb(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Wb(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 Yb(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function qb(e){for(var t=this,n=Xb(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 Xb(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 jb(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function Zb(){return Array.from(this)}function Kb(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Qb(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Jb(){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 Di(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=n_)):t===void 0&&(t=e_);for(var n=new Li(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 Li(a[o])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(i_)}function t_(){return Di(this).eachBefore(r_)}function e_(e){return e.children}function n_(e){return Array.isArray(e)?e[1]:null}function r_(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function i_(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Li(e){this.data=e,this.depth=this.height=0,this.parent=null}Li.prototype=Di.prototype={constructor:Li,count:Fb,each:Hb,eachAfter:Vb,eachBefore:Gb,find:zb,sum:Wb,sort:Yb,path:qb,ancestors:jb,descendants:Zb,leaves:Kb,links:Qb,copy:t_,[Symbol.iterator]:Jb};function s_(e){return e==null?null:ef(e)}function ef(e){if(typeof e!="function")throw new Error;return e}function Yn(){return 0}function wr(e){return function(){return e}}const a_=1664525,o_=1013904223,nf=4294967296;function l_(){let e=1;return()=>(e=(a_*e+o_)%nf)/nf}function c_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function u_(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 h_(e,t){for(var n=0,r=(e=u_(Array.from(e),t)).length,i=[],s,a;n<r;)s=e[n],a&&rf(a,s)?++n:(a=f_(i=d_(i,s)),n=0);return a}function d_(e,t){var n,r;if(Ll(t,e))return[t];for(n=0;n<e.length;++n)if(ua(t,e[n])&&Ll(Ri(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(ua(Ri(e[n],e[r]),t)&&ua(Ri(e[n],t),e[r])&&ua(Ri(e[r],t),e[n])&&Ll(sf(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function ua(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 rf(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 Ll(e,t){for(var n=0;n<t.length;++n)if(!rf(e,t[n]))return!1;return!0}function f_(e){switch(e.length){case 1:return p_(e[0]);case 2:return Ri(e[0],e[1]);case 3:return sf(e[0],e[1],e[2])}}function p_(e){return{x:e.x,y:e.y,r:e.r}}function Ri(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 sf(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,E=y-a*a-o*o+l*l,_=y-c*c-u*u+d*d,S=f*p-h*g,b=(p*_-g*E)/(S*2)-r,M=(g*v-p*m)/S,D=(f*E-h*_)/(S*2)-i,G=(h*m-f*v)/S,I=M*M+G*G-1,w=2*(s+b*M+D*G),C=b*b+D*D-s*s,R=-(Math.abs(I)>1e-6?(w+Math.sqrt(w*w-4*I*C))/(2*I):C/w);return{x:r+b+M*R,y:i+D+G*R,r:R}}function af(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 of(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 lf(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 ha(e){this._=e,this.next=null,this.previous=null}function g_(e,t){if(!(s=(e=c_(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;af(r,n,i=e[2]),n=new ha(n),r=new ha(r),i=new ha(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(l=3;l<s;++l){af(n._,r._,i=e[l]),i=new ha(i),c=r.next,u=n.previous,d=r._.r,h=n._.r;do if(d<=h){if(of(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue t}d+=c._.r,c=c.next}else{if(of(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=lf(n);(i=i.next)!==r;)(o=lf(i))<a&&(n=i,a=o);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=h_(n,t),l=0;l<s;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function m_(e){return Math.sqrt(e.value)}function v_(){var e=null,t=1,n=1,r=Yn;function i(s){const a=l_();return s.x=t/2,s.y=n/2,e?s.eachBefore(cf(e)).eachAfter(Rl(r,.5,a)).eachBefore(uf(1)):s.eachBefore(cf(m_)).eachAfter(Rl(Yn,1,a)).eachAfter(Rl(r,s.r/Math.min(t,n),a)).eachBefore(uf(Math.min(t,n)/(2*s.r))),s}return i.radius=function(s){return arguments.length?(e=s_(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:wr(+s),i):r},i}function cf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Rl(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=g_(i,n),o)for(s=0;s<a;++s)i[s].r-=o;r.r=l+o}}}function uf(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 y_(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 E_(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 x_(e,t){return e.parent===t.parent?1:2}function Il(e){var t=e.children;return t?t[0]:e.t}function kl(e){var t=e.children;return t?t[t.length-1]:e.t}function b_(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 __(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 S_(e,t,n){return e.a.parent===t.parent?e.a:n}function da(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}da.prototype=Object.create(Li.prototype);function T_(e){for(var t=new da(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 da(s[a],a)),i.parent=n;return(t.parent=new da(null,0)).children=[t],t}function w_(){var e=x_,t=1,n=1,r=null;function i(c){var u=T_(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){__(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,E=g.m,_;p=kl(p),h=Il(h),p&&h;)g=Il(g),f=kl(f),f.a=c,_=p.z+y-h.z-v+e(p._,h._),_>0&&(b_(S_(p,c,d),c,_),v+=_,m+=_),y+=p.m,v+=h.m,E+=g.m,m+=f.m;p&&!kl(f)&&(f.t=p,f.m+=y-m),h&&!Il(g)&&(g.t=h,g.m+=v-E,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 O_(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 M_=(1+Math.sqrt(5))/2;function A_(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,E,_,S,b;u<h;){f=i-n,p=s-r;do v=o[d++].value;while(!v&&d<h);for(m=y=v,S=Math.max(p/f,f/p)/(g*e),b=v*v*S,_=Math.max(y/b,b/m);d<h;++d){if(v+=c=o[d].value,c<m&&(m=c),c>y&&(y=c),b=v*v*S,E=Math.max(y/b,b/m),E>_){v-=c;break}_=E}a.push(l={value:v,dice:f<p,children:o.slice(u,d)}),l.dice?E_(l,n,r,i,g?r+=p*v/g:s):O_(l,n,r,g?n+=f*v/g:i,s),g-=v,u=d}return a}const C_=function e(t){function n(r,i,s,a,o){A_(t,r,i,s,a,o)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(M_);function D_(){var e=C_,t=!1,n=1,r=1,i=[0],s=Yn,a=Yn,o=Yn,l=Yn,c=Yn;function u(h){return h.x0=h.y0=0,h.x1=n,h.y1=r,h.eachBefore(d),i=[0],t&&h.eachBefore(y_),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=ef(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:wr(+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:wr(+h),u):a},u.paddingRight=function(h){return arguments.length?(o=typeof h=="function"?h:wr(+h),u):o},u.paddingBottom=function(h){return arguments.length?(l=typeof h=="function"?h:wr(+h),u):l},u.paddingLeft=function(h){return arguments.length?(c=typeof h=="function"?h:wr(+h),u):c},u}function Or(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}const hf=Symbol("implicit");function fa(){var e=new th,t=[],n=[],r=hf;function i(s){let a=e.get(s);if(a===void 0){if(r!==hf)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 th;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 fa(t,n).unknown(r)},Or.apply(i,arguments),i}function Ii(){var e=fa().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=U0(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 Ii(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(u)},Or.apply(d(),arguments)}function L_(e){return function(){return e}}function R_(e){return+e}var df=[0,1];function Mr(e){return e}function Pl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:L_(isNaN(t)?NaN:.5)}function I_(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function k_(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=Pl(i,r),s=n(a,s)):(r=Pl(r,i),s=n(s,a)),function(o){return s(r(o))}}function P_(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]=Pl(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Mo(e,o,1,r)-1;return s[l](i[l](o))}}function $l(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ff(){var e=df,t=df,n=pi,r,i,s,a=Mr,o,l,c;function u(){var h=Math.min(e.length,t.length);return a!==Mr&&(a=I_(e[0],e[h-1])),o=h>2?P_:k_,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),ve)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,R_),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=Ih,u()},d.clamp=function(h){return arguments.length?(a=h?!0:Mr,u()):a!==Mr},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 pf(){return ff()(Mr,Mr)}function $_(e,t,n,r){var i=Co(e,t,n),s;switch(r=Ei(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Px(i,a))&&(r.precision=s),cd(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=$x(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=kx(i))&&(r.precision=s-(r.type==="%")*2);break}}return ll(r)}function gf(e){var t=e.domain;return e.ticks=function(n){var r=t();return Ss(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return $_(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=pr(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 Ue(){var e=pf();return e.copy=function(){return $l(e,Ue())},Or.apply(e,arguments),gf(e)}function mf(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 vf(e){return Math.log(e)}function yf(e){return Math.exp(e)}function N_(e){return-Math.log(-e)}function U_(e){return-Math.exp(-e)}function B_(e){return isFinite(e)?+("1e"+e):e<0?0:e}function F_(e){return e===10?B_:e===Math.E?Math.exp:t=>Math.pow(e,t)}function H_(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 Ef(e){return(t,n)=>-e(-t,n)}function G_(e){const t=e(vf,yf),n=t.domain;let r=10,i,s;function a(){return i=H_(r),s=F_(r),n()[0]<0?(i=Ef(i),s=Ef(s),e(N_,U_)):e(vf,yf),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=Ss(c,u,v))}else m=Ss(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=Ei(l)).precision==null&&(l.trim=!0),l=ll(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(mf(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function xf(){const e=G_(ff()).domain([1,10]);return e.copy=()=>$l(e,xf()).base(e.base()),Or.apply(e,arguments),e}function Nl(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(l){return l!=null&&l<=l?i[Mo(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 Nl().domain([e,t]).range(i).unknown(s)},Or.apply(gf(a),arguments)}const Ul=new Date,Bl=new Date;function Vt(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=>Vt(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)=>(Ul.setTime(+s),Bl.setTime(+a),e(Ul),e(Bl),Math.floor(n(Ul,Bl))),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 pa=Vt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);pa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Vt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):pa),pa.range;const hn=1e3,we=hn*60,dn=we*60,fn=dn*24,Fl=fn*7,bf=fn*30,Hl=fn*365,Ar=Vt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*hn)},(e,t)=>(t-e)/hn,e=>e.getUTCSeconds());Ar.range;const Gl=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn)},(e,t)=>{e.setTime(+e+t*we)},(e,t)=>(t-e)/we,e=>e.getMinutes());Gl.range,Vt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*we)},(e,t)=>(t-e)/we,e=>e.getUTCMinutes()).range;const Vl=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hn-e.getMinutes()*we)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getHours());Vl.range,Vt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*dn)},(e,t)=>(t-e)/dn,e=>e.getUTCHours()).range;const ki=Vt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*we)/fn,e=>e.getDate()-1);ki.range;const zl=Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fn,e=>e.getUTCDate()-1);zl.range,Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fn,e=>Math.floor(e/fn)).range;function qn(e){return Vt(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())*we)/Fl)}const ga=qn(0),ma=qn(1),V_=qn(2),z_=qn(3),Cr=qn(4),W_=qn(5),Y_=qn(6);ga.range,ma.range,V_.range,z_.range,Cr.range,W_.range,Y_.range;function Xn(e){return Vt(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)/Fl)}const _f=Xn(0),va=Xn(1),q_=Xn(2),X_=Xn(3),Dr=Xn(4),j_=Xn(5),Z_=Xn(6);_f.range,va.range,q_.range,X_.range,Dr.range,j_.range,Z_.range;const Wl=Vt(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());Wl.range,Vt(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 pn=Vt(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());pn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(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)}),pn.range;const jn=Vt(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());jn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(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)}),jn.range;function K_(e,t,n,r,i,s){const a=[[Ar,1,hn],[Ar,5,5*hn],[Ar,15,15*hn],[Ar,30,30*hn],[s,1,we],[s,5,5*we],[s,15,15*we],[s,30,30*we],[i,1,dn],[i,3,3*dn],[i,6,6*dn],[i,12,12*dn],[r,1,fn],[r,2,2*fn],[n,1,Fl],[t,1,bf],[t,3,3*bf],[e,1,Hl]];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=Oo(([,,v])=>v).right(a,h);if(f===a.length)return e.every(Co(c/Hl,u/Hl,d));if(f===0)return pa.every(Math.max(Co(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[Q_,J_]=K_(pn,Wl,ga,ki,Vl,Gl);function Yl(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 ql(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 Pi(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function tS(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=$i(i),u=Ni(i),d=$i(s),h=Ni(s),f=$i(a),p=Ni(a),g=$i(o),v=Ni(o),m=$i(l),y=Ni(l),E={a:B,A:U,b:N,B:j,c:null,d:Af,e:Af,f:SS,g:IS,G:PS,H:xS,I:bS,j:_S,L:Cf,m:TS,M:wS,p:Y,q:it,Q:Pf,s:$f,S:OS,u:MS,U:AS,V:CS,w:DS,W:LS,x:null,X:null,y:RS,Y:kS,Z:$S,"%":kf},_={a:et,A:q,b:Q,B:pt,c:null,d:Lf,e:Lf,f:FS,g:ZS,G:QS,H:NS,I:US,j:BS,L:Rf,m:HS,M:GS,p:ot,q:Tt,Q:Pf,s:$f,S:VS,u:zS,U:WS,V:YS,w:qS,W:XS,x:null,X:null,y:jS,Y:KS,Z:JS,"%":kf},S={a:I,A:w,b:C,B:R,c:P,d:Of,e:Of,f:mS,g:wf,G:Tf,H:Mf,I:Mf,j:dS,L:gS,m:hS,M:fS,p:G,q:uS,Q:yS,s:ES,S:pS,u:sS,U:aS,V:oS,w:iS,W:lS,x:O,X:H,y:wf,Y:Tf,Z:cS,"%":vS};E.x=b(n,E),E.X=b(r,E),E.c=b(t,E),_.x=b(n,_),_.X=b(r,_),_.c=b(t,_);function b(Z,F){return function(V){var $=[],mt=-1,gt=0,Ht=Z.length,Gt,st,Rt;for(V instanceof Date||(V=new Date(+V));++mt<Ht;)Z.charCodeAt(mt)===37&&($.push(Z.slice(gt,mt)),(st=Sf[Gt=Z.charAt(++mt)])!=null?Gt=Z.charAt(++mt):st=Gt==="e"?" ":"0",(Rt=F[Gt])&&(Gt=Rt(V,st)),$.push(Gt),gt=mt+1);return $.push(Z.slice(gt,mt)),$.join("")}}function M(Z,F){return function(V){var $=Pi(1900,void 0,1),mt=D($,Z,V+="",0),gt,Ht;if(mt!=V.length)return null;if("Q"in $)return new Date($.Q);if("s"in $)return new Date($.s*1e3+("L"in $?$.L:0));if(F&&!("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 $?(gt=ql(Pi($.y,0,1)),Ht=gt.getUTCDay(),gt=Ht>4||Ht===0?va.ceil(gt):va(gt),gt=zl.offset(gt,($.V-1)*7),$.y=gt.getUTCFullYear(),$.m=gt.getUTCMonth(),$.d=gt.getUTCDate()+($.w+6)%7):(gt=Yl(Pi($.y,0,1)),Ht=gt.getDay(),gt=Ht>4||Ht===0?ma.ceil(gt):ma(gt),gt=ki.offset(gt,($.V-1)*7),$.y=gt.getFullYear(),$.m=gt.getMonth(),$.d=gt.getDate()+($.w+6)%7)}else("W"in $||"U"in $)&&("w"in $||($.w="u"in $?$.u%7:"W"in $?1:0),Ht="Z"in $?ql(Pi($.y,0,1)).getUTCDay():Yl(Pi($.y,0,1)).getDay(),$.m=0,$.d="W"in $?($.w+6)%7+$.W*7-(Ht+5)%7:$.w+$.U*7-(Ht+6)%7);return"Z"in $?($.H+=$.Z/100|0,$.M+=$.Z%100,ql($)):Yl($)}}function D(Z,F,V,$){for(var mt=0,gt=F.length,Ht=V.length,Gt,st;mt<gt;){if($>=Ht)return-1;if(Gt=F.charCodeAt(mt++),Gt===37){if(Gt=F.charAt(mt++),st=S[Gt in Sf?F.charAt(mt++):Gt],!st||($=st(Z,V,$))<0)return-1}else if(Gt!=V.charCodeAt($++))return-1}return $}function G(Z,F,V){var $=c.exec(F.slice(V));return $?(Z.p=u.get($[0].toLowerCase()),V+$[0].length):-1}function I(Z,F,V){var $=f.exec(F.slice(V));return $?(Z.w=p.get($[0].toLowerCase()),V+$[0].length):-1}function w(Z,F,V){var $=d.exec(F.slice(V));return $?(Z.w=h.get($[0].toLowerCase()),V+$[0].length):-1}function C(Z,F,V){var $=m.exec(F.slice(V));return $?(Z.m=y.get($[0].toLowerCase()),V+$[0].length):-1}function R(Z,F,V){var $=g.exec(F.slice(V));return $?(Z.m=v.get($[0].toLowerCase()),V+$[0].length):-1}function P(Z,F,V){return D(Z,t,F,V)}function O(Z,F,V){return D(Z,n,F,V)}function H(Z,F,V){return D(Z,r,F,V)}function B(Z){return a[Z.getDay()]}function U(Z){return s[Z.getDay()]}function N(Z){return l[Z.getMonth()]}function j(Z){return o[Z.getMonth()]}function Y(Z){return i[+(Z.getHours()>=12)]}function it(Z){return 1+~~(Z.getMonth()/3)}function et(Z){return a[Z.getUTCDay()]}function q(Z){return s[Z.getUTCDay()]}function Q(Z){return l[Z.getUTCMonth()]}function pt(Z){return o[Z.getUTCMonth()]}function ot(Z){return i[+(Z.getUTCHours()>=12)]}function Tt(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var F=b(Z+="",E);return F.toString=function(){return Z},F},parse:function(Z){var F=M(Z+="",!1);return F.toString=function(){return Z},F},utcFormat:function(Z){var F=b(Z+="",_);return F.toString=function(){return Z},F},utcParse:function(Z){var F=M(Z+="",!0);return F.toString=function(){return Z},F}}}var Sf={"-":"",_:" ",0:"0"},Wt=/^\s*\d+/,eS=/^%/,nS=/[\\^$*+?|[\]().{}]/g;function vt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function rS(e){return e.replace(nS,"\\$&")}function $i(e){return new RegExp("^(?:"+e.map(rS).join("|")+")","i")}function Ni(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function iS(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function sS(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function aS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function oS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function lS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Tf(e,t,n){var r=Wt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function wf(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function cS(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 uS(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function hS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Of(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function dS(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Mf(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function fS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function pS(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function gS(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function mS(e,t,n){var r=Wt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function vS(e,t,n){var r=eS.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function yS(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ES(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Af(e,t){return vt(e.getDate(),t,2)}function xS(e,t){return vt(e.getHours(),t,2)}function bS(e,t){return vt(e.getHours()%12||12,t,2)}function _S(e,t){return vt(1+ki.count(pn(e),e),t,3)}function Cf(e,t){return vt(e.getMilliseconds(),t,3)}function SS(e,t){return Cf(e,t)+"000"}function TS(e,t){return vt(e.getMonth()+1,t,2)}function wS(e,t){return vt(e.getMinutes(),t,2)}function OS(e,t){return vt(e.getSeconds(),t,2)}function MS(e){var t=e.getDay();return t===0?7:t}function AS(e,t){return vt(ga.count(pn(e)-1,e),t,2)}function Df(e){var t=e.getDay();return t>=4||t===0?Cr(e):Cr.ceil(e)}function CS(e,t){return e=Df(e),vt(Cr.count(pn(e),e)+(pn(e).getDay()===4),t,2)}function DS(e){return e.getDay()}function LS(e,t){return vt(ma.count(pn(e)-1,e),t,2)}function RS(e,t){return vt(e.getFullYear()%100,t,2)}function IS(e,t){return e=Df(e),vt(e.getFullYear()%100,t,2)}function kS(e,t){return vt(e.getFullYear()%1e4,t,4)}function PS(e,t){var n=e.getDay();return e=n>=4||n===0?Cr(e):Cr.ceil(e),vt(e.getFullYear()%1e4,t,4)}function $S(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function Lf(e,t){return vt(e.getUTCDate(),t,2)}function NS(e,t){return vt(e.getUTCHours(),t,2)}function US(e,t){return vt(e.getUTCHours()%12||12,t,2)}function BS(e,t){return vt(1+zl.count(jn(e),e),t,3)}function Rf(e,t){return vt(e.getUTCMilliseconds(),t,3)}function FS(e,t){return Rf(e,t)+"000"}function HS(e,t){return vt(e.getUTCMonth()+1,t,2)}function GS(e,t){return vt(e.getUTCMinutes(),t,2)}function VS(e,t){return vt(e.getUTCSeconds(),t,2)}function zS(e){var t=e.getUTCDay();return t===0?7:t}function WS(e,t){return vt(_f.count(jn(e)-1,e),t,2)}function If(e){var t=e.getUTCDay();return t>=4||t===0?Dr(e):Dr.ceil(e)}function YS(e,t){return e=If(e),vt(Dr.count(jn(e),e)+(jn(e).getUTCDay()===4),t,2)}function qS(e){return e.getUTCDay()}function XS(e,t){return vt(va.count(jn(e)-1,e),t,2)}function jS(e,t){return vt(e.getUTCFullYear()%100,t,2)}function ZS(e,t){return e=If(e),vt(e.getUTCFullYear()%100,t,2)}function KS(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function QS(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Dr(e):Dr.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function JS(){return"+0000"}function kf(){return"%"}function Pf(e){return+e}function $f(e){return Math.floor(+e/1e3)}var Lr,Nf;tT({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 tT(e){return Lr=tS(e),Nf=Lr.format,Lr.parse,Lr.utcFormat,Lr.utcParse,Lr}function eT(e){return new Date(e)}function nT(e){return e instanceof Date?+e:+new Date(+e)}function Uf(e,t,n,r,i,s,a,o,l,c){var u=pf(),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"),E=c("%B"),_=c("%Y");function S(b){return(l(b)<b?f:o(b)<b?p:a(b)<b?g:s(b)<b?v:r(b)<b?i(b)<b?m:y:n(b)<b?E:_)(b)}return u.invert=function(b){return new Date(d(b))},u.domain=function(b){return arguments.length?h(Array.from(b,nT)):h().map(eT)},u.ticks=function(b){var M=h();return e(M[0],M[M.length-1],b??10)},u.tickFormat=function(b,M){return M==null?S:c(M)},u.nice=function(b){var M=h();return(!b||typeof b.range!="function")&&(b=t(M[0],M[M.length-1],b??10)),b?h(mf(M,b)):u},u.copy=function(){return $l(u,Uf(e,t,n,r,i,s,a,o,l,c))},u}function Bf(){return Or.apply(Uf(Q_,J_,pn,Wl,ga,ki,Vl,Gl,Ar,Nf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ht(e){return function(){return e}}const Ff=Math.abs,Qt=Math.atan2,Zn=Math.cos,rT=Math.max,Xl=Math.min,Ke=Math.sin,Rr=Math.sqrt,Jt=1e-12,Ui=Math.PI,ya=Ui/2,Ea=2*Ui;function iT(e){return e>1?0:e<-1?Ui:Math.acos(e)}function Hf(e){return e>=1?ya:e<=-1?-ya:Math.asin(e)}function xa(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 wx(t)}function sT(e){return e.innerRadius}function aT(e){return e.outerRadius}function oT(e){return e.startAngle}function lT(e){return e.endAngle}function cT(e){return e&&e.padAngle}function uT(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<Jt))return h=(u*(t-s)-d*(e-i))/h,[e+h*l,t+h*c]}function ba(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/Rr(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,E=g-f,_=y*y+E*E,S=i-s,b=h*g-p*f,M=(E<0?-1:1)*Rr(rT(0,S*S*_-b*b)),D=(b*E-y*M)/_,G=(-b*y-E*M)/_,I=(b*E+y*M)/_,w=(-b*y+E*M)/_,C=D-v,R=G-m,P=I-v,O=w-m;return C*C+R*R>P*P+O*O&&(D=I,G=w),{cx:D,cy:G,x01:-u,y01:-d,x11:D*(i/S-1),y11:G*(i/S-1)}}function Bi(){var e=sT,t=aT,n=ht(0),r=null,i=oT,s=lT,a=cT,o=null,l=xa(c);function c(){var u,d,h=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-ya,g=s.apply(this,arguments)-ya,v=Ff(g-p),m=g>p;if(o||(o=u=l()),f<h&&(d=f,f=h,h=d),!(f>Jt))o.moveTo(0,0);else if(v>Ea-Jt)o.moveTo(f*Zn(p),f*Ke(p)),o.arc(0,0,f,p,g,!m),h>Jt&&(o.moveTo(h*Zn(g),h*Ke(g)),o.arc(0,0,h,g,p,m));else{var y=p,E=g,_=p,S=g,b=v,M=v,D=a.apply(this,arguments)/2,G=D>Jt&&(r?+r.apply(this,arguments):Rr(h*h+f*f)),I=Xl(Ff(f-h)/2,+n.apply(this,arguments)),w=I,C=I,R,P;if(G>Jt){var O=Hf(G/h*Ke(D)),H=Hf(G/f*Ke(D));(b-=O*2)>Jt?(O*=m?1:-1,_+=O,S-=O):(b=0,_=S=(p+g)/2),(M-=H*2)>Jt?(H*=m?1:-1,y+=H,E-=H):(M=0,y=E=(p+g)/2)}var B=f*Zn(y),U=f*Ke(y),N=h*Zn(S),j=h*Ke(S);if(I>Jt){var Y=f*Zn(E),it=f*Ke(E),et=h*Zn(_),q=h*Ke(_),Q;if(v<Ui)if(Q=uT(B,U,et,q,Y,it,N,j)){var pt=B-Q[0],ot=U-Q[1],Tt=Y-Q[0],Z=it-Q[1],F=1/Ke(iT((pt*Tt+ot*Z)/(Rr(pt*pt+ot*ot)*Rr(Tt*Tt+Z*Z)))/2),V=Rr(Q[0]*Q[0]+Q[1]*Q[1]);w=Xl(I,(h-V)/(F-1)),C=Xl(I,(f-V)/(F+1))}else w=C=0}M>Jt?C>Jt?(R=ba(et,q,B,U,f,C,m),P=ba(Y,it,N,j,f,C,m),o.moveTo(R.cx+R.x01,R.cy+R.y01),C<I?o.arc(R.cx,R.cy,C,Qt(R.y01,R.x01),Qt(P.y01,P.x01),!m):(o.arc(R.cx,R.cy,C,Qt(R.y01,R.x01),Qt(R.y11,R.x11),!m),o.arc(0,0,f,Qt(R.cy+R.y11,R.cx+R.x11),Qt(P.cy+P.y11,P.cx+P.x11),!m),o.arc(P.cx,P.cy,C,Qt(P.y11,P.x11),Qt(P.y01,P.x01),!m))):(o.moveTo(B,U),o.arc(0,0,f,y,E,!m)):o.moveTo(B,U),!(h>Jt)||!(b>Jt)?o.lineTo(N,j):w>Jt?(R=ba(N,j,Y,it,h,-w,m),P=ba(B,U,et,q,h,-w,m),o.lineTo(R.cx+R.x01,R.cy+R.y01),w<I?o.arc(R.cx,R.cy,w,Qt(R.y01,R.x01),Qt(P.y01,P.x01),!m):(o.arc(R.cx,R.cy,w,Qt(R.y01,R.x01),Qt(R.y11,R.x11),!m),o.arc(0,0,h,Qt(R.cy+R.y11,R.cx+R.x11),Qt(P.cy+P.y11,P.cx+P.x11),m),o.arc(P.cx,P.cy,w,Qt(P.y11,P.x11),Qt(P.y01,P.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[Zn(d)*u,Ke(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:ht(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:ht(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:ht(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:ht(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:ht(+u),c):i},c.endAngle=function(u){return arguments.length?(s=typeof u=="function"?u:ht(+u),c):s},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:ht(+u),c):a},c.context=function(u){return arguments.length?(o=u??null,c):o},c}var hT=Array.prototype.slice;function _a(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gf(e){this._context=e}Gf.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 Sa(e){return new Gf(e)}function jl(e){return e[0]}function Zl(e){return e[1]}function Fi(e,t){var n=ht(!0),r=null,i=Sa,s=null,a=xa(o);e=typeof e=="function"?e:e===void 0?jl:ht(e),t=typeof t=="function"?t:t===void 0?Zl:ht(t);function o(l){var c,u=(l=_a(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:ht(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:ht(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:ht(!!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 Kl(e,t,n){var r=null,i=ht(!0),s=null,a=Sa,o=null,l=xa(c);e=typeof e=="function"?e:e===void 0?jl:ht(+e),t=typeof t=="function"?t:ht(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Zl:ht(+n);function c(d){var h,f,p,g=(d=_a(d)).length,v,m=!1,y,E=new Array(g),_=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(E[p],_[p]);o.lineEnd(),o.areaEnd()}m&&(E[h]=+e(v,h,d),_[h]=+t(v,h,d),o.point(r?+r(v,h,d):E[h],n?+n(v,h,d):_[h]))}if(y)return o=null,y+""||null}function u(){return Fi().defined(i).curve(a).context(s)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:ht(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:ht(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:ht(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:ht(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:ht(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:ht(+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:ht(!!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 dT(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function fT(e){return e}function pT(){var e=fT,t=dT,n=null,r=ht(0),i=ht(Ea),s=ht(0);function a(o){var l,c=(o=_a(o)).length,u,d,h=0,f=new Array(c),p=new Array(c),g=+r.apply(this,arguments),v=Math.min(Ea,Math.max(-Ea,i.apply(this,arguments)-g)),m,y=Math.min(Math.abs(v)/c,s.apply(this,arguments)),E=y*(v<0?-1:1),_;for(l=0;l<c;++l)(_=p[f[l]=l]=+e(o[l],l,o))>0&&(h+=_);for(t!=null?f.sort(function(S,b){return t(p[S],p[b])}):n!=null&&f.sort(function(S,b){return n(o[S],o[b])}),l=0,d=h?(v-c*E)/h:0;l<c;++l,g=m)u=f[l],_=p[u],m=g+(_>0?_*d:0)+E,p[u]={data:o[u],index:l,value:_,startAngle:g,endAngle:m,padAngle:y};return p}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:ht(+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:ht(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:ht(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:ht(+o),a):s},a}var gT=zf(Sa);function Vf(e){this._curve=e}Vf.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 zf(e){function t(n){return new Vf(e(n))}return t._curve=e,t}function mT(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(zf(n)):t()._curve},e}function vT(){return mT(Fi().curve(gT))}class yT{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 ET(e){return new yT(e,!0)}function xT(e){return e.source}function bT(e){return e.target}function _T(e){let t=xT,n=bT,r=jl,i=Zl,s=null,a=null,o=xa(l);function l(){let c;const u=hT.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:ht(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:ht(+c),l):i},l.context=function(c){return arguments.length?(c==null?s=a=null:a=e(s=c),l):s},l}function ST(){return _T(ET)}function Dn(){}function Ta(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 wa(e){this._context=e}wa.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:Ta(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:Ta(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TT(e){return new wa(e)}function Wf(e){this._context=e}Wf.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:Ta(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wT(e){return new Wf(e)}function Yf(e){this._context=e}Yf.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:Ta(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OT(e){return new Yf(e)}function qf(e,t){this._basis=new wa(e),this._beta=t}qf.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 MT=function e(t){function n(r){return t===1?new wa(r):new qf(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Oa(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 Ql(e,t){this._context=e,this._k=(1-t)/6}Ql.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:Oa(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:Oa(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 AT=function e(t){function n(r){return new Ql(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Jl(e,t){this._context=e,this._k=(1-t)/6}Jl.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:Oa(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 CT=function e(t){function n(r){return new Jl(r,t)}return n.tension=function(r){return e(+r)},n}(0);function tc(e,t){this._context=e,this._k=(1-t)/6}tc.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:Oa(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 DT=function e(t){function n(r){return new tc(r,t)}return n.tension=function(r){return e(+r)},n}(0);function ec(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Jt){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>Jt){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 Xf(e,t){this._context=e,this._alpha=t}Xf.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:ec(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 LT=function e(t){function n(r){return t?new Xf(r,t):new Ql(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function jf(e,t){this._context=e,this._alpha=t}jf.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:ec(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 RT=function e(t){function n(r){return t?new jf(r,t):new Jl(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Zf(e,t){this._context=e,this._alpha=t}Zf.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:ec(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 IT=function e(t){function n(r){return t?new Zf(r,t):new tc(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Kf(e){this._context=e}Kf.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 Qf(e){return new Kf(e)}function Jf(e){return e<0?-1:1}function tp(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(Jf(s)+Jf(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function ep(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function nc(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 Ma(e){this._context=e}Ma.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:nc(this,this._t0,ep(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,nc(this,ep(this,n=tp(this,e,t)),n);break;default:nc(this,this._t0,n=tp(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function np(e){this._context=new rp(e)}(np.prototype=Object.create(Ma.prototype)).point=function(e,t){Ma.prototype.point.call(this,t,e)};function rp(e){this._context=e}rp.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 kT(e){return new Ma(e)}function PT(e){return new np(e)}function ip(e){this._context=e}ip.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=sp(e),i=sp(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 sp(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 $T(e){return new ip(e)}function Aa(e,t){this._context=e,this._t=t}Aa.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 NT(e){return new Aa(e,.5)}function UT(e){return new Aa(e,0)}function BT(e){return new Aa(e,1)}function ap(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 op(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function FT(e,t){return e[t]}function HT(e){const t=[];return t.key=e,t}function rc(){var e=ht([]),t=op,n=ap,r=FT;function i(s){var a=Array.from(e.apply(this,arguments),HT),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=_a(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:ht(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:ht(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?op:typeof s=="function"?s:ht(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??ap,i):n},i}function GT(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 Hi(e,t,n){this.k=e,this.x=t,this.y=n}Hi.prototype={constructor:Hi,scale:function(e){return e===1?this:new Hi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Hi(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+")"}},Hi.prototype;var VT=typeof global=="object"&&global&&global.Object===Object&&global;const lp=VT;var zT=typeof self=="object"&&self&&self.Object===Object&&self,WT=lp||zT||Function("return this")();const Be=WT;var YT=Be.Symbol;const Oe=YT;var cp=Object.prototype,qT=cp.hasOwnProperty,XT=cp.toString,Gi=Oe?Oe.toStringTag:void 0;function jT(e){var t=qT.call(e,Gi),n=e[Gi];try{e[Gi]=void 0;var r=!0}catch{}var i=XT.call(e);return r&&(t?e[Gi]=n:delete e[Gi]),i}var ZT=Object.prototype,KT=ZT.toString;function QT(e){return KT.call(e)}var JT="[object Null]",tw="[object Undefined]",up=Oe?Oe.toStringTag:void 0;function Kn(e){return e==null?e===void 0?tw:JT:up&&up in Object(e)?jT(e):QT(e)}function Qe(e){return e!=null&&typeof e=="object"}var ew="[object Symbol]";function Ca(e){return typeof e=="symbol"||Qe(e)&&Kn(e)==ew}function hp(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 nw=Array.isArray;const qt=nw;var rw=1/0,dp=Oe?Oe.prototype:void 0,fp=dp?dp.toString:void 0;function pp(e){if(typeof e=="string")return e;if(qt(e))return hp(e,pp)+"";if(Ca(e))return fp?fp.call(e):"";var t=e+"";return t=="0"&&1/e==-rw?"-0":t}var iw=/\s/;function sw(e){for(var t=e.length;t--&&iw.test(e.charAt(t)););return t}var aw=/^\s+/;function ow(e){return e&&e.slice(0,sw(e)+1).replace(aw,"")}function Me(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gp=NaN,lw=/^[-+]0x[0-9a-f]+$/i,cw=/^0b[01]+$/i,uw=/^0o[0-7]+$/i,hw=parseInt;function Vi(e){if(typeof e=="number")return e;if(Ca(e))return gp;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=ow(e);var n=cw.test(e);return n||uw.test(e)?hw(e.slice(2),n?2:8):lw.test(e)?gp:+e}function ic(e){return e}var dw="[object AsyncFunction]",fw="[object Function]",pw="[object GeneratorFunction]",gw="[object Proxy]";function sc(e){if(!Me(e))return!1;var t=Kn(e);return t==fw||t==pw||t==dw||t==gw}var mw=Be["__core-js_shared__"];const ac=mw;var mp=function(){var e=/[^.]+$/.exec(ac&&ac.keys&&ac.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function vw(e){return!!mp&&mp in e}var yw=Function.prototype,Ew=yw.toString;function Qn(e){if(e!=null){try{return Ew.call(e)}catch{}try{return e+""}catch{}}return""}var xw=/[\\^$.*+?()[\]{}|]/g,bw=/^\[object .+?Constructor\]$/,_w=Function.prototype,Sw=Object.prototype,Tw=_w.toString,ww=Sw.hasOwnProperty,Ow=RegExp("^"+Tw.call(ww).replace(xw,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mw(e){if(!Me(e)||vw(e))return!1;var t=sc(e)?Ow:bw;return t.test(Qn(e))}function Aw(e,t){return e==null?void 0:e[t]}function Jn(e,t){var n=Aw(e,t);return Mw(n)?n:void 0}var Cw=Jn(Be,"WeakMap");const oc=Cw;var vp=Object.create,Dw=function(){function e(){}return function(t){if(!Me(t))return{};if(vp)return vp(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Lw=Dw;function Rw(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 Iw(){}function yp(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var kw=800,Pw=16,$w=Date.now;function Nw(e){var t=0,n=0;return function(){var r=$w(),i=Pw-(r-n);if(n=r,i>0){if(++t>=kw)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Uw(e){return function(){return e}}var Bw=function(){try{var e=Jn(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Da=Bw;var Fw=Da?function(e,t){return Da(e,"toString",{configurable:!0,enumerable:!1,value:Uw(t),writable:!0})}:ic,Hw=Nw(Fw);const Gw=Hw;function Vw(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function zw(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 Ww(e){return e!==e}function Yw(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function qw(e,t,n){return t===t?Yw(e,t,n):zw(e,Ww,n)}function Xw(e,t){var n=e==null?0:e.length;return!!n&&qw(e,t,0)>-1}var jw=9007199254740991,Zw=/^(?:0|[1-9]\d*)$/;function lc(e,t){var n=typeof e;return t=t??jw,!!t&&(n=="number"||n!="symbol"&&Zw.test(e))&&e>-1&&e%1==0&&e<t}function La(e,t,n){t=="__proto__"&&Da?Da(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function zi(e,t){return e===t||e!==e&&t!==t}var Kw=Object.prototype,Qw=Kw.hasOwnProperty;function Ep(e,t,n){var r=e[t];(!(Qw.call(e,t)&&zi(r,n))||n===void 0&&!(t in e))&&La(e,t,n)}function Wi(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?La(n,o,l):Ep(n,o,l)}return n}var xp=Math.max;function Jw(e,t,n){return t=xp(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=xp(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),Rw(e,this,o)}}function bp(e,t){return Gw(Jw(e,t,ic),e+"")}var tO=9007199254740991;function cc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=tO}function tr(e){return e!=null&&cc(e.length)&&!sc(e)}function _p(e,t,n){if(!Me(n))return!1;var r=typeof t;return(r=="number"?tr(n)&&lc(t,n.length):r=="string"&&t in n)?zi(n[t],e):!1}function eO(e){return bp(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&&_p(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 nO=Object.prototype;function Ra(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||nO;return e===n}function rO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var iO="[object Arguments]";function Sp(e){return Qe(e)&&Kn(e)==iO}var Tp=Object.prototype,sO=Tp.hasOwnProperty,aO=Tp.propertyIsEnumerable,oO=Sp(function(){return arguments}())?Sp:function(e){return Qe(e)&&sO.call(e,"callee")&&!aO.call(e,"callee")};const Ir=oO;function lO(){return!1}var wp=typeof W=="object"&&W&&!W.nodeType&&W,Op=wp&&typeof module=="object"&&module&&!module.nodeType&&module,cO=Op&&Op.exports===wp,Mp=cO?Be.Buffer:void 0,uO=Mp?Mp.isBuffer:void 0,hO=uO||lO;const kr=hO;var dO="[object Arguments]",fO="[object Array]",pO="[object Boolean]",gO="[object Date]",mO="[object Error]",vO="[object Function]",yO="[object Map]",EO="[object Number]",xO="[object Object]",bO="[object RegExp]",_O="[object Set]",SO="[object String]",TO="[object WeakMap]",wO="[object ArrayBuffer]",OO="[object DataView]",MO="[object Float32Array]",AO="[object Float64Array]",CO="[object Int8Array]",DO="[object Int16Array]",LO="[object Int32Array]",RO="[object Uint8Array]",IO="[object Uint8ClampedArray]",kO="[object Uint16Array]",PO="[object Uint32Array]",Lt={};Lt[MO]=Lt[AO]=Lt[CO]=Lt[DO]=Lt[LO]=Lt[RO]=Lt[IO]=Lt[kO]=Lt[PO]=!0,Lt[dO]=Lt[fO]=Lt[wO]=Lt[pO]=Lt[OO]=Lt[gO]=Lt[mO]=Lt[vO]=Lt[yO]=Lt[EO]=Lt[xO]=Lt[bO]=Lt[_O]=Lt[SO]=Lt[TO]=!1;function $O(e){return Qe(e)&&cc(e.length)&&!!Lt[Kn(e)]}function uc(e){return function(t){return e(t)}}var Ap=typeof W=="object"&&W&&!W.nodeType&&W,Yi=Ap&&typeof module=="object"&&module&&!module.nodeType&&module,NO=Yi&&Yi.exports===Ap,hc=NO&&lp.process,UO=function(){try{var e=Yi&&Yi.require&&Yi.require("util").types;return e||hc&&hc.binding&&hc.binding("util")}catch{}}();const Pr=UO;var Cp=Pr&&Pr.isTypedArray,BO=Cp?uc(Cp):$O;const Ia=BO;var FO=Object.prototype,HO=FO.hasOwnProperty;function Dp(e,t){var n=qt(e),r=!n&&Ir(e),i=!n&&!r&&kr(e),s=!n&&!r&&!i&&Ia(e),a=n||r||i||s,o=a?rO(e.length,String):[],l=o.length;for(var c in e)(t||HO.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||lc(c,l)))&&o.push(c);return o}function Lp(e,t){return function(n){return e(t(n))}}var GO=Lp(Object.keys,Object);const VO=GO;var zO=Object.prototype,WO=zO.hasOwnProperty;function Rp(e){if(!Ra(e))return VO(e);var t=[];for(var n in Object(e))WO.call(e,n)&&n!="constructor"&&t.push(n);return t}function qi(e){return tr(e)?Dp(e):Rp(e)}function YO(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var qO=Object.prototype,XO=qO.hasOwnProperty;function jO(e){if(!Me(e))return YO(e);var t=Ra(e),n=[];for(var r in e)r=="constructor"&&(t||!XO.call(e,r))||n.push(r);return n}function Xi(e){return tr(e)?Dp(e,!0):jO(e)}var ZO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,KO=/^\w*$/;function dc(e,t){if(qt(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ca(e)?!0:KO.test(e)||!ZO.test(e)||t!=null&&e in Object(t)}var QO=Jn(Object,"create");const ji=QO;function JO(){this.__data__=ji?ji(null):{},this.size=0}function tM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var eM="__lodash_hash_undefined__",nM=Object.prototype,rM=nM.hasOwnProperty;function iM(e){var t=this.__data__;if(ji){var n=t[e];return n===eM?void 0:n}return rM.call(t,e)?t[e]:void 0}var sM=Object.prototype,aM=sM.hasOwnProperty;function oM(e){var t=this.__data__;return ji?t[e]!==void 0:aM.call(t,e)}var lM="__lodash_hash_undefined__";function cM(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ji&&t===void 0?lM:t,this}function er(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])}}er.prototype.clear=JO,er.prototype.delete=tM,er.prototype.get=iM,er.prototype.has=oM,er.prototype.set=cM;function uM(){this.__data__=[],this.size=0}function ka(e,t){for(var n=e.length;n--;)if(zi(e[n][0],t))return n;return-1}var hM=Array.prototype,dM=hM.splice;function fM(e){var t=this.__data__,n=ka(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():dM.call(t,n,1),--this.size,!0}function pM(e){var t=this.__data__,n=ka(t,e);return n<0?void 0:t[n][1]}function gM(e){return ka(this.__data__,e)>-1}function mM(e,t){var n=this.__data__,r=ka(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function gn(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])}}gn.prototype.clear=uM,gn.prototype.delete=fM,gn.prototype.get=pM,gn.prototype.has=gM,gn.prototype.set=mM;var vM=Jn(Be,"Map");const Zi=vM;function yM(){this.size=0,this.__data__={hash:new er,map:new(Zi||gn),string:new er}}function EM(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Pa(e,t){var n=e.__data__;return EM(t)?n[typeof t=="string"?"string":"hash"]:n.map}function xM(e){var t=Pa(this,e).delete(e);return this.size-=t?1:0,t}function bM(e){return Pa(this,e).get(e)}function _M(e){return Pa(this,e).has(e)}function SM(e,t){var n=Pa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function mn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mn.prototype.clear=yM,mn.prototype.delete=xM,mn.prototype.get=bM,mn.prototype.has=_M,mn.prototype.set=SM;var TM="Expected a function";function fc(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(TM);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(fc.Cache||mn),n}fc.Cache=mn;var wM=500;function OM(e){var t=fc(e,function(r){return n.size===wM&&n.clear(),r}),n=t.cache;return t}var MM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,AM=/\\(\\)?/g,CM=OM(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(MM,function(n,r,i,s){t.push(i?s.replace(AM,"$1"):r||n)}),t});const DM=CM;function Ki(e){return e==null?"":pp(e)}function Ip(e,t){return qt(e)?e:dc(e,t)?[e]:DM(Ki(e))}var LM=1/0;function $a(e){if(typeof e=="string"||Ca(e))return e;var t=e+"";return t=="0"&&1/e==-LM?"-0":t}function kp(e,t){t=Ip(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[$a(t[n++])];return n&&n==r?e:void 0}function Mt(e,t,n){var r=e==null?void 0:kp(e,t);return r===void 0?n:r}function pc(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Pp=Oe?Oe.isConcatSpreadable:void 0;function RM(e){return qt(e)||Ir(e)||!!(Pp&&e&&e[Pp])}function Na(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=RM),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Na(o,t-1,n,r,i):pc(i,o):r||(i[i.length]=o)}return i}function $p(e){var t=e==null?0:e.length;return t?Na(e,1):[]}var IM=Lp(Object.getPrototypeOf,Object);const gc=IM;var kM="[object Object]",PM=Function.prototype,$M=Object.prototype,Np=PM.toString,NM=$M.hasOwnProperty,UM=Np.call(Object);function BM(e){if(!Qe(e)||Kn(e)!=kM)return!1;var t=gc(e);if(t===null)return!0;var n=NM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Np.call(n)==UM}function FM(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 HM(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:FM(e,t,n)}var GM="\\ud800-\\udfff",VM="\\u0300-\\u036f",zM="\\ufe20-\\ufe2f",WM="\\u20d0-\\u20ff",YM=VM+zM+WM,qM="\\ufe0e\\ufe0f",XM="\\u200d",jM=RegExp("["+XM+GM+YM+qM+"]");function Up(e){return jM.test(e)}function ZM(e){return e.split("")}var Bp="\\ud800-\\udfff",KM="\\u0300-\\u036f",QM="\\ufe20-\\ufe2f",JM="\\u20d0-\\u20ff",tA=KM+QM+JM,eA="\\ufe0e\\ufe0f",nA="["+Bp+"]",mc="["+tA+"]",vc="\\ud83c[\\udffb-\\udfff]",rA="(?:"+mc+"|"+vc+")",Fp="[^"+Bp+"]",Hp="(?:\\ud83c[\\udde6-\\uddff]){2}",Gp="[\\ud800-\\udbff][\\udc00-\\udfff]",iA="\\u200d",Vp=rA+"?",zp="["+eA+"]?",sA="(?:"+iA+"(?:"+[Fp,Hp,Gp].join("|")+")"+zp+Vp+")*",aA=zp+Vp+sA,oA="(?:"+[Fp+mc+"?",mc,Hp,Gp,nA].join("|")+")",lA=RegExp(vc+"(?="+vc+")|"+oA+aA,"g");function cA(e){return e.match(lA)||[]}function uA(e){return Up(e)?cA(e):ZM(e)}function hA(e){return function(t){t=Ki(t);var n=Up(t)?uA(t):void 0,r=n?n[0]:t.charAt(0),i=n?HM(n,1).join(""):t.slice(1);return r[e]()+i}}var dA=hA("toUpperCase");const fA=dA;function pA(e){return fA(Ki(e).toLowerCase())}function gA(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 mA(e){return function(t){return e==null?void 0:e[t]}}var vA={À:"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"},yA=mA(vA);const EA=yA;var xA=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bA="\\u0300-\\u036f",_A="\\ufe20-\\ufe2f",SA="\\u20d0-\\u20ff",TA=bA+_A+SA,wA="["+TA+"]",OA=RegExp(wA,"g");function MA(e){return e=Ki(e),e&&e.replace(xA,EA).replace(OA,"")}var AA=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function CA(e){return e.match(AA)||[]}var DA=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function LA(e){return DA.test(e)}var Wp="\\ud800-\\udfff",RA="\\u0300-\\u036f",IA="\\ufe20-\\ufe2f",kA="\\u20d0-\\u20ff",PA=RA+IA+kA,Yp="\\u2700-\\u27bf",qp="a-z\\xdf-\\xf6\\xf8-\\xff",$A="\\xac\\xb1\\xd7\\xf7",NA="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",UA="\\u2000-\\u206f",BA=" \\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",Xp="A-Z\\xc0-\\xd6\\xd8-\\xde",FA="\\ufe0e\\ufe0f",jp=$A+NA+UA+BA,Zp="['’]",Kp="["+jp+"]",HA="["+PA+"]",Qp="\\d+",GA="["+Yp+"]",Jp="["+qp+"]",tg="[^"+Wp+jp+Qp+Yp+qp+Xp+"]",VA="\\ud83c[\\udffb-\\udfff]",zA="(?:"+HA+"|"+VA+")",WA="[^"+Wp+"]",eg="(?:\\ud83c[\\udde6-\\uddff]){2}",ng="[\\ud800-\\udbff][\\udc00-\\udfff]",$r="["+Xp+"]",YA="\\u200d",rg="(?:"+Jp+"|"+tg+")",qA="(?:"+$r+"|"+tg+")",ig="(?:"+Zp+"(?:d|ll|m|re|s|t|ve))?",sg="(?:"+Zp+"(?:D|LL|M|RE|S|T|VE))?",ag=zA+"?",og="["+FA+"]?",XA="(?:"+YA+"(?:"+[WA,eg,ng].join("|")+")"+og+ag+")*",jA="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ZA="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",KA=og+ag+XA,QA="(?:"+[GA,eg,ng].join("|")+")"+KA,JA=RegExp([$r+"?"+Jp+"+"+ig+"(?="+[Kp,$r,"$"].join("|")+")",qA+"+"+sg+"(?="+[Kp,$r+rg,"$"].join("|")+")",$r+"?"+rg+"+"+ig,$r+"+"+sg,ZA,jA,Qp,QA].join("|"),"g");function tC(e){return e.match(JA)||[]}function eC(e,t,n){return e=Ki(e),t=n?void 0:t,t===void 0?LA(e)?tC(e):CA(e):e.match(t)||[]}var nC="['’]",rC=RegExp(nC,"g");function lg(e){return function(t){return gA(eC(MA(t).replace(rC,"")),e,"")}}var iC=lg(function(e,t,n){return t=t.toLowerCase(),e+(n?pA(t):t)});const sC=iC;function aC(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function cg(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Vi(n),n=n===n?n:0),t!==void 0&&(t=Vi(t),t=t===t?t:0),aC(Vi(e),t,n)}function oC(){this.__data__=new gn,this.size=0}function lC(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function cC(e){return this.__data__.get(e)}function uC(e){return this.__data__.has(e)}var hC=200;function dC(e,t){var n=this.__data__;if(n instanceof gn){var r=n.__data__;if(!Zi||r.length<hC-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mn(r)}return n.set(e,t),this.size=n.size,this}function Fe(e){var t=this.__data__=new gn(e);this.size=t.size}Fe.prototype.clear=oC,Fe.prototype.delete=lC,Fe.prototype.get=cC,Fe.prototype.has=uC,Fe.prototype.set=dC;function fC(e,t){return e&&Wi(t,qi(t),e)}function pC(e,t){return e&&Wi(t,Xi(t),e)}var ug=typeof W=="object"&&W&&!W.nodeType&&W,hg=ug&&typeof module=="object"&&module&&!module.nodeType&&module,gC=hg&&hg.exports===ug,dg=gC?Be.Buffer:void 0,fg=dg?dg.allocUnsafe:void 0;function pg(e,t){if(t)return e.slice();var n=e.length,r=fg?fg(n):new e.constructor(n);return e.copy(r),r}function mC(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 gg(){return[]}var vC=Object.prototype,yC=vC.propertyIsEnumerable,mg=Object.getOwnPropertySymbols,EC=mg?function(e){return e==null?[]:(e=Object(e),mC(mg(e),function(t){return yC.call(e,t)}))}:gg;const yc=EC;function xC(e,t){return Wi(e,yc(e),t)}var bC=Object.getOwnPropertySymbols,_C=bC?function(e){for(var t=[];e;)pc(t,yc(e)),e=gc(e);return t}:gg;const vg=_C;function SC(e,t){return Wi(e,vg(e),t)}function yg(e,t,n){var r=t(e);return qt(e)?r:pc(r,n(e))}function Ec(e){return yg(e,qi,yc)}function TC(e){return yg(e,Xi,vg)}var wC=Jn(Be,"DataView");const xc=wC;var OC=Jn(Be,"Promise");const bc=OC;var MC=Jn(Be,"Set");const Nr=MC;var Eg="[object Map]",AC="[object Object]",xg="[object Promise]",bg="[object Set]",_g="[object WeakMap]",Sg="[object DataView]",CC=Qn(xc),DC=Qn(Zi),LC=Qn(bc),RC=Qn(Nr),IC=Qn(oc),nr=Kn;(xc&&nr(new xc(new ArrayBuffer(1)))!=Sg||Zi&&nr(new Zi)!=Eg||bc&&nr(bc.resolve())!=xg||Nr&&nr(new Nr)!=bg||oc&&nr(new oc)!=_g)&&(nr=function(e){var t=Kn(e),n=t==AC?e.constructor:void 0,r=n?Qn(n):"";if(r)switch(r){case CC:return Sg;case DC:return Eg;case LC:return xg;case RC:return bg;case IC:return _g}return t});const Ur=nr;var kC=Object.prototype,PC=kC.hasOwnProperty;function $C(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&PC.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var NC=Be.Uint8Array;const Ua=NC;function _c(e){var t=new e.constructor(e.byteLength);return new Ua(t).set(new Ua(e)),t}function UC(e,t){var n=t?_c(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var BC=/\w*$/;function FC(e){var t=new e.constructor(e.source,BC.exec(e));return t.lastIndex=e.lastIndex,t}var Tg=Oe?Oe.prototype:void 0,wg=Tg?Tg.valueOf:void 0;function HC(e){return wg?Object(wg.call(e)):{}}function Og(e,t){var n=t?_c(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var GC="[object Boolean]",VC="[object Date]",zC="[object Map]",WC="[object Number]",YC="[object RegExp]",qC="[object Set]",XC="[object String]",jC="[object Symbol]",ZC="[object ArrayBuffer]",KC="[object DataView]",QC="[object Float32Array]",JC="[object Float64Array]",tD="[object Int8Array]",eD="[object Int16Array]",nD="[object Int32Array]",rD="[object Uint8Array]",iD="[object Uint8ClampedArray]",sD="[object Uint16Array]",aD="[object Uint32Array]";function oD(e,t,n){var r=e.constructor;switch(t){case ZC:return _c(e);case GC:case VC:return new r(+e);case KC:return UC(e,n);case QC:case JC:case tD:case eD:case nD:case rD:case iD:case sD:case aD:return Og(e,n);case zC:return new r;case WC:case XC:return new r(e);case YC:return FC(e);case qC:return new r;case jC:return HC(e)}}function Mg(e){return typeof e.constructor=="function"&&!Ra(e)?Lw(gc(e)):{}}var lD="[object Map]";function cD(e){return Qe(e)&&Ur(e)==lD}var Ag=Pr&&Pr.isMap,uD=Ag?uc(Ag):cD;const hD=uD;var dD="[object Set]";function fD(e){return Qe(e)&&Ur(e)==dD}var Cg=Pr&&Pr.isSet,pD=Cg?uc(Cg):fD;const gD=pD;var mD=1,vD=2,yD=4,Dg="[object Arguments]",ED="[object Array]",xD="[object Boolean]",bD="[object Date]",_D="[object Error]",Lg="[object Function]",SD="[object GeneratorFunction]",TD="[object Map]",wD="[object Number]",Rg="[object Object]",OD="[object RegExp]",MD="[object Set]",AD="[object String]",CD="[object Symbol]",DD="[object WeakMap]",LD="[object ArrayBuffer]",RD="[object DataView]",ID="[object Float32Array]",kD="[object Float64Array]",PD="[object Int8Array]",$D="[object Int16Array]",ND="[object Int32Array]",UD="[object Uint8Array]",BD="[object Uint8ClampedArray]",FD="[object Uint16Array]",HD="[object Uint32Array]",At={};At[Dg]=At[ED]=At[LD]=At[RD]=At[xD]=At[bD]=At[ID]=At[kD]=At[PD]=At[$D]=At[ND]=At[TD]=At[wD]=At[Rg]=At[OD]=At[MD]=At[AD]=At[CD]=At[UD]=At[BD]=At[FD]=At[HD]=!0,At[_D]=At[Lg]=At[DD]=!1;function Ba(e,t,n,r,i,s){var a,o=t&mD,l=t&vD,c=t&yD;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!Me(e))return e;var u=qt(e);if(u){if(a=$C(e),!o)return yp(e,a)}else{var d=Ur(e),h=d==Lg||d==SD;if(kr(e))return pg(e,o);if(d==Rg||d==Dg||h&&!i){if(a=l||h?{}:Mg(e),!o)return l?SC(e,pC(a,e)):xC(e,fC(a,e))}else{if(!At[d])return i?e:{};a=oD(e,d,o)}}s||(s=new Fe);var f=s.get(e);if(f)return f;s.set(e,a),gD(e)?e.forEach(function(v){a.add(Ba(v,t,n,v,e,s))}):hD(e)&&e.forEach(function(v,m){a.set(m,Ba(v,t,n,m,e,s))});var p=c?l?TC:Ec:l?Xi:qi,g=u?void 0:p(e);return Vw(g||e,function(v,m){g&&(m=v,v=e[m]),Ep(a,m,Ba(v,t,n,m,e,s))}),a}var GD=1,VD=4;function vn(e){return Ba(e,GD|VD)}var zD="__lodash_hash_undefined__";function WD(e){return this.__data__.set(e,zD),this}function YD(e){return this.__data__.has(e)}function Qi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new mn;++t<n;)this.add(e[t])}Qi.prototype.add=Qi.prototype.push=WD,Qi.prototype.has=YD;function Ig(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 kg(e,t){return e.has(t)}var qD=1,XD=2;function Pg(e,t,n,r,i,s){var a=n&qD,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&XD?new Qi: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(!Ig(t,function(m,y){if(!kg(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 jD(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Sc(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var ZD=1,KD=2,QD="[object Boolean]",JD="[object Date]",tL="[object Error]",eL="[object Map]",nL="[object Number]",rL="[object RegExp]",iL="[object Set]",sL="[object String]",aL="[object Symbol]",oL="[object ArrayBuffer]",lL="[object DataView]",$g=Oe?Oe.prototype:void 0,Tc=$g?$g.valueOf:void 0;function cL(e,t,n,r,i,s,a){switch(n){case lL:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case oL:return!(e.byteLength!=t.byteLength||!s(new Ua(e),new Ua(t)));case QD:case JD:case nL:return zi(+e,+t);case tL:return e.name==t.name&&e.message==t.message;case rL:case sL:return e==t+"";case eL:var o=jD;case iL:var l=r&ZD;if(o||(o=Sc),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=KD,a.set(e,t);var u=Pg(o(e),o(t),r,i,s,a);return a.delete(e),u;case aL:if(Tc)return Tc.call(e)==Tc.call(t)}return!1}var uL=1,hL=Object.prototype,dL=hL.hasOwnProperty;function fL(e,t,n,r,i,s){var a=n&uL,o=Ec(e),l=o.length,c=Ec(t),u=c.length;if(l!=u&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in t:dL.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 E=a?r(y,m,h,t,e,s):r(m,y,h,e,t,s);if(!(E===void 0?m===y||i(m,y,n,r,s):E)){g=!1;break}v||(v=h=="constructor")}if(g&&!v){var _=e.constructor,S=t.constructor;_!=S&&"constructor"in e&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof S=="function"&&S instanceof S)&&(g=!1)}return s.delete(e),s.delete(t),g}var pL=1,Ng="[object Arguments]",Ug="[object Array]",Fa="[object Object]",gL=Object.prototype,Bg=gL.hasOwnProperty;function mL(e,t,n,r,i,s){var a=qt(e),o=qt(t),l=a?Ug:Ur(e),c=o?Ug:Ur(t);l=l==Ng?Fa:l,c=c==Ng?Fa:c;var u=l==Fa,d=c==Fa,h=l==c;if(h&&kr(e)){if(!kr(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new Fe),a||Ia(e)?Pg(e,t,n,r,i,s):cL(e,t,l,n,r,i,s);if(!(n&pL)){var f=u&&Bg.call(e,"__wrapped__"),p=d&&Bg.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,v=p?t.value():t;return s||(s=new Fe),i(g,v,n,r,s)}}return h?(s||(s=new Fe),fL(e,t,n,r,i,s)):!1}function Ha(e,t,n,r,i){return e===t?!0:e==null||t==null||!Qe(e)&&!Qe(t)?e!==e&&t!==t:mL(e,t,n,r,Ha,i)}var vL=1,yL=2;function EL(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 Fe;if(r)var h=r(c,u,l,e,t,d);if(!(h===void 0?Ha(u,c,vL|yL,r,d):h))return!1}}return!0}function Fg(e){return e===e&&!Me(e)}function xL(e){for(var t=qi(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Fg(i)]}return t}function Hg(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function bL(e){var t=xL(e);return t.length==1&&t[0][2]?Hg(t[0][0],t[0][1]):function(n){return n===e||EL(n,e,t)}}function _L(e,t){return e!=null&&t in Object(e)}function SL(e,t,n){t=Ip(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=$a(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&&cc(i)&&lc(a,i)&&(qt(e)||Ir(e)))}function TL(e,t){return e!=null&&SL(e,t,_L)}var wL=1,OL=2;function ML(e,t){return dc(e)&&Fg(t)?Hg($a(e),t):function(n){var r=Mt(n,e);return r===void 0&&r===t?TL(n,e):Ha(t,r,wL|OL)}}function AL(e){return function(t){return t==null?void 0:t[e]}}function CL(e){return function(t){return kp(t,e)}}function DL(e){return dc(e)?AL($a(e)):CL(e)}function Ga(e){return typeof e=="function"?e:e==null?ic:typeof e=="object"?qt(e)?ML(e[0],e[1]):bL(e):DL(e)}function LL(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 RL(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 IL=RL();const Gg=IL;function kL(e,t){return e&&Gg(e,t,qi)}function PL(e,t){return function(n,r){if(n==null)return n;if(!tr(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 $L=PL(kL);const wc=$L;function NL(e,t,n,r){return wc(e,function(i,s,a){t(r,i,n(i),a)}),r}function UL(e,t){return function(n,r){var i=qt(n)?LL:NL,s=t?t():{};return i(n,e,Ga(r),s)}}var BL=function(){return Be.Date.now()};const Oc=BL;var FL="Expected a function",HL=Math.max,GL=Math.min;function Va(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(FL);t=Vi(t)||0,Me(n)&&(u=!!n.leading,d="maxWait"in n,s=d?HL(Vi(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h);function f(b){var M=r,D=i;return r=i=void 0,c=b,a=e.apply(D,M),a}function p(b){return c=b,o=setTimeout(m,t),u?f(b):a}function g(b){var M=b-l,D=b-c,G=t-M;return d?GL(G,s-D):G}function v(b){var M=b-l,D=b-c;return l===void 0||M>=t||M<0||d&&D>=s}function m(){var b=Oc();if(v(b))return y(b);o=setTimeout(m,g(b))}function y(b){return o=void 0,h&&r?f(b):(r=i=void 0,a)}function E(){o!==void 0&&clearTimeout(o),c=0,r=l=i=o=void 0}function _(){return o===void 0?a:y(Oc())}function S(){var b=Oc(),M=v(b);if(r=arguments,i=this,l=b,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 S.cancel=E,S.flush=_,S}function Mc(e,t,n){(n!==void 0&&!zi(e[t],n)||n===void 0&&!(t in e))&&La(e,t,n)}function Ac(e){return Qe(e)&&tr(e)}function Cc(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function VL(e){return Wi(e,Xi(e))}function zL(e,t,n,r,i,s,a){var o=Cc(e,n),l=Cc(t,n),c=a.get(l);if(c){Mc(e,n,c);return}var u=s?s(o,l,n+"",e,t,a):void 0,d=u===void 0;if(d){var h=qt(l),f=!h&&kr(l),p=!h&&!f&&Ia(l);u=l,h||f||p?qt(o)?u=o:Ac(o)?u=yp(o):f?(d=!1,u=pg(l,!0)):p?(d=!1,u=Og(l,!0)):u=[]:BM(l)||Ir(l)?(u=o,Ir(o)?u=VL(o):(!Me(o)||sc(o))&&(u=Mg(l))):d=!1}d&&(a.set(l,u),i(u,l,r,s,a),a.delete(l)),Mc(e,n,u)}function Vg(e,t,n,r,i){e!==t&&Gg(t,function(s,a){if(i||(i=new Fe),Me(s))zL(e,t,a,n,Vg,r,i);else{var o=r?r(Cc(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),Mc(e,a,o)}},Xi)}function WL(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 YL(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function qL(e,t){var n=-1,r=tr(e)?Array(e.length):[];return wc(e,function(i,s,a){r[++n]=t(i,s,a)}),r}function XL(e,t){var n=qt(e)?hp:qL;return n(e,Ga(t))}var jL=1/0;function ZL(e,t){return Na(XL(e,t),jL)}function KL(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 QL=Object.prototype,JL=QL.hasOwnProperty,tR=UL(function(e,t,n){JL.call(e,n)?e[n].push(t):La(e,n,[t])});const eR=tR;var nR="[object Map]",rR="[object Set]",iR=Object.prototype,sR=iR.hasOwnProperty;function He(e){if(e==null)return!0;if(tr(e)&&(qt(e)||typeof e=="string"||typeof e.splice=="function"||kr(e)||Ia(e)||Ir(e)))return!e.length;var t=Ur(e);if(t==nR||t==rR)return!e.size;if(Ra(e))return!Rp(e).length;for(var n in e)if(sR.call(e,n))return!1;return!0}function zg(e,t){return Ha(e,t)}var aR=lg(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()});const Br=aR;var oR=eO(function(e,t,n){Vg(e,t,n)});const at=oR;function lR(e,t){var n;return wc(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}function cR(e,t,n){var r=qt(e)?Ig:lR;return n&&_p(e,t,n)&&(t=void 0),r(e,Ga(t))}var uR=1/0,hR=Nr&&1/Sc(new Nr([,-0]))[1]==uR?function(e){return new Nr(e)}:Iw;const dR=hR;var fR=200;function Wg(e,t,n){var r=-1,i=Xw,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=WL;else if(s>=fR){var c=t?null:dR(e);if(c)return Sc(c);a=!1,i=kg,l=new Qi}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 pR=bp(function(e){var t=YL(e);return Ac(t)&&(t=void 0),Wg(Na(e,1,Ac,!0),Ga(t))});const gR=pR;function Ji(e){return e&&e.length?Wg(e):[]}var Dc=(e=>(e.RENDER_FINISHED="render-finished",e.RESIZE="chart-resize",e.MOUSEOVER="chart-mouseover",e.MOUSEOUT="chart-mouseout",e))(Dc||{}),Lc=(e=>(e.SHOW="show-modal",e.HIDE="hide-modal",e))(Lc||{}),Rc=(e=>(e.UPDATE="model-update",e))(Rc||{}),Yg=(e=>(e.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",e.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",e.BUTTON_CLICK="toolbar-button-click",e))(Yg||{}),Ic=(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))(Ic||{}),kc=(e=>(e.CHANGE="zoom-domain-change",e))(kc||{}),Pc=(e=>(e.CANVAS_ZOOM_IN="canvas-zoom-in",e.CANVAS_ZOOM_OUT="canvas-zoom-out",e))(Pc||{}),$c=(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))($c||{}),Nc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(Nc||{}),Uc=(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))(Uc||{}),Bc=(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))(Bc||{}),Fc=(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))(Fc||{}),Hc=(e=>(e.BAR_MOUSEOVER="bar-mouseover",e.BAR_MOUSEMOVE="bar-mousemove",e.BAR_CLICK="bar-click",e.BAR_MOUSEOUT="bar-mouseout",e))(Hc||{}),Gc=(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))(Gc||{}),Vc=(e=>(e.SCATTER_MOUSEOVER="scatter-mouseover",e.SCATTER_MOUSEMOVE="scatter-mousemove",e.SCATTER_CLICK="scatter-click",e.SCATTER_MOUSEOUT="scatter-mouseout",e))(Vc||{}),zc=(e=>(e.POINT_MOUSEOVER="scatter-mouseover",e.POINT_MOUSEMOVE="scatter-mousemove",e.POINT_CLICK="scatter-click",e.POINT_MOUSEOUT="scatter-mouseout",e))(zc||{}),Wc=(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))(Wc||{}),Yc=(e=>(e.NODE_MOUSEOVER="tree-node-mouseover",e.NODE_CLICK="tree-node-click",e.NODE_MOUSEOUT="tree-node-mouseout",e))(Yc||{}),qc=(e=>(e.LEAF_MOUSEOVER="leaf-mouseover",e.LEAF_MOUSEMOVE="leaf-mousemove",e.LEAF_CLICK="leaf-click",e.LEAF_MOUSEOUT="leaf-mouseout",e))(qc||{}),Fr=(e=>(e.SHOW="show-tooltip",e.MOVE="move-tooltip",e.HIDE="hide-tooltip",e))(Fr||{}),Xc=(e=>(e.SHOW="show-threshold",e.HIDE="hide-threshold",e))(Xc||{}),qg=(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))(qg||{}),Xg=(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))(Xg||{}),jg=(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))(jg||{}),Zg=(e=>(e.METER_MOUSEOVER="meter-mouseover",e.METER_CLICK="meter-click",e.METER_MOUSEOUT="meter-mouseout",e.METER_MOUSEMOVE="meter-mousemove",e))(Zg||{}),Kg=(e=>(e.HEATMAP_MOUSEOVER="heatmap-mouseover",e.HEATMAP_CLICK="heatmap-click",e.HEATMAP_MOUSEOUT="heatmap-mouseout",e.HEATMAP_MOUSEMOVE="hetmap-mousemove",e))(Kg||{}),Hr=(e=>(e.CHOROPLETH_MOUSEOVER="choropleth-mouseover",e.CHOROPLETH_CLICK="choropleth-click",e.CHOROPLETH_MOUSEOUT="choropleth-mouseout",e.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",e))(Hr||{});const T=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:jg,Area:Nc,Axis:$c,Bar:Hc,Boxplot:Gc,CanvasZoom:Pc,Chart:Dc,Choropleth:Hr,CirclePack:Xg,Gauge:Fc,Heatmap:Kg,Legend:qg,Line:zc,Meter:Zg,Modal:Lc,Model:Rc,Pie:Bc,Radar:Wc,Scatter:Vc,Threshold:Xc,Toolbar:Yg,Tooltip:Fr,Tree:Yc,Treemap:qc,WordCloud:Uc,ZoomBar:Ic,ZoomDomain:kc},Symbol.toStringTag,{value:"Module"}));var tt=(e=>(e.HTML="html",e.SVG="svg",e))(tt||{}),jc=(e=>(e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10",e))(jc||{}),rt=(e=>(e.BACKGROUND="background",e.FILL="fill",e.STROKE="stroke",e.TOOLTIP="tooltip",e))(rt||{}),z=(e=>(e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom",e))(z||{}),Ge=(e=>(e.GRAPH_VIEW="graph_view",e.SLIDER_VIEW="slider_view",e))(Ge||{}),Ae=(e=>(e.END_LINE="end_line",e.MID_LINE="mid_line",e.FRONT_LINE="front_line",e.NONE="none",e))(Ae||{}),zt=(e=>(e.VERTICAL="vertical",e.HORIZONTAL="horizontal",e))(zt||{}),K=(e=>(e.TIME="time",e.LINEAR="linear",e.LOG="log",e.LABELS="labels",e.LABELS_RATIO="labels-ratio",e))(K||{}),Gr=(e=>(e.RIGHT="right",e.LEFT="left",e.TOP="top",e.BOTTOM="bottom",e))(Gr||{}),Ut=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e))(Ut||{}),Vr=(e=>(e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e))(Vr||{}),za=(e=>(e.TREE="tree",e.DENDROGRAM="dendrogram",e))(za||{}),wt=(e=>(e.ROW="row",e.COLUMN="column",e.ROW_REVERSE="row-reverse",e.COLUMN_REVERSE="column-reverse",e))(wt||{}),lt=(e=>(e.FIXED="fixed",e.PREFERRED="preferred",e.STRETCH="stretch",e))(lt||{}),rr=(e=>(e.CENTER="center",e))(rr||{}),ts=(e=>(e.LEFT="left",e.RIGHT="right",e))(ts||{}),Bt=(e=>(e.GRID="grid",e.VERT_OR_HORIZ="vertOrHoriz",e.PIE="pie",e.DONUT="donut",e))(Bt||{}),Je=(e=>(e.START="start",e.MIDDLE="middle",e.END="end",e))(Je||{}),tn=(e=>(e.BASELINE="baseline",e.MIDDLE="middle",e.HANGING="hanging",e))(tn||{}),ir=(e=>(e.SEMI="semi",e.FULL="full",e))(ir||{}),Wa=(e=>(e.UP="up",e.DOWN="down",e))(Wa||{}),es=(e=>(e.SUCCESS="success",e.WARNING="warning",e.DANGER="danger",e))(es||{}),ns=(e=>(e.ALWAYS="always",e.AUTO="auto",e.NEVER="never",e))(ns||{}),Ee=(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))(Ee||{}),It=(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))(It||{}),Ya=(e=>(e.LEFT="left",e.RIGHT="right",e))(Ya||{}),Ft=(e=>(e.CHECKBOX="checkbox",e.RADIUS="radius",e.AREA="area",e.SIZE="size",e.LINE="line",e.QUARTILE="quartile",e.ZOOM="zoom",e))(Ft||{}),rs=(e=>(e.LINEAR="linear",e.QUANTIZE="quantize",e))(rs||{}),zr=(e=>(e.ON="on",e.AUTO="auto",e.OFF="off",e))(zr||{}),is=(e=>(e.DEFAULT="default",e.HOVERABLE="hoverable",e))(is||{}),en=(e=>(e.geoEqualEarth="geoEqualEarth",e.geoAlbers="geoAlbers",e.geoConicEqualArea="geoConicEqualArea",e.geoConicEquidistant="geoConicEquidistant",e.geoEquirectangular="geoEquirectangular",e.geoMercator="geoMercator",e.geoNaturalEarth1="geoNaturalEarth1",e))(en||{});const ue="cds",yn={opacity:{unselected:.05,selected:.4}},Ln={ticks:{number:7,rotateIfSmallerThan:30,verticalSpaceRatio:2.5,horizontalSpaceRatio:3.5},ratio:{reference:"value",compareTo:"marker"},paddingRatio:.1,hover:{rectanglePadding:4}},Wr={duration:1e3,ease:Xh,zoomLevel:3},Yr={circles:{fillOpacity:.3,hover:{stroke:"#FFF"}},padding:{mainGroup:4,children:2},hierarchyLevel:2},Qg={pairingOptions:{"1-color":4,"2-color":5,"3-color":5,"4-color":3,"5-color":2,"14-color":1}},Ce={circle:{radius:4,opacity:{hovered:1,default:.3}},box:{opacity:{hovered:.5,default:.3}},strokeWidth:{default:1,thicker:2}},mR={defaultBins:10},Pt={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}},En={opacity:{unselected:.3,selected:1},weight:{selected:2,unselected:1}},Xt={statusBar:{paddingRight:5},status:{indicatorSize:16,paddingLeft:15},total:{paddingLeft:36,paddingRight:24},height:{default:8,proportional:16},dividerWidth:2},Ct={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}},sr={opacity:{unselected:.1,selected:.3},xLabelPadding:10,yLabelPadding:8,yTicksNumber:4,minRange:10,xAxisRectHeight:50,dotsRadius:5},Ve={nodeWidth:4,nodeHoveredWidth:8,minNodePadding:24,opacity:{unfocus:.3,default:.8,selected:1}},Jg={minCellDividerDimension:16,chartPadding:.5},tm={default:{size:24}},vR={horizontalOffset:10},em={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}},xe={height:{[Ge.GRAPH_VIEW]:32,[Ge.SLIDER_VIEW]:10},spacerHeight:8,handleWidth:5,handleBarWidth:1,handleBarHeight:12},yR=[{type:Ft.RADIUS,name:"Radius"},{type:Ft.AREA,name:"Poor area"},{type:Ft.AREA,name:"Satisfactory area"},{type:Ft.AREA,name:"Great area"},{type:Ft.QUARTILE,name:"Quartiles"}];function ER(e,t,n){let r=null;return function(...i){const s=this;s.mousePosition=Bn(i[0],n),clearTimeout(r),r=setTimeout(function(){e.apply(s,i)},t)}}function kt(e,t){var i;const n=vn(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://charts.carbondesignsystem.com/?path=/story/docs-tutorials--tabular-data-format");const o=a.mapsTo;if(o==null){const l=a.scaleType;l==null?a.mapsTo="value":l===K.TIME?a.mapsTo="date":l===K.LABELS&&(a.mapsTo="key")}}else delete n.axes[s];return Kc(n,t),at(n,t)}function xn(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 ss(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 Zc(e,t,n="value",r=!1){const i=e/t.reduce((s,a)=>s+a[n],0)*100;return r?i:i%1!==0?parseFloat(i.toFixed(1)):i}function as(e,t,n){if(n>e.length)return e;if(t===Ae.MID_LINE)return e.substr(0,n/2)+"..."+e.substr(-n/2);if(t===Ae.FRONT_LINE)return"..."+e.substr(-n);if(t===Ae.END_LINE)return e.substr(0,n)+"..."}function Kc(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=yR.filter(o=>s.includes(o.type)&&!i.includes(o.type));e.legend.additionalItems=a,t.legend.additionalItems=gR(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},nm=(e,t)=>t===zt.HORIZONTAL?{y0:e.x0,y1:e.x1,x0:e.y0,x1:e.y1}:e,ie=(e,t)=>{const{x0:n,x1:r,y0:i,y1:s}=nm(e,t);return`M${n},${i}L${n},${s}L${r},${s}L${r},${i}L${n},${i}`};function bn(e,t,n){return n===zt.VERTICAL?[e,t]:[t,e]}function yt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function ze(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function rm(e,t){const n=yt(e);return isNaN(t)?ze(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Qc(e,t){const n=yt(e);if(isNaN(t))return ze(e,NaN);if(!t)return n;const r=n.getDate(),i=ze(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const s=i.getDate();return r>=s?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function Jc(e,t){const n=+yt(e);return ze(e,n+t)}const im=6048e5,xR=864e5,sm=6e4,am=36e5;function om(e,t){return Jc(e,t*am)}let bR={};function qa(){return bR}function os(e,t){var o,l,c,u;const n=qa(),r=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=yt(e),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function Xa(e){return os(e,{weekStartsOn:1})}function lm(e){const t=yt(e),n=t.getFullYear(),r=ze(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Xa(r),s=ze(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=Xa(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function cm(e){const t=yt(e);return t.setHours(0,0,0,0),t}function um(e){const 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 hm(e,t){const n=cm(e),r=cm(t),i=n.getTime()-um(n),s=r.getTime()-um(r);return Math.round((i-s)/xR)}function _R(e){const t=lm(e),n=ze(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Xa(n)}function tu(e,t){return Jc(e,t*sm)}function eu(e,t){return Jc(e,t*1e3)}function dm(e,t){return Qc(e,t*12)}function ls(e,t){const n=yt(e),r=yt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function SR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function TR(e){if(!SR(e)&&typeof e!="number")return!1;const t=yt(e);return!isNaN(Number(t))}function wR(e,t){const n=yt(e),r=yt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function OR(e,t){const n=yt(e),r=yt(t);return n.getFullYear()-r.getFullYear()}function MR(e,t){const n=yt(e),r=yt(t),i=fm(n,r),s=Math.abs(hm(n,r));n.setDate(n.getDate()-i*s);const a=+(fm(n,r)===-i),o=i*(s-a);return o===0?0:o}function fm(e,t){const 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 nu(e,t){return yt(e).getTime()-yt(t).getTime()}function ru(e){return e?Math[e]:Math.trunc}function AR(e,t,n){const r=nu(e,t)/am;return ru(n==null?void 0:n.roundingMethod)(r)}function pm(e,t,n){const r=nu(e,t)/sm;return ru(n==null?void 0:n.roundingMethod)(r)}function CR(e){const t=yt(e);return t.setHours(23,59,59,999),t}function DR(e){const t=yt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function LR(e){const t=yt(e);return+CR(t)==+DR(t)}function RR(e,t){const n=yt(e),r=yt(t),i=ls(n,r),s=Math.abs(wR(n,r));let a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);let o=ls(n,r)===-i;LR(yt(e))&&s===1&&ls(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function gm(e,t,n){const r=nu(e,t)/1e3;return ru(n==null?void 0:n.roundingMethod)(r)}function IR(e,t){const n=yt(e),r=yt(t),i=ls(n,r),s=Math.abs(OR(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=ls(n,r)===-i,o=i*(s-+a);return o===0?0:o}function kR(e){const t=yt(e),n=ze(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const PR={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"}},$R=(e,t,n)=>{let r;const i=PR[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function iu(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const NR={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},UR={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},BR={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},FR={date:iu({formats:NR,defaultWidth:"full"}),time:iu({formats:UR,defaultWidth:"full"}),dateTime:iu({formats:BR,defaultWidth:"full"})},HR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},GR=(e,t,n,r)=>HR[e];function cs(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const VR={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zR={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},WR={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"]},YR={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"]},qR={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"}},XR={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"}},jR={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:cs({values:VR,defaultWidth:"wide"}),quarter:cs({values:zR,defaultWidth:"wide",argumentCallback:e=>e-1}),month:cs({values:WR,defaultWidth:"wide"}),day:cs({values:YR,defaultWidth:"wide"}),dayPeriod:cs({values:qR,defaultWidth:"wide",formattingValues:XR,defaultFormattingWidth:"wide"})};function us(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?KR(o,d=>d.test(a)):ZR(o,d=>d.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function ZR(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function KR(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function QR(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const JR=/^(\d+)(th|st|nd|rd)?/i,tI=/\d+/i,eI={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},nI={any:[/^b/i,/^(a|c)/i]},rI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iI={any:[/1/i,/2/i,/3/i,/4/i]},sI={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},aI={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]},oI={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},lI={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]},cI={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},uI={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}},hI={ordinalNumber:QR({matchPattern:JR,parsePattern:tI,valueCallback:e=>parseInt(e,10)}),era:us({matchPatterns:eI,defaultMatchWidth:"wide",parsePatterns:nI,defaultParseWidth:"any"}),quarter:us({matchPatterns:rI,defaultMatchWidth:"wide",parsePatterns:iI,defaultParseWidth:"any",valueCallback:e=>e+1}),month:us({matchPatterns:sI,defaultMatchWidth:"wide",parsePatterns:aI,defaultParseWidth:"any"}),day:us({matchPatterns:oI,defaultMatchWidth:"wide",parsePatterns:lI,defaultParseWidth:"any"}),dayPeriod:us({matchPatterns:cI,defaultMatchWidth:"any",parsePatterns:uI,defaultParseWidth:"any"})},mm={code:"en-US",formatDistance:$R,formatLong:FR,formatRelative:GR,localize:jR,match:hI,options:{weekStartsOn:0,firstWeekContainsDate:1}};function dI(e){const t=yt(e);return hm(t,kR(t))+1}function fI(e){const t=yt(e),n=Xa(t).getTime()-_R(t).getTime();return Math.round(n/im)+1}function vm(e,t){var u,d,h,f;const n=yt(e),r=n.getFullYear(),i=qa(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,a=ze(e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=os(a,t),l=ze(e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const c=os(l,t);return n.getTime()>=o.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function pI(e,t){var o,l,c,u;const n=qa(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=vm(e,t),s=ze(e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),os(s,t)}function gI(e,t){const n=yt(e),r=os(n,t).getTime()-pI(n,t).getTime();return Math.round(r/im)+1}function _t(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Rn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return _t(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):_t(n+1,2)},d(e,t){return _t(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return _t(e.getHours()%12||12,t.length)},H(e,t){return _t(e.getHours(),t.length)},m(e,t){return _t(e.getMinutes(),t.length)},s(e,t){return _t(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.floor(r*Math.pow(10,n-3));return _t(i,t.length)}},qr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Rn.y(e,t)},Y:function(e,t,n,r){const i=vm(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return _t(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):_t(s,t.length)},R:function(e,t){const n=lm(e);return _t(n,t.length)},u:function(e,t){const n=e.getFullYear();return _t(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return _t(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return _t(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Rn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return _t(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=gI(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):_t(i,t.length)},I:function(e,t,n){const r=fI(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):_t(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Rn.d(e,t)},D:function(e,t,n){const r=dI(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):_t(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return _t(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return _t(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return _t(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=qr.noon:r===0?i=qr.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=qr.evening:r>=12?i=qr.afternoon:r>=4?i=qr.morning:i=qr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Rn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Rn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):_t(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):_t(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Rn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Rn.s(e,t)},S:function(e,t){return Rn.S(e,t)},X:function(e,t,n,r){const s=(r._originalDate||e).getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Em(s);case"XXXX":case"XX":return ar(s);case"XXXXX":case"XXX":default:return ar(s,":")}},x:function(e,t,n,r){const s=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return Em(s);case"xxxx":case"xx":return ar(s);case"xxxxx":case"xxx":default:return ar(s,":")}},O:function(e,t,n,r){const s=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ym(s,":");case"OOOO":default:return"GMT"+ar(s,":")}},z:function(e,t,n,r){const s=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ym(s,":");case"zzzz":default:return"GMT"+ar(s,":")}},t:function(e,t,n,r){const i=r._originalDate||e,s=Math.floor(i.getTime()/1e3);return _t(s,t.length)},T:function(e,t,n,r){const s=(r._originalDate||e).getTime();return _t(s,t.length)}};function ym(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+_t(s,2)}function Em(e,t){return e%60===0?(e>0?"-":"+")+_t(Math.abs(e)/60,2):ar(e,t)}function ar(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=_t(Math.floor(r/60),2),s=_t(r%60,2);return n+i+t+s}const xm=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},bm=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},vI={p:bm,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return xm(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",xm(r,t)).replace("{{time}}",bm(i,t))}},yI=["D","DD"],EI=["YY","YYYY"];function xI(e){return yI.indexOf(e)!==-1}function bI(e){return EI.indexOf(e)!==-1}function _m(e,t,n){if(e==="YYYY")throw new RangeError(`Use \`yyyy\` instead of \`YYYY\` (in \`${t}\`) for formatting years to the input \`${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 \`${t}\`) for formatting years to the input \`${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 \`${t}\`) for formatting days of the month to the input \`${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 \`${t}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`)}const _I=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,SI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,TI=/^'([^]*?)'?$/,wI=/''/g,OI=/[a-zA-Z]/;function Xr(e,t,n){var u,d,h,f,p,g,v,m;const r=qa(),i=(n==null?void 0:n.locale)??r.locale??mm,s=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((f=(h=r.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((m=(v=r.locale)==null?void 0:v.options)==null?void 0:m.weekStartsOn)??0,o=yt(e);if(!TR(o))throw new RangeError("Invalid time value");const l={firstWeekContainsDate:s,weekStartsOn:a,locale:i,_originalDate:o};return t.match(SI).map(function(y){const E=y[0];if(E==="p"||E==="P"){const _=vI[E];return _(y,i.formatLong)}return y}).join("").match(_I).map(function(y){if(y==="''")return"'";const E=y[0];if(E==="'")return MI(y);const _=mI[E];if(_)return!(n!=null&&n.useAdditionalWeekYearTokens)&&bI(y)&&_m(y,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&xI(y)&&_m(y,t,String(e)),_(o,y,i.localize,l);if(E.match(OI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return y}).join("")}function MI(e){const t=e.match(TI);return t?t[1].replace(wI,"'"):e}function AI(e,t){return rm(e,-t)}function CI(e,t){return Qc(e,-t)}function DI(e,t){return om(e,-t)}function Sm(e,t){return tu(e,-t)}function Tm(e,t){return eu(e,-t)}function LI(e,t){return dm(e,-t)}const jr={type:Ae.END_LINE,threshold:16,numCharacter:14},RI={enabled:!0,position:Gr.BOTTOM,clickable:!0,truncation:jr,alignment:Ut.LEFT,order:null,additionalItems:[]},II={x:{enabled:!0,numberOfTicks:15,alignWithAxisTicks:!1},y:{enabled:!0,numberOfTicks:5,alignWithAxisTicks:!1}},kI={enabled:!0},wm={enabled:!0,showTotal:!0,truncation:jr,groupLabel:"Group"},Om={top:{visible:!0,includeZero:!0,truncation:jr},bottom:{visible:!0,includeZero:!0,truncation:jr},left:{visible:!0,includeZero:!0,truncation:jr},right:{visible:!0,includeZero:!0,truncation:jr}},ja={addSpaceOnEdges:1,showDayName:!1,localeObject:mm,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"}}},PI=typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled),te={width:null,height:null,resizable:!0,theme:jc.WHITE,tooltip:wm,legend:RI,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:It.SHOW_AS_DATATABLE},...PI?[{type:It.MAKE_FULLSCREEN}]:[],{type:It.EXPORT_CSV},{type:It.EXPORT_PNG},{type:It.EXPORT_JPG}]}},Mm=at({},te,{thematic:{projection:en.geoNaturalEarth1}}),hs=at({},te,{axes:Om,timeScale:ja,grid:II,ruler:kI,zoomBar:{zoomRatio:.4,minZoomRatio:.01,top:{enabled:!1,type:Ge.GRAPH_VIEW}}}),or=at({},hs,{bars:{maxWidth:16,spacingFactor:.25},timeScale:at(ja,{addSpaceOnEdges:1})}),$I=at({},or,{}),NI=at({},or,{}),UI=at({},or,{bars:at({},or.bars,{dividerSize:1.5})}),BI=at({},or,{}),su=at({},hs,{points:{radius:4,fillOpacity:.3,filled:!0,enabled:!0}}),FI=su,Am=at({},su,{points:{radius:3,filled:!1,enabled:!0}}),Cm=at({},Am,{timeScale:at(ja,{addSpaceOnEdges:0})}),HI=Cm,GI=at({},hs,{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:Ft.RADIUS,name:"Radius"}]}}),VI=at({},hs,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Ft.AREA,name:"Poor area"},{type:Ft.AREA,name:"Satisfactory area"},{type:Ft.AREA,name:"Great area"},{type:Ft.QUARTILE,name:"Quartiles"}]}}),zI=at({},or,{bars:{dividerSize:1.5},timeScale:at(ja,{addSpaceOnEdges:0})}),WI=at({},te,{tooltip:at({},wm,{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"}}),Dm=at({},te,{pie:{labels:{formatter:null,enabled:!0},alignment:Ut.LEFT,sortFunction:null,valueMapsTo:"value"}}),YI=at({},te,{legend:{enabled:!1},gauge:{type:ir.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:Ut.LEFT}}),qI=at({},Dm,{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:Ut.LEFT}}),Lm=at({},te,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),XI=at({},Lm,{legend:{enabled:!0}}),jI=at({},te,{radar:{axes:{angle:"key",value:"value"},alignment:Ut.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:e=>e??"N/A"}}),ZI=at({},or,{comboChartTypes:[]}),KI=at({tree:{type:za.TREE}},te,{}),QI=at({},te,{data:at(te.data,{groupMapsTo:"name"})}),JI=at({},te,Yr,{data:at(te.data,{groupMapsTo:"name"})}),tk=at({},te,{alluvial:{data:at(te.data,{groupMapsTo:"source"}),nodeAlignment:Ut.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),ek=at({},te,{axes:Om,heatmap:{divider:{state:zr.AUTO},colorLegend:{type:"linear"}}}),nk=at({},Mm,{choropleth:{colorLegend:{type:"linear"}}}),Ot={alluvialChart:tk,areaChart:Cm,axisChart:hs,boxplotChart:BI,bubbleChart:GI,bulletChart:VI,chart:te,circlePackChart:JI,choroplethChart:nk,comboChart:ZI,donutChart:qI,gaugeChart:YI,groupedBarChart:NI,heatmapChart:ek,histogramChart:zI,lineChart:Am,lollipopChart:FI,meterChart:Lm,pieChart:Dm,proportionalMeterChart:XI,radarChart:jI,scatterChart:su,simpleBarChart:$I,stackedAreaChart:HI,stackedBarChart:UI,thematicChart:Mm,treeChart:KI,treemapChart:QI,wordCloudChart:WI};var Rm=(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))(Rm||{});const au=[["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 Im(e,t,n,r,i){const s=t===0,a=Number(Xr(new Date(e),"c"))===2,o=Number(Xr(new Date(e),"q"))===1,l=t!==0?n[t-1]:null;switch(r){case"15seconds":return s||Ka(e)||ds(e,l)||In(e);case"minute":return s||Ka(e)||ds(e,l)||In(e);case"30minutes":return s||Ka(e)||ds(e,l)||In(e);case"hourly":return s||Ka(e)||ds(e,l)||In(e);case"daily":return i?s||a||In(e):s||ds(e,l)||In(e);case"weekly":return s||a||In(e);case"monthly":return s||In(e);case"quarterly":return s||o;case"yearly":return!1;default:throw new Error(`${r} is not a valid time interval.`)}}function ou(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=Im(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 Xr(o,d,{locale:h})}function Za(e){const t=new Date(e);return{M:t.getMonth()+1,d:t.getDate(),H:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}}function rk(e){if(e)return e.slice(1).map((t,n)=>t-e[n])}function ik(e){const t=au.reduce((n,[,r],i)=>{const s=au[n][1],a=Math.abs(s-e),o=Math.abs(r-e);return a<o?n:i},0);return au[t][0]}function lu(e,t){if(Rm[t])return t;if(e.length===1)return"15seconds";const n=rk(e),r=Mn(n);return ik(r)}function Ka(e){const{s:t,m:n,H:r}=Za(e);return r===0&&n===0&&t===0}function ds(e,t){const n=Za(e).M,r=Za(t).M;return n!==r}function In(e){const{M:t,d:n,s:r,m:i,H:s}=Za(e);return t===1&&n===1&&s===0&&i===0&&r===0}function km(e){return e===void 0?"":e.toISOString()}function sk(e){const t=e.trim();return["=","+","-","@"," ","\r"].includes(t.charAt(0))?` ${t}`:/[,\"\n]/.test(t)?`"${t}"`:t}class nn{constructor(t){this.state={options:{}},this.colorScale={},this.colorClassNames={},this.services=t}formatTable({headers:t,cells:n}){const r=this.getOptions(),i=x(r,"tabularRepModal","tableHeadingFormatter"),s=x(r,"tabularRepModal","tableCellFormatter"),{cartesianScales:a}=this.services,o=a==null?void 0:a.getDomainAxisScaleType();let l;return o===K.TIME&&(l=u=>Xr(u,"MMM d, yyyy")),[typeof i=="function"?i(t):t,...typeof s=="function"?s(n):n.map(u=>(l&&(u[1]=l(u[1])),u))]}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===K.LINEAR||c===K.LOG)&&(r=r.map(u=>({...u,[l]:u[l]===null?u[l]:Number(u[l])}))),l&&a[o].domain)if(c===K.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}=Pt.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(vn(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}=Pt.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 eR(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=mR.defaultBins}=s,l=Array.isArray(o),c=$0().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 rc().keys(r)(s).map((a,o)=>Object.keys(a).filter(l=>!isNaN(l)).map(l=>{const c=a[l];return c[n]=r[o],c}))}getGroupedData(t){const n=this.getDisplayData(t),r={},{groupMapsTo:i}=this.getOptions().data;return n.map(s=>{const a=s[i];r[a]!==null&&r[a]!==void 0?r[a].push(s):r[a]=[s]}),Object.keys(r).map(s=>({name:s,data:r[s]}))}getStackKeys({bins:t=null,groups:n=null}={bins:null,groups:null}){const r=this.getOptions(),i=this.getDisplayData(n);let s;t?s=t.map(l=>`${l.x0}:${l.x1}`):s=Ji(i.map(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l);return l[c]instanceof Date?km(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===K.TIME?s.sort((l,c)=>{const u=new Date(l),d=new Date(c);return u-d}):(o===K.LOG||o===K.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?km(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=KL(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?rc().offset(GT):rc()).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();Kc(n,t),this.set({options:at(n,t)})}update(t=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(T.Model.UPDATE,{animate:t}))}toggleDataLabel(t){const{ACTIVE:n,DISABLED:r}=Pt.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(T.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://charts.carbondesignsystem.com/?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 n=this.getTabularDataArray().map(a=>a.map(o=>`"${(o==="&ndash;"?"–":o).split(/[,;'"`]/).map(u=>sk(u)).join("")}"`)).map(a=>a.join(",")).join(`
2
+ `),r=this.getOptions();let i="myChart";const s=x(r,"fileDownload","fileName");typeof s=="function"?i=s("csv"):typeof s=="string"&&(i=s),this.services.files.downloadCSV(n,`${i}.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}=Pt.items.status,s=this.getOptions(),a=Ji(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=Qg.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=fa().range(o).domain(this.allDataGroups)}}function ak(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 ok=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function _n(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Qa(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function lk(e){const t=Qa(e,"border-left-width"),n=Qa(e,"border-right-width");return e.clientWidth+t+n}function ck(e){const t=Qa(e,"border-top-width"),n=Qa(e,"border-bottom-width");return e.clientHeight+t+n}function Pm(e,t={}){const n=t.width||lk(e),r=t.height||ck(e);return{width:n,height:r}}function uk(){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 be=16384;function hk(e){(e.width>be||e.height>be)&&(e.width>be&&e.height>be?e.width>e.height?(e.height*=be/e.width,e.width=be):(e.width*=be/e.height,e.height=be):e.width>be?(e.height*=be/e.width,e.width=be):(e.width*=be/e.height,e.height=be))}function Ja(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 dk(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function fk(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),dk(i)}const he=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||he(n,t)};function pk(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function gk(e){return _n(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function mk(e,t,n){const r=`.${e}:${t}`,i=n.cssText?pk(n):gk(n);return document.createTextNode(`${r}{${i}}`)}function $m(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const s=ok();try{t.className=`${t.className} ${s}`}catch{return}const a=document.createElement("style");a.appendChild(mk(s,n,r)),t.appendChild(a)}function vk(e,t){$m(e,t,":before"),$m(e,t,":after")}const Nm="application/font-woff",Um="image/jpeg",yk={woff:Nm,woff2:Nm,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Um,jpeg:Um,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Ek(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function cu(e){const t=Ek(e).toLowerCase();return yk[t]||""}function xk(e){return e.split(/,/)[1]}function uu(e){return e.search(/^(data:)/)!==-1}function Bm(e,t){return`data:${t};base64,${e}`}async function Fm(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 hu={};function bk(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 du(e,t,n){const r=bk(e,t,n.includeQueryParams);if(hu[r]!=null)return hu[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const s=await Fm(e,n.fetchRequestInit,({res:a,result:o})=>(t||(t=a.headers.get("Content-Type")||""),xk(o)));i=Bm(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 hu[r]=i,i}async function _k(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ja(t)}async function Sk(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 Ja(o)}const n=e.poster,r=cu(n),i=await du(n,r,t);return Ja(i)}async function Tk(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await to(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function wk(e,t){return he(e,HTMLCanvasElement)?_k(e):he(e,HTMLVideoElement)?Sk(e,t):he(e,HTMLIFrameElement)?Tk(e):e.cloneNode(!1)}const Ok=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function Mk(e,t,n){var r,i;let s=[];return Ok(e)&&e.assignedNodes?s=_n(e.assignedNodes()):he(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=_n(e.contentDocument.body.childNodes):s=_n(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||he(e,HTMLVideoElement)||await s.reduce((a,o)=>a.then(()=>to(o,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function Ak(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):_n(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`),he(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 Ck(e,t){he(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),he(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Dk(e,t){if(he(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function Lk(e,t){return he(t,Element)&&(Ak(e,t),vk(e,t),Ck(e,t),Dk(e,t)),t}async function Rk(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 to(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 to(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>wk(r,t)).then(r=>Mk(e,r,t)).then(r=>Lk(e,r)).then(r=>Rk(r,t))}const Hm=/url\((['"]?)([^'"]+?)\1\)/g,Ik=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,kk=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Pk(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function $k(e){const t=[];return e.replace(Hm,(n,r,i)=>(t.push(i),n)),t.filter(n=>!uu(n))}async function Nk(e,t,n,r,i){try{const s=n?ak(t,n):t,a=cu(t);let o;if(i){const l=await i(s);o=Bm(l,a)}else o=await du(s,a,r);return e.replace(Pk(t),`$1${o}$3`)}catch{}return e}function Uk(e,{preferredFontFormat:t}){return t?e.replace(kk,n=>{for(;;){const[r,,i]=Ik.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Gm(e){return e.search(Hm)!==-1}async function Vm(e,t,n){if(!Gm(e))return e;const r=Uk(e,n);return $k(r).reduce((s,a)=>s.then(o=>Nk(o,a,t,n)),Promise.resolve(r))}async function eo(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const s=await Vm(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}async function Bk(e,t){await eo("background",e,t)||await eo("background-image",e,t),await eo("mask",e,t)||await eo("mask-image",e,t)}async function Fk(e,t){const n=he(e,HTMLImageElement);if(!(n&&!uu(e.src))&&!(he(e,SVGImageElement)&&!uu(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await du(r,cu(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 Hk(e,t){const r=_n(e.childNodes).map(i=>zm(i,t));await Promise.all(r).then(()=>e)}async function zm(e,t){he(e,Element)&&(await Bk(e,t),await Fk(e,t),await Hk(e,t))}function Gk(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 Wm={};async function Ym(e){let t=Wm[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Wm[e]=t,t}async function qm(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),Fm(o,t.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>n)}function Xm(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 Vk(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{_n(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let o=a+1;const l=s.href,c=Ym(l).then(u=>qm(u,t)).then(u=>Xm(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(Ym(i.href).then(o=>qm(o,t)).then(o=>Xm(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{_n(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}function zk(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Gm(t.style.getPropertyValue("src")))}async function Wk(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=_n(e.ownerDocument.styleSheets),r=await Vk(n,t);return zk(r)}async function Yk(e,t){const n=await Wk(e,t);return(await Promise.all(n.map(i=>{const s=i.parentStyleSheet?i.parentStyleSheet.href:null;return Vm(i.cssText,s,t)}))).join(`
3
+ `)}async function qk(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Yk(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 Xk(e,t={}){const{width:n,height:r}=Pm(e,t),i=await to(e,t,!0);return await qk(i,t),await zm(i,t),Gk(i,t),await fk(i,n,r)}async function jm(e,t={}){const{width:n,height:r}=Pm(e,t),i=await Xk(e,t),s=await Ja(i),a=document.createElement("canvas"),o=a.getContext("2d"),l=t.pixelRatio||uk(),c=t.canvasWidth||n,u=t.canvasHeight||r;return a.width=c*l,a.height=u*l,t.skipAutoScale||hk(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 jk(e,t={}){return(await jm(e,t)).toDataURL()}async function Zk(e,t={}){return(await jm(e,t)).toDataURL("image/jpeg",t.quality||1)}class Sn{constructor(t,n){this.model=t,this.services=n,this.init()}init(){}update(){}setModel(t){this.model=t}setServices(t){this.services=t}}const Kk="DONT_STYLE_ME_css_styles_verifier";class A extends Sn{constructor(t,n){super(t,n)}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=L(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.initializeID(),this.styleHolderElement(),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=L(this.getHolder()).append("div").classed(`${ue}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");r.append("g").attr("class",Kk),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),L(this.getHolder()).classed(`${ue}--chart-holder`,!0).attr("data-carbon-theme",i)}getHolder(){return this.model.get("holder")}exportToJPG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=L(r);i.classed("filled",!0),Zk(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=x(n,"fileDownload","fileName");typeof o=="function"?a=o("jpg"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.jpg`),i.classed("filled",!1)})}exportToPNG(){const t=this,n=this.model.getOptions(),r=this.getHolder(),i=L(r);i.classed("filled",!0),jk(this.getMainContainer(),{quality:1,filter:s=>!(s.classList&&s.classList.contains("cds--cc--toolbar"))}).then(function(s){var l;let a="myChart";const o=x(n,"fileDownload","fileName");typeof o=="function"?a=o("png"):typeof o=="string"&&(a=o),(l=t.services.files)==null||l.downloadImage(s,`${a}.png`),i.classed("filled",!1)}).catch(function(s){console.error("oops, something went wrong!",s)})}toggleFullscreen(){const t=this.getHolder();L(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=L(this.getHolder()),n=t.classed("fullscreen");t.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:t}=A.getSVGElementSize(L(this.mainContainer),{useBBox:!0}),n=L(this.mainContainer).attr("class"),r=L(this.mainContainer).selectAll(`.${n} > svg`);let i=0;r.nodes().forEach(function(s){i+=Number(A.getSVGElementSize(L(s),{useBBox:!0}).height)}),i<=t?L(this.mainContainer).attr("height",i):L(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const t=this.getHolder();t&&L(t).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(T.Chart.MOUSEOUT)})}addResizeListener(){const t=this.getHolder();if(!t)return;let n=t.clientWidth,r=t.clientHeight;const i=Va(()=>{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(T.Chart.RESIZE))},12.5);new ResizeObserver(i).observe(t)}}class ft{constructor(t,n,r){if(this.type="",this.renderType=tt.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(L(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(`${ue}--${i}--${this.type}`,!0),n&&n.classed(`${ue}--${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===tt.SVG?"svg":"div"}${r}.${ue}--${n}--${this.type}`);if(t.withinChartClip){const s=this.model.get("chartClipId");if(s){const o=L(`#${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?at({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:Zm,setPrototypeOf:Km,isFrozen:Qk,getPrototypeOf:Jk,getOwnPropertyDescriptor:Qm}=Object;let{freeze:se,seal:We,create:Jm}=Object,{apply:fu,construct:pu}=typeof Reflect<"u"&&Reflect;se||(se=function(t){return t}),We||(We=function(t){return t}),fu||(fu=function(t,n,r){return t.apply(n,r)}),pu||(pu=function(t,n){return new t(...n)});const no=De(Array.prototype.forEach),tv=De(Array.prototype.pop),fs=De(Array.prototype.push),ro=De(String.prototype.toLowerCase),gu=De(String.prototype.toString),t2=De(String.prototype.match),ps=De(String.prototype.replace),e2=De(String.prototype.indexOf),n2=De(String.prototype.trim),_e=De(RegExp.prototype.test),gs=r2(TypeError);function De(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return fu(e,t,r)}}function r2(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return pu(e,n)}}function ut(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ro;Km&&Km(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(Qk(t)||(t[r]=s),i=s)}e[i]=!0}return e}function Zr(e){const t=Jm(null);for(const[n,r]of Zm(e))Qm(e,n)!==void 0&&(t[n]=r);return t}function io(e,t){for(;e!==null;){const r=Qm(e,t);if(r){if(r.get)return De(r.get);if(typeof r.value=="function")return De(r.value)}e=Jk(e)}function n(r){return console.warn("fallback value for",r),null}return n}const ev=se(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),mu=se(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),vu=se(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),i2=se(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),yu=se(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),s2=se(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nv=se(["#text"]),rv=se(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Eu=se(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),iv=se(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),so=se(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),a2=We(/\{\{[\w\W]*|[\w\W]*\}\}/gm),o2=We(/<%[\w\W]*|[\w\W]*%>/gm),l2=We(/\${[\w\W]*}/gm),c2=We(/^data-[\-\w.\u00B7-\uFFFF]/),u2=We(/^aria-[\-\w]+$/),sv=We(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),h2=We(/^(?:\w+script|data):/i),d2=We(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),av=We(/^html$/i);var ov=Object.freeze({__proto__:null,MUSTACHE_EXPR:a2,ERB_EXPR:o2,TMPLIT_EXPR:l2,DATA_ATTR:c2,ARIA_ATTR:u2,IS_ALLOWED_URI:sv,IS_SCRIPT_OR_DATA:h2,ATTR_WHITESPACE:d2,DOCTYPE_NAME:av});const f2=function(){return typeof window>"u"?null:window},p2=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function lv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f2();const t=nt=>lv(nt);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:f}=e,p=l.prototype,g=io(p,"cloneNode"),v=io(p,"nextSibling"),m=io(p,"childNodes"),y=io(p,"parentNode");if(typeof a=="function"){const nt=n.createElement("template");nt.content&&nt.content.ownerDocument&&(n=nt.content.ownerDocument)}let E,_="";const{implementation:S,createNodeIterator:b,createDocumentFragment:M,getElementsByTagName:D}=n,{importNode:G}=r;let I={};t.isSupported=typeof Zm=="function"&&typeof y=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:w,ERB_EXPR:C,TMPLIT_EXPR:R,DATA_ATTR:P,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:B}=ov;let{IS_ALLOWED_URI:U}=ov,N=null;const j=ut({},[...ev,...mu,...vu,...yu,...nv]);let Y=null;const it=ut({},[...rv,...Eu,...iv,...so]);let et=Object.seal(Jm(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,Q=null,pt=!0,ot=!0,Tt=!1,Z=!0,F=!1,V=!1,$=!1,mt=!1,gt=!1,Ht=!1,Gt=!1,st=!0,Rt=!1;const ur="user-content-";let Le=!0,xs=!1,ii={},si=null;const n0=ut({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let r0=null;const i0=ut({},["audio","video","img","source","image","track"]);let Xu=null;const s0=ut({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),So="http://www.w3.org/1998/Math/MathML",To="http://www.w3.org/2000/svg",wn="http://www.w3.org/1999/xhtml";let ai=wn,ju=!1,Zu=null;const vF=ut({},[So,To,wn],gu);let hr=null;const yF=["application/xhtml+xml","text/html"],EF="text/html";let Yt=null,oi=null;const xF=n.createElement("form"),a0=function(k){return k instanceof RegExp||k instanceof Function},Ku=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(oi&&oi===k)){if((!k||typeof k!="object")&&(k={}),k=Zr(k),hr=yF.indexOf(k.PARSER_MEDIA_TYPE)===-1?hr=EF:hr=k.PARSER_MEDIA_TYPE,Yt=hr==="application/xhtml+xml"?gu:ro,N="ALLOWED_TAGS"in k?ut({},k.ALLOWED_TAGS,Yt):j,Y="ALLOWED_ATTR"in k?ut({},k.ALLOWED_ATTR,Yt):it,Zu="ALLOWED_NAMESPACES"in k?ut({},k.ALLOWED_NAMESPACES,gu):vF,Xu="ADD_URI_SAFE_ATTR"in k?ut(Zr(s0),k.ADD_URI_SAFE_ATTR,Yt):s0,r0="ADD_DATA_URI_TAGS"in k?ut(Zr(i0),k.ADD_DATA_URI_TAGS,Yt):i0,si="FORBID_CONTENTS"in k?ut({},k.FORBID_CONTENTS,Yt):n0,q="FORBID_TAGS"in k?ut({},k.FORBID_TAGS,Yt):{},Q="FORBID_ATTR"in k?ut({},k.FORBID_ATTR,Yt):{},ii="USE_PROFILES"in k?k.USE_PROFILES:!1,pt=k.ALLOW_ARIA_ATTR!==!1,ot=k.ALLOW_DATA_ATTR!==!1,Tt=k.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,F=k.SAFE_FOR_TEMPLATES||!1,V=k.WHOLE_DOCUMENT||!1,gt=k.RETURN_DOM||!1,Ht=k.RETURN_DOM_FRAGMENT||!1,Gt=k.RETURN_TRUSTED_TYPE||!1,mt=k.FORCE_BODY||!1,st=k.SANITIZE_DOM!==!1,Rt=k.SANITIZE_NAMED_PROPS||!1,Le=k.KEEP_CONTENT!==!1,xs=k.IN_PLACE||!1,U=k.ALLOWED_URI_REGEXP||sv,ai=k.NAMESPACE||wn,et=k.CUSTOM_ELEMENT_HANDLING||{},k.CUSTOM_ELEMENT_HANDLING&&a0(k.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(et.tagNameCheck=k.CUSTOM_ELEMENT_HANDLING.tagNameCheck),k.CUSTOM_ELEMENT_HANDLING&&a0(k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(et.attributeNameCheck=k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),F&&(ot=!1),Ht&&(gt=!0),ii&&(N=ut({},[...nv]),Y=[],ii.html===!0&&(ut(N,ev),ut(Y,rv)),ii.svg===!0&&(ut(N,mu),ut(Y,Eu),ut(Y,so)),ii.svgFilters===!0&&(ut(N,vu),ut(Y,Eu),ut(Y,so)),ii.mathMl===!0&&(ut(N,yu),ut(Y,iv),ut(Y,so))),k.ADD_TAGS&&(N===j&&(N=Zr(N)),ut(N,k.ADD_TAGS,Yt)),k.ADD_ATTR&&(Y===it&&(Y=Zr(Y)),ut(Y,k.ADD_ATTR,Yt)),k.ADD_URI_SAFE_ATTR&&ut(Xu,k.ADD_URI_SAFE_ATTR,Yt),k.FORBID_CONTENTS&&(si===n0&&(si=Zr(si)),ut(si,k.FORBID_CONTENTS,Yt)),Le&&(N["#text"]=!0),V&&ut(N,["html","head","body"]),N.table&&(ut(N,["tbody"]),delete q.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw gs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw gs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=k.TRUSTED_TYPES_POLICY,_=E.createHTML("")}else E===void 0&&(E=p2(f,i)),E!==null&&typeof _=="string"&&(_=E.createHTML(""));se&&se(k),oi=k}},o0=ut({},["mi","mo","mn","ms","mtext"]),l0=ut({},["foreignobject","desc","title","annotation-xml"]),bF=ut({},["title","style","font","a","script"]),wo=ut({},mu);ut(wo,vu),ut(wo,i2);const Qu=ut({},yu);ut(Qu,s2);const _F=function(k){let X=y(k);(!X||!X.tagName)&&(X={namespaceURI:ai,tagName:"template"});const J=ro(k.tagName),Dt=ro(X.tagName);return Zu[k.namespaceURI]?k.namespaceURI===To?X.namespaceURI===wn?J==="svg":X.namespaceURI===So?J==="svg"&&(Dt==="annotation-xml"||o0[Dt]):!!wo[J]:k.namespaceURI===So?X.namespaceURI===wn?J==="math":X.namespaceURI===To?J==="math"&&l0[Dt]:!!Qu[J]:k.namespaceURI===wn?X.namespaceURI===To&&!l0[Dt]||X.namespaceURI===So&&!o0[Dt]?!1:!Qu[J]&&(bF[J]||!wo[J]):!!(hr==="application/xhtml+xml"&&Zu[k.namespaceURI]):!1},dr=function(k){fs(t.removed,{element:k});try{k.parentNode.removeChild(k)}catch{k.remove()}},Ju=function(k,X){try{fs(t.removed,{attribute:X.getAttributeNode(k),from:X})}catch{fs(t.removed,{attribute:null,from:X})}if(X.removeAttribute(k),k==="is"&&!Y[k])if(gt||Ht)try{dr(X)}catch{}else try{X.setAttribute(k,"")}catch{}},c0=function(k){let X=null,J=null;if(mt)k="<remove></remove>"+k;else{const ne=t2(k,/^[\r\n\t ]+/);J=ne&&ne[0]}hr==="application/xhtml+xml"&&ai===wn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const Dt=E?E.createHTML(k):k;if(ai===wn)try{X=new h().parseFromString(Dt,hr)}catch{}if(!X||!X.documentElement){X=S.createDocument(ai,"template",null);try{X.documentElement.innerHTML=ju?_:Dt}catch{}}const ee=X.body||X.documentElement;return k&&J&&ee.insertBefore(n.createTextNode(J),ee.childNodes[0]||null),ai===wn?D.call(X,V?"html":"body")[0]:V?X.documentElement:ee},u0=function(k){return b.call(k.ownerDocument||k,k,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null)},SF=function(k){return k instanceof d&&(typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||!(k.attributes instanceof u)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function")},h0=function(k){return typeof o=="function"&&k instanceof o},On=function(k,X,J){I[k]&&no(I[k],Dt=>{Dt.call(t,X,J,oi)})},d0=function(k){let X=null;if(On("beforeSanitizeElements",k,null),SF(k))return dr(k),!0;const J=Yt(k.nodeName);if(On("uponSanitizeElement",k,{tagName:J,allowedTags:N}),k.hasChildNodes()&&!h0(k.firstElementChild)&&_e(/<[/\w]/g,k.innerHTML)&&_e(/<[/\w]/g,k.textContent))return dr(k),!0;if(!N[J]||q[J]){if(!q[J]&&p0(J)&&(et.tagNameCheck instanceof RegExp&&_e(et.tagNameCheck,J)||et.tagNameCheck instanceof Function&&et.tagNameCheck(J)))return!1;if(Le&&!si[J]){const Dt=y(k)||k.parentNode,ee=m(k)||k.childNodes;if(ee&&Dt){const ne=ee.length;for(let pe=ne-1;pe>=0;--pe)Dt.insertBefore(g(ee[pe],!0),v(k))}}return dr(k),!0}return k instanceof l&&!_F(k)||(J==="noscript"||J==="noembed"||J==="noframes")&&_e(/<\/no(script|embed|frames)/i,k.innerHTML)?(dr(k),!0):(F&&k.nodeType===3&&(X=k.textContent,no([w,C,R],Dt=>{X=ps(X,Dt," ")}),k.textContent!==X&&(fs(t.removed,{element:k.cloneNode()}),k.textContent=X)),On("afterSanitizeElements",k,null),!1)},f0=function(k,X,J){if(st&&(X==="id"||X==="name")&&(J in n||J in xF))return!1;if(!(ot&&!Q[X]&&_e(P,X))){if(!(pt&&_e(O,X))){if(!Y[X]||Q[X]){if(!(p0(k)&&(et.tagNameCheck instanceof RegExp&&_e(et.tagNameCheck,k)||et.tagNameCheck instanceof Function&&et.tagNameCheck(k))&&(et.attributeNameCheck instanceof RegExp&&_e(et.attributeNameCheck,X)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck(X))||X==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&_e(et.tagNameCheck,J)||et.tagNameCheck instanceof Function&&et.tagNameCheck(J))))return!1}else if(!Xu[X]){if(!_e(U,ps(J,B,""))){if(!((X==="src"||X==="xlink:href"||X==="href")&&k!=="script"&&e2(J,"data:")===0&&r0[k])){if(!(Tt&&!_e(H,ps(J,B,"")))){if(J)return!1}}}}}}return!0},p0=function(k){return k.indexOf("-")>0},g0=function(k){On("beforeSanitizeAttributes",k,null);const{attributes:X}=k;if(!X)return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y};let Dt=X.length;for(;Dt--;){const ee=X[Dt],{name:ne,namespaceURI:pe,value:fr}=ee,bs=Yt(ne);let ge=ne==="value"?fr:n2(fr);if(J.attrName=bs,J.attrValue=ge,J.keepAttr=!0,J.forceKeepAttr=void 0,On("uponSanitizeAttribute",k,J),ge=J.attrValue,J.forceKeepAttr||(Ju(ne,k),!J.keepAttr))continue;if(!Z&&_e(/\/>/i,ge)){Ju(ne,k);continue}F&&no([w,C,R],v0=>{ge=ps(ge,v0," ")});const m0=Yt(k.nodeName);if(f0(m0,bs,ge)){if(Rt&&(bs==="id"||bs==="name")&&(Ju(ne,k),ge=ur+ge),E&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!pe)switch(f.getAttributeType(m0,bs)){case"TrustedHTML":{ge=E.createHTML(ge);break}case"TrustedScriptURL":{ge=E.createScriptURL(ge);break}}try{pe?k.setAttributeNS(pe,ne,ge):k.setAttribute(ne,ge),tv(t.removed)}catch{}}}On("afterSanitizeAttributes",k,null)},TF=function nt(k){let X=null;const J=u0(k);for(On("beforeSanitizeShadowDOM",k,null);X=J.nextNode();)On("uponSanitizeShadowNode",X,null),!d0(X)&&(X.content instanceof s&&nt(X.content),g0(X));On("afterSanitizeShadowDOM",k,null)};return t.sanitize=function(nt){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X=null,J=null,Dt=null,ee=null;if(ju=!nt,ju&&(nt="<!-->"),typeof nt!="string"&&!h0(nt))if(typeof nt.toString=="function"){if(nt=nt.toString(),typeof nt!="string")throw gs("dirty is not a string, aborting")}else throw gs("toString is not a function");if(!t.isSupported)return nt;if($||Ku(k),t.removed=[],typeof nt=="string"&&(xs=!1),xs){if(nt.nodeName){const fr=Yt(nt.nodeName);if(!N[fr]||q[fr])throw gs("root node is forbidden and cannot be sanitized in-place")}}else if(nt instanceof o)X=c0("<!---->"),J=X.ownerDocument.importNode(nt,!0),J.nodeType===1&&J.nodeName==="BODY"||J.nodeName==="HTML"?X=J:X.appendChild(J);else{if(!gt&&!F&&!V&&nt.indexOf("<")===-1)return E&&Gt?E.createHTML(nt):nt;if(X=c0(nt),!X)return gt?null:Gt?_:""}X&&mt&&dr(X.firstChild);const ne=u0(xs?nt:X);for(;Dt=ne.nextNode();)d0(Dt)||(Dt.content instanceof s&&TF(Dt.content),g0(Dt));if(xs)return nt;if(gt){if(Ht)for(ee=M.call(X.ownerDocument);X.firstChild;)ee.appendChild(X.firstChild);else ee=X;return(Y.shadowroot||Y.shadowrootmode)&&(ee=G.call(r,ee,!0)),ee}let pe=V?X.outerHTML:X.innerHTML;return V&&N["!doctype"]&&X.ownerDocument&&X.ownerDocument.doctype&&X.ownerDocument.doctype.name&&_e(av,X.ownerDocument.doctype.name)&&(pe="<!DOCTYPE "+X.ownerDocument.doctype.name+`>
4
+ `+pe),F&&no([w,C,R],fr=>{pe=ps(pe,fr," ")}),E&&Gt?E.createHTML(pe):pe},t.setConfig=function(){let nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ku(nt),$=!0},t.clearConfig=function(){oi=null,$=!1},t.isValidAttribute=function(nt,k,X){oi||Ku({});const J=Yt(nt),Dt=Yt(k);return f0(J,Dt,X)},t.addHook=function(nt,k){typeof k=="function"&&(I[nt]=I[nt]||[],fs(I[nt],k))},t.removeHook=function(nt){if(I[nt])return tv(I[nt])},t.removeHooks=function(nt){I[nt]&&(I[nt]=[])},t.removeAllHooks=function(){I={}},t}var xu=lv();const ao=e=>xu.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),g2=e=>xu.sanitize(e,{NAMESPACE:"http://www.w3.org/2000/svg",USE_PROFILES:{html:!0,svg:!0,svgFilters:!0}}),rn=e=>xu.sanitize(e,{ALLOWED_TAGS:[]}),bo=class bo extends ft{constructor(){super(...arguments),this.type="toolbar",this.renderType=tt.HTML}init(){const t=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(T.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",t)}),this.services.events.addEventListener(T.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"),l=this;o.merge(a).classed("disabled",c=>c.shouldBeDisabled()).attr("aria-disabled",c=>c.shouldBeDisabled()).attr("aria-label",c=>c.title).html(c=>`
5
5
  <button
6
6
  class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
7
7
  aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${rn(c.id)}`)}" aria-label="${rn(c.title)}">
8
8
  <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">
9
- ${n2(c.iconSVG.content)}
9
+ ${g2(c.iconSVG.content)}
10
10
  </svg>
11
11
  </button>`).each(function(c,u){L(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"),L(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),L(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",t).classed("cds--overflow-menu--open",t)),t?this.services.events.dispatchEvent(T.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(T.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=L(`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=L(`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=L(`#${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=L(`#${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=L(`#${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(T.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===It.CUSTOM?(x(a,"id")===null&&(a.id=`toolbar-button-${bo.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>
12
12
  <circle cx="16" cy="16" r="2"></circle>
13
13
  <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 It.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 It.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 It.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 It.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 It.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(T.Modal.SHOW)};break;case It.EXPORT_CSV:i={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(t)},clickFunction:()=>this.model.exportToCSV()};break;case It.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 It.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 It.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"/>
14
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 It.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
15
- <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 It.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 It.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 It.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 It.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 It.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 It.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)}}};bo.buttonID=0;let Kr=bo;const _o=class _o extends ft{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=_o.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===lt.PREFERRED||i===lt.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(n=>x(n,"growth")===lt.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=A.getHTMLElementSize(n.node()),s=this.configs.direction===wt.ROW||this.configs.direction===wt.ROW_REVERSE,a=x(this.model.getOptions(),"style","prefix"),o=n.classed(`${ue}--${a}--layout-row`,this.configs.direction===wt.ROW).classed(`${ue}--${a}--layout-row-reverse`,this.configs.direction===wt.ROW_REVERSE).classed(`${ue}--${a}--layout-column`,this.configs.direction===wt.COLUMN).classed(`${ue}--${a}--layout-column-reverse`,this.configs.direction===wt.COLUMN_REVERSE).classed(`${ue}--${a}--layout-alignitems-center`,this.configs.alignItems===rr.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=L(this),p=x(u,"renderType")===tt.SVG;d.setParent(p?A.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const g=x(u,"growth");(g===lt.PREFERRED||g===lt.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")===tt.SVG?A.getSVGElementSize(L(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):A.getHTMLElementSize(this);if(d===lt.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")===lt.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")===lt.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())})}};_o.instanceID=Math.floor(Math.random()*99999999999);let ae=_o;class Tn extends ft{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||tm.default.size}px`).style("height",`${this.configs.size||tm.default.size}px`).attr("opacity",0)}}var r2={prefix:"bx",selectorTabbable:`
15
+ <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 It.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 It.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 It.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 It.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 It.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 It.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)}}};bo.buttonID=0;let Kr=bo;const _o=class _o extends ft{constructor(t,n,r,i){super(t,n,i),this.type="layout",this.configs=i,this.children=r,this._instanceID=_o.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===lt.PREFERRED||i===lt.FIXED}).each(function(r){n+=r.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(n=>x(n,"growth")===lt.STRETCH).size()}render(t=!0){const n=this.parent,{width:r,height:i}=A.getHTMLElementSize(n.node()),s=this.configs.direction===wt.ROW||this.configs.direction===wt.ROW_REVERSE,a=x(this.model.getOptions(),"style","prefix"),o=n.classed(`${ue}--${a}--layout-row`,this.configs.direction===wt.ROW).classed(`${ue}--${a}--layout-row-reverse`,this.configs.direction===wt.ROW_REVERSE).classed(`${ue}--${a}--layout-column`,this.configs.direction===wt.COLUMN).classed(`${ue}--${a}--layout-column-reverse`,this.configs.direction===wt.COLUMN_REVERSE).classed(`${ue}--${a}--layout-alignitems-center`,this.configs.alignItems===rr.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=L(this),p=x(u,"renderType")===tt.SVG;d.setParent(p?A.appendOrSelect(h,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):h);const g=x(u,"growth");(g===lt.PREFERRED||g===lt.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")===tt.SVG?A.getSVGElementSize(L(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):A.getHTMLElementSize(this);if(d===lt.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")===lt.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")===lt.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())})}};_o.instanceID=Math.floor(Math.random()*99999999999);let ae=_o;class Tn extends ft{constructor(){super(...arguments),this.type="spacer"}render(t=!1){this.getComponentContainer().style("width",`${this.configs.size||tm.default.size}px`).style("height",`${this.configs.size||tm.default.size}px`).attr("opacity",0)}}var m2={prefix:"bx",selectorTabbable:`
16
16
  a[href], area[href], input:not([disabled]):not([tabindex='-1']),
17
17
  button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),
18
18
  textarea:not([disabled]):not([tabindex='-1']),
@@ -22,9 +22,9 @@
22
22
  button:not([disabled]),select:not([disabled]),
23
23
  textarea:not([disabled]),
24
24
  iframe, object, embed, *[tabindex], *[contenteditable=true]
25
- `},gu=r2;function ev(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 i2(e,t,n){return t&&ev(e.prototype,t),n&&ev(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a2(e){return u2(e)||c2(e)||l2(e)||o2()}function o2(){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 l2(e,t){if(e){if(typeof e=="string")return mu(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 mu(e,t)}}function c2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function u2(e){if(Array.isArray(e))return mu(e)}function mu(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 nv(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,a2(nv(n))):t.push(n),t},[])}function h2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return nv(t).reduce(function(r,i){return i(r)},function(){function r(){s2(this,r)}return i2(r)}())}function vu(e){"@babel/helpers - typeof";return vu=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},vu(e)}function d2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rv(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 f2(e,t,n){return t&&rv(e.prototype,t),n&&rv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function p2(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&&yu(e,t)}function yu(e,t){return yu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},yu(e,t)}function g2(e){var t=v2();return function(){var r=oo(e),i;if(t){var s=oo(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return m2(this,i)}}function m2(e,t){if(t&&(vu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iv(e)}function iv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v2(){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 oo(e){return oo=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},oo(e)}function y2(e){var t=function(n){p2(i,n);var r=g2(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(d2(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,iv(a)),a}return f2(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 Eu(e){"@babel/helpers - typeof";return Eu=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},Eu(e)}function E2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sv(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 x2(e,t,n){return t&&sv(e.prototype,t),n&&sv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lo(){return typeof Reflect<"u"&&Reflect.get?lo=Reflect.get:lo=function(t,n,r){var i=b2(t,n);if(i){var s=Object.getOwnPropertyDescriptor(i,n);return s.get?s.get.call(arguments.length<3?t:r):s.value}},lo.apply(this,arguments)}function b2(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Qr(e),e!==null););return e}function _2(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&&xu(e,t)}function xu(e,t){return xu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},xu(e,t)}function S2(e){var t=O2();return function(){var r=Qr(e),i;if(t){var s=Qr(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return T2(this,i)}}function T2(e,t){if(t&&(Eu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w2(e)}function w2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O2(){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 Qr(e){return Qr=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Qr(e)}function M2(e){var t=function(n){_2(i,n);var r=S2(i);function i(){var s;E2(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 x2(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)}),lo(Qr(i.prototype),"release",this).call(this)}}]),i}(e);return t}function gs(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 bu(e){"@babel/helpers - typeof";return bu=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},bu(e)}function A2(e){return R2(e)||L2(e)||D2(e)||C2()}function C2(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
27
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D2(e,t){if(e){if(typeof e=="string")return _u(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 _u(e,t)}}function L2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function R2(e){if(Array.isArray(e))return _u(e)}function _u(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 I2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function av(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 k2(e,t,n){return t&&av(e.prototype,t),n&&av(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function P2(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&&Su(e,t)}function Su(e,t){return Su=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Su(e,t)}function $2(e){var t=B2();return function(){var r=co(e),i;if(t){var s=co(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return N2(this,i)}}function N2(e,t){if(t&&(bu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U2(e)}function U2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B2(){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 co(e){return co=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},co(e)}function F2(e){var t=function(n){P2(i,n);var r=$2(i);function i(){return I2(this,i),r.apply(this,arguments)}return k2(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(_){return _[0].toUpperCase()+_.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 E=[u,d].filter(Boolean);this._changeState.apply(this,A2(E).concat([function(){v.dispatchEvent(new CustomEvent(a.options["eventAfter".concat(p)],{bubbles:!0,cancelable:!0,detail:d})),h&&h()}]))}}}]),i}(e);return t}function Tu(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 ov(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 wu(e){"@babel/helpers - typeof";return wu=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},wu(e)}function H2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lv(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 G2(e,t,n){return t&&lv(e.prototype,t),n&&lv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function V2(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&&Ou(e,t)}function Ou(e,t){return Ou=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Ou(e,t)}function z2(e){var t=q2();return function(){var r=uo(e),i;if(t){var s=uo(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return W2(this,i)}}function W2(e,t){if(t&&(wu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y2(e)}function Y2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q2(){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 uo(e){return uo=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},uo(e)}function X2(e){var t=function(n){V2(i,n);var r=z2(i);function i(){return H2(this,i),r.apply(this,arguments)}return G2(i,[{key:"show",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("shown",ov(a),o)}},{key:"hide",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("hidden",ov(a),o)}}]),i}(e);return t}var j2=[F2,X2];const Z2=j2;function K2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Q2(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 Mu(e){"@babel/helpers - typeof";return Mu=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},Mu(e)}function J2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cv(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 tP(e,t,n){return t&&cv(e.prototype,t),n&&cv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function eP(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&&Au(e,t)}function Au(e,t){return Au=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Au(e,t)}function nP(e){var t=sP();return function(){var r=ho(e),i;if(t){var s=ho(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return rP(this,i)}}function rP(e,t){if(t&&(Mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iP(e)}function iP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sP(){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 ho(e){return ho=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ho(e)}function aP(e){var t=function(n){eP(i,n);var r=nP(i);function i(){return J2(this,i),r.apply(this,arguments)}return tP(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 gs(o,d,function(h){var f=Tu(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 Cu(e){"@babel/helpers - typeof";return Cu=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},Cu(e)}function oP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uv(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 lP(e,t,n){return t&&uv(e.prototype,t),n&&uv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cP(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&&Du(e,t)}function Du(e,t){return Du=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Du(e,t)}function uP(e){var t=fP();return function(){var r=fo(e),i;if(t){var s=fo(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return hP(this,i)}}function hP(e,t){if(t&&(Cu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dP(e)}function dP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fP(){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 fo(e){return fo=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},fo(e)}var pP=function(e){cP(n,e);var t=uP(n);function n(r,i){var s;return oP(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!Tu(a,l)})&&s.element.querySelector(gu.selectorTabbable).focus()},s._hookCloseActions(),s}return lP(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(gu.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(gs(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(gs(this.element,"transitionend",c))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(gs(this.element,"click",function(s){var a=Tu(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(gs(this.element.ownerDocument.body,"keydown",function(s){s.which===27&&i.shouldStateBeChanged("hidden")&&(s.stopPropagation(),i.hide(s))}))}}],[{key:"options",get:function(){var i=gu.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}(h2(y2,aP,Z2,M2));const gP=pP;class po extends ft{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const i=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${i}__modal-title`).attr("aria-describedby",`${i}__modal-description`).attr("tabindex",-1),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),gP.create(this.modal.node()).show(),document.addEventListener("modal-hidden",this.handleHideModal)},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null),document.removeEventListener("modal-hidden",this.handleHideModal)},this.init()}addEventListeners(){this.services.events.addEventListener(T.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(T.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),r=x(n,"style","prefix"),i=this.model.getTabularDataArray();return`
25
+ `},bu=m2;function cv(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 v2(e,t,n){return t&&cv(e.prototype,t),n&&cv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E2(e){return S2(e)||_2(e)||b2(e)||x2()}function x2(){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 b2(e,t){if(e){if(typeof e=="string")return _u(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 _u(e,t)}}function _2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function S2(e){if(Array.isArray(e))return _u(e)}function _u(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 uv(e){return e.reduce(function(t,n){return Array.isArray(n)?t.push.apply(t,E2(uv(n))):t.push(n),t},[])}function T2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return uv(t).reduce(function(r,i){return i(r)},function(){function r(){y2(this,r)}return v2(r)}())}function Su(e){"@babel/helpers - typeof";return Su=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},Su(e)}function w2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hv(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 O2(e,t,n){return t&&hv(e.prototype,t),n&&hv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function M2(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&&Tu(e,t)}function Tu(e,t){return Tu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Tu(e,t)}function A2(e){var t=D2();return function(){var r=oo(e),i;if(t){var s=oo(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return C2(this,i)}}function C2(e,t){if(t&&(Su(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dv(e)}function dv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D2(){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 oo(e){return oo=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},oo(e)}function L2(e){var t=function(n){M2(i,n);var r=A2(i);function i(s){var a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(w2(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,dv(a)),a}return O2(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 wu(e){"@babel/helpers - typeof";return wu=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},wu(e)}function R2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fv(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 I2(e,t,n){return t&&fv(e.prototype,t),n&&fv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lo(){return typeof Reflect<"u"&&Reflect.get?lo=Reflect.get:lo=function(t,n,r){var i=k2(t,n);if(i){var s=Object.getOwnPropertyDescriptor(i,n);return s.get?s.get.call(arguments.length<3?t:r):s.value}},lo.apply(this,arguments)}function k2(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=Qr(e),e!==null););return e}function P2(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&&Ou(e,t)}function Ou(e,t){return Ou=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Ou(e,t)}function $2(e){var t=B2();return function(){var r=Qr(e),i;if(t){var s=Qr(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return N2(this,i)}}function N2(e,t){if(t&&(wu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U2(e)}function U2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B2(){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 Qr(e){return Qr=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Qr(e)}function F2(e){var t=function(n){P2(i,n);var r=$2(i);function i(){var s;R2(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 I2(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)}),lo(Qr(i.prototype),"release",this).call(this)}}]),i}(e);return t}function ms(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 Mu(e){"@babel/helpers - typeof";return Mu=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},Mu(e)}function H2(e){return W2(e)||z2(e)||V2(e)||G2()}function G2(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
27
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V2(e,t){if(e){if(typeof e=="string")return Au(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 Au(e,t)}}function z2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function W2(e){if(Array.isArray(e))return Au(e)}function Au(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 Y2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pv(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 q2(e,t,n){return t&&pv(e.prototype,t),n&&pv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function X2(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&&Cu(e,t)}function Cu(e,t){return Cu=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Cu(e,t)}function j2(e){var t=Q2();return function(){var r=co(e),i;if(t){var s=co(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return Z2(this,i)}}function Z2(e,t){if(t&&(Mu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return K2(e)}function K2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q2(){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 co(e){return co=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},co(e)}function J2(e){var t=function(n){X2(i,n);var r=j2(i);function i(){return Y2(this,i),r.apply(this,arguments)}return q2(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(_){return _[0].toUpperCase()+_.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 E=[u,d].filter(Boolean);this._changeState.apply(this,H2(E).concat([function(){v.dispatchEvent(new CustomEvent(a.options["eventAfter".concat(p)],{bubbles:!0,cancelable:!0,detail:d})),h&&h()}]))}}}]),i}(e);return t}function Du(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 gv(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 Lu(e){"@babel/helpers - typeof";return Lu=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},Lu(e)}function tP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mv(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 eP(e,t,n){return t&&mv(e.prototype,t),n&&mv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function nP(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&&Ru(e,t)}function Ru(e,t){return Ru=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Ru(e,t)}function rP(e){var t=aP();return function(){var r=uo(e),i;if(t){var s=uo(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return iP(this,i)}}function iP(e,t){if(t&&(Lu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sP(e)}function sP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aP(){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 uo(e){return uo=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},uo(e)}function oP(e){var t=function(n){nP(i,n);var r=rP(i);function i(){return tP(this,i),r.apply(this,arguments)}return eP(i,[{key:"show",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("shown",gv(a),o)}},{key:"hide",value:function(a,o){(!a||typeof a=="function")&&(o=a),this.changeState("hidden",gv(a),o)}}]),i}(e);return t}var lP=[J2,oP];const cP=lP;function uP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function hP(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 Iu(e){"@babel/helpers - typeof";return Iu=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},Iu(e)}function dP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vv(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 fP(e,t,n){return t&&vv(e.prototype,t),n&&vv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pP(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&&ku(e,t)}function ku(e,t){return ku=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},ku(e,t)}function gP(e){var t=yP();return function(){var r=ho(e),i;if(t){var s=ho(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return mP(this,i)}}function mP(e,t){if(t&&(Iu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vP(e)}function vP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yP(){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 ho(e){return ho=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ho(e)}function EP(e){var t=function(n){pP(i,n);var r=gP(i);function i(){return dP(this,i),r.apply(this,arguments)}return fP(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 ms(o,d,function(h){var f=Du(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 Pu(e){"@babel/helpers - typeof";return Pu=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},Pu(e)}function xP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yv(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 bP(e,t,n){return t&&yv(e.prototype,t),n&&yv(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _P(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&&$u(e,t)}function $u(e,t){return $u=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},$u(e,t)}function SP(e){var t=OP();return function(){var r=fo(e),i;if(t){var s=fo(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return TP(this,i)}}function TP(e,t){if(t&&(Pu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wP(e)}function wP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OP(){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 fo(e){return fo=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},fo(e)}var MP=function(e){_P(n,e);var t=SP(n);function n(r,i){var s;return xP(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!Du(a,l)})&&s.element.querySelector(bu.selectorTabbable).focus()},s._hookCloseActions(),s}return bP(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(bu.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(ms(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(ms(this.element,"transitionend",c))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(ms(this.element,"click",function(s){var a=Du(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(ms(this.element.ownerDocument.body,"keydown",function(s){s.which===27&&i.shouldStateBeChanged("hidden")&&(s.stopPropagation(),i.hide(s))}))}}],[{key:"options",get:function(){var i=bu.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}(T2(L2,EP,cP,F2));const AP=MP;class po extends ft{constructor(t,n,r){super(t,n,r),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{const i=this.services.domUtils.getChartID();this.modal.attr("data-modal",!0).attr("class","cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby",`${i}__modal-title`).attr("aria-describedby",`${i}__modal-description`).attr("tabindex",-1),this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),AP.create(this.modal.node()).show(),document.addEventListener("modal-hidden",this.handleHideModal)},this.handleHideModal=()=>{this.modal.attr("role",null).attr("aria-modal",null).attr("aria-labelledby",null).attr("aria-describedby",null).attr("tabindex",null),document.removeEventListener("modal-hidden",this.handleHideModal)},this.init()}addEventListeners(){this.services.events.addEventListener(T.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(T.Modal.SHOW,this.handleShowModal)}getModalHTML(){const t=this.services.domUtils.getChartID(),n=this.model.getOptions(),r=x(n,"style","prefix"),i=this.model.getTabularDataArray();return`
28
28
  <div class="cds--modal-container cds--modal-container">
29
29
  <div class="cds--modal-header cds--modal-header">
30
30
  <p class="cds--modal-header__label cds--type-delta cds--modal-header__label cds--type-delta" id="${t}__modal-title">Tabular representation</p>
@@ -60,7 +60,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
60
60
  <div class="${ue}--${r}-modal-footer-spacer"></div>
61
61
  <button class="cds--btn cds--btn--primary cds--btn cds--btn--primary" type="button" data-modal-primary-focus>Download as CSV</button>
62
62
  </div>
63
- </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=L(this.services.domUtils.getHolder()),i=x(n,"style","prefix");this.modal=A.appendOrSelect(r,`div.${ue}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class ms extends ft{constructor(){super(...arguments),this.type="title",this.renderType=tt.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=>rn(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(T.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(T.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(T.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 ct=(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))(ct||{});class Lu extends ft{constructor(){super(...arguments),this.type="legend",this.renderType=tt.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}=Pt.items.status,l=a.some(y=>y.status===o),c=x(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Ut.CENTER).classed("right-aligned",i===Ut.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ct.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===Pt.items.status.ACTIVE});const f=x(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Pt.checkbox.radius,g=h.append("div").classed("checkbox",!0),v=g.merge(d.select("div.checkbox")).attr("role",ct.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(y,E)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${E}-title`)).attr("aria-checked",({status:y})=>y===Pt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",y=>this.model.getColorClassName({classNameTypes:[rt.BACKGROUND],dataGroupName:y.name,originalClassName:"checkbox"})).style("background",y=>y.status===Pt.items.status.ACTIVE?this.model.getFillColor(y.name)||this.model.getStrokeColor(y.name):null).classed("active",function(y){return y.status===Pt.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,E=u.selectAll("div.additional-item").data(m);E.exit().remove();const _=E.enter().append("div").merge(E).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(M,D)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${v.size()+D}-title`));_.selectAll("*").remove();let S,b=1;_.append("svg").classed("icon",!0).each(function(M){const D=L(this);!S||S!=M.type?(S=M.type,b=1):b++,y.addAdditionalItem(D,M,b)}),_.append("p").merge(_.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}=Pt.area;if(n.type===Ft.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Ft.RADIUS){const{iconData:a,fill:o,stroke:l}=Pt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ct.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===Ft.LINE){const a=Pt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ct.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===Ft.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ct.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Pt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Ft.SIZE){const{iconData:a,fill:o,stroke:l}=Pt.size;t.attr("fill","none").attr("role",ct.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===Ft.QUARTILE){const{iconData:a}=Pt.quartile;t.selectAll("rect").attr("role",ct.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===Ft.ZOOM){const{iconData:a,color:o}=x(Pt,"zoom"),l=t.attr("role",ct.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!==Ae.NONE?a.html(function(o){const l=rn(o.name);return l.length>i&&l.length!==s?as(l,r,s):l}):a.html(o=>rn(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(T.Legend.ITEM_HOVER,{hoveredElement:L(this)});const o=L(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==Ae.NONE&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){L(this).datum().name.length>s.threshold&&s.type!==Ae.NONE&&t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(T.Legend.ITEM_CLICK,{clickedElement:L(this)});const o=L(this).datum();t.model.toggleDataLabel(o.name)}).on("mouseout",function(){const a=L(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Ae.NONE&&t.services.events.dispatchEvent(T.Tooltip.HIDE),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,{hoveredElement:L(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(T.Legend.ITEM_MOUSEOUT,{hoveredElement:L(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=L(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class hv extends ft{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=tt.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 mP extends hv{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 Jr,jt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(jt||(jt={}));var dv=(Jr={},Jr[jt.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)}},Jr[jt.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)}},Jr[jt.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)}},Jr[jt.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)}},Jr),fv=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},go=function(){function e(t){t===void 0&&(t={}),this.positions=dv,this.positions=Object.assign({},dv,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:fv.innerHeight,width:fv.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 go;class Ru extends ft{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=tt.HTML,this.isEventListenerAdded=!1,this.positionService=new go,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>${ao(i.detail.content)}</p></div>`:a=ao(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>${ao(i.detail.content)}</p></div>`;l.html(c)}else l.html(`<div class="title-tooltip"><p>${ao(this.model.getOptions().tooltip.customHTML(s,a))}</p></div>`);else l.html(a);l.selectAll(".datapoint-tooltip").each(function(c,u){const d=o[u];o[u]&&o[u].color&&L(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(T.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(T.Tooltip.MOVE,null),this.services.events.removeEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(T.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!==Ae.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=as(a.label,r,s)),a.value&&a.value.length>i&&(a.value=as(a.value,r,s)),a}):t.map(a=>(a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
63
+ </div>`}render(t=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const r=L(this.services.domUtils.getHolder()),i=x(n,"style","prefix");this.modal=A.appendOrSelect(r,`div.${ue}--${i}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class vs extends ft{constructor(){super(...arguments),this.type="title",this.renderType=tt.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=>rn(s)),i.node()&&i.node().offsetWidth<i.node().scrollWidth){const s=this;i.on("mouseover",function(a){s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:i,content:i.text()})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){s.services.events.dispatchEvent(T.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(T.Tooltip.SHOW,{event:l,hoveredElement:t,content:r})}).on("mousemove",function(l){o.services.events.dispatchEvent(T.Tooltip.MOVE,{event:l})}).on("mouseout",function(){o.services.events.dispatchEvent(T.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 ct=(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))(ct||{});class Nu extends ft{constructor(){super(...arguments),this.type="legend",this.renderType=tt.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}=Pt.items.status,l=a.some(y=>y.status===o),c=x(r,"order"),u=this.getComponentContainer().classed("center-aligned",i===Ut.CENTER).classed("right-aligned",i===Ut.RIGHT).classed(s,!0).classed("has-deactivated-items",l).attr("role",ct.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===Pt.items.status.ACTIVE});const f=x(this.getOptions(),"legend","clickable");u.classed("clickable",f&&a.length>1);const p=Pt.checkbox.radius,g=h.append("div").classed("checkbox",!0),v=g.merge(d.select("div.checkbox")).attr("role",ct.CHECKBOX).attr("tabindex",f?0:-1).attr("aria-labelledby",(y,E)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${E}-title`)).attr("aria-checked",({status:y})=>y===Pt.items.status.ACTIVE).attr("width",p*2).attr("height",p*2).attr("class",y=>this.model.getColorClassName({classNameTypes:[rt.BACKGROUND],dataGroupName:y.name,originalClassName:"checkbox"})).style("background",y=>y.status===Pt.items.status.ACTIVE?this.model.getFillColor(y.name)||this.model.getStrokeColor(y.name):null).classed("active",function(y){return y.status===Pt.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,E=u.selectAll("div.additional-item").data(m);E.exit().remove();const _=E.enter().append("div").merge(E).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(M,D)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${v.size()+D}-title`));_.selectAll("*").remove();let S,b=1;_.append("svg").classed("icon",!0).each(function(M){const D=L(this);!S||S!=M.type?(S=M.type,b=1):b++,y.addAdditionalItem(D,M,b)}),_.append("p").merge(_.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}=Pt.area;if(n.type===Ft.RADIUS?t.style("width",`${s}px`).style("height",`${s}px`):t.style("width",`${i}px`).style("height",`${s}px`),n.type===Ft.RADIUS){const{iconData:a,fill:o,stroke:l}=Pt.radius;t.attr("fill","none").selectAll("circle").data(a).enter().append("circle").classed("radius",!0).attr("role",ct.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===Ft.LINE){const a=Pt.line;t.select("line.line").empty()&&t.append("line").classed(`line-${r}`,!0).attr("role",ct.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===Ft.AREA)t.select("rect.area").empty()&&t.append("rect").classed(`area-${r}`,!0).attr("role",ct.IMG).attr("aria-label","area").attr("width",i).attr("height",s).style("fill",r>3&&!n.fill?Pt.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Ft.SIZE){const{iconData:a,fill:o,stroke:l}=Pt.size;t.attr("fill","none").attr("role",ct.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===Ft.QUARTILE){const{iconData:a}=Pt.quartile;t.selectAll("rect").attr("role",ct.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===Ft.ZOOM){const{iconData:a,color:o}=x(Pt,"zoom"),l=t.attr("role",ct.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!==Ae.NONE?a.html(function(o){const l=rn(o.name);return l.length>i&&l.length!==s?as(l,r,s):l}):a.html(o=>rn(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(T.Legend.ITEM_HOVER,{hoveredElement:L(this)});const o=L(this);o.select("div.checkbox").classed("hovered",!0);const l=o.datum();l.name.length>s.threshold&&s.numCharacter<l.name.length&&s.type!==Ae.NONE&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})}).on("mousemove",function(a){L(this).datum().name.length>s.threshold&&s.type!==Ae.NONE&&t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(){t.services.events.dispatchEvent(T.Legend.ITEM_CLICK,{clickedElement:L(this)});const o=L(this).datum();t.model.toggleDataLabel(o.name)}).on("mouseout",function(){const a=L(this);a.select("div.checkbox").classed("hovered",!1),a.datum().name.length>s.threshold&&s.type!==Ae.NONE&&t.services.events.dispatchEvent(T.Tooltip.HIDE),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,{hoveredElement:L(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(T.Legend.ITEM_MOUSEOUT,{hoveredElement:L(this)})}),n.selectAll("g.additional-item").on("mouseover",function(a){const o=L(this),l=o.datum();l.name.length>s.threshold&&t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:o,content:l.name})})}}class Ev extends ft{constructor(t,n,r){super(t,n,r),this.type="chart-clip",this.renderType=tt.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 CP extends Ev{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 Jr,jt;(function(e){e.LEFT="left",e.RIGHT="right",e.TOP="top",e.BOTTOM="bottom"})(jt||(jt={}));var xv=(Jr={},Jr[jt.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)}},Jr[jt.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)}},Jr[jt.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)}},Jr[jt.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)}},Jr),bv=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},go=function(){function e(t){t===void 0&&(t={}),this.positions=xv,this.positions=Object.assign({},xv,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:bv.innerHeight,width:bv.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 go;class Uu extends ft{constructor(t,n,r){super(t,n,r),this.type="tooltip",this.renderType=tt.HTML,this.isEventListenerAdded=!1,this.positionService=new go,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>${ao(i.detail.content)}</p></div>`:a=ao(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>${ao(i.detail.content)}</p></div>`;l.html(c)}else l.html(`<div class="title-tooltip"><p>${ao(this.model.getOptions().tooltip.customHTML(s,a))}</p></div>`);else l.html(a);l.selectAll(".datapoint-tooltip").each(function(c,u){const d=o[u];o[u]&&o[u].color&&L(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(T.Tooltip.MOVE,t=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(t)}),this.services.events.addEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(T.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(T.Tooltip.MOVE,null),this.services.events.removeEventListener(T.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(T.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(T.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!==Ae.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=as(a.label,r,s)),a.value&&a.value.length>i&&(a.value=as(a.value,r,s)),a}):t.map(a=>(a.value=a.value?this.valueFormatter(a.value,a.label):a.value,a))}getTooltipHTML(t){return'<ul class="multi-tooltip">'+t.map(n=>`<li>
64
64
  <div class="datapoint-tooltip${n.bold?" bold":""}">
65
65
  ${n.class||n.color?`<div class="tooltip-color ${n.class}"></div>`:""}
66
66
  <div class="label">
@@ -69,17 +69,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
69
69
  </div>
70
70
  ${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
71
71
  </div>
72
- </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 jr(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 jr(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=L(this.services.domUtils.getHolder()),s=x(n,"style","prefix");this.tooltip=A.appendOrSelect(i,`div.${ue}--${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=Bn(x(t,"detail","event"),n);else{const h=x(i,"zoomBar","top","type"),f=xe.height[h];s&&(a[1]+=f+xe.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=jt.LEFT:a[0]/o<.1?c=jt.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[jt.RIGHT,jt.LEFT,jt.TOP,jt.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=vR;c===jt.LEFT&&(u*=-1);const d=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,d)}}class vP extends Sn{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(T.CanvasZoom.CANVAS_ZOOM_IN,{element:L(t)})}zoomOut(t,n){const r=n||Wr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}}class yP extends Sn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class EP extends Sn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class vs extends Sn{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:vs.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}}class xP extends Sn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(T.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(em,n,"duration")||em.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Ye{constructor(t,n){this.components=[],this.services={canvasZoom:vP,domUtils:A,events:yP,files:EP,gradientUtils:vs,transitions:xP},this.model=new nn(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(T.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(T.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(T.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 Lu(this.model,this.services)],growth:lt.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new mP(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new ms(this.model,this.services)],growth:lt.STRETCH},c={id:"toolbar",components:[new Kr(this.model,this.services)],growth:lt.PREFERRED},u={id:"header",components:[new ae(this.model,this.services,[l,...i?[c]:[]],{direction:wt.ROW,alignItems:rr.CENTER})],growth:lt.PREFERRED},d={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:x(n,"graphFrameRenderType")||tt.SVG},h=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=wt.COLUMN;if(h){const m=x(r,"legend","position");m==="left"?(f=wt.ROW,r.legend.orientation||(r.legend.orientation=Vr.VERTICAL)):m==="right"?(f=wt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Vr.VERTICAL)):m==="bottom"&&(f=wt.COLUMN_REVERSE)}const p={id:"spacer",components:[new Tn(this.model,this.services)],growth:lt.PREFERRED},g={id:"full-frame",components:[new ae(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:lt.STRETCH},v=[];if(o||i){v.push(u);const m={id:"spacer",components:[new Tn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};v.push(m)}return v.push(g),[new Ru(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,v,{direction:wt.COLUMN})]}}class lr extends nn{constructor(t){super(t),this.axisFlavor=is.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===K.TIME&&(u=h=>jr(h,"MMM d, yyyy")),[["Group",s.label,a.label,...o?[o.label]:[],...l?[l.label]:[]],...t.map(h=>[h[r],h[s.identifier]===null?"&ndash;":u?u(h[s.identifier]):h[s.identifier],h[a.identifier]===null||isNaN(h[a.identifier])?"&ndash;":h[a.identifier].toLocaleString(),...o?[h[o.identifier]===null?"&ndash;":h[o.identifier]]:[],...l?[h[l.identifier]===null||isNaN(h[l.identifier])?"&ndash;":h[l.identifier]]:[]])]}setData(t){let n;if(t&&(n=super.setData(t),x(this.getOptions(),"zoomBar",z.TOP,"enabled"))){const r=x(this.getOptions(),"zoomBar",z.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(vn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=Ji(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(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(z).forEach(i=>{const s=z[i],a=n.axes[s];if(a&&a.scaleType===K.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 bP extends lr{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 pv(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 _P(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 Iu(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 SP(e){return e.depth}function TP(e,t){return t-1-e.height}function gv(e,t){return e.sourceLinks.length?e.depth:t-1}function mo(e){return function(){return e}}function mv(e,t){return vo(e.source,t.source)||e.index-t.index}function vv(e,t){return vo(e.target,t.target)||e.index-t.index}function vo(e,t){return e.y0-t.y0}function ku(e){return e.value}function wP(e){return e.index}function OP(e){return e.nodes}function MP(e){return e.links}function yv(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Ev({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 AP(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=wP,l=gv,c,u,d=OP,h=MP,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),S(O),Ev(O),O}p.update=function(O){return Ev(O),O},p.nodeId=function(O){return arguments.length?(o=typeof O=="function"?O:mo(O),p):o},p.nodeAlign=function(O){return arguments.length?(l=typeof O=="function"?O:mo(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:mo(O),p):d},p.links=function(O){return arguments.length?(h=typeof O=="function"?O:mo(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:H}){for(const[U,N]of O.entries())N.index=U,N.sourceLinks=[],N.targetLinks=[];const B=new Map(O.map((U,N)=>[o(U,N,O),U]));for(const[U,N]of H.entries()){N.index=U;let{source:j,target:Y}=N;typeof j!="object"&&(j=N.source=yv(B,j)),typeof Y!="object"&&(Y=N.target=yv(B,Y)),j.sourceLinks.push(N),Y.targetLinks.push(N)}if(u!=null)for(const{sourceLinks:U,targetLinks:N}of O)U.sort(u),N.sort(u)}function v({nodes:O}){for(const H of O)H.value=H.fixedValue===void 0?Math.max(Iu(H.sourceLinks,ku),Iu(H.targetLinks,ku)):H.fixedValue}function m({nodes:O}){const H=O.length;let B=new Set(O),U=new Set,N=0;for(;B.size;){for(const j of B){j.depth=N;for(const{target:Y}of j.sourceLinks)U.add(Y)}if(++N>H)throw new Error("circular link");B=U,U=new Set}}function y({nodes:O}){const H=O.length;let B=new Set(O),U=new Set,N=0;for(;B.size;){for(const j of B){j.height=N;for(const{source:Y}of j.targetLinks)U.add(Y)}if(++N>H)throw new Error("circular link");B=U,U=new Set}}function E({nodes:O}){const H=pv(O,N=>N.depth)+1,B=(n-e-i)/(H-1),U=new Array(H);for(const N of O){const j=Math.max(0,Math.min(H-1,Math.floor(l.call(null,N,H))));N.layer=j,N.x0=e+j*B,N.x1=N.x0+i,U[j]?U[j].push(N):U[j]=[N]}if(c)for(const N of U)N.sort(c);return U}function _(O){const H=_P(O,B=>(r-t-(B.length-1)*a)/Iu(B,ku));for(const B of O){let U=t;for(const N of B){N.y0=U,N.y1=U+N.value*H,U=N.y1+a;for(const j of N.sourceLinks)j.width=j.value*H}U=(r-U+a)/(B.length+1);for(let N=0;N<B.length;++N){const j=B[N];j.y0+=U*(N+1),j.y1+=U*(N+1)}C(B)}}function S(O){const H=E(O);a=Math.min(s,(r-t)/(pv(H,B=>B.length)-1)),_(H);for(let B=0;B<f;++B){const U=Math.pow(.99,B),N=Math.max(1-U,(B+1)/f);M(H,U,N),b(H,U,N)}}function b(O,H,B){for(let U=1,N=O.length;U<N;++U){const j=O[U];for(const Y of j){let it=0,et=0;for(const{source:Q,value:pt}of Y.targetLinks){let ot=pt*(Y.layer-Q.layer);it+=R(Q,Y)*ot,et+=ot}if(!(et>0))continue;let q=(it/et-Y.y0)*H;Y.y0+=q,Y.y1+=q,w(Y)}c===void 0&&j.sort(vo),D(j,B)}}function M(O,H,B){for(let U=O.length,N=U-2;N>=0;--N){const j=O[N];for(const Y of j){let it=0,et=0;for(const{target:Q,value:pt}of Y.sourceLinks){let ot=pt*(Q.layer-Y.layer);it+=P(Y,Q)*ot,et+=ot}if(!(et>0))continue;let q=(it/et-Y.y0)*H;Y.y0+=q,Y.y1+=q,w(Y)}c===void 0&&j.sort(vo),D(j,B)}}function D(O,H){const B=O.length>>1,U=O[B];I(O,U.y0-a,B-1,H),G(O,U.y1+a,B+1,H),I(O,r,O.length-1,H),G(O,t,0,H)}function G(O,H,B,U){for(;B<O.length;++B){const N=O[B],j=(H-N.y0)*U;j>1e-6&&(N.y0+=j,N.y1+=j),H=N.y1+a}}function I(O,H,B,U){for(;B>=0;--B){const N=O[B],j=(N.y1-H)*U;j>1e-6&&(N.y0-=j,N.y1-=j),H=N.y0-a}}function w({sourceLinks:O,targetLinks:H}){if(u===void 0){for(const{source:{sourceLinks:B}}of H)B.sort(vv);for(const{target:{targetLinks:B}}of O)B.sort(mv)}}function C(O){if(u===void 0)for(const{sourceLinks:H,targetLinks:B}of O)H.sort(vv),B.sort(mv)}function R(O,H){let B=O.y0-(O.sourceLinks.length-1)*a/2;for(const{target:U,width:N}of O.sourceLinks){if(U===H)break;B+=N+a}for(const{source:U,width:N}of H.targetLinks){if(U===O)break;B-=N}return B}function P(O,H){let B=H.y0-(H.targetLinks.length-1)*a/2;for(const{source:U,width:N}of H.targetLinks){if(U===O)break;B+=N+a}for(const{target:U,width:N}of O.sourceLinks){if(U===H)break;B-=N}return B}return p}var Pu=Math.PI,$u=2*Pu,cr=1e-6,CP=$u-cr;function Nu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function xv(){return new Nu}Nu.prototype=xv.prototype={constructor:Nu,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>cr)if(!(Math.abs(u*o-l*c)>cr)||!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((Pu-Math.acos((p+d-g)/(2*v*m)))/2),E=y/m,_=y/v;Math.abs(E-1)>cr&&(this._+="L"+(e+E*c)+","+(t+E*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*f)+","+(this._x1=e+_*o)+","+(this._y1=t+_*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)>cr||Math.abs(this._y1-c)>cr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%$u+$u),d>CP?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>cr&&(this._+="A"+n+","+n+",0,"+ +(d>=Pu)+","+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 bv(e){return function(){return e}}function DP(e){return e[0]}function LP(e){return e[1]}var RP=Array.prototype.slice;function IP(e){return e.source}function kP(e){return e.target}function PP(e){var t=IP,n=kP,r=DP,i=LP,s=null;function a(){var o,l=RP.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=xv()),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:bv(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:bv(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function $P(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function NP(){return PP($P)}function UP(e){return[e.source.x1,e.y0]}function BP(e){return[e.target.x0,e.y1]}function FP(){return NP().source(UP).target(BP)}class HP extends ft{constructor(){super(...arguments),this.type="alluvial",this.renderType=tt.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=Ve.minNodePadding;s.alluvial.nodePadding>Ve.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=gv;c===Ut.LEFT?u=SP:c===Ut.RIGHT&&(u=TP);const d=AP().nodeId(m=>m.name).nodeWidth(Ve.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 E=this.services.domUtils.generateElementIDString(`alluvial-category-${y}`),{width:_}=A.getSVGElementSize(L(`text#${E}`),{useBBox:!0});let S=0;return m+S>=_&&(S=-_+4),S});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",E=>m[E.source.name])).call(y=>y.append("stop").attr("offset","100%").attr("stop-color",E=>m[E.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",FP()).attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-line-${m.index}`)).attr("class",m=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[rt.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[rt.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",Ve.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 E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${y}`),{width:_}=A.getSVGElementSize(L(`text#${E}`),{useBBox:!0});return _+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(m,y)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${y}`),{width:_}=A.getSVGElementSize(L(`text#${E}`),{useBBox:!0}),S=(m.y1-m.y0)/2-9;let b=m.x1-m.x0;return m.x1>=_?b=b-(_+16):b+=4,`translate(${b}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=Va((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"?(L(i).lower(),a.style("stroke-opacity",Ve.opacity.default)):a.style("stroke-opacity",function(){return i===this?(L(this).raise(),Ve.opacity.selected):Ve.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(i,s){const a=L(this);r(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(T.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(T.Alluvial.LINE_MOUSEMOVE,{event:i,element:L(this),datum:s}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:i,element:L(this),datum:s})}).on("mouseout",function(i,s){const a=L(this);r(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:i,hoveredElement:a})})}addNodeEventListener(){const t=this,n=Va((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",Ve.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)?(L(this).classed("link-hovered",!0).raise(),Ve.opacity.selected):Ve.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=L(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=ss(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=ss(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(T.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEMOVE,{event:r,element:L(this),datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_CLICK,{event:r,element:L(this),datum:i})}).on("mouseout",function(r,i){const s=L(this),a=ss(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Ve.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=ss(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(T.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.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
+ </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 Xr(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 Xr(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=L(this.services.domUtils.getHolder()),s=x(n,"style","prefix");this.tooltip=A.appendOrSelect(i,`div.${ue}--${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=Bn(x(t,"detail","event"),n);else{const h=x(i,"zoomBar","top","type"),f=xe.height[h];s&&(a[1]+=f+xe.spacerHeight)}const o=n.offsetWidth,l=n.offsetHeight;let c;a[0]/o>.9?c=jt.LEFT:a[0]/o<.1?c=jt.RIGHT:c=this.positionService.findBestPlacementAt({left:a[0],top:a[1]},r,[jt.RIGHT,jt.LEFT,jt.TOP,jt.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:l}));let{horizontalOffset:u}=vR;c===jt.LEFT&&(u*=-1);const d=this.positionService.findPositionAt({left:a[0]+u,top:a[1]},r,c);this.positionService.setElement(r,d)}}class DP extends Sn{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(T.CanvasZoom.CANVAS_ZOOM_IN,{element:L(t)})}zoomOut(t,n){const r=n||Wr;t.transition().duration(r.duration).ease(r.ease).attr("transform",""),this.services.events.dispatchEvent(T.CanvasZoom.CANVAS_ZOOM_OUT)}}class LP extends Sn{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(t,n){this.documentFragment.addEventListener(t,n)}removeEventListener(t,n){this.documentFragment.removeEventListener(t,n)}dispatchEvent(t,n){let r;n?r=new CustomEvent(t,{detail:n}):(r=document.createEvent("Event"),r.initEvent(t,!1,!0)),this.documentFragment.dispatchEvent(r)}}class RP extends Sn{constructor(t,n){super(t,n)}downloadCSV(t,n){const r=document.createElement("a"),i="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([t],{type:i}),n);else if(URL&&"download"in r){const s=URL.createObjectURL(new Blob([t],{type:i}));r.href=s,r.setAttribute("download",n),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}else location.href=`data:application/octet-stream,${encodeURIComponent(t)}`}downloadImage(t,n){const r=document.createElement("a");r.download=n,r.href=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)}}class ys extends Sn{static appendOrUpdateLinearGradient(t){let n=t.svg.select(`defs linearGradient#${t.id}`);n.empty()&&(n=t.svg.append("defs").append("linearGradient").attr("id",t.id).attr("x1",t.x1).attr("x2",t.x2).attr("y1",t.y1).attr("y2",t.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(t.stops).enter().append("stop").attr("offset",r=>r.offset).style("stop-color",r=>r.color).style("stop-opacity",r=>r.opacity)}static getOffsetRatio(t){return(Math.abs(t[1])*100/Math.abs(t[0]-t[1])).toFixed(2)+"%"}static getStops(t,n){const r=t[0]<0&&t[1]>0;let i=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return r&&(i=[{offset:"0%",color:n,opacity:"0.6"},{offset:ys.getOffsetRatio(t),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),i}}class IP extends Sn{constructor(){super(...arguments),this.pendingTransitions={}}init(){var t;(t=this.services.events)==null||t.addEventListener(T.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(em,n,"duration")||em.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Ye{constructor(t,n){this.components=[],this.services={canvasZoom:DP,domUtils:A,events:LP,files:RP,gradientUtils:ys,transitions:IP},this.model=new nn(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(T.Model.UPDATE,r=>{const i=!!x(r,"detail","animate");this.update(i)}),this.model.setData(n.data),this.services.events.addEventListener(T.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(T.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 Nu(this.model,this.services)],growth:lt.PREFERRED},a=x(r,"canvasZoom","enabled");a&&a===!0&&t.push(new CP(this.model,this.services));const o=!!this.model.getOptions().title,l={id:"title",components:[new vs(this.model,this.services)],growth:lt.STRETCH},c={id:"toolbar",components:[new Kr(this.model,this.services)],growth:lt.PREFERRED},u={id:"header",components:[new ae(this.model,this.services,[l,...i?[c]:[]],{direction:wt.ROW,alignItems:rr.CENTER})],growth:lt.PREFERRED},d={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:x(n,"graphFrameRenderType")||tt.SVG},h=x(n,"excludeLegend")!==!0&&r.legend.enabled!==!1;let f=wt.COLUMN;if(h){const m=x(r,"legend","position");m==="left"?(f=wt.ROW,r.legend.orientation||(r.legend.orientation=Vr.VERTICAL)):m==="right"?(f=wt.ROW_REVERSE,r.legend.orientation||(r.legend.orientation=Vr.VERTICAL)):m==="bottom"&&(f=wt.COLUMN_REVERSE)}const p={id:"spacer",components:[new Tn(this.model,this.services)],growth:lt.PREFERRED},g={id:"full-frame",components:[new ae(this.model,this.services,[...h?[s]:[],...h?[p]:[],d],{direction:f})],growth:lt.STRETCH},v=[];if(o||i){v.push(u);const m={id:"spacer",components:[new Tn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};v.push(m)}return v.push(g),[new Uu(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,v,{direction:wt.COLUMN})]}}class lr extends nn{constructor(t){super(t),this.axisFlavor=is.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,{primaryDomain:i,primaryRange:s,secondaryDomain:a,secondaryRange:o}=this.assignRangeAndDomains(),l=["Group",i.label,s.label,...a?[a.label]:[],...o?[o.label]:[]],c=t.map(u=>[u[r],u[i.identifier]===null?"&ndash;":u[i.identifier],u[s.identifier]===null||isNaN(u[s.identifier])?"&ndash;":u[s.identifier].toLocaleString(),...a?[u[a.identifier]===null?"&ndash;":u[a.identifier]]:[],...o?[u[o.identifier]===null||isNaN(u[o.identifier])?"&ndash;":u[o.identifier]]:[]]);return super.formatTable({headers:l,cells:c})}setData(t){let n;if(t&&(n=super.setData(t),x(this.getOptions(),"zoomBar",z.TOP,"enabled"))){const r=x(this.getOptions(),"zoomBar",z.TOP,"data");this.setZoomBarData(r)}return n}setZoomBarData(t){const n=t?this.sanitize(vn(t)):this.getDisplayData();let r=n;const{cartesianScales:i}=this.services;if(n&&i.domainAxisPosition&&i.rangeAxisPosition){const s=i.getDomainIdentifier(),a=i.getRangeIdentifier();let o=n.map(l=>l[s].getTime());o=Ji(o).sort(),r=o.map(l=>{let c=0;const u={};return n.forEach(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(z).forEach(i=>{const s=z[i],a=n.axes[s];if(a&&a.scaleType===K.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 kP extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData();t.sort((i,s)=>i.source.localeCompare(s.source));const n=["Source","Target","Value"],r=[...t.map(i=>[i.source,i.target,i.value])];return super.formatTable({headers:n,cells:r})}}function _v(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 PP(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 Bu(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 $P(e){return e.depth}function NP(e,t){return t-1-e.height}function Sv(e,t){return e.sourceLinks.length?e.depth:t-1}function mo(e){return function(){return e}}function Tv(e,t){return vo(e.source,t.source)||e.index-t.index}function wv(e,t){return vo(e.target,t.target)||e.index-t.index}function vo(e,t){return e.y0-t.y0}function Fu(e){return e.value}function UP(e){return e.index}function BP(e){return e.nodes}function FP(e){return e.links}function Ov(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Mv({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 HP(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=UP,l=Sv,c,u,d=BP,h=FP,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),S(O),Mv(O),O}p.update=function(O){return Mv(O),O},p.nodeId=function(O){return arguments.length?(o=typeof O=="function"?O:mo(O),p):o},p.nodeAlign=function(O){return arguments.length?(l=typeof O=="function"?O:mo(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:mo(O),p):d},p.links=function(O){return arguments.length?(h=typeof O=="function"?O:mo(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:H}){for(const[U,N]of O.entries())N.index=U,N.sourceLinks=[],N.targetLinks=[];const B=new Map(O.map((U,N)=>[o(U,N,O),U]));for(const[U,N]of H.entries()){N.index=U;let{source:j,target:Y}=N;typeof j!="object"&&(j=N.source=Ov(B,j)),typeof Y!="object"&&(Y=N.target=Ov(B,Y)),j.sourceLinks.push(N),Y.targetLinks.push(N)}if(u!=null)for(const{sourceLinks:U,targetLinks:N}of O)U.sort(u),N.sort(u)}function v({nodes:O}){for(const H of O)H.value=H.fixedValue===void 0?Math.max(Bu(H.sourceLinks,Fu),Bu(H.targetLinks,Fu)):H.fixedValue}function m({nodes:O}){const H=O.length;let B=new Set(O),U=new Set,N=0;for(;B.size;){for(const j of B){j.depth=N;for(const{target:Y}of j.sourceLinks)U.add(Y)}if(++N>H)throw new Error("circular link");B=U,U=new Set}}function y({nodes:O}){const H=O.length;let B=new Set(O),U=new Set,N=0;for(;B.size;){for(const j of B){j.height=N;for(const{source:Y}of j.targetLinks)U.add(Y)}if(++N>H)throw new Error("circular link");B=U,U=new Set}}function E({nodes:O}){const H=_v(O,N=>N.depth)+1,B=(n-e-i)/(H-1),U=new Array(H);for(const N of O){const j=Math.max(0,Math.min(H-1,Math.floor(l.call(null,N,H))));N.layer=j,N.x0=e+j*B,N.x1=N.x0+i,U[j]?U[j].push(N):U[j]=[N]}if(c)for(const N of U)N.sort(c);return U}function _(O){const H=PP(O,B=>(r-t-(B.length-1)*a)/Bu(B,Fu));for(const B of O){let U=t;for(const N of B){N.y0=U,N.y1=U+N.value*H,U=N.y1+a;for(const j of N.sourceLinks)j.width=j.value*H}U=(r-U+a)/(B.length+1);for(let N=0;N<B.length;++N){const j=B[N];j.y0+=U*(N+1),j.y1+=U*(N+1)}C(B)}}function S(O){const H=E(O);a=Math.min(s,(r-t)/(_v(H,B=>B.length)-1)),_(H);for(let B=0;B<f;++B){const U=Math.pow(.99,B),N=Math.max(1-U,(B+1)/f);M(H,U,N),b(H,U,N)}}function b(O,H,B){for(let U=1,N=O.length;U<N;++U){const j=O[U];for(const Y of j){let it=0,et=0;for(const{source:Q,value:pt}of Y.targetLinks){let ot=pt*(Y.layer-Q.layer);it+=R(Q,Y)*ot,et+=ot}if(!(et>0))continue;let q=(it/et-Y.y0)*H;Y.y0+=q,Y.y1+=q,w(Y)}c===void 0&&j.sort(vo),D(j,B)}}function M(O,H,B){for(let U=O.length,N=U-2;N>=0;--N){const j=O[N];for(const Y of j){let it=0,et=0;for(const{target:Q,value:pt}of Y.sourceLinks){let ot=pt*(Q.layer-Y.layer);it+=P(Y,Q)*ot,et+=ot}if(!(et>0))continue;let q=(it/et-Y.y0)*H;Y.y0+=q,Y.y1+=q,w(Y)}c===void 0&&j.sort(vo),D(j,B)}}function D(O,H){const B=O.length>>1,U=O[B];I(O,U.y0-a,B-1,H),G(O,U.y1+a,B+1,H),I(O,r,O.length-1,H),G(O,t,0,H)}function G(O,H,B,U){for(;B<O.length;++B){const N=O[B],j=(H-N.y0)*U;j>1e-6&&(N.y0+=j,N.y1+=j),H=N.y1+a}}function I(O,H,B,U){for(;B>=0;--B){const N=O[B],j=(N.y1-H)*U;j>1e-6&&(N.y0-=j,N.y1-=j),H=N.y0-a}}function w({sourceLinks:O,targetLinks:H}){if(u===void 0){for(const{source:{sourceLinks:B}}of H)B.sort(wv);for(const{target:{targetLinks:B}}of O)B.sort(Tv)}}function C(O){if(u===void 0)for(const{sourceLinks:H,targetLinks:B}of O)H.sort(wv),B.sort(Tv)}function R(O,H){let B=O.y0-(O.sourceLinks.length-1)*a/2;for(const{target:U,width:N}of O.sourceLinks){if(U===H)break;B+=N+a}for(const{source:U,width:N}of H.targetLinks){if(U===O)break;B-=N}return B}function P(O,H){let B=H.y0-(H.targetLinks.length-1)*a/2;for(const{source:U,width:N}of H.targetLinks){if(U===O)break;B+=N+a}for(const{target:U,width:N}of O.sourceLinks){if(U===H)break;B-=N}return B}return p}var Hu=Math.PI,Gu=2*Hu,cr=1e-6,GP=Gu-cr;function Vu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Av(){return new Vu}Vu.prototype=Av.prototype={constructor:Vu,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>cr)if(!(Math.abs(u*o-l*c)>cr)||!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((Hu-Math.acos((p+d-g)/(2*v*m)))/2),E=y/m,_=y/v;Math.abs(E-1)>cr&&(this._+="L"+(e+E*c)+","+(t+E*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*f)+","+(this._x1=e+_*o)+","+(this._y1=t+_*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)>cr||Math.abs(this._y1-c)>cr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%Gu+Gu),d>GP?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>cr&&(this._+="A"+n+","+n+",0,"+ +(d>=Hu)+","+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 Cv(e){return function(){return e}}function VP(e){return e[0]}function zP(e){return e[1]}var WP=Array.prototype.slice;function YP(e){return e.source}function qP(e){return e.target}function XP(e){var t=YP,n=qP,r=VP,i=zP,s=null;function a(){var o,l=WP.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Av()),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:Cv(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Cv(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function jP(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function ZP(){return XP(jP)}function KP(e){return[e.source.x1,e.y0]}function QP(e){return[e.target.x0,e.y1]}function JP(){return ZP().source(KP).target(QP)}class t$ extends ft{constructor(){super(...arguments),this.type="alluvial",this.renderType=tt.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=Ve.minNodePadding;s.alluvial.nodePadding>Ve.minNodePadding&&(l=s.alluvial.nodePadding);const c=x(s,"alluvial","nodeAlignment");let u=Sv;c===Ut.LEFT?u=$P:c===Ut.RIGHT&&(u=NP);const d=HP().nodeId(m=>m.name).nodeWidth(Ve.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 E=this.services.domUtils.generateElementIDString(`alluvial-category-${y}`),{width:_}=A.getSVGElementSize(L(`text#${E}`),{useBBox:!0});let S=0;return m+S>=_&&(S=-_+4),S});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",E=>m[E.source.name])).call(y=>y.append("stop").attr("offset","100%").attr("stop-color",E=>m[E.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",JP()).attr("id",m=>this.services.domUtils.generateElementIDString(`alluvial-line-${m.index}`)).attr("class",m=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[rt.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[rt.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",Ve.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 E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${y}`),{width:_}=A.getSVGElementSize(L(`text#${E}`),{useBBox:!0});return _+8}).attr("height",18).attr("stroke-width",2).lower(),v.attr("transform",(m,y)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${y}`),{width:_}=A.getSVGElementSize(L(`text#${E}`),{useBBox:!0}),S=(m.y1-m.y0)/2-9;let b=m.x1-m.x0;return m.x1>=_?b=b-(_+16):b+=4,`translate(${b}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,r=Va((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"?(L(i).lower(),a.style("stroke-opacity",Ve.opacity.default)):a.style("stroke-opacity",function(){return i===this?(L(this).raise(),Ve.opacity.selected):Ve.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(i,s){const a=L(this);r(this,"mouseover"),a.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(T.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(T.Alluvial.LINE_MOUSEMOVE,{event:i,element:L(this),datum:s}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:i,element:L(this),datum:s})}).on("mouseout",function(i,s){const a=L(this);r(this,"mouseout"),a.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:i,element:a,datum:s}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:i,hoveredElement:a})})}addNodeEventListener(){const t=this,n=Va((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",Ve.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)?(L(this).classed("link-hovered",!0).raise(),Ve.opacity.selected):Ve.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=L(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=ss(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=ss(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(T.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEMOVE,{event:r,element:L(this),datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_CLICK,{event:r,element:L(this),datum:i})}).on("mouseout",function(r,i){const s=L(this),a=ss(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",Ve.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=ss(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(T.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.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`
73
73
  <svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
74
74
  <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"/>
75
75
  <rect width="32" height="32"/>
76
- </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class GP extends Ye{constructor(t,n){super(t,n),this.model=new bP(this.services),this.model.setOptions(kt(Ot.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new HP(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri extends ft{constructor(){super(...arguments),this.type="grid-brush",this.renderType=tt.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===K.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=S=>{const b=S[1]-S[0];let M="0,"+b.toString();const D=Math.floor(l/ri.DASH_LENGTH),G=D*ri.DASH_LENGTH;for(let I=0;I<D;I++)M+=","+ri.DASH_LENGTH;M+=","+(l-G),D%2===1&&(M+=",0"),M+=","+b.toString(),M+=","+l.toString(),f.attr("stroke-dasharray",M)},v=S=>{const b=S.selection;b===null||b[0]===b[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(b))},m=(S,b)=>{const M=Bf().range([0,o]).domain(p);let D=[M.invert(S),M.invert(b)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let y;const E=S=>{const b=S.selection;b!==null&&(m(b[0],b[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=ed().extent([[0,0],[o-1,l]]).on("start brush end",v).on("end.brushed",E),s.call(y));const _=this.services.zoom.getZoomRatio();i.on("click",function(S){if(S.shiftKey){const b=this.services.domUtils.getHolder(),M=Bn(s.node(),b)[0];let D=M-o*_/2;D<0&&(D=0);let G=M+o*_/2;G>o&&(G=o),m(D,G)}})}}};ri.DASH_LENGTH=4;let Uu=ri;class VP extends ft{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=tt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=ed(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=x(this.getOptions(),"zoomBar",z.TOP,"type"),a=x(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=xe.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",xe.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ge.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===Ge.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===K.TIME){let v=this.services.zoom.getZoomBarData();if(He(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"),E=x(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(y&&y[0].valueOf()===E[0].valueOf()&&y[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:at([],E),zoomDomain:E?at([],E):m},{skipUpdate:!0}):E===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:at([],m)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(m),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ie(v,b=>b.value));const _=this.model.get("zoomDomain");if(s===Ge.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 b=a.highlightStartMapsTo,M=a.highlightEndMapsTo,D=a.color,G=a.labelMapsTo;a.data.forEach((I,w)=>{A.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(I[b])).attr("width",this.xScale(I[M])-this.xScale(I[b])).style("fill",D&&D.scale[I[G]]?D.scale[I[G]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[I[G]]?D.scale[I[G]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(_,c,l);const S=A.appendOrSelect(n,this.brushSelector).call(this.brush);if(_!==void 0)if(_[0].valueOf()===_[1].valueOf())S.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const b=_.map(M=>this.xScale(M));b[1]-b[0]<this.MIN_SELECTION_DIFF||(S.call(this.brush.move,b),this.updateBrushHandle(this.getComponentContainer(),b))}i&&(this.brush.filter(()=>!1),S.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",z.TOP,"type"),a=xe.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=T.ZoomBar.SELECTION_START:t.type==="brush"?a=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=xe.handleWidth,s=x(this.getOptions(),"zoomBar",z.TOP,"type"),a=xe.height[s],o=-i/2,l=xe.handleBarWidth,c=s===Ge.GRAPH_VIEW?xe.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===Ge.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",z.TOP,"type"),r=xe.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,E)=>_=>s.getValueFromScale(m,y,E,_),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=x(this.getOptions(),"zoomBar",z.TOP,"type"),p=xe.height[f],g=Kl().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=vn(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",z.TOP,"type"),a=xe.height[s],o=Fi()([[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",z.TOP,"type")===Ge.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class zP extends ft{constructor(t,n){super(t,n),this.type="threshold",this.renderType=tt.SVG,this.positionService=new go}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).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===z.LEFT||h===z.RIGHT?(v=f,g=d.services.cartesianScales.getMainXScale()):(g=f,v=d.services.cartesianScales.getMainYScale());const m=p===K.LABELS,[y,E]=g.range(),[_,S]=v.range(),{cartesianScales:b}=d.services,M=b.getOrientation(),D=R=>b.getDomainValue(R),G=R=>b.getRangeValue(R),[I,w]=bn(D,G,M),C=L(this);h===z.TOP||h===z.BOTTOM?(C.selectAll("line.threshold-line").transition().call(R=>d.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",S).attr("y2",_).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),C.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-I(R)).attr("width",Math.abs(_-S)).classed("rotate",!0)):(C.selectAll("line.threshold-line").transition().call(R=>d.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",y).attr("x2",E).attr("y1",({datum:R})=>w(R)+(m?f.step()/2:0)).attr("y2",({datum:R})=>w(R)+(m?f.step()/2:0)).style("stroke",({fillColor:R})=>R),C.selectAll("rect.threshold-hoverable-area").attr("x",y).attr("y",({datum:R})=>w(R)).attr("width",Math.abs(E-y)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.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)===K.TIME){const a=[z.LEFT,z.RIGHT].includes(r),o=this.services.cartesianScales.getMainXScale(),l=this.services.cartesianScales.getMainYScale(),c=a?l:o,u=x(i,"timeScale"),d=nu(c.ticks(),x(u,"timeInterval"));return eu(n,0,c.ticks(),d,u)}return n.toLocaleString("en")}appendThresholdLabel(){const t=L(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=A.appendOrSelect(t,`div.${ue}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Bn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(rn(`${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,[jt.RIGHT,jt.LEFT,jt.TOP,jt.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){L(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:L(this),datum:L(this).datum()})}).on("mouseout",function(r){L(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:L(this),datum:L(this).datum()})})}}class WP extends ft{constructor(t,n){super(t,n),this.type="highlight",this.renderType=tt.SVG,this.positionService=new go,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).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:E}=d.services,_=E.getOrientation(),S=I=>E.getDomainValue(I),b=I=>E.getRangeValue(I),[M,D]=bn(S,b,_),G=L(this);h===z.TOP||h===z.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,...w})=>M(w[I])).attr("width",({highlightStartMapsTo:I,highlightEndMapsTo:w,...C})=>Math.max(M(C[w])-M(C[I]),0)).style("stroke",({color:I,labelMapsTo:w,...C})=>I&&I.scale[C[w]]?I.scale[C[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:I,labelMapsTo:w,...C})=>I&&I.scale[C[w]]?I.scale[C[w]]: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,...w})=>D(w[I])).attr("height",({highlightStartMapsTo:I,highlightEndMapsTo:w,...C})=>Math.max(D(C[I])-D(C[w]),0)).style("stroke",({color:I,labelMapsTo:w,...C})=>I&&I.scale[C[w]]?I.scale[C[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:I,labelMapsTo:w,...C})=>I&&I.scale[C[w]]?I.scale[C[w]]:null)})}}class _v extends Ru{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:[rt.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:[rt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&x(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:Mt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function ys(e,t){const n=yt(e),r=yt(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function YP(e,t){const n=yt(e),r=yt(t);return n.getFullYear()-r.getFullYear()}function qP(e,t){const n=yt(e),r=yt(t),i=ys(n,r),s=Math.abs(YP(n,r));n.setFullYear(1584),r.setFullYear(1584);const a=ys(n,r)===-i,o=i*(s-+a);return o===0?0:o}function Bu(e,t){const n=yt(e);if(isNaN(t))return ze(e,NaN);if(!t)return n;const r=n.getDate(),i=ze(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const s=i.getDate();return r>=s?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}function Sv(e,t){return Bu(e,t*12)}function XP(e,t){return Sv(e,-t)}function jP(e,t){const n=yt(e),r=yt(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function ZP(e){const t=yt(e);return t.setHours(23,59,59,999),t}function KP(e){const t=yt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function QP(e){const t=yt(e);return+ZP(t)==+KP(t)}function JP(e,t){const n=yt(e),r=yt(t),i=ys(n,r),s=Math.abs(jP(n,r));let a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);let o=ys(n,r)===-i;QP(yt(e))&&s===1&&ys(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function t$(e,t){return Bu(e,-t)}function e$(e,t){const n=yt(e),r=yt(t),i=Tv(n,r),s=Math.abs(mm(n,r));n.setDate(n.getDate()-i*s);const a=+(Tv(n,r)===-i),o=i*(s-a);return o===0?0:o}function Tv(e,t){const 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 wv(e,t){const n=yt(e);return isNaN(t)?ze(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function n$(e,t){return wv(e,-t)}function Fu(e,t){return yt(e).getTime()-yt(t).getTime()}function Hu(e){return e?Math[e]:Math.trunc}function r$(e,t,n){const r=Fu(e,t)/fm;return Hu(n==null?void 0:n.roundingMethod)(r)}function Gu(e,t){const n=+yt(e);return ze(e,n+t)}function Ov(e,t){return Gu(e,t*fm)}function i$(e,t){return Ov(e,-t)}function Mv(e,t,n){const r=Fu(e,t)/dm;return Hu(n==null?void 0:n.roundingMethod)(r)}function Vu(e,t){return Gu(e,t*dm)}function Av(e,t){return Vu(e,-t)}function Cv(e,t,n){const r=Fu(e,t)/1e3;return Hu(n==null?void 0:n.roundingMethod)(r)}function zu(e,t){return Gu(e,t*1e3)}function Dv(e,t){return zu(e,-t)}class s$ extends Sn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=x(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=x(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return x(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const r=this.getAxisOptions(t).title;return r||(t===z.BOTTOM||t===z.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(z).map(n=>z[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===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=zt.VERTICAL:this.orientation=zt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=x(t,"axes");((r=n[z.LEFT])!=null&&r.correspondingDatasets&&n[z.RIGHT]||(i=n[z.RIGHT])!=null&&i.correspondingDatasets&&n[z.LEFT]||(s=n[z.TOP])!=null&&s.correspondingDatasets&&n[z.BOTTOM]||(a=n[z.BOTTOM])!=null&&a.correspondingDatasets&&n[z.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]===K.LINEAR||this.scaleTypes[t]===K.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=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.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 K.LABELS:u=t(c)+t.step()/2;break;case K.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===K.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return a$(n,s)}else return o$(n,Ln.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,z.LEFT)===null&&x(n,z.RIGHT)!==null||x(n,z.RIGHT,"main")===!0||r&&x(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,z.BOTTOM)===null&&x(n,z.TOP)!==null||x(n,z.TOP,"main")===!0||r&&x(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||K.LINEAR,o=s.scaleType||K.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===K.LABELS||o===K.TIME)&&a===K.LABELS||a===K.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")||K.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:m}=this.model.getBinConfigurations();return[0,Un(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}=Ln.ratio;if(r.domain)return a===K.LABELS?r.domain:(a===K.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===K.LABELS)return Ji(o.map(m=>m[c]));let p,g;const v=this.model.getDataGroupNames();if(a===K.LABELS_RATIO)return o.map(m=>`${m[h]}/${m[f]}`);if(a===K.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}),E=o.filter(S=>!v.includes(S[m])),_=[];y.forEach(S=>{const{...b}=S;let M=0,D=0;Object.values(b).forEach(G=>{isNaN(G)||(G<0?D+=G:M+=G)}),_.push([D,M])}),g=[...$p(_),...E.map(S=>S[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!==K.TIME&&a!==K.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(m=>{const y=x(m,"value");y!==null&&g.push(y)}),p=Ie(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")||K.LINEAR;this.scaleTypes[t]=i;let s;return i===K.TIME?s=Bf():i===K.LOG?s=xf().base(r.base||10):i===K.LABELS||i===K.LABELS_RATIO?s=Ii():s=Ue(),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)===K.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 a$(e,t){const n=new Date(e[0]),r=new Date(e[1]);return qP(r,n)>1?[XP(n,t),Sv(r,t)]:JP(r,n)>1?[t$(n,t),Bu(r,t)]:e$(r,n)>1?[n$(n,t),wv(r,t)]:r$(r,n)>1?[i$(n,t),Ov(r,t)]:Mv(r,n)>30?[Av(n,t*30),Vu(r,t*30)]:Mv(r,n)>1?[Av(n,t),Vu(r,t)]:Cv(r,n)>15?[Dv(n,t*15),zu(r,t*15)]:Cv(r,n)>1?[Dv(n,t),zu(r,t)]:[n,r]}function o$([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===K.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 l$ extends Sn{constructor(){super(...arguments),this.curveTypes={curveLinear:Sa,curveLinearClosed:Qf,curveBasis:TT,curveBasisClosed:wT,curveBasisOpen:OT,curveBundle:MT,curveCardinal:AT,curveCardinalClosed:CT,curveCardinalOpen:DT,curveCatmullRom:LT,curveCatmullRomClosed:RT,curveCatmullRomOpen:IT,curveMonotoneX:kT,curveMonotoneY:PT,curveNatural:$T,curveStep:NT,curveStepAfter:BT,curveStepBefore:UT}}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 c$ extends Sn{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===K.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,Ie(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(T.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=xe.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 de extends Ye{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:s$,curves:l$,zoom:c$}),this.model=new lr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",z.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===z.BOTTOM&&o===K.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new ms(this.model,this.services)],growth:lt.STRETCH},h={id:"toolbar",components:[new Kr(this.model,this.services)],growth:lt.PREFERRED},f={id:"header",components:[new ae(this.model,this.services,[d,...s?[h]:[]],{direction:wt.ROW,alignItems:rr.CENTER})],growth:lt.PREFERRED},p={id:"legend",components:[new Lu(this.model,this.services)],growth:lt.PREFERRED};l&&!c&&t.push(new hv(this.model,this.services),new Uu(this.model,this.services)),t.push(new zP(this.model,this.services)),t.push(new WP(this.model,this.services));const g={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:tt.SVG},v=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let m=wt.COLUMN;if(v){const b=x(this.model.getOptions(),"legend","position");b===Gr.LEFT?(m=wt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Vr.VERTICAL)):b===Gr.RIGHT?(m=wt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Vr.VERTICAL)):b===Gr.BOTTOM&&(m=wt.COLUMN_REVERSE)}const y={id:"spacer",components:[new Tn(this.model,this.services)],growth:lt.PREFERRED},E={id:"full-frame",components:[new ae(this.model,this.services,[...v?[p]:[],...v?[y]:[],g],{direction:m})],growth:lt.STRETCH},_={id:"zoom-bar",components:[new VP(this.model,this.services)],growth:lt.PREFERRED,renderType:tt.SVG},S=[];if(u||s){S.push(f);const b={id:"spacer",components:[new Tn(this.model,this.services,s?{size:15}:void 0)],growth:lt.PREFERRED};S.push(b)}return l&&S.push(_),S.push(E),[new _v(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,S,{direction:wt.COLUMN})]}}class Se extends ft{constructor(){super(...arguments),this.type="grid",this.renderType=tt.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=Ro(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=ah(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(xn(u).tx)-Number(xn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+xn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+xn(o).tx;else if(o)l=+xn(o).tx-+xn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=A.getSVGElementSize(u).width-+xn(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=xn(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 Lv extends ft{constructor(){super(...arguments),this.type="area",this.renderType=tt.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?yn.opacity.unselected:yn.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",yn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=Kl().curve(this.services.curves.getD3Curve()).defined(S=>{const b=s.getRangeIdentifier(),M=S[b];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=(S,b)=>{x(r,"axes",S,"includeZero")===!1&&b[0]>0&&b[1]>0&&(d=b[0])},f=S=>u?s.getBoundedScaledValues(S)[0]:s.getRangeValue(d),p=S=>u?s.getBoundedScaledValues(S)[1]:s.getRangeValue(S);a===zt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(S=>s.getDomainValue(S)).y0(S=>f(S)).y1(S=>p(S))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(S=>f(S)).x1(S=>p(S)).y(S=>s.getDomainValue(S)));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,S=>S.name),y=L(this.services.domUtils.getMainContainer());if(m.exit().attr("opacity",0).remove(),!l.length)return;if(v){const S=y.select(`path.${this.model.getColorClassName({classNameTypes:[rt.STROKE],dataGroupName:l[0].name})}`).node();let b;if(S)b=getComputedStyle(S,null).getPropertyValue("stroke");else{const M=x(this.model.getOptions(),"color","scale");if(M!==null){const D=Object.keys(M);b=M[D[0]]}}vs.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:vs.getStops(i,b)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,_=m.enter().append("path");v?_.merge(m).style("fill",S=>`url(#${this.services.domUtils.generateElementIDString(`${S.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",S=>this.model.getColorClassName({classNameTypes:[rt.FILL],dataGroupName:S.name,originalClassName:"area"})).attr("d",S=>{const{data:b}=S;return o(b)}):(_.attr("opacity",0).merge(m).attr("class","area").attr("class",S=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],dataGroupName:S.name,originalClassName:"area"})).style("fill",S=>E.model.getFillColor(S.name)).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"area-update-enter",animate:t})).attr("opacity",u?1:yn.opacity.selected).attr("d",S=>{const{data:b}=S;return o(b)}),u&&_.attr("fill-opacity",yn.opacity.selected).style("stroke",S=>E.model.getStrokeColor(S.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ti extends ft{constructor(){super(...arguments),this.type="line",this.renderType=tt.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?En.opacity.unselected:En.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",En.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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]=bn(s,a,r.getOrientation()),c=this.getOptions(),u=Fi().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),E=this.services.cartesianScales.getRangeIdentifier(m);return{name:x(m,0,g),data:m.map(_=>({[y]:_.data.sharedStackKey,[g]:_[g],[E]:_[1]})),hidden:!cR(m,_=>_[0]!==_[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:[rt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name)).attr("role",ct.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Rv=5;function u$(e,t){return e>t-Rv&&e<t+Rv}class kn extends ft{constructor(){super(...arguments),this.type="ruler",this.renderType=tt.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===zt.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=>u$(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(T.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,E=Math.abs(u-m.domainValue),_=Math.abs(u-y);return E>_||(E<_?v=[m]:v.push(m)),v},[]);if(g.length>0){const v=g.map(_=>_.originalData).filter(_=>{const S=this.services.cartesianScales.getRangeIdentifier(_),b=_[S];return b!=null}),m=g.map(_=>_.domainValue),y=f.filter(_=>{const S=this.services.cartesianScales.getDomainValue(_);return m.includes(S)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!zg(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(v)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.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(T.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=Bn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=ER(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 sn extends ft{constructor(){super(...arguments),this.type="scatter",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.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]=bn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=bn(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]=bn(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)?[rt.FILL,rt.STROKE]:[rt.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",ct.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=L(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[rt.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(T.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=L(this);(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:L(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=L(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(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Iv extends ft{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=tt.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.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===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.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===K.LABELS||this.scaleType===K.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=ah;break;case z.BOTTOM:h=Ro;break;case z.RIGHT:h=Y0;break;case z.TOP:h=W0;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",`${ct.GRAPHICS_OBJECT} ${ct.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===K.TIME||v.scaleType===K.TIME,y=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&m&&!y&&d.domain(E),!i){p.attr("aria-hidden",!0);return}const _=x(v,"scaleType"),S=x(r,"data","loading"),b=x(v,"ticks","number"),M=x(v,"ticks","values"),D=x(v,"truncation","type"),G=x(v,"truncation","threshold"),I=x(v,"truncation","numCharacter"),w=b!==null,C=x(r,"timeScale"),R=A.appendOrSelect(g,"g.tick"),P=A.appendOrSelect(R,"text").text("0"),O=A.getSVGElementSize(P.node(),{useBBox:!0}).height;R.remove();const H=this.scaleType||v.scaleType||K.LINEAR,B=h(d).tickSizeOuter(0);if(d.ticks){let q;if(w?q=b:(q=Ln.ticks.number,y&&(q=this.getNumberOfFittingTicks(o,O,Ln.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(q=0),B.ticks(q),m)if(!d.ticks(q).length)B.tickValues([]);else{const Q=x(r,"timeScale","addSpaceOnEdges"),pt=x(r,"axes",n,"domain"),ot=d.copy();Q&&!pt&&ot.nice(q);const Tt=ot.ticks(q);Q&&Tt.length>2&&!pt&&(Tt.splice(Tt.length-1,1),Tt.splice(0,1)),B.tickValues(Tt)}}let U;const N=x(v,"ticks","formatter");if(m){const q=nu(B.tickValues(),x(r,"timeScale","timeInterval"));N===null?U=(Q,pt)=>eu(Q,pt,B.tickValues(),q,C):U=(Q,pt)=>{const ot=eu(Q,pt,B.tickValues(),q,C);return N(Q,pt,ot)}}else N===null?H===K.LINEAR&&(U=q=>q.toLocaleString()):U=N;B.tickFormat(U);const[j,Y]=this.services.cartesianScales.getScaleByPosition(n).domain();let it;if(M){if(m)M.forEach((q,Q)=>{q.getTime===void 0&&(M[Q]=new Date(q))}),it=M.filter(q=>{const Q=q.getTime();return Q>=new Date(j).getTime()&&Q<=new Date(Y).getTime()});else if(_===K.LABELS){const q=this.services.cartesianScales.getScaleByPosition(n).domain();it=M.filter(Q=>q.includes(Q))}else it=M.filter(q=>q>=j&&q<=Y);B.tickValues(it)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(v.title){const q=A.appendOrSelect(l,"text.axis-title").html(et||S?"":rn(v.title)),Q=x(v,"titleOrientation");let pt;switch(n){case z.LEFT:Q===Ya.RIGHT?q.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):q.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:q.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:Q===Ya.LEFT?q.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):q.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:pt=A.getSVGElementSize(q,{useBBox:!0}).height,q.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${pt/2})`).style("text-anchor","middle");break}}if(m){const q=nu(B.tickValues(),x(r,"timeScale","timeInterval")),Q=C.showDayName,pt=p;t&&(p=p.transition().call(Tt=>this.services.transitions.setupTransition({transition:Tt,name:"axis-update",animate:t}))),p=p.call(B),pt.selectAll(".tick").data(B.tickValues(),d).order().select("text").style("font-weight",(Tt,Z)=>wm(Tt,Z,B.tickValues(),q,Q)?"bold":"normal")}else!t||!f?p=p.call(B):p=p.transition().call(q=>this.services.transitions.setupTransition({transition:q,name:"axis-update",animate:t})).call(B);if(g.call(B),n===z.BOTTOM||n===z.TOP){let q=!1;const Q=x(v,"ticks","rotation");if(Q===ns.ALWAYS)q=!0;else if(Q===ns.NEVER)q=!1;else if(!Q||Q===ns.AUTO)if(d.step)q=g.selectAll("g.tick text").nodes().some(ot=>A.getSVGElementSize(ot,{useBBox:!0}).width>=d.step());else{q=!1;const pt=g.append("text").text("A"),ot=A.getSVGElementSize(pt.node(),{useBBox:!0}).width;let Tt;g.selectAll("g.tick").each(function(){const Z=L(this),F=parseFloat(x(xn(this),"tx"));F!==null&&Tt+Z.text().length*ot*.8>=F&&(q=!0),Tt=F}),pt.remove()}q?(w||(B.ticks(this.getNumberOfFittingTicks(a,O,Ln.ticks.horizontalSpaceRatio)),g.call(B),p.call(B)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(S?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",q=>q),g.selectAll("g.tick").attr("aria-label",q=>q),D!==Ae.NONE&&_===K.LABELS&&!M){const q=this.services.cartesianScales.getScaleDomain(n);if(q.length>0){const Q=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(Q);const pt=this;l.selectAll("g.tick text").data(q).text(function(ot){return ot.length>G?(pt.truncation[n]=!0,as(ot,D,I)):ot}),this.getInvisibleAxisRef().selectAll("g.tick text").data(q).text(function(ot){return ot.length>G?as(ot,D,I):ot}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(q)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=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(T.Axis.LABEL_MOUSEOVER,{event:c,element:L(this),datum:u}),a===K.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:L(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:L(this),datum:u}),a===K.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:L(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:L(this),datum:u}),a===K.LABELS&&l.services.events.dispatchEvent(T.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 cg(i,2,Ln.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 h$ extends Iv{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=L(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 z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-Ln.hover.rectanglePadding).attr("y",p).attr("width",u+Ln.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=L(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===K.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=L(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:L(this).select("text"),datum:L(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:L(this).select("text"),datum:L(this).select("text").datum()}),a===K.LABELS&&l.services.events.dispatchEvent(T.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(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:L(this),datum:L(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:L(this),datum:L(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:L(this),datum:L(this).select("text").datum()})),n===z.LEFT||n===z.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 fe extends ft{constructor(){super(...arguments),this.type="2D-axes",this.renderType=tt.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=x(this.getOptions(),"axes");r.forEach(o=>{i[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===is.DEFAULT?new Iv(this.model,this.services,c):new h$(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===z.LEFT||c===z.RIGHT)&&(f+=5)),c){case z.TOP:s.top=h+f;break;case z.BOTTOM:s.bottom=h+f;break;case z.LEFT:s.left=d+f;break;case z.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(T.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(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class oe extends ft{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=x(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Bt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Bt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Bt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Bt.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===zt.VERTICAL&&this.drawYGrid(t),n===zt.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=Ue().domain([0,1]).range(t),this.yScale=Ue().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=Bi().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Ct.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+Ct.xOffset;c===Ut.CENTER?p=s/2:c===Ut.RIGHT&&(p=s-t-Ct.xOffset);const g=t+Ct.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+Ct.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
+ </svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class e$ extends Ye{constructor(t,n){super(t,n),this.model=new kP(this.services),this.model.setOptions(kt(Ot.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new t$(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri extends ft{constructor(){super(...arguments),this.type="grid-brush",this.renderType=tt.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===K.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=S=>{const b=S[1]-S[0];let M="0,"+b.toString();const D=Math.floor(l/ri.DASH_LENGTH),G=D*ri.DASH_LENGTH;for(let I=0;I<D;I++)M+=","+ri.DASH_LENGTH;M+=","+(l-G),D%2===1&&(M+=",0"),M+=","+b.toString(),M+=","+l.toString(),f.attr("stroke-dasharray",M)},v=S=>{const b=S.selection;b===null||b[0]===b[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(b))},m=(S,b)=>{const M=Bf().range([0,o]).domain(p);let D=[M.invert(S),M.invert(b)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let y;const E=S=>{const b=S.selection;b!==null&&(m(b[0],b[1]),s.call(y.move,null),f.style("display","none"))};l!=0&&o!=0&&(y=ed().extent([[0,0],[o-1,l]]).on("start brush end",v).on("end.brushed",E),s.call(y));const _=this.services.zoom.getZoomRatio();i.on("click",function(S){if(S.shiftKey){const b=this.services.domUtils.getHolder(),M=Bn(s.node(),b)[0];let D=M-o*_/2;D<0&&(D=0);let G=M+o*_/2;G>o&&(G=o),m(D,G)}})}}};ri.DASH_LENGTH=4;let zu=ri;class n$ extends ft{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=tt.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=ed(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=x(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer(),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=x(this.getOptions(),"zoomBar",z.TOP,"type"),a=x(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=xe.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",xe.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ge.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===Ge.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===K.TIME){let v=this.services.zoom.getZoomBarData();if(He(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"),E=x(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(y&&y[0].valueOf()===E[0].valueOf()&&y[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:at([],E),zoomDomain:E?at([],E):m},{skipUpdate:!0}):E===null&&y!==null&&this.model.set({initialZoomDomain:null,zoomDomain:at([],m)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(m),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ie(v,b=>b.value));const _=this.model.get("zoomDomain");if(s===Ge.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 b=a.highlightStartMapsTo,M=a.highlightEndMapsTo,D=a.color,G=a.labelMapsTo;a.data.forEach((I,w)=>{A.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(I[b])).attr("width",this.xScale(I[M])-this.xScale(I[b])).style("fill",D&&D.scale[I[G]]?D.scale[I[G]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[I[G]]?D.scale[I[G]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(_,c,l);const S=A.appendOrSelect(n,this.brushSelector).call(this.brush);if(_!==void 0)if(_[0].valueOf()===_[1].valueOf())S.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const b=_.map(M=>this.xScale(M));b[1]-b[0]<this.MIN_SELECTION_DIFF||(S.call(this.brush.move,b),this.updateBrushHandle(this.getComponentContainer(),b))}i&&(this.brush.filter(()=>!1),S.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",z.TOP,"type"),a=xe.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=T.ZoomBar.SELECTION_START:t.type==="brush"?a=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=xe.handleWidth,s=x(this.getOptions(),"zoomBar",z.TOP,"type"),a=xe.height[s],o=-i/2,l=xe.handleBarWidth,c=s===Ge.GRAPH_VIEW?xe.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===Ge.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",z.TOP,"type"),r=xe.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,E)=>_=>s.getValueFromScale(m,y,E,_),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=x(this.getOptions(),"zoomBar",z.TOP,"type"),p=xe.height[f],g=Kl().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=vn(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",z.TOP,"type"),a=xe.height[s],o=Fi()([[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",z.TOP,"type")===Ge.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class r$ extends ft{constructor(t,n){super(t,n),this.type="threshold",this.renderType=tt.SVG,this.positionService=new go}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).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===z.LEFT||h===z.RIGHT?(v=f,g=d.services.cartesianScales.getMainXScale()):(g=f,v=d.services.cartesianScales.getMainYScale());const m=p===K.LABELS,[y,E]=g.range(),[_,S]=v.range(),{cartesianScales:b}=d.services,M=b.getOrientation(),D=R=>b.getDomainValue(R),G=R=>b.getRangeValue(R),[I,w]=bn(D,G,M),C=L(this);h===z.TOP||h===z.BOTTOM?(C.selectAll("line.threshold-line").transition().call(R=>d.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",S).attr("y2",_).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),C.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-I(R)).attr("width",Math.abs(_-S)).classed("rotate",!0)):(C.selectAll("line.threshold-line").transition().call(R=>d.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",y).attr("x2",E).attr("y1",({datum:R})=>w(R)+(m?f.step()/2:0)).attr("y2",({datum:R})=>w(R)+(m?f.step()/2:0)).style("stroke",({fillColor:R})=>R),C.selectAll("rect.threshold-hoverable-area").attr("x",y).attr("y",({datum:R})=>w(R)).attr("width",Math.abs(E-y)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.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)===K.TIME){const a=[z.LEFT,z.RIGHT].includes(r),o=this.services.cartesianScales.getMainXScale(),l=this.services.cartesianScales.getMainYScale(),c=a?l:o,u=x(i,"timeScale"),d=lu(c.ticks(),x(u,"timeInterval"));return ou(n,0,c.ticks(),d,u)}return n.toLocaleString("en")}appendThresholdLabel(){const t=L(this.services.domUtils.getHolder()),n=x(this.getOptions(),"style","prefix");this.label=A.appendOrSelect(t,`div.${ue}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=Bn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(rn(`${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,[jt.RIGHT,jt.LEFT,jt.TOP,jt.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){L(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:L(this),datum:L(this).datum()})}).on("mouseout",function(r){L(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:L(this),datum:L(this).datum()})})}}class i$ extends ft{constructor(t,n){super(t,n),this.type="highlight",this.renderType=tt.SVG,this.positionService=new go,this.highlightStrokeWidth=1}render(t=!1){const n=x(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).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:E}=d.services,_=E.getOrientation(),S=I=>E.getDomainValue(I),b=I=>E.getRangeValue(I),[M,D]=bn(S,b,_),G=L(this);h===z.TOP||h===z.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,...w})=>M(w[I])).attr("width",({highlightStartMapsTo:I,highlightEndMapsTo:w,...C})=>Math.max(M(C[w])-M(C[I]),0)).style("stroke",({color:I,labelMapsTo:w,...C})=>I&&I.scale[C[w]]?I.scale[C[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:I,labelMapsTo:w,...C})=>I&&I.scale[C[w]]?I.scale[C[w]]: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,...w})=>D(w[I])).attr("height",({highlightStartMapsTo:I,highlightEndMapsTo:w,...C})=>Math.max(D(C[I])-D(C[w]),0)).style("stroke",({color:I,labelMapsTo:w,...C})=>I&&I.scale[C[w]]?I.scale[C[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:I,labelMapsTo:w,...C})=>I&&I.scale[C[w]]?I.scale[C[w]]:null)})}}class Dv extends Uu{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:[rt.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:[rt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&x(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:Mt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}class s$ extends Sn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=x(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=x(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return x(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const r=this.getAxisOptions(t).title;return r||(t===z.BOTTOM||t===z.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(z).map(n=>z[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===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=zt.VERTICAL:this.orientation=zt.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=x(t,"axes");((r=n[z.LEFT])!=null&&r.correspondingDatasets&&n[z.RIGHT]||(i=n[z.RIGHT])!=null&&i.correspondingDatasets&&n[z.LEFT]||(s=n[z.TOP])!=null&&s.correspondingDatasets&&n[z.BOTTOM]||(a=n[z.BOTTOM])!=null&&a.correspondingDatasets&&n[z.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]===K.LINEAR||this.scaleTypes[t]===K.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=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.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 K.LABELS:u=t(c)+t.step()/2;break;case K.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===K.TIME){const s=x(r,"timeScale","addSpaceOnEdges");return a$(n,s)}else return o$(n,Ln.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,z.LEFT)===null&&x(n,z.RIGHT)!==null||x(n,z.RIGHT,"main")===!0||r&&x(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=x(t,"axes"),r=this.isDualAxes();return x(n,z.BOTTOM)===null&&x(n,z.TOP)!==null||x(n,z.TOP,"main")===!0||r&&x(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=x(r,"axes",t.primary),s=x(r,"axes",n.primary),a=i.scaleType||K.LINEAR,o=s.scaleType||K.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===K.LABELS||o===K.TIME)&&a===K.LABELS||a===K.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")||K.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:m}=this.model.getBinConfigurations();return[0,Un(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}=Ln.ratio;if(r.domain)return a===K.LABELS?r.domain:(a===K.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===K.LABELS)return Ji(o.map(m=>m[c]));let p,g;const v=this.model.getDataGroupNames();if(a===K.LABELS_RATIO)return o.map(m=>`${m[h]}/${m[f]}`);if(a===K.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}),E=o.filter(S=>!v.includes(S[m])),_=[];y.forEach(S=>{const{...b}=S;let M=0,D=0;Object.values(b).forEach(G=>{isNaN(G)||(G<0?D+=G:M+=G)}),_.push([D,M])}),g=[...$p(_),...E.map(S=>S[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!==K.TIME&&a!==K.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(m=>{const y=x(m,"value");y!==null&&g.push(y)}),p=Ie(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")||K.LINEAR;this.scaleTypes[t]=i;let s;return i===K.TIME?s=Bf():i===K.LOG?s=xf().base(r.base||10):i===K.LABELS||i===K.LABELS_RATIO?s=Ii():s=Ue(),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)===K.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 a$(e,t){const n=new Date(e[0]),r=new Date(e[1]);return IR(r,n)>1?[LI(n,t),dm(r,t)]:RR(r,n)>1?[CI(n,t),Qc(r,t)]:MR(r,n)>1?[AI(n,t),rm(r,t)]:AR(r,n)>1?[DI(n,t),om(r,t)]:pm(r,n)>30?[Sm(n,t*30),tu(r,t*30)]:pm(r,n)>1?[Sm(n,t),tu(r,t)]:gm(r,n)>15?[Tm(n,t*15),eu(r,t*15)]:gm(r,n)>1?[Tm(n,t),eu(r,t)]:[n,r]}function o$([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===K.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 l$ extends Sn{constructor(){super(...arguments),this.curveTypes={curveLinear:Sa,curveLinearClosed:Qf,curveBasis:TT,curveBasisClosed:wT,curveBasisOpen:OT,curveBundle:MT,curveCardinal:AT,curveCardinalClosed:CT,curveCardinalOpen:DT,curveCatmullRom:LT,curveCatmullRomClosed:RT,curveCatmullRomOpen:IT,curveMonotoneX:kT,curveMonotoneY:PT,curveNatural:$T,curveStep:NT,curveStepAfter:BT,curveStepBefore:UT}}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 c$ extends Sn{isZoomBarEnabled(){if(!this.services.cartesianScales||!x(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=x(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===K.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,Ie(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(T.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=xe.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 de extends Ye{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:s$,curves:l$,zoom:c$}),this.model=new lr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=x(r,"zoomBar",z.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===z.BOTTOM&&o===K.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new vs(this.model,this.services)],growth:lt.STRETCH},h={id:"toolbar",components:[new Kr(this.model,this.services)],growth:lt.PREFERRED},f={id:"header",components:[new ae(this.model,this.services,[d,...s?[h]:[]],{direction:wt.ROW,alignItems:rr.CENTER})],growth:lt.PREFERRED},p={id:"legend",components:[new Nu(this.model,this.services)],growth:lt.PREFERRED};l&&!c&&t.push(new Ev(this.model,this.services),new zu(this.model,this.services)),t.push(new r$(this.model,this.services)),t.push(new i$(this.model,this.services));const g={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:tt.SVG},v=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let m=wt.COLUMN;if(v){const b=x(this.model.getOptions(),"legend","position");b===Gr.LEFT?(m=wt.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Vr.VERTICAL)):b===Gr.RIGHT?(m=wt.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Vr.VERTICAL)):b===Gr.BOTTOM&&(m=wt.COLUMN_REVERSE)}const y={id:"spacer",components:[new Tn(this.model,this.services)],growth:lt.PREFERRED},E={id:"full-frame",components:[new ae(this.model,this.services,[...v?[p]:[],...v?[y]:[],g],{direction:m})],growth:lt.STRETCH},_={id:"zoom-bar",components:[new n$(this.model,this.services)],growth:lt.PREFERRED,renderType:tt.SVG},S=[];if(u||s){S.push(f);const b={id:"spacer",components:[new Tn(this.model,this.services,s?{size:15}:void 0)],growth:lt.PREFERRED};S.push(b)}return l&&S.push(_),S.push(E),[new Dv(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,S,{direction:wt.COLUMN})]}}class Se extends ft{constructor(){super(...arguments),this.type="grid",this.renderType=tt.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=Ro(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=ah(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(xn(u).tx)-Number(xn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+xn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+xn(o).tx;else if(o)l=+xn(o).tx-+xn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=A.getSVGElementSize(u).width-+xn(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=xn(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 Lv extends ft{constructor(){super(...arguments),this.type="area",this.renderType=tt.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?yn.opacity.unselected:yn.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",yn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=Kl().curve(this.services.curves.getD3Curve()).defined(S=>{const b=s.getRangeIdentifier(),M=S[b];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=(S,b)=>{x(r,"axes",S,"includeZero")===!1&&b[0]>0&&b[1]>0&&(d=b[0])},f=S=>u?s.getBoundedScaledValues(S)[0]:s.getRangeValue(d),p=S=>u?s.getBoundedScaledValues(S)[1]:s.getRangeValue(S);a===zt.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(S=>s.getDomainValue(S)).y0(S=>f(S)).y1(S=>p(S))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(S=>f(S)).x1(S=>p(S)).y(S=>s.getDomainValue(S)));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,S=>S.name),y=L(this.services.domUtils.getMainContainer());if(m.exit().attr("opacity",0).remove(),!l.length)return;if(v){const S=y.select(`path.${this.model.getColorClassName({classNameTypes:[rt.STROKE],dataGroupName:l[0].name})}`).node();let b;if(S)b=getComputedStyle(S,null).getPropertyValue("stroke");else{const M=x(this.model.getOptions(),"color","scale");if(M!==null){const D=Object.keys(M);b=M[D[0]]}}ys.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:ys.getStops(i,b)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,_=m.enter().append("path");v?_.merge(m).style("fill",S=>`url(#${this.services.domUtils.generateElementIDString(`${S.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",S=>this.model.getColorClassName({classNameTypes:[rt.FILL],dataGroupName:S.name,originalClassName:"area"})).attr("d",S=>{const{data:b}=S;return o(b)}):(_.attr("opacity",0).merge(m).attr("class","area").attr("class",S=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],dataGroupName:S.name,originalClassName:"area"})).style("fill",S=>E.model.getFillColor(S.name)).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"area-update-enter",animate:t})).attr("opacity",u?1:yn.opacity.selected).attr("d",S=>{const{data:b}=S;return o(b)}),u&&_.attr("fill-opacity",yn.opacity.selected).style("stroke",S=>E.model.getStrokeColor(S.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ti extends ft{constructor(){super(...arguments),this.type="line",this.renderType=tt.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?En.opacity.unselected:En.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",En.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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]=bn(s,a,r.getOrientation()),c=this.getOptions(),u=Fi().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),E=this.services.cartesianScales.getRangeIdentifier(m);return{name:x(m,0,g),data:m.map(_=>({[y]:_.data.sharedStackKey,[g]:_[g],[E]:_[1]})),hidden:!cR(m,_=>_[0]!==_[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:[rt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name)).attr("role",ct.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Rv=5;function u$(e,t){return e>t-Rv&&e<t+Rv}class kn extends ft{constructor(){super(...arguments),this.type="ruler",this.renderType=tt.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===zt.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=>u$(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(T.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,E=Math.abs(u-m.domainValue),_=Math.abs(u-y);return E>_||(E<_?v=[m]:v.push(m)),v},[]);if(g.length>0){const v=g.map(_=>_.originalData).filter(_=>{const S=this.services.cartesianScales.getRangeIdentifier(_),b=_[S];return b!=null}),m=g.map(_=>_.domainValue),y=f.filter(_=>{const S=this.services.cartesianScales.getDomainValue(_);return m.includes(S)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!zg(this.elementsToHighlight,y)&&this.hideRuler(),y.dispatch("mouseover"),this.elementsToHighlight=y,this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(v)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.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(T.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=Bn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=ER(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 sn extends ft{constructor(){super(...arguments),this.type="scatter",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.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]=bn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=bn(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]=bn(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)?[rt.FILL,rt.STROKE]:[rt.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",ct.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=L(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[rt.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(T.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=L(this);(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:L(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=L(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(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Iv extends ft{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=tt.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.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===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.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===K.LABELS||this.scaleType===K.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=ah;break;case z.BOTTOM:h=Ro;break;case z.RIGHT:h=Y0;break;case z.TOP:h=W0;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",`${ct.GRAPHICS_OBJECT} ${ct.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===K.TIME||v.scaleType===K.TIME,y=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&m&&!y&&d.domain(E),!i){p.attr("aria-hidden",!0);return}const _=x(v,"scaleType"),S=x(r,"data","loading"),b=x(v,"ticks","number"),M=x(v,"ticks","values"),D=x(v,"truncation","type"),G=x(v,"truncation","threshold"),I=x(v,"truncation","numCharacter"),w=b!==null,C=x(r,"timeScale"),R=A.appendOrSelect(g,"g.tick"),P=A.appendOrSelect(R,"text").text("0"),O=A.getSVGElementSize(P.node(),{useBBox:!0}).height;R.remove();const H=this.scaleType||v.scaleType||K.LINEAR,B=h(d).tickSizeOuter(0);if(d.ticks){let q;if(w?q=b:(q=Ln.ticks.number,y&&(q=this.getNumberOfFittingTicks(o,O,Ln.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(q=0),B.ticks(q),m)if(!d.ticks(q).length)B.tickValues([]);else{const Q=x(r,"timeScale","addSpaceOnEdges"),pt=x(r,"axes",n,"domain"),ot=d.copy();Q&&!pt&&ot.nice(q);const Tt=ot.ticks(q);Q&&Tt.length>2&&!pt&&(Tt.splice(Tt.length-1,1),Tt.splice(0,1)),B.tickValues(Tt)}}let U;const N=x(v,"ticks","formatter");if(m){const q=lu(B.tickValues(),x(r,"timeScale","timeInterval"));N===null?U=(Q,pt)=>ou(Q,pt,B.tickValues(),q,C):U=(Q,pt)=>{const ot=ou(Q,pt,B.tickValues(),q,C);return N(Q,pt,ot)}}else N===null?H===K.LINEAR&&(U=q=>q.toLocaleString()):U=N;B.tickFormat(U);const[j,Y]=this.services.cartesianScales.getScaleByPosition(n).domain();let it;if(M){if(m)M.forEach((q,Q)=>{q.getTime===void 0&&(M[Q]=new Date(q))}),it=M.filter(q=>{const Q=q.getTime();return Q>=new Date(j).getTime()&&Q<=new Date(Y).getTime()});else if(_===K.LABELS){const q=this.services.cartesianScales.getScaleByPosition(n).domain();it=M.filter(Q=>q.includes(Q))}else it=M.filter(q=>q>=j&&q<=Y);B.tickValues(it)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(v.title){const q=A.appendOrSelect(l,"text.axis-title").html(et||S?"":rn(v.title)),Q=x(v,"titleOrientation");let pt;switch(n){case z.LEFT:Q===Ya.RIGHT?q.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):q.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:q.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:Q===Ya.LEFT?q.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):q.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:pt=A.getSVGElementSize(q,{useBBox:!0}).height,q.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${pt/2})`).style("text-anchor","middle");break}}if(m){const q=lu(B.tickValues(),x(r,"timeScale","timeInterval")),Q=C.showDayName,pt=p;t&&(p=p.transition().call(Tt=>this.services.transitions.setupTransition({transition:Tt,name:"axis-update",animate:t}))),p=p.call(B),pt.selectAll(".tick").data(B.tickValues(),d).order().select("text").style("font-weight",(Tt,Z)=>Im(Tt,Z,B.tickValues(),q,Q)?"bold":"normal")}else!t||!f?p=p.call(B):p=p.transition().call(q=>this.services.transitions.setupTransition({transition:q,name:"axis-update",animate:t})).call(B);if(g.call(B),n===z.BOTTOM||n===z.TOP){let q=!1;const Q=x(v,"ticks","rotation");if(Q===ns.ALWAYS)q=!0;else if(Q===ns.NEVER)q=!1;else if(!Q||Q===ns.AUTO)if(d.step)q=g.selectAll("g.tick text").nodes().some(ot=>A.getSVGElementSize(ot,{useBBox:!0}).width>=d.step());else{q=!1;const pt=g.append("text").text("A"),ot=A.getSVGElementSize(pt.node(),{useBBox:!0}).width;let Tt;g.selectAll("g.tick").each(function(){const Z=L(this),F=parseFloat(x(xn(this),"tx"));F!==null&&Tt+Z.text().length*ot*.8>=F&&(q=!0),Tt=F}),pt.remove()}q?(w||(B.ticks(this.getNumberOfFittingTicks(a,O,Ln.ticks.horizontalSpaceRatio)),g.call(B),p.call(B)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(S?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",q=>q),g.selectAll("g.tick").attr("aria-label",q=>q),D!==Ae.NONE&&_===K.LABELS&&!M){const q=this.services.cartesianScales.getScaleDomain(n);if(q.length>0){const Q=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(Q);const pt=this;l.selectAll("g.tick text").data(q).text(function(ot){return ot.length>G?(pt.truncation[n]=!0,as(ot,D,I)):ot}),this.getInvisibleAxisRef().selectAll("g.tick text").data(q).text(function(ot){return ot.length>G?as(ot,D,I):ot}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(q)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=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(T.Axis.LABEL_MOUSEOVER,{event:c,element:L(this),datum:u}),a===K.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:L(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:L(this),datum:u}),a===K.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:L(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:L(this),datum:u}),a===K.LABELS&&l.services.events.dispatchEvent(T.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 cg(i,2,Ln.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 h$ extends Iv{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=L(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 z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-Ln.hover.rectanglePadding).attr("y",p).attr("width",u+Ln.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=L(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===K.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=L(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:L(this).select("text"),datum:L(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:L(this).select("text"),datum:L(this).select("text").datum()}),a===K.LABELS&&l.services.events.dispatchEvent(T.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(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:L(this),datum:L(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:L(this),datum:L(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:L(this),datum:L(this).select("text").datum()})),n===z.LEFT||n===z.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 fe extends ft{constructor(){super(...arguments),this.type="2D-axes",this.renderType=tt.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=x(this.getOptions(),"axes");r.forEach(o=>{i[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===is.DEFAULT?new Iv(this.model,this.services,c):new h$(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===z.LEFT||c===z.RIGHT)&&(f+=5)),c){case z.TOP:s.top=h+f;break;case z.BOTTOM:s.bottom=h+f;break;case z.LEFT:s.left=d+f;break;case z.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(T.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(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class oe extends ft{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=x(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Bt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Bt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Bt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Bt.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===zt.VERTICAL&&this.drawYGrid(t),n===zt.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=Ue().domain([0,1]).range(t),this.yScale=Ue().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=Bi().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Ct.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+Ct.xOffset;c===Ut.CENTER?p=s/2:c===Ut.RIGHT&&(p=s-t-Ct.xOffset);const g=t+Ct.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+Ct.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=`
77
77
  <stop class="${s}" offset="${c}"></stop>
78
78
  <stop class="${a}" offset="${c+.2}"></stop>
79
79
  <stop class="${s}" offset="${c+2*.2}"></stop>
80
- `;h.html(f),p();function p(){h.attr("gradientTransform",`translate(${c-3*.2*l}, 0)`).transition().duration(2e3).delay(1e3).ease(ux).attr("gradientTransform",`translate(${u+3*.2*l}, 0)`).on("end",p)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class d$ extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(vn(Ot.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new ti(this.model,this.services),new Lv(this.model,this.services),new sn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class f$ extends lr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Do(t,.25),q_50:Do(t,.5),q_75:Do(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(E=>E[o]).sort(Re),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 E of l)E<f||E>p?g.push(E):v.push(E);c.outliers=g;const m=Mn(v),y=Un(v);c.whiskers={min:m||Mn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||Un([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=["&ndash;"]),[s[n],x(s,"whiskers","min")!==null?x(s,"whiskers","min").toLocaleString():"&ndash;",x(s,"quartiles","q_25")!==null?x(s,"quartiles","q_25").toLocaleString():"&ndash;",x(s,"quartiles","q_50")!==null?x(s,"quartiles","q_50").toLocaleString():"&ndash;",x(s,"quartiles","q_75")!==null?x(s,"quartiles","q_75").toLocaleString():"&ndash;",x(s,"whiskers","max")!==null?x(s,"whiskers","max").toLocaleString():"&ndash;",x(s,"quartiles","q_75")!==null&&x(s,"quartiles","q_25")!==null?(x(s,"quartiles","q_75")-x(s,"quartiles","q_25")).toLocaleString():"&ndash;",a.map(o=>o.toLocaleString()).join(",")]})]}setColorClassNames(){const n=x(this.getOptions(),"color","pairing");let r=x(n,"option");const i=Qg.pairingOptions;r=r<=i["1-color"]?r:1;const s=this.allDataGroups.map(()=>`1-${r}-1`);this.colorClassNames=fa().range(s).domain(this.allDataGroups)}}class p$ extends ft{constructor(){super(...arguments),this.type="boxplot",this.renderType=tt.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===zt.VERTICAL,[m,y]=bn(w=>this.services.cartesianScales.getDomainValue(w),w=>this.services.cartesianScales.getRangeValue(w),g),E=Math.floor((v?h:f)/s.length),_=Math.min(E/2,16),S=this.model.getBoxplotData(),b=n.selectAll(".box-group").data(S);b.exit().remove();const M=b.enter().append("g").attr("class","box-group"),D=b.merge(M);M.append("path").merge(b.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ce.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalstartline",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i]),R=C,P=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.quartiles.q_25);return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ce.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalendline",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i]),R=C,P=p.getRangeValue(w.whiskers.max),O=p.getRangeValue(w.quartiles.q_75);return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],originalClassName:"box"})).attr("fill-opacity",Ce.box.opacity.default).attr("stroke-width",Ce.strokeWidth.default).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",w=>w[i]).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-quartiles",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i])-_/2,R=C+_,P=p.getRangeValue(Math[v?"max":"min"](w.quartiles.q_75,w.quartiles.q_25)),O=P+Math.abs(p.getRangeValue(w.quartiles.q_75)-p.getRangeValue(w.quartiles.q_25));return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",w=>{const C=p.getDomainValue(w[i])-_/2,R=C+_,P=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.whiskers.max);return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ce.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-startingwhisker",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i])-_/4,R=C+_/2,P=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.whiskers.min);return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-median",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i])-_/2,R=C+_,P=p.getRangeValue(w.quartiles.q_50);return ie({x0:C,x1:R,y0:P,y1:P},g)}),M.append("path").merge(b.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ce.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-endingwhisker",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i])-_/4,R=C+_/2,P=p.getRangeValue(w.whiskers.max),O=p.getRangeValue(w.whiskers.max);return ie({x0:C,x1:R,y0:P,y1:O},g)});const G=D.selectAll("circle.outlier").data(w=>w.outliers.map(C=>({min:w.whiskers.min,max:w.whiskers.max,[i]:w[i],value:C})));G.exit().remove();const I=G.enter().append("circle");G.merge(I).attr("r",Ce.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ce.circle.opacity.default).attr("cx",m).transition().call(w=>this.services.transitions.setupTransition({transition:w,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=L(this);L(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ce.box.opacity.hovered),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[r],class:t.model.getColorClassName({classNameTypes:[rt.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(T.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=L(this);t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(T.Boxplot.BOX_CLICK,{event:i,element:L(this),datum:s})}).on("mouseout",function(i,s){const a=L(this);L(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ce.box.opacity.default),t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.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=L(this);o.classed("hovered",!0).attr("fill-opacity",Ce.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[r],class:t.model.getColorClassName({classNameTypes:[rt.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=L(this);t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(T.Boxplot.OUTLIER_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);o.classed("hovered",!1).attr("fill-opacity",Ce.circle.opacity.default),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class ei extends ft{constructor(){super(...arguments),this.type="zero-line",this.renderType=tt.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=nm({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 g$ extends de{constructor(t,n){super(t,n),this.model=new f$(this.services),this.model.setOptions(kt(Ot.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new p$(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class m$ extends sn{constructor(){super(...arguments),this.type="bubble",this.renderType=tt.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?Ie(s):[1,1];return Ue().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]=bn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ct.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:[rt.FILL,rt.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 v$ extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new m$(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class y$ extends lr{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),s=x(n,"bullet","performanceAreaTitles");return[["Title","Group","Value","Target","Percentage","Performance"],...t.map(o=>[o.title,o[r],o.value===null?"&ndash;":o.value,x(o,"marker")===null?"&ndash;":o.marker,x(o,"marker")===null?"&ndash;":`${Math.floor(o[i]/o.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(o)]])]}}class E$ extends ft{constructor(){super(...arguments),this.type="bullet",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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((E,_)=>{E!=null&&E<u&&g.push({datum:y,value:E,order:_+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,b,M;return y.order===1?(_=this.services.cartesianScales.getDomainValue(y.datum)-16/2,S=_+16,b=c-2,M=l+1):(_=this.services.cartesianScales.getDomainValue(y.datum)-16/2,S=_+16,b=this.services.cartesianScales.getRangeValue(y.value),M=c),ie({x0:_,x1:S,y0:b,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:[rt.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>this.model.getFillColor(m[r])).attr("d",m=>{const E=this.services.cartesianScales.getDomainValue(m)-4,_=E+8,S=this.services.cartesianScales.getRangeValue(0)+1,b=this.services.cartesianScales.getRangeValue(m);return ie({x0:E,x1:_,y0:S,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ct.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 E=this.services.cartesianScales.getDomainValue(m)-12,_=E+24,S=this.services.cartesianScales.getRangeValue(m.marker);return ie({x0:E,x1:_,y0:S,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let g=[];s.filter(y=>x(y,"marker")!==null).forEach(y=>{const E=y.marker,_=y[o];g=g.concat([{datum:y,value:E*.25,barValue:_},{datum:y,value:E*.5,barValue:_},{datum:y,value:E*.75,barValue:_}])});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:E})=>{let _=4;y.ranges&&y.ranges.indexOf(E)!==-1&&(_=8);const S=this.services.cartesianScales.getDomainValue(y)-_/2,b=S+_,M=this.services.cartesianScales.getRangeValue(E);return ie({x0:S,x1:b,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=L(this);o.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=x(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[rt.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(T.Bar.BAR_MOUSEMOVE,{event:s,element:L(this),datum:a}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);o.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class x$ extends de{constructor(t,n){super(t,n),this.model=new y$(this.services),this.model.setOptions(kt(Ot.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new E$(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}function kv(e){const t=Ie(e,r=>r.value),n=Ue().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 Pv(e,t){const n=x(t,"gradient","colors"),r=!He(n);let i=x(t,"pairing","option");const s=kv(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 Nl().domain(s).range(o)}class b$ extends nn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(He(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!He(n)&&!He(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?"&ndash;":r.id,r.name,r.value])]}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=x(this.getOptions(),"color");this._colorScale=Pv(this.getDisplayData(),t)}}function _$(e){return e}function S$(e){if(e==null)return _$;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 T$(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function w$(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return $v(e,n)})}:$v(e,t)}function $v(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Wu(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 Wu(e,t){var n=S$(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&&T$(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 O$(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 M$(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 A$(e){return Wu(e,C$.apply(this,arguments))}function C$(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 M$(Wu(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=O$(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 D$ extends kn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=tt.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===zt.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(Mt(m,"data.x0"))<=h&&parseFloat(Mt(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!zg(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=L(v.nodes()[0]).datum(),y=parseFloat(Mt(m,"data.x0")),E=parseFloat(Mt(m,"data.x1")),_=this.model.getActiveDataGroupNames(),S=_.reverse().map(M=>({label:M,value:Mt(m,`data.${M}`),class:this.model.getColorClassName({classNameTypes:[rt.TOOLTIP],dataGroupName:M})})).filter(M=>M.value!==0);if(S.length>0){this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:Mt(s,"bins.rangeLabel")||"Range",value:`${y} – ${E}`},...S,...x(s,"tooltip","showTotal")===!0?[{label:Mt(s,"tooltip.totalLabel")||"Total",value:_.reduce((D,G)=>D+parseFloat(Mt(m,`data.${G}`)),0)}]:[]]}),f.attr("opacity",1);const M=d((y+E)/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 yo extends kn{formatTooltipData(t){return t.reverse()}}class Nv extends Lu{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=tt.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>Pt.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(T.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=!He(s),d=kv(this.model.getDisplayData()),h=!(i<=Pt.color.barWidth),f=h?Pt.color.barWidth:i,p=A.appendOrSelect(r,"g.legend"),g=A.appendOrSelect(p,"g.legend-axis");if(l){const D=A.appendOrSelect(r,"g.legend-title");A.appendOrSelect(D,"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 D=1;D<y+1;D++)m.push(a===rs.LINEAR?`stop-color-${v}-${o}-${D}`:`fill-${v}-${o}-${D}`);const E=ve(d[0],d[1]),_=nE(E,3),S=Ue().domain(d).range([0,f]),b=Ro(S).tickSize(0).tickValues(_);let M;switch(a){case rs.LINEAR:this.drawLinear(m,p,f);break;case rs.QUANTIZE:M=this.drawQuantize(m,v,u,p,f),S.range([M,f]);break;default:throw Error("Entered color legend type is not supported.")}g.attr("transform",`translate(0,${Pt.color.axisYTranslation})`).call(b),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",Pt.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=Ii().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",Pt.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(T.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class L$ extends ms{constructor(){super(...arguments),this.type="meter-title",this.renderType=tt.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-Xt.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=Xt.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=Xt.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=Xt.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-Xt.total.paddingLeft}else{const i=A.appendOrSelect(this.parent,"text.percent-value"),s=Xt.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=A.appendOrSelect(this.parent,"g.status-indicator").node(),l=A.getSVGElementSize(o,{useBBox:!0}).width+Xt.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case es.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 es.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case es.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 Yu extends ft{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=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 R$ extends ft{constructor(){super(...arguments),this.type="circle-pack",this.renderType=tt.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:Yr.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=Di({children:s}).sum(g=>g.value).sort((g,v)=>v.value-g.value),h=v_().size([r,i]).padding(g=>g.depth>=1?Yr.padding.children+3:Yr.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:[rt.FILL,rt.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",Yr.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",Yr.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){L(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=L(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
+ `;h.html(f),p();function p(){h.attr("gradientTransform",`translate(${c-3*.2*l}, 0)`).transition().duration(2e3).delay(1e3).ease(ux).attr("gradientTransform",`translate(${u+3*.2*l}, 0)`).on("end",p)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class d$ extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(vn(Ot.areaChart),n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new ti(this.model,this.services),new Lv(this.model,this.services),new sn(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class f$ extends lr{constructor(t){super(t)}getBoxQuartiles(t){return{q_25:Do(t,.25),q_50:Do(t,.5),q_75:Do(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(E=>E[o]).sort(Re),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 E of l)E<f||E>p?g.push(E):v.push(E);c.outliers=g;const m=Mn(v),y=Un(v);c.whiskers={min:m||Mn([c.quartiles.q_25,c.quartiles.q_50,c.quartiles.q_75]),max:y||Un([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(),i=["Group","Minimum","Q1","Median","Q3","Maximum","IQR","Outlier(s)"],s=[...r.map(a=>{let o=x(a,"outliers");return(o===null||o.length===0)&&(o=["&ndash;"]),[a[n],x(a,"whiskers","min")!==null?x(a,"whiskers","min").toLocaleString():"&ndash;",x(a,"quartiles","q_25")!==null?x(a,"quartiles","q_25").toLocaleString():"&ndash;",x(a,"quartiles","q_50")!==null?x(a,"quartiles","q_50").toLocaleString():"&ndash;",x(a,"quartiles","q_75")!==null?x(a,"quartiles","q_75").toLocaleString():"&ndash;",x(a,"whiskers","max")!==null?x(a,"whiskers","max").toLocaleString():"&ndash;",x(a,"quartiles","q_75")!==null&&x(a,"quartiles","q_25")!==null?(x(a,"quartiles","q_75")-x(a,"quartiles","q_25")).toLocaleString():"&ndash;",o.map(l=>l.toLocaleString()).join(",")]})];return super.formatTable({headers:i,cells:s})}setColorClassNames(){const n=x(this.getOptions(),"color","pairing");let r=x(n,"option");const i=Qg.pairingOptions;r=r<=i["1-color"]?r:1;const s=this.allDataGroups.map(()=>`1-${r}-1`);this.colorClassNames=fa().range(s).domain(this.allDataGroups)}}class p$ extends ft{constructor(){super(...arguments),this.type="boxplot",this.renderType=tt.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===zt.VERTICAL,[m,y]=bn(w=>this.services.cartesianScales.getDomainValue(w),w=>this.services.cartesianScales.getRangeValue(w),g),E=Math.floor((v?h:f)/s.length),_=Math.min(E/2,16),S=this.model.getBoxplotData(),b=n.selectAll(".box-group").data(S);b.exit().remove();const M=b.enter().append("g").attr("class","box-group"),D=b.merge(M);M.append("path").merge(b.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",Ce.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalstartline",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i]),R=C,P=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.quartiles.q_25);return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",Ce.strokeWidth.default).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-verticalendline",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i]),R=C,P=p.getRangeValue(w.whiskers.max),O=p.getRangeValue(w.quartiles.q_75);return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],originalClassName:"box"})).attr("fill-opacity",Ce.box.opacity.default).attr("stroke-width",Ce.strokeWidth.default).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",w=>w[i]).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-quartiles",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i])-_/2,R=C+_,P=p.getRangeValue(Math[v?"max":"min"](w.quartiles.q_75,w.quartiles.q_25)),O=P+Math.abs(p.getRangeValue(w.quartiles.q_75)-p.getRangeValue(w.quartiles.q_25));return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",w=>{const C=p.getDomainValue(w[i])-_/2,R=C+_,P=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.whiskers.max);return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"whisker start"})).attr("stroke-width",Ce.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-startingwhisker",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i])-_/4,R=C+_/2,P=p.getRangeValue(w.whiskers.min),O=p.getRangeValue(w.whiskers.min);return ie({x0:C,x1:R,y0:P,y1:O},g)}),M.append("path").merge(b.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-median",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i])-_/2,R=C+_,P=p.getRangeValue(w.quartiles.q_50);return ie({x0:C,x1:R,y0:P,y1:P},g)}),M.append("path").merge(b.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.STROKE],originalClassName:"whisker end"})).attr("stroke-width",Ce.strokeWidth.thicker).attr("fill","none").transition().call(w=>this.services.transitions.setupTransition({transition:w,name:"boxplot-update-endingwhisker",animate:t})).attr("d",w=>{const C=p.getDomainValue(w[i])-_/4,R=C+_/2,P=p.getRangeValue(w.whiskers.max),O=p.getRangeValue(w.whiskers.max);return ie({x0:C,x1:R,y0:P,y1:O},g)});const G=D.selectAll("circle.outlier").data(w=>w.outliers.map(C=>({min:w.whiskers.min,max:w.whiskers.max,[i]:w[i],value:C})));G.exit().remove();const I=G.enter().append("circle");G.merge(I).attr("r",Ce.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],originalClassName:"outlier"})).attr("fill-opacity",Ce.circle.opacity.default).attr("cx",m).transition().call(w=>this.services.transitions.setupTransition({transition:w,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=L(this);L(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",Ce.box.opacity.hovered),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:n.tooltip.groupLabel,value:s[r],class:t.model.getColorClassName({classNameTypes:[rt.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(T.Boxplot.BOX_MOUSEOVER,{event:i,element:a,datum:s})}).on("mousemove",function(i,s){const a=L(this);t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEMOVE,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){t.services.events.dispatchEvent(T.Boxplot.BOX_CLICK,{event:i,element:L(this),datum:s})}).on("mouseout",function(i,s){const a=L(this);L(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",Ce.box.opacity.default),t.services.events.dispatchEvent(T.Boxplot.BOX_MOUSEOUT,{event:i,element:a,datum:s}),t.services.events.dispatchEvent(T.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=L(this);o.classed("hovered",!0).attr("fill-opacity",Ce.circle.opacity.hovered).classed("unfilled",!1),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel,value:a[r],class:t.model.getColorClassName({classNameTypes:[rt.TOOLTIP]})},{label:"Outlier",value:a[i]}]}),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOVER,{event:s,element:o,datum:a})}).on("mousemove",function(s,a){const o=L(this);t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEMOVE,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(T.Boxplot.OUTLIER_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);o.classed("hovered",!1).attr("fill-opacity",Ce.circle.opacity.default),t.services.events.dispatchEvent(T.Boxplot.OUTLIER_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class ei extends ft{constructor(){super(...arguments),this.type="zero-line",this.renderType=tt.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=nm({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 g$ extends de{constructor(t,n){super(t,n),this.model=new f$(this.services),this.model.setOptions(kt(Ot.boxplotChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new p$(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t,{legend:{enabled:!1}})}}class m$ extends sn{constructor(){super(...arguments),this.type="bubble",this.renderType=tt.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?Ie(s):[1,1];return Ue().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]=bn(l,c,o.getOrientation());t.raise().classed("dot",!0).attr("role",ct.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:[rt.FILL,rt.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 v$ extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.bubbleChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new m$(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class y$ extends lr{constructor(t){super(t)}getMatchingRangeIndexForDatapoint(t){let n;for(let r=t.ranges.length-1;r>0;r--){const i=t.ranges[r];if(t.value>=i)return n=r,n}return 0}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.services.cartesianScales.getRangeIdentifier(),s=x(n,"bullet","performanceAreaTitles"),a=["Title","Group","Value","Target","Percentage","Performance"],o=[...t.map(l=>[l.title,l[r],l.value===null?"&ndash;":l.value,x(l,"marker")===null?"&ndash;":l.marker,x(l,"marker")===null?"&ndash;":`${Math.floor(l[i]/l.marker*100)}%`,s[this.getMatchingRangeIndexForDatapoint(l)]])];return super.formatTable({headers:a,cells:o})}}class E$ extends ft{constructor(){super(...arguments),this.type="bullet",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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((E,_)=>{E!=null&&E<u&&g.push({datum:y,value:E,order:_+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,b,M;return y.order===1?(_=this.services.cartesianScales.getDomainValue(y.datum)-16/2,S=_+16,b=c-2,M=l+1):(_=this.services.cartesianScales.getDomainValue(y.datum)-16/2,S=_+16,b=this.services.cartesianScales.getRangeValue(y.value),M=c),ie({x0:_,x1:S,y0:b,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:[rt.FILL],dataGroupName:m[r],originalClassName:"bar"})).style("fill",m=>this.model.getFillColor(m[r])).attr("d",m=>{const E=this.services.cartesianScales.getDomainValue(m)-4,_=E+8,S=this.services.cartesianScales.getRangeValue(0)+1,b=this.services.cartesianScales.getRangeValue(m);return ie({x0:E,x1:_,y0:S,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ct.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 E=this.services.cartesianScales.getDomainValue(m)-12,_=E+24,S=this.services.cartesianScales.getRangeValue(m.marker);return ie({x0:E,x1:_,y0:S,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{let g=[];s.filter(y=>x(y,"marker")!==null).forEach(y=>{const E=y.marker,_=y[o];g=g.concat([{datum:y,value:E*.25,barValue:_},{datum:y,value:E*.5,barValue:_},{datum:y,value:E*.75,barValue:_}])});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:E})=>{let _=4;y.ranges&&y.ranges.indexOf(E)!==-1&&(_=8);const S=this.services.cartesianScales.getDomainValue(y)-_/2,b=S+_,M=this.services.cartesianScales.getRangeValue(E);return ie({x0:S,x1:b,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=L(this);o.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:s,element:o,datum:a});const l=x(n,"bullet","performanceAreaTitles"),c=t.model.getMatchingRangeIndexForDatapoint(a);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:n.tooltip.groupLabel||"Group",value:a[r],class:t.model.getColorClassName({classNameTypes:[rt.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(T.Bar.BAR_MOUSEMOVE,{event:s,element:L(this),datum:a}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);o.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:s,element:o,datum:a}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class x$ extends de{constructor(t,n){super(t,n),this.model=new y$(this.services),this.model.setOptions(kt(Ot.bulletChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new E$(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}function kv(e){const t=Ie(e,r=>r.value),n=Ue().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 Pv(e,t){const n=x(t,"gradient","colors"),r=!He(n);let i=x(t,"pairing","option");const s=kv(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 Nl().domain(s).range(o)}class b$ extends nn{constructor(t){super(t),this._colorScale=void 0,this._matrix={}}getFillColor(t){return this._colorScale(t)}getCombinedData(){if(He(this._matrix)){const t=this.getOptions(),n=this.getDisplayData();!He(n)&&!He(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(),n=["Country ID","Country Name","Value"],r=[...t.map(i=>[i.id===null?"&ndash;":i.id,i.name,i.value])];return super.formatTable({headers:n,cells:r})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=x(this.getOptions(),"color");this._colorScale=Pv(this.getDisplayData(),t)}}function _$(e){return e}function S$(e){if(e==null)return _$;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 T$(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function w$(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return $v(e,n)})}:$v(e,t)}function $v(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,s=Wu(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 Wu(e,t){var n=S$(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&&T$(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 O$(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 M$(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 A$(e){return Wu(e,C$.apply(this,arguments))}function C$(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 M$(Wu(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=O$(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 D$ extends kn{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=tt.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===zt.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(Mt(m,"data.x0"))<=h&&parseFloat(Mt(m,"data.x1"))>=h)return!0});if(v.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!zg(this.elementsToHighlight,v)&&this.hideRuler(),v.dispatch("mouseover"),this.elementsToHighlight=v;const m=L(v.nodes()[0]).datum(),y=parseFloat(Mt(m,"data.x0")),E=parseFloat(Mt(m,"data.x1")),_=this.model.getActiveDataGroupNames(),S=_.reverse().map(M=>({label:M,value:Mt(m,`data.${M}`),class:this.model.getColorClassName({classNameTypes:[rt.TOOLTIP],dataGroupName:M})})).filter(M=>M.value!==0);if(S.length>0){this.services.events.dispatchEvent(T.Tooltip.SHOW,{mousePosition:[n,r],hoveredElement:p,items:[{label:Mt(s,"bins.rangeLabel")||"Range",value:`${y} – ${E}`},...S,...x(s,"tooltip","showTotal")===!0?[{label:Mt(s,"tooltip.totalLabel")||"Total",value:_.reduce((D,G)=>D+parseFloat(Mt(m,`data.${G}`)),0)}]:[]]}),f.attr("opacity",1);const M=d((y+E)/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 yo extends kn{formatTooltipData(t){return t.reverse()}}class Nv extends Nu{constructor(t,n,r){super(t,n,r),this.type="color-legend",this.renderType=tt.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>Pt.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(T.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=!He(s),d=kv(this.model.getDisplayData()),h=!(i<=Pt.color.barWidth),f=h?Pt.color.barWidth:i,p=A.appendOrSelect(r,"g.legend"),g=A.appendOrSelect(p,"g.legend-axis");if(l){const D=A.appendOrSelect(r,"g.legend-title");A.appendOrSelect(D,"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 D=1;D<y+1;D++)m.push(a===rs.LINEAR?`stop-color-${v}-${o}-${D}`:`fill-${v}-${o}-${D}`);const E=ve(d[0],d[1]),_=nE(E,3),S=Ue().domain(d).range([0,f]),b=Ro(S).tickSize(0).tickValues(_);let M;switch(a){case rs.LINEAR:this.drawLinear(m,p,f);break;case rs.QUANTIZE:M=this.drawQuantize(m,v,u,p,f),S.range([M,f]);break;default:throw Error("Entered color legend type is not supported.")}g.attr("transform",`translate(0,${Pt.color.axisYTranslation})`).call(b),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",Pt.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=Ii().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",Pt.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(T.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class L$ extends vs{constructor(){super(...arguments),this.type="meter-title",this.renderType=tt.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-Xt.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=Xt.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=Xt.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=Xt.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-Xt.total.paddingLeft}else{const i=A.appendOrSelect(this.parent,"text.percent-value"),s=Xt.statusBar.paddingRight,a=i.node().getComputedTextLength(),o=A.appendOrSelect(this.parent,"g.status-indicator").node(),l=A.getSVGElementSize(o,{useBBox:!0}).width+Xt.status.paddingLeft;return r-a-s-l}}getStatusIconPathString(t){switch(t){case es.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 es.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case es.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 Yu extends ft{getBarWidth(){const t=this.getOptions();if(t.bars.width)return t.bars.width;const n=this.model.getDisplayData().length,r=this.services.cartesianScales.getMainXScale(),i=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 R$ extends ft{constructor(){super(...arguments),this.type="circle-pack",this.renderType=tt.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:Yr.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=Di({children:s}).sum(g=>g.value).sort((g,v)=>v.value-g.value),h=v_().size([r,i]).padding(g=>g.depth>=1?Yr.padding.children+3:Yr.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:[rt.FILL,rt.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",Yr.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",Yr.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){L(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const t=L(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`
81
81
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
82
82
  <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"/>
83
83
  <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"/>
84
- </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=L(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:Mt(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(T.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(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=L(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");L(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");L(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(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function I$(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class Uv extends ft{constructor(){super(...arguments),this.type="pie",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Ct.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(C=>C[a]>0),l=this.computeRadius();this.arc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l+Ct.hoverArc.outerRadiusOffset);const u=pT().value(C=>C[a]).sort(x(i,"pie","sortFunction")).padAngle(Ct.padAngle)(o),h=A.appendOrSelect(r,"g.slices").attr("role",ct.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,C=>C.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",C=>this.model.getColorClassName({classNameTypes:[rt.FILL],dataGroupName:C.data[s],originalClassName:"slice"})).style("fill",C=>n.model.getFillColor(C.data[s])).attr("d",this.arc).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",C=>`${C[a]}, ${Zc(C.data[a],o,a)+"%"}`).attrTween("d",function(C){return I$.bind(this)(C,n.arc)});const g=i.pie.labels.enabled,v=g?u.filter(C=>C.data[a]>0):[],y=A.appendOrSelect(r,"g.labels").attr("role",ct.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(v,C=>C.data[s]);y.exit().attr("opacity",0).remove();const E=y.enter().append("text").classed("pie-label",!0),_=[];E.merge(y).style("text-anchor","middle").text(C=>i.pie.labels.formatter?i.pie.labels.formatter({...C,percentageValue:Zc(C.data[a],o,a,!0)}):Zc(C.data[a],o,a)+"%").datum(function(C){const R=l+7,P=(C.endAngle-C.startAngle)/2+C.startAngle,O=P/Math.PI*180,H=this.getComputedTextLength();return C.textOffsetX=H/2,C.textOffsetY=O>90&&O<270?10:0,C.xPosition=(C.textOffsetX+R)*Math.sin(P),C.yPosition=(C.textOffsetY+R)*-Math.cos(P),C}).attr("transform",function(C,R){const P=v.length,O=(C.endAngle-C.startAngle)*(180/Math.PI);if(R>=P-2&&O<Ct.callout.minSliceDegree){let H,B;return C.index===P-1?(H=C.xPosition+Ct.callout.offsetX+Ct.callout.textMargin+C.textOffsetX,B=C.yPosition-Ct.callout.offsetY,C.direction=ts.RIGHT,_.push(C)):(H=C.xPosition-Ct.callout.offsetX-C.textOffsetX-Ct.callout.textMargin,B=C.yPosition-Ct.callout.offsetY,C.direction=ts.LEFT,_.push(C)),`translate(${H}, ${B})`}return`translate(${C.xPosition}, ${C.yPosition})`}),this.renderCallouts(_);const S=x(i,"donut")?"donut":"pie",b=x(i,S,"alignment"),{width:M}=A.getSVGElementSize(this.getParent(),{useAttrs:!0}),D=g?Ct.xOffset:0,G=g?Ct.yOffset:0;let I=l+D;b===Ut.CENTER?I=M/2:b===Ut.RIGHT&&(I=M-l-Ct.xOffset);let w=l+G;_.length>0&&(w+=Ct.yOffsetCallout),r.attr("x",I+7).attr("y",w),this.addEventListeners()}renderCallouts(t){const n=A.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ct.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",ct.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===ts.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Ct.callout.offsetX,y:c-Ct.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Ct.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Ct.callout.offsetX,y:c-Ct.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Ct.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return L(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 L(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=L(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(T.Pie.SLICE_MOUSEOVER,{event:n,element:L(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(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(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.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+Ct.radiusOffset:i}}class k$ extends Uv{constructor(){super(...arguments),this.type="donut",this.renderType=tt.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(L(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=Ih:s=ve;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Bv="4,10 8,6 12,10",Fv="12,6 8,10 4,6";class P$ extends ft{constructor(){super(...arguments),this.type="gauge",this.renderType=tt.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return cg(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")===ir.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 Wa.UP:return Bv;case Wa.DOWN:return Fv;default:return t>0?Bv:Fv}}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=Bi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Bi().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:[rt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ct.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===Ut.CENTER?m=v/2:g===Ut.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===ir.FULL&&!s?d=l(a):r===ir.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,E=u?"%":"",_=A.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",m/2).text(E),{width:S,height:b}=A.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${b/2}px`),p.attr("transform",`translate(-${S/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=L(this);A.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const E=x(r,"gauge","status");A.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",E!==null?`gauge-delta-arrow status--${E}`:"").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(T.Gauge.ARC_MOUSEOVER,{event:n,element:L(this),datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.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===ir.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Hv extends Yu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Ji(n.map(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",ct.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()===zt.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:[rt.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),E=this.services.cartesianScales.getRangeValue(h),_=this.services.cartesianScales.getDomainValue(h)-p/2,S=_+p;if(!this.isOutsideZoomedDomain(_,S))return ie({x0:g,x1:v,y0:y,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ct.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=L(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.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=Ii().domain(t).rangeRound([0,this.getGroupWidth()])}}class $$ extends ft{constructor(){super(...arguments),this.type="heatmap",this.renderType=tt.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)}, ${Mn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Mn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:L(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(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.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!==zr.OFF&&(t===zr.AUTO&&Jg.minCellDividerDimension<=this.xBandwidth&&Jg.minCellDividerDimension<=this.yBandwidth||t===zr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=Mt(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=L(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ss(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(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.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(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:L(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:L(this),datum:u})}).on("mouseout",function(c,u){const h=L(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class N$ extends ft{constructor(){super(...arguments),this.type="histogram",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=>Mt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ct.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:[rt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const d=Mt(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()===zt.VERTICAL?v+=1:v-=1),ie({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ct.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=L(this);a.classed("hovered",!0);const o=parseFloat(Mt(s,"data.x0")),l=parseFloat(Mt(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:Mt(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[rt.TOOLTIP],dataGroupName:s[n]})},{label:u,value:Mt(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("mouseout",function(){L(this).classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class U$ extends sn{constructor(){super(...arguments),this.type="lollipop",this.renderType=tt.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]?En.weight.unselected:En.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",En.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?En.opacity.unselected:En.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",En.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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]=bn(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:[rt.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===zt.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(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class B$ extends ft{constructor(){super(...arguments),this.type="meter",this.renderType=tt.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)-Xt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Xt.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 E=x(i,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ue().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?Xt.height.proportional:Xt.height.default)),A.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Xt.height.proportional:Xt.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",E=>E.x).attr("y",0).attr("height",()=>f||(s?Xt.height.proportional:Xt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[rt.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):E.width).style("fill",E=>n.model.getFillColor(E[c])).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.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?Xt.height.proportional:Xt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),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=L(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=L(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function Gv(e){const t=F$(Vv(e),360);return Pn(t,[0,10])||Pn(t,[350,0])?{textAnchor:Je.START,dominantBaseline:tn.MIDDLE}:Pn(t,[10,80])?{textAnchor:Je.START,dominantBaseline:tn.HANGING}:Pn(t,[80,100])?{textAnchor:Je.MIDDLE,dominantBaseline:tn.HANGING}:Pn(t,[100,170])?{textAnchor:Je.END,dominantBaseline:tn.HANGING}:Pn(t,[170,190])?{textAnchor:Je.END,dominantBaseline:tn.MIDDLE}:Pn(t,[190,260])?{textAnchor:Je.END,dominantBaseline:tn.BASELINE}:Pn(t,[260,280])?{textAnchor:Je.MIDDLE,dominantBaseline:tn.BASELINE}:{textAnchor:Je.START,dominantBaseline:tn.BASELINE}}function F$(e,t){return(e%t+t)%t}function Pn(e,[t,n]){return e>=t&&e<=n}function Vv(e){return e*(180/Math.PI)}function Nt(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 H$(e,t){return t*Math.sin(e-Math.PI/2)}class G$ extends ft{constructor(){super(...arguments),this.type="radar",this.renderType=tt.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=ZL(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return at(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=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:at(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:sr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?sr.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",sr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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}=sr;this.uniqueKeys=Array.from(new Set(s.map(F=>F[u]))),this.uniqueGroups=Array.from(new Set(s.map(F=>F[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),S=(Math.min(r,i)-y)/2;if(S<=0)return;const b=Ii().domain(this.fullDataNormalized.map(F=>F[u])).range([0,2*Math.PI].map(F=>F-Math.PI/2)),M=Mn(this.fullDataNormalized.map(F=>F[d])),D=Ue().domain([M>=0?0:M,Un(this.fullDataNormalized.map(F=>F[d]))]).range([g,S]).nice(p),G=D.ticks(p),I=F=>this.model.getFillColor(F),w=vT().angle(F=>b(F[u])+Math.PI/2).radius(F=>D(F[d])).curve(Qf),C=this.uniqueKeys.map(F=>{const V=this.getLabelDimensions(F).width,$=H$(b(F),S);return V+$}),P={x:Un(C)+h,y:i/2},H=A.appendOrSelect(n,"g.y-axes").attr("role",ct.GROUP).selectAll("path").data(G,F=>F),B=F=>this.uniqueKeys.map(V=>({[u]:V,[d]:F}));H.join(F=>F.append("path").attr("opacity",0).attr("transform",`translate(${P.x}, ${P.y})`).attr("fill","none").call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",$=>w(B($)))),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${P.x}, ${P.y})`).attr("d",$=>w(B($)))),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_exit",animate:t})).attr("d",$=>w(B($))).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-axes").attr("role",ct.GROUP).selectAll("line").data(this.uniqueKeys,F=>F).join(F=>F.append("line").attr("opacity",0).attr("class",V=>`x-axis-${Br(V)}`).attr("stroke-dasharray","0").attr("x1",V=>Nt(b(V),0,P).x).attr("y1",V=>Nt(b(V),0,P).y).attr("x2",V=>Nt(b(V),0,P).x).attr("y2",V=>Nt(b(V),0,P).y).call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",$=>Nt(b($),D.range()[0],P).x).attr("y1",$=>Nt(b($),D.range()[0],P).y).attr("x2",$=>Nt(b($),D.range()[1],P).x).attr("y2",$=>Nt(b($),D.range()[1],P).y)),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",$=>Nt(b($),D.range()[0],P).x).attr("y1",$=>Nt(b($),D.range()[0],P).y).attr("x2",$=>Nt(b($),D.range()[1],P).x).attr("y2",$=>Nt(b($),D.range()[1],P).y)),F=>F.call(V=>V.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",ct.GROUP).selectAll("text").data(this.uniqueKeys).join(F=>F.append("text").text(V=>V).attr("opacity",0).attr("x",V=>Nt(b(V),D.range()[1]+h,P).x).attr("y",V=>Nt(b(V),D.range()[1]+h,P).y).style("text-anchor",V=>Gv(b(V)).textAnchor).style("dominant-baseline",V=>Gv(b(V)).dominantBaseline).call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",$=>Nt(b($),D.range()[1]+h,P).x).attr("y",$=>Nt(b($),D.range()[1]+h,P).y).end().finally(()=>{const $=x(o,"radar","alignment"),mt=this.getAlignmentXOffset($,n,this.getParent());n.attr("x",mt)})),F=>F.call(V=>V.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",ct.GROUP).selectAll("path").data(this.groupedDataNormalized,F=>F.name).join(F=>F.append("path").attr("class",V=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],dataGroupName:V.name,originalClassName:"blob"})).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-label",V=>V.name).attr("opacity",0).attr("transform",t?()=>`translate(${P.x}, ${P.y}) scale(${1+Math.random()*.35})`:`translate(${P.x}, ${P.y})`).style("fill",V=>I(V.name)).style("fill-opacity",sr.opacity.selected).style("stroke",V=>I(V.name)).call(V=>{const $=V.transition().call(mt=>this.services.transitions.setupTransition({transition:mt,name:"radar_blobs_enter",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",`translate(${P.x}, ${P.y})`),$.attr("opacity",1).attr("d",mt=>w(mt.data))}),F=>(F.attr("class",V=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],dataGroupName:V.name,originalClassName:"blob"})).style("fill",V=>I(V.name)).style("stroke",V=>I(V.name)),F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${P.x}, ${P.y})`).attr("d",$=>w($.data))),F),F=>F.call(V=>{const $=V.transition().call(mt=>this.services.transitions.setupTransition({transition:mt,name:"radar_blobs_exit",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",()=>`translate(${P.x}, ${P.y}) scale(${1+Math.random()*.35})`),$.attr("opacity",0).remove()})),A.appendOrSelect(n,"g.dots").attr("role",ct.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(F=>x(F,d)!==null)).join(F=>F.append("circle").attr("role",ct.GRAPHICS_SYMBOL).attr("aria-label",V=>V[c]),F=>F,F=>F.remove()).attr("class",F=>this.model.getColorClassName({classNameTypes:[rt.FILL],dataGroupName:F[l],originalClassName:Br(F[u])})).attr("cx",F=>Nt(b(F[u]),D(F[d]),P).x).attr("cy",F=>Nt(b(F[u]),D(F[d]),P).y).attr("r",0).attr("opacity",0).style("fill",F=>I(F[l])),A.appendOrSelect(n,"g.x-axes-rect").attr("role",ct.GROUP).selectAll("rect").data(this.uniqueKeys).join(F=>F.append("rect"),F=>F,F=>F.remove()).attr("x",P.x).attr("y",P.y-v/2).attr("width",D.range()[1]).attr("height",v).style("fill","red").style("fill-opacity",0).attr("transform",F=>`rotate(${Vv(b(F))}, ${P.x}, ${P.y})`),A.appendOrSelect(n,"g.y-labels").attr("role",ct.GROUP).selectAll("text").data(Ie(G)).join(F=>F.append("text").attr("opacity",0).text(V=>V).attr("x",V=>Nt(-Math.PI/2,D(V),P).x+f).attr("y",V=>Nt(-Math.PI/2,D(V),P).y).style("text-anchor","start").style("dominant-baseline","middle").call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_update",animate:t})).text($=>$).attr("opacity",1).attr("x",$=>Nt(-Math.PI/2,D($),P).x+f).attr("y",$=>Nt(-Math.PI/2,D($),P).y)),F=>F.call(V=>V.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===Ut.CENTER?a=Math.floor((s-i.width)/2):t===Ut.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.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=L(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Br(i)}`),o=t.parent.selectAll(`.dots circle.${Br(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",sr.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.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:[rt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=L(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:L(this),datum:i})}).on("mouseout",function(r,i){const s=L(this),a=t.parent.select(`.x-axes .x-axis-${Br(i)}`),o=t.parent.selectAll(`.dots circle.${Br(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class zv extends Yu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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:[rt.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 E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),v=this.services.cartesianScales.getRangeValue(c)}const m=Math.abs(v-g);if(m!==0&&m<2&&(h>0&&a===zt.VERTICAL||h<0&&a===zt.HORIZONTAL?v=g-2:v=g+2),!this.isOutsideZoomedDomain(f,p))return ie({x0:f,x1:p,y0:g,y1:v},a)}).attr("opacity",1).attr("role",ct.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=L(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:L(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class V$ extends oe{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 Wv extends ft{constructor(){super(...arguments),this.type="area-stacked",this.renderType=tt.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?yn.opacity.unselected:yn.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",yn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=Kl().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:[rt.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s))).attr("role",ct.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",yn.opacity.selected).attr("d",this.areaGenerator)}}class Yv extends Yu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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",ct.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:[rt.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()===zt.VERTICAL?g+=c[1]===0?2:1:g-=1:v||(this.services.cartesianScales.getOrientation()===zt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ct.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=L(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.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(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=L(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:L(this),datum:s})}).on("mouseout",function(i,s){const a=L(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class qv extends sn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=tt.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",ct.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 ni=6;class z$ extends ft{constructor(){super(...arguments),this.type="tree",this.renderType=tt.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+ni:30-ni},h=Di({name:o,children:a}),f=10,p=r/6,g=b=>{const M=h.descendants().reverse(),D=h.links();let G=h,I=h;h.eachBefore(U=>{U.x<G.x&&(G=U),U.x>I.x&&(I=U)});const w=I.x-G.x,C=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,G.x,r,w].join(" ")),R=S.selectAll("g").data(M,U=>U.id),P=this,O=R.enter().append("g").attr("transform",()=>`translate(${b.y0},${b.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,N){P.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:U,element:L(this),datum:N})}).on("click",function(U,N){N.depth!==0&&(N.children=N.children?null:N._children,g(N)),P.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:U,element:L(this),datum:N})}).on("mouseout",function(U,N){P.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:U,element:L(this),datum:N})});O.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",U=>U._children?-ni:ni).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),R.merge(O).transition(C).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),R.exit().transition(C).remove().attr("transform",()=>`translate(${b.y},${b.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const H=_.selectAll("path").data(D,U=>U.target.id),B=H.enter().append("path").attr("d",()=>{const U={x:b.x0,y:b.y0};return E({source:U,target:U})});H.merge(B).transition(C).attr("d",E),H.exit().transition(C).remove().attr("d",()=>{const U={x:b.x,y:b.y};return E({source:U,target:U})}),h.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},v=h.descendants(),m=v[v.length-1].depth,y=x(s,"tree","type")===za.DENDROGRAM?Ub().size([i,r-u-m*ni-l]):w_().nodeSize([f,p]).size([i,r-u-m*ni-l]),E=ST().x(b=>b.y).y(b=>b.x);h.x0=p/2,h.y0=0,h.descendants().forEach((b,M)=>{b.id=M,b._children=b.children}),y(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const _=n.append("g").attr("class","links"),S=n.append("g").attr("class","nodes");g(h)}}var W$="#000000",Y$="#ffffff",q$="#fcf4d6",X$="#fddc69",j$="#f1c21b",Z$="#d2a106",K$="#b28600",Q$="#8e6a00",J$="#684e00",tN="#483700",eN="#302400",nN="#1c1500",rN={10:q$,20:X$,30:j$,40:Z$,50:K$,60:Q$,70:J$,80:tN,90:eN,100:nN},iN="#fff2e8",sN="#ffd9be",aN="#ffb784",oN="#ff832b",lN="#eb6200",cN="#ba4e00",uN="#8a3800",hN="#5e2900",dN="#3e1a00",fN="#231000",pN={10:iN,20:sN,30:aN,40:oN,50:lN,60:cN,70:uN,80:hN,90:dN,100:fN},gN="#fff1f1",mN="#ffd7d9",vN="#ffb3b8",yN="#ff8389",EN="#fa4d56",xN="#da1e28",bN="#a2191f",_N="#750e13",SN="#520408",TN="#2d0709",wN={10:gN,20:mN,30:vN,40:yN,50:EN,60:xN,70:bN,80:_N,90:SN,100:TN},ON="#fff0f7",MN="#ffd6e8",AN="#ffafd2",CN="#ff7eb6",DN="#ee5396",LN="#d02670",RN="#9f1853",IN="#740937",kN="#510224",PN="#2a0a18",$N={10:ON,20:MN,30:AN,40:CN,50:DN,60:LN,70:RN,80:IN,90:kN,100:PN},NN="#f6f2ff",UN="#e8daff",BN="#d4bbff",FN="#be95ff",HN="#a56eff",GN="#8a3ffc",VN="#6929c4",zN="#491d8b",WN="#31135e",YN="#1c0f30",qN={10:NN,20:UN,30:BN,40:FN,50:HN,60:GN,70:VN,80:zN,90:WN,100:YN},XN="#edf5ff",jN="#d0e2ff",ZN="#a6c8ff",KN="#78a9ff",QN="#4589ff",JN="#0f62fe",tU="#0043ce",eU="#002d9c",nU="#001d6c",rU="#001141",iU={10:XN,20:jN,30:ZN,40:KN,50:QN,60:JN,70:tU,80:eU,90:nU,100:rU},sU="#e5f6ff",aU="#bae6ff",oU="#82cfff",lU="#33b1ff",cU="#1192e8",uU="#0072c3",hU="#00539a",dU="#003a6d",fU="#012749",pU="#061727",gU={10:sU,20:aU,30:oU,40:lU,50:cU,60:uU,70:hU,80:dU,90:fU,100:pU},mU="#d9fbfb",vU="#9ef0f0",yU="#3ddbd9",EU="#08bdba",xU="#009d9a",bU="#007d79",_U="#005d5d",SU="#004144",TU="#022b30",wU="#081a1c",OU={10:mU,20:vU,30:yU,40:EU,50:xU,60:bU,70:_U,80:SU,90:TU,100:wU},MU="#defbe6",AU="#a7f0ba",CU="#6fdc8c",DU="#42be65",LU="#24a148",RU="#198038",IU="#0e6027",kU="#044317",PU="#022d0d",$U="#071908",NU={10:MU,20:AU,30:CU,40:DU,50:LU,60:RU,70:IU,80:kU,90:PU,100:$U},UU="#f2f4f8",BU="#dde1e6",FU="#c1c7cd",HU="#a2a9b0",GU="#878d96",VU="#697077",zU="#4d5358",WU="#343a3f",YU="#21272a",qU="#121619",XU={10:UU,20:BU,30:FU,40:HU,50:GU,60:VU,70:zU,80:WU,90:YU,100:qU},jU="#f4f4f4",ZU="#e0e0e0",KU="#c6c6c6",QU="#a8a8a8",JU="#8d8d8d",tB="#6f6f6f",eB="#525252",nB="#393939",rB="#262626",iB="#161616",sB={10:jU,20:ZU,30:KU,40:QU,50:JU,60:tB,70:eB,80:nB,90:rB,100:iB},aB="#f7f3f2",oB="#e5e0df",lB="#cac5c4",cB="#ada8a8",uB="#8f8b8b",hB="#726e6e",dB="#565151",fB="#3c3838",pB="#272525",gB="#171414",mB={10:aB,20:oB,30:lB,40:cB,50:uB,60:hB,70:dB,80:fB,90:pB,100:gB},Xv={black:{100:W$},blue:iU,coolGray:XU,cyan:gU,gray:sB,green:NU,magenta:$N,orange:pN,purple:qN,red:wN,teal:OU,warmGray:mB,white:{0:Y$},yellow:rN};const vB=e=>{if(!e)return null;for(const t of Object.keys(Xv)){const n=Xv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},jv=function(){const e=L(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=an(t);let r;if(n&&(r=vB(n?n.hex():null)),r==null){const i=Ho(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let yB=0;class EB extends ft{constructor(){super(...arguments),this.type="treemap",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=Di({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,v)=>v.value-g.value),c=D_().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",()=>yB++).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=L(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:[rt.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=L(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${v}`}).append("use").attr("xlink:href",function(){const v=L(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=Ho(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",jv).attr("x",7).attr("y",18);return s&&v.attr("clip-path",function(){const m=L(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",jv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=L(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),an(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.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(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(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(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}var xB={value:function(){}};function Zv(){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 Eo(n)}function Eo(e){this._=e}function bB(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}})}Eo.prototype=Zv.prototype={constructor:Eo,on:function(e,t){var n=this._,r=bB(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=_B(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]=Kv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Kv(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 Eo(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 _B(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Kv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=xB,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const SB=Q2(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Zv},Symbol.toStringTag,{value:"Module"}))).dispatch,qu=Math.PI/180,TB={archimedean:Jv,rectangular:PB},Es=64,xo=2048;var wB=function(){var e=[256,256],t=OB,n=MB,r=AB,i=Qv,s=Qv,a=CB,o=DB,l=Jv,c=[],u=1/0,d=SB("word","end"),h=null,f=Math.random,p={},g=NB;p.canvas=function(y){return arguments.length?(g=$n(y),p):g},p.start=function(){var y=v(g()),E=$B((e[0]>>5)*e[1]),_=null,S=c.length,b=-1,M=[],D=c.map(function(I,w){return I.text=t.call(this,I,w),I.font=n.call(this,I,w),I.style=i.call(this,I,w),I.weight=s.call(this,I,w),I.rotate=a.call(this,I,w),I.size=~~r.call(this,I,w),I.padding=o.call(this,I,w),I}).sort(function(I,w){return w.size-I.size});return h&&clearInterval(h),h=setInterval(G,0),G(),p;function G(){for(var I=Date.now();Date.now()-I<u&&++b<S&&h;){var w=D[b];w.x=e[0]*(f()+.5)>>1,w.y=e[1]*(f()+.5)>>1,LB(y,w,D,b),w.hasText&&m(E,w,_)&&(M.push(w),d.call("word",p,w),_?IB(_,w):_=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=e[0]>>1,w.y-=e[1]>>1)}b>=S&&(p.stop(),d.call("end",p,M,_))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const y of c)delete y.sprite;return p};function v(y){const E=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const _=Math.sqrt(E.getImageData(0,0,1,1).data.length>>2);return y.width=(Es<<5)/_,y.height=xo/_,E.fillStyle=E.strokeStyle="red",{context:E,ratio:_}}function m(y,E,_){e[0],e[1];for(var S=E.x,b=E.y,M=Math.sqrt(e[0]*e[0]+e[1]*e[1]),D=l(e),G=f()<.5?1:-1,I=-G,w,C,R;(w=D(I+=G))&&(C=~~w[0],R=~~w[1],!(Math.min(Math.abs(C),Math.abs(R))>=M));)if(E.x=S+C,E.y=b+R,!(E.x+E.x0<0||E.y+E.y0<0||E.x+E.x1>e[0]||E.y+E.y1>e[1])&&(!_||kB(E,_))&&!RB(E,y,e[0])){for(var P=E.sprite,O=E.width>>5,H=e[0]>>5,B=E.x-(O<<4),U=B&127,N=32-U,j=E.y1-E.y0,Y=(E.y+E.y0)*H+(B>>5),it,et=0;et<j;et++){it=0;for(var q=0;q<=O;q++)y[Y+q]|=it<<N|(q<O?(it=P[et*O+q])>>>U:0);Y+=H}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=$n(y),p):n},p.fontStyle=function(y){return arguments.length?(i=$n(y),p):i},p.fontWeight=function(y){return arguments.length?(s=$n(y),p):s},p.rotate=function(y){return arguments.length?(a=$n(y),p):a},p.text=function(y){return arguments.length?(t=$n(y),p):t},p.spiral=function(y){return arguments.length?(l=TB[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=$n(y),p):r},p.padding=function(y){return arguments.length?(o=$n(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 OB(e){return e.text}function MB(){return"serif"}function Qv(){return"normal"}function AB(e){return Math.sqrt(e.value)}function CB(){return(~~(random()*6)-3)*30}function DB(){return 1}function LB(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Es<<5)/s,xo/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 w=i.measureText(t.text),C=-Math.floor(w.width/2);let R=(w.width+1)*s,P=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*qu),d=Math.cos(t.rotate*qu),h=R*d,f=R*u,p=P*d,g=P*u;R=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,P=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else R=R+31>>5<<5;if(P>l&&(l=P),a+R>=Es<<5&&(a=0,o+=l,l=0),o+P>=xo)break;i.translate((a+(R>>1))/s,(o+(P>>1))/s),t.rotate&&i.rotate(t.rotate*qu),i.fillText(t.text,C,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,C,0)),i.restore(),t.width=R,t.height=P,t.xoff=a,t.yoff=o,t.x1=R>>1,t.y1=P>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=R}for(var v=i.getImageData(0,0,(Es<<5)/s,xo/s).data,m=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,E=y>>5,_=t.y1-t.y0,S=0;S<_*E;S++)m[S]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var b=0,M=-1,D=0;D<_;D++){for(var S=0;S<y;S++){var G=E*D+(S>>5),I=v[(o+D)*(Es<<5)+(a+S)<<2]?1<<31-S%32:0;m[G]|=I,b|=I}b?M=D:(t.y0++,_--,D--,o++)}t.y1=t.y0+M,t.sprite=m.slice(0,(t.y1-t.y0)*E)}}}function RB(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 IB(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 kB(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 Jv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function PB(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 $B(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function NB(){return document.createElement("canvas")}function $n(e){return typeof e=="function"?e:function(){return e}}const UB=K2(wB);class BB extends ft{constructor(){super(...arguments),this.type="wordcloud",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=UB().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:[rt.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?Ie(i):[1,1];return Ue().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Va(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(T.WordCloud.WORD_MOUSEOVER,{event:s,element:L(this),datum:a}),r.services.events.dispatchEvent(T.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:[rt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=L(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class FB extends ft{constructor(){super(...arguments),this.type="geo",this.renderType=tt.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=A$(s,Object.values(l)),u=w$(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=ub().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",Fi()([[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 en.geoEqualEarth:t=Cb();break;case en.geoAlbers:t=_b();break;case en.geoConicEqualArea:t=Qd();break;case en.geoConicEquidistant:t=Mb();break;case en.geoEquirectangular:t=wb();break;case en.geoMercator:t=Sb();break;case en.geoNaturalEarth1:t=Db();break;default:throw new Error("Projection is not supported.")}return t}}class HB extends FB{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=L(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Fr.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(Hr.CHOROPLETH_MOUSEMOVE,{event:r,element:L(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Fr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Hr.CHOROPLETH_CLICK,{event:r,element:L(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=L(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Fr.HIDE,{event:r,hoveredElement:s})})}}class GB extends Ye{constructor(t,n){super(t,n),this.model=new b$(this.services),this.model.setOptions(kt(Ot.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 ms(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new Kr(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new ae(this.model,this.services,[a,...i?[o]:[]],{direction:wt.ROW,alignItems:rr.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Nv(this.model,this.services,{chartType:"choropleth"})],growth:lt.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:tt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=wt.COLUMN_REVERSE,f={id:"spacer",components:[new Tn(this.model,this.services,{size:15})],growth:lt.PREFERRED},p={id:"full-frame",components:[new ae(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new Tn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(v)}return g.push(p),[new Ru(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,g,{direction:wt.COLUMN})]}getComponents(){const t=[new HB(this.model,this.services)];return this.getChartComponents(t)}}class VB extends nn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=at({},t,this.getZoomOptions(t));Kc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:at(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&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:Ft.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent","Value"]];return t.forEach(r=>{let i=r.value?r.value:0;r.children&&(i+=this.getChildrenDatums(r.children,r.name,n,0)),n.push(["&ndash;",r.name,i])}),n}getChildrenDatums(t,n,r=[],i=0){const s=n;return t.forEach(a=>{const o=a.name;let l=0;if(a.children)a.children.length>0&&(typeof a.value=="number"&&(i+=a.value),l+=this.getChildrenDatums(a.children,o,r,l),r.push([o,s,l]),i+=l);else{let c=0;typeof a.value=="number"&&(c=a.value,i+=a.value),r.push([a.name,s,c])}}),i}}class zB extends Ye{constructor(t,n){super(t,n),this.model=new VB(this.services),this.model.setOptions(kt(Ot.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new R$(this.model,this.services)];return this.getChartComponents(t)}}const t0={[Ee.LINE]:[ti,sn],[Ee.SCATTER]:[sn],[Ee.AREA]:[Lv,ti,sn],[Ee.STACKED_AREA]:[Wv,ti,qv,yo],[Ee.SIMPLE_BAR]:[zv],[Ee.GROUPED_BAR]:[Hv,ei],[Ee.STACKED_BAR]:[Yv,yo]};class WB extends de{constructor(t,n){super(t,n);const r=kt(Ot.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Ee.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(t0).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=`${sC(i.type)}Chart`;return a=at({},Ot[l],this.model.getOptions(),i.options),i.type===Ee.STACKED_AREA&&(o=!0),t0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=at({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return $p(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===Ee.STACKED_BAR||s.type===Ee.STACKED_AREA),r=[new fe(this.model,this.services),new Se(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID}),...n?[]:[new kn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class YB extends nn{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,{valueMapsTo:i}=n.pie;return[["Group","Value"],...t.map(a=>[a[r],a[i]===null?"&ndash;":a[i].toLocaleString()])]}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class e0 extends Ye{constructor(t,n,r=!1){super(t,n),this.model=new YB(this.services),!r&&(this.model.setOptions(kt(Ot.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Uv(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.PIE})];return this.getChartComponents(t)}}class qB extends e0{constructor(t,n){super(t,n,!0),this.model.setOptions(kt(Ot.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new k$(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.DONUT})];return this.getChartComponents(t)}}class XB extends nn{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?"&ndash;":s.value.toLocaleString()])]}}class jB extends Ye{constructor(t,n){super(t,n),this.model=new XB(this.services),this.model.setOptions(kt(Ot.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new P$(this.model,this.services)];return this.getChartComponents(t)}}class ZB extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new Hv(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class KB extends lr{constructor(t){super(t),this.axisFlavor=is.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")!==K.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==K.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==K.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==K.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ie(this.getDisplayData(),r=>r.value),n=Ue().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(He(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(He(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(He(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]=vn(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(vn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){He(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?"&ndash;":s[n.identifier],s[r.identifier]===null?"&ndash;":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=!He(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=Nl().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=Pv(this.getDisplayData(),l)}}class QB extends de{constructor(t,n){super(t,n),this.model=new KB(this.services),this.model.setOptions(kt(Ot.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 ms(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new Kr(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new ae(this.model,this.services,[a,...i?[o]:[]],{direction:wt.ROW,alignItems:rr.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Nv(this.model,this.services,{chartType:"heatmap"})],growth:lt.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:tt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=wt.COLUMN_REVERSE,f={id:"spacer",components:[new Tn(this.model,this.services,{size:15})],growth:lt.PREFERRED},p={id:"full-frame",components:[new ae(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new Tn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(v)}return g.push(p),[new _v(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,g,{direction:wt.COLUMN})]}getComponents(){const t=[new fe(this.model,this.services),new $$(this.model,this.services)];return this.getAxisChartComponents(t)}}class JB extends lr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData();return[[Mt(t,"bins.rangeLabel")||"Range",...r.map(s=>Mt(s,`0.${n}`))],...Mt(r,0).map((s,a)=>[`${Mt(s,"data.x0")} – ${Mt(s,"data.x1")}`,...r.map(o=>Mt(o[a],`data.${Mt(o[a],n)}`))])]}}class tF extends de{constructor(t,n){super(t,n),this.model=new JB(this.services),this.model.setOptions(kt(Ot.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new D$(this.model,this.services),new N$(this.model,this.services)];return this.getAxisChartComponents(t)}}class eF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new ti(this.model,this.services),new sn(this.model,this.services,{handleThresholds:!0}),new V$(this.model,this.services),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class nF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new U$(this.model,this.services),new sn(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class rF extends nn{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 iF extends Ye{constructor(t,n){var i;super(t,n),this.model=new rF(this.services);const r=(i=n.options.meter)!=null&&i.proportional?at(vn(Ot.proportionalMeterChart),n.options):at(vn(Ot.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:lt.STRETCH,renderType:tt.SVG},{id:"spacer",components:[new Tn(this.model,this.services,{size:8})],growth:lt.STRETCH}]:[],{id:"meter-graph",components:[new B$(this.model,this.services)],growth:lt.STRETCH,renderType:tt.SVG}],r=[new ae(this.model,this.services,n,{direction:wt.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:tt.HTML})}}class sF extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),s=x(n,"0","data").map(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():"&ndash;")])]}}class aF extends Ye{constructor(t,n){super(t,n),this.model=new sF(this.services),this.model.setOptions(kt(Ot.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new G$(this.model,this.services)];return this.getChartComponents(t)}}class oF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new sn(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class lF extends nn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=[["Child","Parent"]];return t.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,"&ndash;"])}),n}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class cF extends Ye{constructor(t,n){super(t,n),this.model=new lF(this.services),this.model.setOptions(kt(Ot.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new z$(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class uF extends nn{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 hF extends Ye{constructor(t,n){super(t,n),this.model=new uF(this.services),this.model.setOptions(kt(Ot.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new EB(this.model,this.services)];return this.getChartComponents(t)}}class dF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new zv(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class fF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new yo(this.model,this.services),new Wv(this.model,this.services),new ti(this.model,this.services,{stacked:!0}),new qv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class pF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new yo(this.model,this.services),new Yv(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.VERT_OR_HORIZ}),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class gF extends nn{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 mF extends Ye{constructor(t,n){super(t,n),this.model=new gF(this.services),this.model.setOptions(kt(Ot.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new BB(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.PIE})];return this.getChartComponents(t)}}W.Alignments=Ut,W.AlluvialChart=GP,W.AreaChart=d$,W.AreaEvent=Nc,W.ArrowDirections=Wa,W.AxisEvent=$c,W.AxisFlavor=is,W.AxisPositions=z,W.AxisTitleOrientations=Ya,W.BarEvent=Hc,W.BoxplotChart=g$,W.BoxplotEvent=Gc,W.BubbleChart=v$,W.BulletChart=x$,W.CalloutDirections=ts,W.CanvasZoomEvent=Pc,W.CartesianOrientations=zt,W.ChartEvent=Dc,W.ChartTheme=jc,W.ChartTypes=Ee,W.CirclePackChart=zB,W.ColorClassNameTypes=rt,W.ColorLegendType=rs,W.ComboChart=WB,W.DividerStatus=zr,W.DominantBaseline=tn,W.DonutChart=qB,W.ExperimentalChoroplethChart=GB,W.GaugeChart=jB,W.GaugeEvent=Fc,W.GaugeTypes=ir,W.GroupedBarChart=ZB,W.HeatmapChart=QB,W.HistogramChart=tF,W.LayoutAlignItems=rr,W.LayoutDirection=wt,W.LayoutGrowth=lt,W.LegendItemType=Ft,W.LegendOrientations=Vr,W.LegendPositions=Gr,W.LineChart=eF,W.LineEvent=zc,W.LollipopChart=nF,W.MeterChart=iF,W.ModalEvent=Lc,W.ModelEvent=Rc,W.PieChart=e0,W.PieEvent=Bc,W.Projection=en,W.RadarChart=aF,W.RadarEvent=Wc,W.RenderTypes=tt,W.ScaleTypes=K,W.ScatterChart=oF,W.ScatterEvent=Vc,W.SimpleBarChart=dF,W.Skeletons=Bt,W.StackedAreaChart=fF,W.StackedBarChart=pF,W.Statuses=es,W.TextAnchor=Je,W.ThresholdEvent=Xc,W.TickRotations=ns,W.ToolbarControlTypes=It,W.TooltipEvent=Fr,W.TreeChart=cF,W.TreeEvent=Yc,W.TreeTypes=za,W.TreemapChart=hF,W.TreemapEvent=qc,W.TruncationTypes=Ae,W.WordCloudChart=mF,W.WordCloudEvent=Uc,W.ZoomBarTypes=Ge,W.ZoomDomainEvent=kc,W.ZoombarEvent=Ic,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
84
+ </svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=L(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:Mt(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(T.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(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=L(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");L(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");L(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(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function I$(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class Uv extends ft{constructor(){super(...arguments),this.type="pie",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Ct.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(C=>C[a]>0),l=this.computeRadius();this.arc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Bi().innerRadius(this.getInnerRadius()).outerRadius(l+Ct.hoverArc.outerRadiusOffset);const u=pT().value(C=>C[a]).sort(x(i,"pie","sortFunction")).padAngle(Ct.padAngle)(o),h=A.appendOrSelect(r,"g.slices").attr("role",ct.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,C=>C.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",C=>this.model.getColorClassName({classNameTypes:[rt.FILL],dataGroupName:C.data[s],originalClassName:"slice"})).style("fill",C=>n.model.getFillColor(C.data[s])).attr("d",this.arc).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",C=>`${C[a]}, ${Zc(C.data[a],o,a)+"%"}`).attrTween("d",function(C){return I$.bind(this)(C,n.arc)});const g=i.pie.labels.enabled,v=g?u.filter(C=>C.data[a]>0):[],y=A.appendOrSelect(r,"g.labels").attr("role",ct.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(v,C=>C.data[s]);y.exit().attr("opacity",0).remove();const E=y.enter().append("text").classed("pie-label",!0),_=[];E.merge(y).style("text-anchor","middle").text(C=>i.pie.labels.formatter?i.pie.labels.formatter({...C,percentageValue:Zc(C.data[a],o,a,!0)}):Zc(C.data[a],o,a)+"%").datum(function(C){const R=l+7,P=(C.endAngle-C.startAngle)/2+C.startAngle,O=P/Math.PI*180,H=this.getComputedTextLength();return C.textOffsetX=H/2,C.textOffsetY=O>90&&O<270?10:0,C.xPosition=(C.textOffsetX+R)*Math.sin(P),C.yPosition=(C.textOffsetY+R)*-Math.cos(P),C}).attr("transform",function(C,R){const P=v.length,O=(C.endAngle-C.startAngle)*(180/Math.PI);if(R>=P-2&&O<Ct.callout.minSliceDegree){let H,B;return C.index===P-1?(H=C.xPosition+Ct.callout.offsetX+Ct.callout.textMargin+C.textOffsetX,B=C.yPosition-Ct.callout.offsetY,C.direction=ts.RIGHT,_.push(C)):(H=C.xPosition-Ct.callout.offsetX-C.textOffsetX-Ct.callout.textMargin,B=C.yPosition-Ct.callout.offsetY,C.direction=ts.LEFT,_.push(C)),`translate(${H}, ${B})`}return`translate(${C.xPosition}, ${C.yPosition})`}),this.renderCallouts(_);const S=x(i,"donut")?"donut":"pie",b=x(i,S,"alignment"),{width:M}=A.getSVGElementSize(this.getParent(),{useAttrs:!0}),D=g?Ct.xOffset:0,G=g?Ct.yOffset:0;let I=l+D;b===Ut.CENTER?I=M/2:b===Ut.RIGHT&&(I=M-l-Ct.xOffset);let w=l+G;_.length>0&&(w+=Ct.yOffsetCallout),r.attr("x",I+7).attr("y",w),this.addEventListeners()}renderCallouts(t){const n=A.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ct.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",ct.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===ts.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Ct.callout.offsetX,y:c-Ct.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Ct.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Ct.callout.offsetX,y:c-Ct.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Ct.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return L(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 L(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=L(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(T.Pie.SLICE_MOUSEOVER,{event:n,element:L(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(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(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.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+Ct.radiusOffset:i}}class k$ extends Uv{constructor(){super(...arguments),this.type="donut",this.renderType=tt.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(L(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=Ih:s=ve;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;t.text(l(a(o)))}}}const Bv="4,10 8,6 12,10",Fv="12,6 8,10 4,6";class P$ extends ft{constructor(){super(...arguments),this.type="gauge",this.renderType=tt.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return cg(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")===ir.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 Wa.UP:return Bv;case Wa.DOWN:return Fv;default:return t>0?Bv:Fv}}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=Bi().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Bi().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:[rt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>x(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ct.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===Ut.CENTER?m=v/2:g===Ut.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===ir.FULL&&!s?d=l(a):r===ir.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,E=u?"%":"",_=A.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${y}px`).attr("x",m/2).text(E),{width:S,height:b}=A.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${b/2}px`),p.attr("transform",`translate(-${S/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=L(this);A.appendOrSelect(y,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const E=x(r,"gauge","status");A.appendOrSelect(y,"polygon.gauge-delta-arrow").attr("class",E!==null?`gauge-delta-arrow status--${E}`:"").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(T.Gauge.ARC_MOUSEOVER,{event:n,element:L(this),datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.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===ir.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class Hv extends Yu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({withinChartClip:!0}),a=Ji(n.map(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",ct.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()===zt.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:[rt.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),E=this.services.cartesianScales.getRangeValue(h),_=this.services.cartesianScales.getDomainValue(h)-p/2,S=_+p;if(!this.isOutsideZoomedDomain(_,S))return ie({x0:g,x1:v,y0:y,y1:E},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ct.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=L(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.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=Ii().domain(t).rangeRound([0,this.getGroupWidth()])}}class $$ extends ft{constructor(){super(...arguments),this.type="heatmap",this.renderType=tt.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)}, ${Mn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${Mn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:L(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(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.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!==zr.OFF&&(t===zr.AUTO&&Jg.minCellDividerDimension<=this.xBandwidth&&Jg.minCellDividerDimension<=this.yBandwidth||t===zr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=Mt(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=L(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ss(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(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.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(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:L(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:L(this),datum:u})}).on("mouseout",function(c,u){const h=L(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class N$ extends ft{constructor(){super(...arguments),this.type="histogram",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=>Mt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ct.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:[rt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s])).attr("d",u=>{const d=Mt(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()===zt.VERTICAL?v+=1:v-=1),ie({x0:f,x1:p,y0:g,y1:v},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ct.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=L(this);a.classed("hovered",!0);const o=parseFloat(Mt(s,"data.x0")),l=parseFloat(Mt(s,"data.x1")),c=r.services.cartesianScales.getRangeAxisPosition(),u=r.services.cartesianScales.getScaleLabel(c);r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,items:[{label:Mt(t,"bins.rangeLabel")||"Range",value:`${o} – ${l}`},{label:t.tooltip.groupLabel||"Group",value:s[n],class:r.model.getColorClassName({classNameTypes:[rt.TOOLTIP],dataGroupName:s[n]})},{label:u,value:Mt(s,`data.${s[n]}`)}]})}).on("mousemove",function(i){r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("mouseout",function(){L(this).classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class U$ extends sn{constructor(){super(...arguments),this.type="lollipop",this.renderType=tt.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]?En.weight.unselected:En.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",En.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?En.opacity.unselected:En.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",En.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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]=bn(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:[rt.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===zt.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(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class B$ extends ft{constructor(){super(...arguments),this.type="meter",this.renderType=tt.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)-Xt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Xt.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 E=x(i,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ue().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?Xt.height.proportional:Xt.height.default)),A.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Xt.height.proportional:Xt.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",E=>E.x).attr("y",0).attr("height",()=>f||(s?Xt.height.proportional:Xt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[rt.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):E.width).style("fill",E=>n.model.getFillColor(E[c])).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.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?Xt.height.proportional:Xt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),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=L(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=L(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function Gv(e){const t=F$(Vv(e),360);return Pn(t,[0,10])||Pn(t,[350,0])?{textAnchor:Je.START,dominantBaseline:tn.MIDDLE}:Pn(t,[10,80])?{textAnchor:Je.START,dominantBaseline:tn.HANGING}:Pn(t,[80,100])?{textAnchor:Je.MIDDLE,dominantBaseline:tn.HANGING}:Pn(t,[100,170])?{textAnchor:Je.END,dominantBaseline:tn.HANGING}:Pn(t,[170,190])?{textAnchor:Je.END,dominantBaseline:tn.MIDDLE}:Pn(t,[190,260])?{textAnchor:Je.END,dominantBaseline:tn.BASELINE}:Pn(t,[260,280])?{textAnchor:Je.MIDDLE,dominantBaseline:tn.BASELINE}:{textAnchor:Je.START,dominantBaseline:tn.BASELINE}}function F$(e,t){return(e%t+t)%t}function Pn(e,[t,n]){return e>=t&&e<=n}function Vv(e){return e*(180/Math.PI)}function Nt(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 H$(e,t){return t*Math.sin(e-Math.PI/2)}class G$ extends ft{constructor(){super(...arguments),this.type="radar",this.renderType=tt.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=ZL(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return at(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=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:at(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?sr.opacity.unselected:sr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?sr.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",sr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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}=sr;this.uniqueKeys=Array.from(new Set(s.map(F=>F[u]))),this.uniqueGroups=Array.from(new Set(s.map(F=>F[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const y=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),S=(Math.min(r,i)-y)/2;if(S<=0)return;const b=Ii().domain(this.fullDataNormalized.map(F=>F[u])).range([0,2*Math.PI].map(F=>F-Math.PI/2)),M=Mn(this.fullDataNormalized.map(F=>F[d])),D=Ue().domain([M>=0?0:M,Un(this.fullDataNormalized.map(F=>F[d]))]).range([g,S]).nice(p),G=D.ticks(p),I=F=>this.model.getFillColor(F),w=vT().angle(F=>b(F[u])+Math.PI/2).radius(F=>D(F[d])).curve(Qf),C=this.uniqueKeys.map(F=>{const V=this.getLabelDimensions(F).width,$=H$(b(F),S);return V+$}),P={x:Un(C)+h,y:i/2},H=A.appendOrSelect(n,"g.y-axes").attr("role",ct.GROUP).selectAll("path").data(G,F=>F),B=F=>this.uniqueKeys.map(V=>({[u]:V,[d]:F}));H.join(F=>F.append("path").attr("opacity",0).attr("transform",`translate(${P.x}, ${P.y})`).attr("fill","none").call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",$=>w(B($)))),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${P.x}, ${P.y})`).attr("d",$=>w(B($)))),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_axes_exit",animate:t})).attr("d",$=>w(B($))).attr("opacity",0).remove())),A.appendOrSelect(n,"g.x-axes").attr("role",ct.GROUP).selectAll("line").data(this.uniqueKeys,F=>F).join(F=>F.append("line").attr("opacity",0).attr("class",V=>`x-axis-${Br(V)}`).attr("stroke-dasharray","0").attr("x1",V=>Nt(b(V),0,P).x).attr("y1",V=>Nt(b(V),0,P).y).attr("x2",V=>Nt(b(V),0,P).x).attr("y2",V=>Nt(b(V),0,P).y).call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",$=>Nt(b($),D.range()[0],P).x).attr("y1",$=>Nt(b($),D.range()[0],P).y).attr("x2",$=>Nt(b($),D.range()[1],P).x).attr("y2",$=>Nt(b($),D.range()[1],P).y)),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",$=>Nt(b($),D.range()[0],P).x).attr("y1",$=>Nt(b($),D.range()[0],P).y).attr("x2",$=>Nt(b($),D.range()[1],P).x).attr("y2",$=>Nt(b($),D.range()[1],P).y)),F=>F.call(V=>V.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",ct.GROUP).selectAll("text").data(this.uniqueKeys).join(F=>F.append("text").text(V=>V).attr("opacity",0).attr("x",V=>Nt(b(V),D.range()[1]+h,P).x).attr("y",V=>Nt(b(V),D.range()[1]+h,P).y).style("text-anchor",V=>Gv(b(V)).textAnchor).style("dominant-baseline",V=>Gv(b(V)).dominantBaseline).call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",$=>Nt(b($),D.range()[1]+h,P).x).attr("y",$=>Nt(b($),D.range()[1]+h,P).y).end().finally(()=>{const $=x(o,"radar","alignment"),mt=this.getAlignmentXOffset($,n,this.getParent());n.attr("x",mt)})),F=>F.call(V=>V.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",ct.GROUP).selectAll("path").data(this.groupedDataNormalized,F=>F.name).join(F=>F.append("path").attr("class",V=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],dataGroupName:V.name,originalClassName:"blob"})).attr("role",ct.GRAPHICS_SYMBOL).attr("aria-label",V=>V.name).attr("opacity",0).attr("transform",t?()=>`translate(${P.x}, ${P.y}) scale(${1+Math.random()*.35})`:`translate(${P.x}, ${P.y})`).style("fill",V=>I(V.name)).style("fill-opacity",sr.opacity.selected).style("stroke",V=>I(V.name)).call(V=>{const $=V.transition().call(mt=>this.services.transitions.setupTransition({transition:mt,name:"radar_blobs_enter",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",`translate(${P.x}, ${P.y})`),$.attr("opacity",1).attr("d",mt=>w(mt.data))}),F=>(F.attr("class",V=>this.model.getColorClassName({classNameTypes:[rt.FILL,rt.STROKE],dataGroupName:V.name,originalClassName:"blob"})).style("fill",V=>I(V.name)).style("stroke",V=>I(V.name)),F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${P.x}, ${P.y})`).attr("d",$=>w($.data))),F),F=>F.call(V=>{const $=V.transition().call(mt=>this.services.transitions.setupTransition({transition:mt,name:"radar_blobs_exit",animate:t}));t&&$.delay(()=>Math.random()*30).attr("transform",()=>`translate(${P.x}, ${P.y}) scale(${1+Math.random()*.35})`),$.attr("opacity",0).remove()})),A.appendOrSelect(n,"g.dots").attr("role",ct.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(F=>x(F,d)!==null)).join(F=>F.append("circle").attr("role",ct.GRAPHICS_SYMBOL).attr("aria-label",V=>V[c]),F=>F,F=>F.remove()).attr("class",F=>this.model.getColorClassName({classNameTypes:[rt.FILL],dataGroupName:F[l],originalClassName:Br(F[u])})).attr("cx",F=>Nt(b(F[u]),D(F[d]),P).x).attr("cy",F=>Nt(b(F[u]),D(F[d]),P).y).attr("r",0).attr("opacity",0).style("fill",F=>I(F[l])),A.appendOrSelect(n,"g.x-axes-rect").attr("role",ct.GROUP).selectAll("rect").data(this.uniqueKeys).join(F=>F.append("rect"),F=>F,F=>F.remove()).attr("x",P.x).attr("y",P.y-v/2).attr("width",D.range()[1]).attr("height",v).style("fill","red").style("fill-opacity",0).attr("transform",F=>`rotate(${Vv(b(F))}, ${P.x}, ${P.y})`),A.appendOrSelect(n,"g.y-labels").attr("role",ct.GROUP).selectAll("text").data(Ie(G)).join(F=>F.append("text").attr("opacity",0).text(V=>V).attr("x",V=>Nt(-Math.PI/2,D(V),P).x+f).attr("y",V=>Nt(-Math.PI/2,D(V),P).y).style("text-anchor","start").style("dominant-baseline","middle").call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),F=>F.call(V=>V.transition().call($=>this.services.transitions.setupTransition({transition:$,name:"radar_y_labels_update",animate:t})).text($=>$).attr("opacity",1).attr("x",$=>Nt(-Math.PI/2,D($),P).x+f).attr("y",$=>Nt(-Math.PI/2,D($),P).y)),F=>F.call(V=>V.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===Ut.CENTER?a=Math.floor((s-i.width)/2):t===Ut.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.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=L(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Br(i)}`),o=t.parent.selectAll(`.dots circle.${Br(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",sr.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.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:[rt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=L(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:L(this),datum:i})}).on("mouseout",function(r,i){const s=L(this),a=t.parent.select(`.x-axes .x-axis-${Br(i)}`),o=t.parent.selectAll(`.dots circle.${Br(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class zv extends Yu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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:[rt.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 E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),v=this.services.cartesianScales.getRangeValue(c)}const m=Math.abs(v-g);if(m!==0&&m<2&&(h>0&&a===zt.VERTICAL||h<0&&a===zt.HORIZONTAL?v=g-2:v=g+2),!this.isOutsideZoomedDomain(f,p))return ie({x0:f,x1:p,y0:g,y1:v},a)}).attr("opacity",1).attr("role",ct.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=L(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:L(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class V$ extends oe{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 Wv extends ft{constructor(){super(...arguments),this.type="area-stacked",this.renderType=tt.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?yn.opacity.unselected:yn.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",yn.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=Kl().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:[rt.FILL],dataGroupName:x(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(x(p,0,s))).attr("role",ct.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",yn.opacity.selected).attr("d",this.areaGenerator)}}class Yv extends Yu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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",ct.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:[rt.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()===zt.VERTICAL?g+=c[1]===0?2:1:g-=1:v||(this.services.cartesianScales.getOrientation()===zt.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ct.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=L(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.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(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=L(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:L(this),datum:s})}).on("mouseout",function(i,s){const a=L(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class qv extends sn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=tt.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",ct.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 ni=6;class z$ extends ft{constructor(){super(...arguments),this.type="tree",this.renderType=tt.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+ni:30-ni},h=Di({name:o,children:a}),f=10,p=r/6,g=b=>{const M=h.descendants().reverse(),D=h.links();let G=h,I=h;h.eachBefore(U=>{U.x<G.x&&(G=U),U.x>I.x&&(I=U)});const w=I.x-G.x,C=n.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,G.x,r,w].join(" ")),R=S.selectAll("g").data(M,U=>U.id),P=this,O=R.enter().append("g").attr("transform",()=>`translate(${b.y0},${b.x0})`).attr("class",U=>U.depth!==0&&U.children&&U.children.length>0?"clickable":null).on("mouseover",function(U,N){P.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:U,element:L(this),datum:N})}).on("click",function(U,N){N.depth!==0&&(N.children=N.children?null:N._children,g(N)),P.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:U,element:L(this),datum:N})}).on("mouseout",function(U,N){P.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:U,element:L(this),datum:N})});O.append("circle").attr("r",2.5).attr("class",U=>U._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",U=>U._children?-ni:ni).attr("text-anchor",U=>U._children?"end":"start").text(U=>U.data.name).clone(!0).attr("class","text-stroke").lower(),R.merge(O).transition(C).attr("transform",U=>`translate(${U.y},${U.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),R.exit().transition(C).remove().attr("transform",()=>`translate(${b.y},${b.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const H=_.selectAll("path").data(D,U=>U.target.id),B=H.enter().append("path").attr("d",()=>{const U={x:b.x0,y:b.y0};return E({source:U,target:U})});H.merge(B).transition(C).attr("d",E),H.exit().transition(C).remove().attr("d",()=>{const U={x:b.x,y:b.y};return E({source:U,target:U})}),h.eachBefore(U=>{U.x0=U.x,U.y0=U.y})},v=h.descendants(),m=v[v.length-1].depth,y=x(s,"tree","type")===za.DENDROGRAM?Ub().size([i,r-u-m*ni-l]):w_().nodeSize([f,p]).size([i,r-u-m*ni-l]),E=ST().x(b=>b.y).y(b=>b.x);h.x0=p/2,h.y0=0,h.descendants().forEach((b,M)=>{b.id=M,b._children=b.children}),y(h),n.attr("viewBox",[-d.left,-d.top,r,f]).style("user-select","none");const _=n.append("g").attr("class","links"),S=n.append("g").attr("class","nodes");g(h)}}var W$="#000000",Y$="#ffffff",q$="#fcf4d6",X$="#fddc69",j$="#f1c21b",Z$="#d2a106",K$="#b28600",Q$="#8e6a00",J$="#684e00",tN="#483700",eN="#302400",nN="#1c1500",rN={10:q$,20:X$,30:j$,40:Z$,50:K$,60:Q$,70:J$,80:tN,90:eN,100:nN},iN="#fff2e8",sN="#ffd9be",aN="#ffb784",oN="#ff832b",lN="#eb6200",cN="#ba4e00",uN="#8a3800",hN="#5e2900",dN="#3e1a00",fN="#231000",pN={10:iN,20:sN,30:aN,40:oN,50:lN,60:cN,70:uN,80:hN,90:dN,100:fN},gN="#fff1f1",mN="#ffd7d9",vN="#ffb3b8",yN="#ff8389",EN="#fa4d56",xN="#da1e28",bN="#a2191f",_N="#750e13",SN="#520408",TN="#2d0709",wN={10:gN,20:mN,30:vN,40:yN,50:EN,60:xN,70:bN,80:_N,90:SN,100:TN},ON="#fff0f7",MN="#ffd6e8",AN="#ffafd2",CN="#ff7eb6",DN="#ee5396",LN="#d02670",RN="#9f1853",IN="#740937",kN="#510224",PN="#2a0a18",$N={10:ON,20:MN,30:AN,40:CN,50:DN,60:LN,70:RN,80:IN,90:kN,100:PN},NN="#f6f2ff",UN="#e8daff",BN="#d4bbff",FN="#be95ff",HN="#a56eff",GN="#8a3ffc",VN="#6929c4",zN="#491d8b",WN="#31135e",YN="#1c0f30",qN={10:NN,20:UN,30:BN,40:FN,50:HN,60:GN,70:VN,80:zN,90:WN,100:YN},XN="#edf5ff",jN="#d0e2ff",ZN="#a6c8ff",KN="#78a9ff",QN="#4589ff",JN="#0f62fe",tU="#0043ce",eU="#002d9c",nU="#001d6c",rU="#001141",iU={10:XN,20:jN,30:ZN,40:KN,50:QN,60:JN,70:tU,80:eU,90:nU,100:rU},sU="#e5f6ff",aU="#bae6ff",oU="#82cfff",lU="#33b1ff",cU="#1192e8",uU="#0072c3",hU="#00539a",dU="#003a6d",fU="#012749",pU="#061727",gU={10:sU,20:aU,30:oU,40:lU,50:cU,60:uU,70:hU,80:dU,90:fU,100:pU},mU="#d9fbfb",vU="#9ef0f0",yU="#3ddbd9",EU="#08bdba",xU="#009d9a",bU="#007d79",_U="#005d5d",SU="#004144",TU="#022b30",wU="#081a1c",OU={10:mU,20:vU,30:yU,40:EU,50:xU,60:bU,70:_U,80:SU,90:TU,100:wU},MU="#defbe6",AU="#a7f0ba",CU="#6fdc8c",DU="#42be65",LU="#24a148",RU="#198038",IU="#0e6027",kU="#044317",PU="#022d0d",$U="#071908",NU={10:MU,20:AU,30:CU,40:DU,50:LU,60:RU,70:IU,80:kU,90:PU,100:$U},UU="#f2f4f8",BU="#dde1e6",FU="#c1c7cd",HU="#a2a9b0",GU="#878d96",VU="#697077",zU="#4d5358",WU="#343a3f",YU="#21272a",qU="#121619",XU={10:UU,20:BU,30:FU,40:HU,50:GU,60:VU,70:zU,80:WU,90:YU,100:qU},jU="#f4f4f4",ZU="#e0e0e0",KU="#c6c6c6",QU="#a8a8a8",JU="#8d8d8d",tB="#6f6f6f",eB="#525252",nB="#393939",rB="#262626",iB="#161616",sB={10:jU,20:ZU,30:KU,40:QU,50:JU,60:tB,70:eB,80:nB,90:rB,100:iB},aB="#f7f3f2",oB="#e5e0df",lB="#cac5c4",cB="#ada8a8",uB="#8f8b8b",hB="#726e6e",dB="#565151",fB="#3c3838",pB="#272525",gB="#171414",mB={10:aB,20:oB,30:lB,40:cB,50:uB,60:hB,70:dB,80:fB,90:pB,100:gB},Xv={black:{100:W$},blue:iU,coolGray:XU,cyan:gU,gray:sB,green:NU,magenta:$N,orange:pN,purple:qN,red:wN,teal:OU,warmGray:mB,white:{0:Y$},yellow:rN};const vB=e=>{if(!e)return null;for(const t of Object.keys(Xv)){const n=Xv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},jv=function(){const e=L(this.parentNode).select("rect.leaf"),t=getComputedStyle(e.node(),null).getPropertyValue("fill"),n=an(t);let r;if(n&&(r=vB(n?n.hex():null)),r==null){const i=Ho(n).l;r=Math.abs(i*100-100)}return r>50?"white":"black"};let yB=0;class EB extends ft{constructor(){super(...arguments),this.type="treemap",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=Di({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,v)=>v.value-g.value),c=D_().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",()=>yB++).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=L(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:[rt.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=L(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${v}`}).append("use").attr("xlink:href",function(){const v=L(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=Ho(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",jv).attr("x",7).attr("y",18);return s&&v.attr("clip-path",function(){const m=L(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",jv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=L(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),an(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.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(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=L(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:L(this),datum:r})}).on("mouseout",function(n,r){const i=L(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(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}var xB={value:function(){}};function Zv(){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 Eo(n)}function Eo(e){this._=e}function bB(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}})}Eo.prototype=Zv.prototype={constructor:Eo,on:function(e,t){var n=this._,r=bB(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=_B(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]=Kv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Kv(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 Eo(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 _B(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Kv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=xB,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const SB=hP(Object.freeze(Object.defineProperty({__proto__:null,dispatch:Zv},Symbol.toStringTag,{value:"Module"}))).dispatch,qu=Math.PI/180,TB={archimedean:Jv,rectangular:PB},Es=64,xo=2048;var wB=function(){var e=[256,256],t=OB,n=MB,r=AB,i=Qv,s=Qv,a=CB,o=DB,l=Jv,c=[],u=1/0,d=SB("word","end"),h=null,f=Math.random,p={},g=NB;p.canvas=function(y){return arguments.length?(g=$n(y),p):g},p.start=function(){var y=v(g()),E=$B((e[0]>>5)*e[1]),_=null,S=c.length,b=-1,M=[],D=c.map(function(I,w){return I.text=t.call(this,I,w),I.font=n.call(this,I,w),I.style=i.call(this,I,w),I.weight=s.call(this,I,w),I.rotate=a.call(this,I,w),I.size=~~r.call(this,I,w),I.padding=o.call(this,I,w),I}).sort(function(I,w){return w.size-I.size});return h&&clearInterval(h),h=setInterval(G,0),G(),p;function G(){for(var I=Date.now();Date.now()-I<u&&++b<S&&h;){var w=D[b];w.x=e[0]*(f()+.5)>>1,w.y=e[1]*(f()+.5)>>1,LB(y,w,D,b),w.hasText&&m(E,w,_)&&(M.push(w),d.call("word",p,w),_?IB(_,w):_=[{x:w.x+w.x0,y:w.y+w.y0},{x:w.x+w.x1,y:w.y+w.y1}],w.x-=e[0]>>1,w.y-=e[1]>>1)}b>=S&&(p.stop(),d.call("end",p,M,_))}},p.stop=function(){h&&(clearInterval(h),h=null);for(const y of c)delete y.sprite;return p};function v(y){const E=y.getContext("2d",{willReadFrequently:!0});y.width=y.height=1;const _=Math.sqrt(E.getImageData(0,0,1,1).data.length>>2);return y.width=(Es<<5)/_,y.height=xo/_,E.fillStyle=E.strokeStyle="red",{context:E,ratio:_}}function m(y,E,_){e[0],e[1];for(var S=E.x,b=E.y,M=Math.sqrt(e[0]*e[0]+e[1]*e[1]),D=l(e),G=f()<.5?1:-1,I=-G,w,C,R;(w=D(I+=G))&&(C=~~w[0],R=~~w[1],!(Math.min(Math.abs(C),Math.abs(R))>=M));)if(E.x=S+C,E.y=b+R,!(E.x+E.x0<0||E.y+E.y0<0||E.x+E.x1>e[0]||E.y+E.y1>e[1])&&(!_||kB(E,_))&&!RB(E,y,e[0])){for(var P=E.sprite,O=E.width>>5,H=e[0]>>5,B=E.x-(O<<4),U=B&127,N=32-U,j=E.y1-E.y0,Y=(E.y+E.y0)*H+(B>>5),it,et=0;et<j;et++){it=0;for(var q=0;q<=O;q++)y[Y+q]|=it<<N|(q<O?(it=P[et*O+q])>>>U:0);Y+=H}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=$n(y),p):n},p.fontStyle=function(y){return arguments.length?(i=$n(y),p):i},p.fontWeight=function(y){return arguments.length?(s=$n(y),p):s},p.rotate=function(y){return arguments.length?(a=$n(y),p):a},p.text=function(y){return arguments.length?(t=$n(y),p):t},p.spiral=function(y){return arguments.length?(l=TB[y]||y,p):l},p.fontSize=function(y){return arguments.length?(r=$n(y),p):r},p.padding=function(y){return arguments.length?(o=$n(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 OB(e){return e.text}function MB(){return"serif"}function Qv(){return"normal"}function AB(e){return Math.sqrt(e.value)}function CB(){return(~~(random()*6)-3)*30}function DB(){return 1}function LB(e,t,n,r){if(!t.sprite){var i=e.context,s=e.ratio;i.clearRect(0,0,(Es<<5)/s,xo/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 w=i.measureText(t.text),C=-Math.floor(w.width/2);let R=(w.width+1)*s,P=t.size<<1;if(t.rotate){var u=Math.sin(t.rotate*qu),d=Math.cos(t.rotate*qu),h=R*d,f=R*u,p=P*d,g=P*u;R=Math.max(Math.abs(h+g),Math.abs(h-g))+31>>5<<5,P=~~Math.max(Math.abs(f+p),Math.abs(f-p))}else R=R+31>>5<<5;if(P>l&&(l=P),a+R>=Es<<5&&(a=0,o+=l,l=0),o+P>=xo)break;i.translate((a+(R>>1))/s,(o+(P>>1))/s),t.rotate&&i.rotate(t.rotate*qu),i.fillText(t.text,C,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,C,0)),i.restore(),t.width=R,t.height=P,t.xoff=a,t.yoff=o,t.x1=R>>1,t.y1=P>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,a+=R}for(var v=i.getImageData(0,0,(Es<<5)/s,xo/s).data,m=[];--r>=0;)if(t=n[r],!!t.hasText){for(var y=t.width,E=y>>5,_=t.y1-t.y0,S=0;S<_*E;S++)m[S]=0;if(a=t.xoff,a==null)return;o=t.yoff;for(var b=0,M=-1,D=0;D<_;D++){for(var S=0;S<y;S++){var G=E*D+(S>>5),I=v[(o+D)*(Es<<5)+(a+S)<<2]?1<<31-S%32:0;m[G]|=I,b|=I}b?M=D:(t.y0++,_--,D--,o++)}t.y1=t.y0+M,t.sprite=m.slice(0,(t.y1-t.y0)*E)}}}function RB(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 IB(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 kB(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 Jv(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function PB(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 $B(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function NB(){return document.createElement("canvas")}function $n(e){return typeof e=="function"?e:function(){return e}}const UB=uP(wB);class BB extends ft{constructor(){super(...arguments),this.type="wordcloud",this.renderType=tt.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(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.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=UB().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:[rt.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?Ie(i):[1,1];return Ue().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=Va(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(T.WordCloud.WORD_MOUSEOVER,{event:s,element:L(this),datum:a}),r.services.events.dispatchEvent(T.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:[rt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=L(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:L(this),datum:a})}).on("mouseout",function(s,a){const o=L(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class FB extends ft{constructor(){super(...arguments),this.type="geo",this.renderType=tt.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=A$(s,Object.values(l)),u=w$(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=ub().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",Fi()([[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 en.geoEqualEarth:t=Cb();break;case en.geoAlbers:t=_b();break;case en.geoConicEqualArea:t=Qd();break;case en.geoConicEquidistant:t=Mb();break;case en.geoEquirectangular:t=wb();break;case en.geoMercator:t=Sb();break;case en.geoNaturalEarth1:t=Db();break;default:throw new Error("Projection is not supported.")}return t}}class HB extends FB{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=L(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Fr.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(Hr.CHOROPLETH_MOUSEMOVE,{event:r,element:L(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Fr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Hr.CHOROPLETH_CLICK,{event:r,element:L(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=L(this);t.services.events.dispatchEvent(Hr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(Fr.HIDE,{event:r,hoveredElement:s})})}}class GB extends Ye{constructor(t,n){super(t,n),this.model=new b$(this.services),this.model.setOptions(kt(Ot.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 vs(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new Kr(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new ae(this.model,this.services,[a,...i?[o]:[]],{direction:wt.ROW,alignItems:rr.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Nv(this.model,this.services,{chartType:"choropleth"})],growth:lt.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:tt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=wt.COLUMN_REVERSE,f={id:"spacer",components:[new Tn(this.model,this.services,{size:15})],growth:lt.PREFERRED},p={id:"full-frame",components:[new ae(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new Tn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(v)}return g.push(p),[new Uu(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,g,{direction:wt.COLUMN})]}getComponents(){const t=[new HB(this.model,this.services)];return this.getChartComponents(t)}}class VB extends nn{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=at({},t,this.getZoomOptions(t));Kc(n,r);const i=this.getHierarchyLevel(),s=x(n,"circlePack","hierarchyLevel");this.set({options:at(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&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:Ft.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"],r=[];return t.forEach(i=>{let s=i.value?i.value:0;i.children&&(s+=this.getChildrenDatums(i.children,i.name,r,0)),r.push(["&ndash;",i.name,s])}),super.formatTable({headers:n,cells:r})}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 zB extends Ye{constructor(t,n){super(t,n),this.model=new VB(this.services),this.model.setOptions(kt(Ot.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new R$(this.model,this.services)];return this.getChartComponents(t)}}const t0={[Ee.LINE]:[ti,sn],[Ee.SCATTER]:[sn],[Ee.AREA]:[Lv,ti,sn],[Ee.STACKED_AREA]:[Wv,ti,qv,yo],[Ee.SIMPLE_BAR]:[zv],[Ee.GROUPED_BAR]:[Hv,ei],[Ee.STACKED_BAR]:[Yv,yo]};class WB extends de{constructor(t,n){super(t,n);const r=kt(Ot.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:Ee.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(t0).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=`${sC(i.type)}Chart`;return a=at({},Ot[l],this.model.getOptions(),i.options),i.type===Ee.STACKED_AREA&&(o=!0),t0[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=at({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return $p(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===Ee.STACKED_BAR||s.type===Ee.STACKED_AREA),r=[new fe(this.model,this.services),new Se(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID}),...n?[]:[new kn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class YB extends nn{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,{valueMapsTo:i}=n.pie,s=["Group","Value"],a=[...t.map(o=>[o[r],o[i]===null?"&ndash;":o[i].toLocaleString()])];return super.formatTable({headers:s,cells:a})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class e0 extends Ye{constructor(t,n,r=!1){super(t,n),this.model=new YB(this.services),!r&&(this.model.setOptions(kt(Ot.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new Uv(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.PIE})];return this.getChartComponents(t)}}class qB extends e0{constructor(t,n){super(t,n,!0),this.model.setOptions(kt(Ot.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new k$(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.DONUT})];return this.getChartComponents(t)}}class XB extends nn{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,i=["Group","Value"],s=[...t.map(a=>[a[r],a.value===null?"&ndash;":a.value.toLocaleString()])];return super.formatTable({headers:i,cells:s})}}class jB extends Ye{constructor(t,n){super(t,n),this.model=new XB(this.services),this.model.setOptions(kt(Ot.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new P$(this.model,this.services)];return this.getChartComponents(t)}}class ZB extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new Hv(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class KB extends lr{constructor(t){super(t),this.axisFlavor=is.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")!==K.LABELS||x(n,"right","scaleType")&&x(n,"right","scaleType")!==K.LABELS||x(n,"top","scaleType")&&x(n,"top","scaleType")!==K.LABELS||x(n,"bottom","scaleType")&&x(n,"bottom","scaleType")!==K.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Ie(this.getDisplayData(),r=>r.value),n=Ue().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(He(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(He(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(He(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]=vn(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(vn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){He(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(),i=[n.label,r.label,"Value"],s=[...t.map(a=>[a[n.identifier]===null?"&ndash;":a[n.identifier],a[r.identifier]===null?"&ndash;":a[r.identifier].toLocaleString(),a.value])];return super.formatTable({headers:i,cells:s})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=x(t,"color","gradient","colors"),r=!He(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=Nl().domain(s).range(o);const l=x(this.getOptions(),"color");this._colorScale=Pv(this.getDisplayData(),l)}}class QB extends de{constructor(t,n){super(t,n),this.model=new KB(this.services),this.model.setOptions(kt(Ot.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 vs(this.model,this.services)],growth:lt.STRETCH},o={id:"toolbar",components:[new Kr(this.model,this.services)],growth:lt.PREFERRED},l={id:"header",components:[new ae(this.model,this.services,[a,...i?[o]:[]],{direction:wt.ROW,alignItems:rr.CENTER})],growth:lt.PREFERRED},c={id:"legend",components:[new Nv(this.model,this.services,{chartType:"heatmap"})],growth:lt.PREFERRED,renderType:tt.SVG},u={id:"graph-frame",components:t,growth:lt.STRETCH,renderType:tt.SVG},d=x(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1,h=wt.COLUMN_REVERSE,f={id:"spacer",components:[new Tn(this.model,this.services,{size:15})],growth:lt.PREFERRED},p={id:"full-frame",components:[new ae(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:lt.STRETCH},g=[];if(s||i){g.push(l);const v={id:"spacer",components:[new Tn(this.model,this.services,i?{size:15}:void 0)],growth:lt.PREFERRED};g.push(v)}return g.push(p),[new Dv(this.model,this.services),new po(this.model,this.services),new ae(this.model,this.services,g,{direction:wt.COLUMN})]}getComponents(){const t=[new fe(this.model,this.services),new $$(this.model,this.services)];return this.getAxisChartComponents(t)}}class JB extends lr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this.getBinnedStackedData(),i=[Mt(t,"bins.rangeLabel")||"Range",...r.map(a=>Mt(a,`0.${n}`))],s=[...Mt(r,0).map((a,o)=>[`${Mt(a,"data.x0")} – ${Mt(a,"data.x1")}`,...r.map(l=>Mt(l[o],`data.${Mt(l[o],n)}`))])];return super.formatTable({headers:i,cells:s})}}class tF extends de{constructor(t,n){super(t,n),this.model=new JB(this.services),this.model.setOptions(kt(Ot.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new D$(this.model,this.services),new N$(this.model,this.services)];return this.getAxisChartComponents(t)}}class eF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new ti(this.model,this.services),new sn(this.model,this.services,{handleThresholds:!0}),new V$(this.model,this.services),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class nF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new U$(this.model,this.services),new sn(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class rF extends nn{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=[],l;if(s===null){l=100;const c=t[0];a=["Group","Value",...i?["Status"]:[]],o=[[c[r],c.value,...i?[i]:[]]]}else{const c=x(s,"total");l=c||this.getMaximumDomain(t),a=["Group","Value","Percentage of total"],o=[...t.map(u=>[u[r],u.value,(u.value/l*100).toFixed(2)+" %"])]}return super.formatTable({headers:a,cells:o})}}class iF extends Ye{constructor(t,n){var i;super(t,n),this.model=new rF(this.services);const r=(i=n.options.meter)!=null&&i.proportional?at(vn(Ot.proportionalMeterChart),n.options):at(vn(Ot.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:lt.STRETCH,renderType:tt.SVG},{id:"spacer",components:[new Tn(this.model,this.services,{size:8})],growth:lt.STRETCH}]:[],{id:"meter-graph",components:[new B$(this.model,this.services)],growth:lt.STRETCH,renderType:tt.SVG}],r=[new ae(this.model,this.services,n,{direction:wt.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:tt.HTML})}}class sF extends lr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=x(t,"radar","axes"),s=x(n,"0","data").map(l=>l[r]),a=["Group",...s],o=[...n.map(l=>[l.name,...s.map((c,u)=>x(l,"data",u,i)!==null?x(l,"data",u,i).toLocaleString():"&ndash;")])];return super.formatTable({headers:a,cells:o})}}class aF extends Ye{constructor(t,n){super(t,n),this.model=new sF(this.services),this.model.setOptions(kt(Ot.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new G$(this.model,this.services)];return this.getChartComponents(t)}}class oF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new kn(this.model,this.services),new sn(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class lF extends nn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"&ndash;"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class cF extends Ye{constructor(t,n){super(t,n),this.model=new lF(this.services),this.model.setOptions(kt(Ot.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new z$(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class uF extends nn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Group","Value"],r=[];return t.forEach(i=>{Array.isArray(i.children)?i.children.forEach(s=>{r.push([s.name,i.name,s.value])}):x(i.name)!==null&&x(i.value)&&r.push(["–",i.name,i.value])}),super.formatTable({headers:n,cells:r})}}class hF extends Ye{constructor(t,n){super(t,n),this.model=new uF(this.services),this.model.setOptions(kt(Ot.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new EB(this.model,this.services)];return this.getChartComponents(t)}}class dF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new zv(this.model,this.services),new ei(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class fF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new yo(this.model,this.services),new Wv(this.model,this.services),new ti(this.model,this.services,{stacked:!0}),new qv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new oe(this.model,this.services,{skeleton:Bt.GRID})];return this.getAxisChartComponents(t)}}class pF extends de{constructor(t,n){super(t,n),this.model.setOptions(kt(Ot.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new fe(this.model,this.services),new Se(this.model,this.services),new yo(this.model,this.services),new Yv(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.VERT_OR_HORIZ}),new ei(this.model,this.services)];return this.getAxisChartComponents(t)}}class gF extends nn{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,a=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],o=[...t.map(l=>[l[i],l[s],l[r]])];return super.formatTable({headers:a,cells:o})}}class mF extends Ye{constructor(t,n){super(t,n),this.model=new gF(this.services),this.model.setOptions(kt(Ot.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new BB(this.model,this.services),new oe(this.model,this.services,{skeleton:Bt.PIE})];return this.getChartComponents(t)}}W.Alignments=Ut,W.AlluvialChart=e$,W.AreaChart=d$,W.AreaEvent=Nc,W.ArrowDirections=Wa,W.AxisEvent=$c,W.AxisFlavor=is,W.AxisPositions=z,W.AxisTitleOrientations=Ya,W.BarEvent=Hc,W.BoxplotChart=g$,W.BoxplotEvent=Gc,W.BubbleChart=v$,W.BulletChart=x$,W.CalloutDirections=ts,W.CanvasZoomEvent=Pc,W.CartesianOrientations=zt,W.ChartEvent=Dc,W.ChartTheme=jc,W.ChartTypes=Ee,W.CirclePackChart=zB,W.ColorClassNameTypes=rt,W.ColorLegendType=rs,W.ComboChart=WB,W.DividerStatus=zr,W.DominantBaseline=tn,W.DonutChart=qB,W.ExperimentalChoroplethChart=GB,W.GaugeChart=jB,W.GaugeEvent=Fc,W.GaugeTypes=ir,W.GroupedBarChart=ZB,W.HeatmapChart=QB,W.HistogramChart=tF,W.LayoutAlignItems=rr,W.LayoutDirection=wt,W.LayoutGrowth=lt,W.LegendItemType=Ft,W.LegendOrientations=Vr,W.LegendPositions=Gr,W.LineChart=eF,W.LineEvent=zc,W.LollipopChart=nF,W.MeterChart=iF,W.ModalEvent=Lc,W.ModelEvent=Rc,W.PieChart=e0,W.PieEvent=Bc,W.Projection=en,W.RadarChart=aF,W.RadarEvent=Wc,W.RenderTypes=tt,W.ScaleTypes=K,W.ScatterChart=oF,W.ScatterEvent=Vc,W.SimpleBarChart=dF,W.Skeletons=Bt,W.StackedAreaChart=fF,W.StackedBarChart=pF,W.Statuses=es,W.TextAnchor=Je,W.ThresholdEvent=Xc,W.TickRotations=ns,W.ToolbarControlTypes=It,W.TooltipEvent=Fr,W.TreeChart=cF,W.TreeEvent=Yc,W.TreeTypes=za,W.TreemapChart=hF,W.TreemapEvent=qc,W.TruncationTypes=Ae,W.WordCloudChart=mF,W.WordCloudEvent=Uc,W.ZoomBarTypes=Ge,W.ZoomDomainEvent=kc,W.ZoombarEvent=Ic,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
85
85
  //# sourceMappingURL=bundle.umd.js.map